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

Michael Stahl mstahl at redhat.com
Tue Jun 27 10:59:51 UTC 2017


 sw/source/uibase/app/apphdl.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit e1f9228cfbc11110310eac0c17165565ee8904f0
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Jun 27 12:54:13 2017 +0200

    sw: fix the assertion in SwModule::Notify()
    
    This assertion (for i#116192) is actually triggered while loading
    fdo65932.html in CppunitTest_sw_filters_test:
    
    The perverted LoadHiddenDocument() hack in SwHTMLParser::SetControlSize()
    may create a view too early, before loading finishes, but this
    shouldn't be a problem because HTML is never a template, so move the
    assertion into the place where we actually modify the document directly
    without going via the shell.
    
    Change-Id: Ifa4b1ec4ab4142f4159daf5785cd90b5468f7e3e

diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 9fe4c69efbae..494857f069a4 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -829,7 +829,6 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
             switch( pEvHint->GetEventId() )
             {
             case SfxEventHintId::LoadFinished:
-                SAL_WARN_IF(pWrtSh, "sw", "pWrtSh should be null");
                 // if it is a new document created from a template,
                 // update fixed fields
                 if (pDocSh->GetMedium())
@@ -837,6 +836,9 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
                     const SfxBoolItem* pTemplateItem = SfxItemSet::GetItem<SfxBoolItem>(pDocSh->GetMedium()->GetItemSet(), SID_TEMPLATE, false);
                     if (pTemplateItem && pTemplateItem->GetValue())
                     {
+                        // assume that not calling via SwEditShell::SetFixFields
+                        // is allowed, because the shell hasn't been created yet
+                        assert(!pWrtSh);
                         pDocSh->GetDoc()->getIDocumentFieldsAccess().SetFixFields(nullptr);
                     }
                 }


More information about the Libreoffice-commits mailing list