[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Mar 7 16:45:25 UTC 2019


 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 c782dc3441ef29056ba146e0798637b923bcf5f3
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Mar 5 14:12:27 2019 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Thu Mar 7 17:44:57 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.Stahl at cib.de>
    (cherry picked from commit d55e75d9173fd0d5928bae45ed49d3c105140468)
    Reviewed-on: https://gerrit.libreoffice.org/68768
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index e8e26348ec85..02330c6e811e 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -279,9 +279,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 e0a675911ef3..dcbe320bd0af 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -55,6 +55,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 2a0a5c5fa6d5..c4c6d19b0ede 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -1672,15 +1672,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,
@@ -1771,8 +1762,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;
             }
         }


More information about the Libreoffice-commits mailing list