[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - sw/source
Michael Stahl
mstahl at redhat.com
Thu May 5 14:35:15 UTC 2016
sw/source/filter/html/htmlform.cxx | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit e26463e647c10a4db0612747f914a132f398dfb6
Author: Michael Stahl <mstahl at redhat.com>
Date: Tue May 3 14:35:32 2016 +0200
sw: HTML filter: avoid turning on Undo with ridiculous hacks
SwHTMLParser::SetControlSize() loads a "hidden document" into the same
model (!) that is currently being imported (!), just so it can get a
awt::XControl from the ViewShell; unfortunately creating the ViewShell
happens to enable Undo too, so turn that off again.
This avoids triggering the assert in SwRegHistory::InsertItems() on
kde122884-1.html
Change-Id: I3d8fcd5c43bcb8e7ed8775710acbc2d40f2ffdd0
(cherry picked from commit 2ce95e838260ed1e7e64ac8f5662aa2e2234ab9e)
Reviewed-on: https://gerrit.libreoffice.org/24665
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index 94794a7..9d48671 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -62,6 +62,7 @@
#include <com/sun/star/form/XForm.hpp>
#include <doc.hxx>
#include <IDocumentLayoutAccess.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
#include <swtable.hxx>
#include <fmtanchr.hxx>
@@ -665,6 +666,8 @@ void SwHTMLParser::SetControlSize( const uno::Reference< drawing::XShape >& rSha
m_pTempViewFrame = SfxViewFrame::LoadHiddenDocument( *pDocSh, 0 );
CallStartAction();
pVSh = m_pDoc->getIDocumentLayoutAccess().GetCurrentViewShell();
+ // this ridiculous hack also enables Undo, so turn it off again
+ m_pDoc->GetIDocumentUndoRedo().DoUndo(false);
}
}
More information about the Libreoffice-commits
mailing list