sw/source/core/txtnode/ndtxt.cxx | 3 --- sw/source/filter/basflt/shellio.cxx | 17 +++++++++++++++++ sw/source/uibase/app/docsh2.cxx | 11 ----------- 3 files changed, 17 insertions(+), 14 deletions(-)
New commits: commit d55e75d9173fd0d5928bae45ed49d3c105140468 Author: Michael Stahl <michael.st...@cib.de> AuthorDate: Tue Mar 5 14:12:27 2019 +0100 Commit: Michael Stahl <michael.st...@cib.de> CommitDate: Tue Mar 5 18:35:14 2019 +0100 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.st...@cib.de> 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; } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits