[Libreoffice-commits] core.git: sw/source

Michael Stahl mstahl at redhat.com
Tue May 3 12:50:04 UTC 2016


 sw/source/filter/html/htmlform.cxx |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 2ce95e838260ed1e7e64ac8f5662aa2e2234ab9e
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

diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index 2672ac2..f66a469 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>
@@ -664,6 +665,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