Kaydet (Commit) 623cd778 authored tarafından Armin Le Grand's avatar Armin Le Grand

i123468 Added SdrEndTextEdit before replacing EmptyPresObj, also secured…

i123468 Added SdrEndTextEdit before replacing EmptyPresObj, also secured ReplaceObjectAtView to check for active TextEdit, assert this and make an emergency correction
üst 7cb6c17b
......@@ -378,6 +378,14 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
pPage->InsertPresObj( pOleObj, ePresObjKind );
pOleObj->SetUserCall(pPickObj->GetUserCall());
}
// #123468# we need to end text edit before replacing the object. There cannot yet
// being text typed (else it would not be an EmptyPresObj anymore), but it may be
// in text edit mode
if(mpView->IsTextEdit())
{
mpView->SdrEndTextEdit();
}
}
bool bRet = true;
......
......@@ -39,6 +39,7 @@
#include "svx/svdstr.hrc" // Namen aus der Resource
#include "svx/svdglob.hxx" // StringCache
#include <svx/e3dsceneupdater.hxx>
#include <svx/svdview.hxx>
// #i13033#
#include <clonelist.hxx>
......@@ -1022,6 +1023,26 @@ sal_Bool SdrEditView::InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, sal_
void SdrEditView::ReplaceObjectAtView(SdrObject* pOldObj, SdrPageView& rPV, SdrObject* pNewObj, sal_Bool bMark)
{
if(IsTextEdit())
{
#ifdef DBG_UTIL
if(pOldObj && dynamic_cast< SdrTextObj* >(pOldObj) && static_cast< SdrTextObj* >(pOldObj)->IsTextEditActive())
{
OSL_ENSURE(false, "OldObject is in TextEdit mode, this has to be ended before replacing it usnig SdrEndTextEdit (!)");
}
if(pNewObj && dynamic_cast< SdrTextObj* >(pNewObj) && static_cast< SdrTextObj* >(pNewObj)->IsTextEditActive())
{
OSL_ENSURE(false, "NewObject is in TextEdit mode, this has to be ended before replacing it usnig SdrEndTextEdit (!)");
}
#endif
// #123468# emergency repair situation, needs to cast up to a class derived from
// this one; (aw080 has a mechanism for that and the view hierarchy is secured to
// always be a SdrView)
if(dynamic_cast< SdrView* >(this)) static_cast< SdrView* >(this)->SdrEndTextEdit();
}
SdrObjList* pOL=pOldObj->GetObjList();
const bool bUndo = IsUndoEnabled();
if( bUndo )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment