diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2019-03-05 14:12:27 +0100 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2019-03-05 18:35:14 +0100 |
commit | d55e75d9173fd0d5928bae45ed49d3c105140468 (patch) | |
tree | a3e4dc2d168a2384fe813c9baf506f5180a02001 /sw | |
parent | d9bd131b11e47c7b1b7f0ae5bc50fff28f157016 (diff) |
sw_redlinehide: fix RSID related asserts regression
Due to sw_redlinehide the SwTextNode::MakeFrame() is skipped on
SwTextNodes that are merged due to redlining. But then the
IgnoreStart/IgnoreEnd flags on the hints are not initialised and some
assert like assert(pHt->IsFormatIgnoreStart()) fails.
tdf90056-1.odt is an example document.
There doesn't appear to be a convenient place to initialise it per-node
as it is finished; the ODF import inserts APPEND_PARAGRAPH before
inserting the hints themselves.
So remove the initialisation from MakeFrame() and just do it in
SwReader::Read().
Change-Id: Ib33fe3033fc05bd2f5ef2ac8d059d587642ccf48
Reviewed-on: https://gerrit.libreoffice.org/68748
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/txtnode/ndtxt.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/basflt/shellio.cxx | 17 | ||||
-rw-r--r-- | sw/source/uibase/app/docsh2.cxx | 11 |
3 files changed, 17 insertions, 14 deletions
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 785aac960606..2fbf5a71e60b 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -277,9 +277,6 @@ void SwTextNode::FileLoadedInitHints() SwContentFrame *SwTextNode::MakeFrame( SwFrame* pSib ) { - // fdo#52028: ODF file import does not result in MergePortions being called - // for every attribute, since that would be inefficient. So call it here. - FileLoadedInitHints(); SwContentFrame *pFrame = new SwTextFrame( this, pSib ); return pFrame; } diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index 1c0d473cbd4c..b8596debc8ee 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -56,6 +56,7 @@ #include <poolfmt.hxx> #include <fltini.hxx> #include <docsh.hxx> +#include <ndtxt.hxx> #include <redline.hxx> #include <swerror.h> #include <paratr.hxx> @@ -63,6 +64,15 @@ using namespace ::com::sun::star; +static bool sw_MergePortions(SwNode *const& pNode, void *) +{ + if (pNode->IsTextNode()) + { + pNode->GetTextNode()->FileLoadedInitHints(); + } + return true; +} + ErrCode SwReader::Read( const Reader& rOptions ) { // copy variables @@ -338,6 +348,13 @@ ErrCode SwReader::Read( const Reader& rOptions ) } } + // fdo#52028: ODF file import does not result in MergePortions being called + // for every attribute, since that would be inefficient. So call it here. + // This is only necessary for formats that may contain RSIDs (ODF,MSO). + // It's too hard to figure out which nodes were inserted in Insert->File + // case (redlines, flys, footnotes, header/footer) so just do every node. + mxDoc->GetNodes().ForEach(&sw_MergePortions); + mxDoc->SetInReading( false ); mxDoc->SetInXMLImport( false ); diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 13ebc3e7dbe5..e9ebabc6a912 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -1668,15 +1668,6 @@ SfxInPlaceClient* SwDocShell::GetIPClient( const ::svt::EmbeddedObjectRef& xObjR return pResult; } -static bool lcl_MergePortions(SwNode *const& pNode, void *) -{ - if (pNode->IsTextNode()) - { - pNode->GetTextNode()->FileLoadedInitHints(); - } - return true; -} - int SwFindDocShell( SfxObjectShellRef& xDocSh, SfxObjectShellLock& xLockRef, const OUString& rFileName, @@ -1767,8 +1758,6 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh, xDocSh = static_cast<SfxObjectShell*>(xLockRef); if (xDocSh->DoLoad(xMed.release())) { - SwDoc const& rDoc(*pNew->GetDoc()); - const_cast<SwDoc&>(rDoc).GetNodes().ForEach(&lcl_MergePortions); return 2; } } |