summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-06-27 12:54:13 +0200
committerMichael Stahl <mstahl@redhat.com>2017-06-27 12:59:02 +0200
commite1f9228cfbc11110310eac0c17165565ee8904f0 (patch)
tree0c51e8ada6fc079bf9126e6c409b309bab937800 /sw/source/uibase
parent37e7bb9c7803a3d4a3b4c44562487403e274203f (diff)
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
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/app/apphdl.cxx4
1 files changed, 3 insertions, 1 deletions
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);
}
}