From e1f9228cfbc11110310eac0c17165565ee8904f0 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 27 Jun 2017 12:54:13 +0200 Subject: 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 --- sw/source/uibase/app/apphdl.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sw/source/uibase') 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(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); } } -- cgit