Kaydet (Commit) 3b729ab3 authored tarafından Armin Le Grand's avatar Armin Le Grand Kaydeden (comit) Caolán McNamara

Resolves: #i123468# Added SdrEndTextEdit before replacing EmptyPresObj...

also secured ReplaceObjectAtView to check for active TextEdit, assert this and
make an emergency correction

(cherry picked from commit 623cd778)

Conflicts:
	svx/source/svdraw/svdedtv.cxx

Change-Id: I0e9ae1b1cd84e04c37c4de38aca7752804782384
üst 11f9439a
...@@ -352,6 +352,14 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) ...@@ -352,6 +352,14 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
pPage->InsertPresObj( pOleObj, ePresObjKind ); pPage->InsertPresObj( pOleObj, ePresObjKind );
pOleObj->SetUserCall(pPickObj->GetUserCall()); pOleObj->SetUserCall(pPickObj->GetUserCall());
} }
// #i123468# 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; bool bRet = true;
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "svx/svdglob.hxx" #include "svx/svdglob.hxx"
#include <svx/e3dsceneupdater.hxx> #include <svx/e3dsceneupdater.hxx>
#include <rtl/strbuf.hxx> #include <rtl/strbuf.hxx>
#include <svx/svdview.hxx>
// #i13033# // #i13033#
#include <clonelist.hxx> #include <clonelist.hxx>
...@@ -987,6 +988,28 @@ sal_Bool SdrEditView::InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, sal_ ...@@ -987,6 +988,28 @@ sal_Bool SdrEditView::InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, sal_
void SdrEditView::ReplaceObjectAtView(SdrObject* pOldObj, SdrPageView& rPV, SdrObject* pNewObj, sal_Bool bMark) 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
// #i123468# 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)
SdrView *pSdrView = dynamic_cast<SdrView*>(this);
if (pSdrView)
pSdrView->SdrEndTextEdit();
}
SdrObjList* pOL=pOldObj->GetObjList(); SdrObjList* pOL=pOldObj->GetObjList();
const bool bUndo = IsUndoEnabled(); const bool bUndo = IsUndoEnabled();
if( bUndo ) 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