[Libreoffice-commits] core.git: 2 commits - sw/source
Michael Stahl
mstahl at redhat.com
Fri Apr 28 11:59:22 UTC 2017
sw/source/uibase/utlui/content.cxx | 2 +-
sw/source/uibase/wrtsh/wrtsh1.cxx | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
New commits:
commit 7f207fca577ef820be2aec0a442df7e8ab6e14a6
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Apr 28 13:26:01 2017 +0200
tdf#107474 sw: fix crash when deleting header with active SdrObject
The problem is that the SdrView's text edit mode remains active when
the header is deleted, which deletes the active SdrObject that is
anchored in the header.
Then the next call to SdrBeginTextEdit() will call SdrEndTextEdit()
but the mxTextEditObj WeakReference is null then and so the cleanup
code that resets the SdrOutliner's UndoManager is not called,
but then the SdrOutliner is deleted.
What's really horrible about this is that while text editing is active,
both SdrObjEditView and ImpEditEngine consider themselves the
exclusive owner of SwDoc's UndoManager.
(regression from 12a4200e8ff7f045efcc7e9d15a24b15b248c437
and d7b7c9fdfe63deec26c420efc3ff1fd73c21bb27)
Change-Id: I17c5165a03d2de1eaba8a335dfbfded56573f8a2
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index d37bfcd7a1d7..617fc2cecf20 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -1763,6 +1763,11 @@ void SwWrtShell::SetReadonlyOption(bool bSet)
void SwWrtShell::ChangeHeaderOrFooter(
const OUString& rStyleName, bool bHeader, bool bOn, bool bShowWarning)
{
+ SdrView *const pSdrView = GetDrawView();
+ if (pSdrView && pSdrView->IsTextEdit())
+ { // tdf#107474 deleting header may delete active drawing object
+ pSdrView->SdrEndTextEdit(true);
+ }
addCurrentPosition();
StartAllAction();
StartUndo( SwUndoId::HEADER_FOOTER ); // #i7983#
commit 875d9d55a3646d0a027cf776b840e7f78c7f7ab5
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Apr 28 13:25:46 2017 +0200
sw: remove useless comment
Change-Id: I019aa3a9381af0cb26970b69ab41258e05410617
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 4cb03a5a7423..0363ec3d535a 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -2768,7 +2768,7 @@ void SwContentTree::KeyInput(const KeyEvent& rEvent)
SdrView* pDrawView = m_pActiveShell->GetDrawView();
if (pDrawView)
{
- pDrawView->SdrEndTextEdit();//Change from "EndTextEdit" to "SdrEndTextEdit" for acc migration
+ pDrawView->SdrEndTextEdit();
SwDrawModel* pDrawModel = m_pActiveShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
SdrPage* pPage = pDrawModel->GetPage(0);
More information about the Libreoffice-commits
mailing list