summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2014-02-17 15:48:54 +0000
committerDavid Tardon <dtardon@redhat.com>2014-06-10 12:42:26 +0000
commitb8de5aa4195fbb2f1fbf1312cb8a6e6c3c8b9852 (patch)
tree078a6f36cdcf1800dffdf391f3169f3962844ba9
parent5e04f1b373a288d7804253113bb28796a67dc67f (diff)
Resolves: fdo#78404 #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 623cd778689bd0851652b2db00b24c308dfb657a) Conflicts: svx/source/svdraw/svdedtv.cxx (cherry picked from commit 3b729ab35b5064dcd21f125dfd0aa7d7e709fd9f) Change-Id: I0e9ae1b1cd84e04c37c4de38aca7752804782384 Reviewed-on: https://gerrit.libreoffice.org/9482 Tested-by: David Tardon <dtardon@redhat.com> Reviewed-by: David Tardon <dtardon@redhat.com>
-rw-r--r--sd/source/ui/func/fuinsert.cxx8
-rw-r--r--svx/source/svdraw/svdedtv.cxx23
2 files changed, 31 insertions, 0 deletions
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index 9f507024f3c0..886be3490eab 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -338,6 +338,14 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
pPage->InsertPresObj( pOleObj, ePresObjKind );
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;
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index a872d426bd8c..602bf19c7c83 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -33,6 +33,7 @@
#include "svx/svdglob.hxx"
#include <svx/e3dsceneupdater.hxx>
#include <rtl/strbuf.hxx>
+#include <svx/svdview.hxx>
// #i13033#
#include <clonelist.hxx>
@@ -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)
{
+ 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();
const bool bUndo = IsUndoEnabled();
if( bUndo )