[Libreoffice-commits] core.git: sw/inc sw/source

László Németh (via logerrit) logerrit at kemper.freedesktop.org
Tue May 28 05:50:08 UTC 2019


 sw/inc/IDocumentRedlineAccess.hxx             |    4 ++++
 sw/source/core/doc/DocumentRedlineManager.cxx |   16 ++++++++++++----
 sw/source/core/inc/DocumentRedlineManager.hxx |    4 ++++
 sw/source/core/unocore/unocrsrhelper.cxx      |    4 ++++
 4 files changed, 24 insertions(+), 4 deletions(-)

New commits:
commit caeb6ff68d49e1b1ca911cf3f63371b855ee935d
Author:     László Németh <nemeth at numbertext.org>
AuthorDate: Mon May 27 18:23:46 2019 +0200
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Tue May 28 07:49:28 2019 +0200

    DOCX import: clean-up FinalizeImport() of change tracking
    
    FinalizeImport() could be triggered by accident while
    editing the document. Now we set it by checking
    PROP_REDLINE_REVERT_PROPERTIES used only in OOXML import.
    
    This is a clean-up of the commit 8acc15b5113c798ecdbeed91456a92e7b0c1334e
    "tdf#118699 DOCX import: don't add numbering."
    
    Change-Id: Ib1f4ee41ba94d640788396037b668b85b800f9d0
    Reviewed-on: https://gerrit.libreoffice.org/73043
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>

diff --git a/sw/inc/IDocumentRedlineAccess.hxx b/sw/inc/IDocumentRedlineAccess.hxx
index 7592de03411d..20c6d5b97210 100644
--- a/sw/inc/IDocumentRedlineAccess.hxx
+++ b/sw/inc/IDocumentRedlineAccess.hxx
@@ -229,6 +229,10 @@ public:
     virtual void SetRedlinePassword(
         /*[in]*/const css::uno::Sequence <sal_Int8>& rNewPassword) = 0;
 
+    virtual bool IsFinalizeImport() const = 0;
+
+    virtual void SetFinalizeImport(bool const bFinalizeImport) = 0;
+
 protected:
      virtual ~IDocumentRedlineAccess() {};
 };
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx
index 93f8f0b972e7..94a361e14f37 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -820,10 +820,10 @@ RedlineFlags DocumentRedlineManager::GetRedlineFlags() const
 
 void DocumentRedlineManager::SetRedlineFlags( RedlineFlags eMode )
 {
-    if ( m_bFinalizeImport )
+    if ( IsFinalizeImport() )
     {
         FinalizeImport();
-        m_bFinalizeImport = false;
+        SetFinalizeImport( false );
     }
 
     if( meRedlineFlags != eMode )
@@ -1424,8 +1424,6 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall
                                 // better fix it.
                                 n = 0;
                                 bDec = true;
-                                // or simply this is an OOXML import
-                                m_bFinalizeImport = true;
                             }
 
                             mpRedlineTable->DeleteAndDestroy( nToBeDeleted );
@@ -3000,6 +2998,16 @@ void DocumentRedlineManager::SetRedlinePassword(
     m_rDoc.getIDocumentState().SetModified();
 }
 
+bool DocumentRedlineManager::IsFinalizeImport() const
+{
+    return m_bFinalizeImport;
+}
+
+void DocumentRedlineManager::SetFinalizeImport(bool const bFinalizeImport)
+{
+    m_bFinalizeImport = bFinalizeImport;
+}
+
 /// Set comment text for the Redline, which is inserted later on via
 /// AppendRedline. Is used by Autoformat.
 /// A null pointer resets the mode. The pointer is not copied, so it
diff --git a/sw/source/core/inc/DocumentRedlineManager.hxx b/sw/source/core/inc/DocumentRedlineManager.hxx
index dd64f5511d12..1288faae5e38 100644
--- a/sw/source/core/inc/DocumentRedlineManager.hxx
+++ b/sw/source/core/inc/DocumentRedlineManager.hxx
@@ -117,6 +117,10 @@ public:
     virtual void SetRedlinePassword(
         /*[in]*/const css::uno::Sequence <sal_Int8>& rNewPassword) override;
 
+    virtual bool IsFinalizeImport() const override;
+
+    virtual void SetFinalizeImport(bool const bFinalizeImport) override;
+
     //Non Interface methods;
 
     /** Set comment-text for Redline. It then comes in via AppendRedLine.
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index 0b8a3d8fadb9..2e935b87477c 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -1260,6 +1260,10 @@ void makeRedline( SwPaM const & rPaM,
                 pRedlineExtraData = new SwRedlineExtraData_FormattingChanges( &aItemSet );
             }
         }
+
+        // to finalize DOCX import
+        if ( eType == RedlineType::Delete && !pRedlineAccess->IsFinalizeImport() )
+            pRedlineAccess->SetFinalizeImport( true );
     }
 
     SwRangeRedline* pRedline = new SwRangeRedline( aRedlineData, rPaM );


More information about the Libreoffice-commits mailing list