[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - sw/source

Serge Krot (via logerrit) logerrit at kemper.freedesktop.org
Fri Jun 12 11:41:10 UTC 2020


 sw/source/core/doc/DocumentContentOperationsManager.cxx |    2 ++
 sw/source/core/doc/docbm.cxx                            |    7 ++++++-
 sw/source/core/inc/mvsave.hxx                           |    2 ++
 sw/source/core/inc/rolbck.hxx                           |    2 ++
 sw/source/core/undo/rolbck.cxx                          |    8 ++++++--
 5 files changed, 18 insertions(+), 3 deletions(-)

New commits:
commit fc075494106285c4e0ce1f765e21bd8b7f2cb164
Author:     Serge Krot <Serge.Krot at cib.de>
AuthorDate: Wed Jun 10 19:15:41 2020 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Jun 12 13:40:38 2020 +0200

    tdf#101856 copy missing bookmark properties
    
    - in case of undo/redo
    - in case of copying bookmark
    
    Change-Id: Ia21f42973b0e7c2cc4abfe2febe9818509aec4d5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96064
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96116

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index b3243bd0e624..3135172cfe84 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -291,6 +291,8 @@ namespace
             {
                 pNewBookmark->SetKeyCode(pOldBookmark->GetKeyCode());
                 pNewBookmark->SetShortName(pOldBookmark->GetShortName());
+                pNewBookmark->Hide(pOldBookmark->IsHidden());
+                pNewBookmark->SetHideCondition(pOldBookmark->GetHideCondition());
             }
             ::sw::mark::IFieldmark* const pNewFieldmark =
                 dynamic_cast< ::sw::mark::IFieldmark* const >(pNewMark);
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 65ae2df1c182..ed383ecec8e2 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1222,7 +1222,7 @@ SaveBookmark::SaveBookmark(
     const SwNodeIndex & rMvPos,
     const SwIndex* pIdx)
     : m_aName(rBkmk.GetName())
-    , m_aShortName()
+    , m_bHidden(false)
     , m_aCode()
     , m_eOrigBkmType(IDocumentMarkAccess::GetType(rBkmk))
 {
@@ -1231,6 +1231,8 @@ SaveBookmark::SaveBookmark(
     {
         m_aShortName = pBookmark->GetShortName();
         m_aCode = pBookmark->GetKeyCode();
+        m_bHidden = pBookmark->IsHidden();
+        m_aHideCondition = pBookmark->GetHideCondition();
 
         ::sfx2::Metadatable const*const pMetadatable(
                 dynamic_cast< ::sfx2::Metadatable const* >(pBookmark));
@@ -1299,6 +1301,9 @@ void SaveBookmark::SetInDoc(
         {
             pBookmark->SetKeyCode(m_aCode);
             pBookmark->SetShortName(m_aShortName);
+            pBookmark->Hide(m_bHidden);
+            pBookmark->SetHideCondition(m_aHideCondition);
+
             if (m_pMetadataUndo)
             {
                 ::sfx2::Metadatable * const pMeta(
diff --git a/sw/source/core/inc/mvsave.hxx b/sw/source/core/inc/mvsave.hxx
index ec0a1e412787..852ac885faa0 100644
--- a/sw/source/core/inc/mvsave.hxx
+++ b/sw/source/core/inc/mvsave.hxx
@@ -58,6 +58,8 @@ namespace sw { namespace mark
     private:
             OUString m_aName;
             OUString m_aShortName;
+            bool m_bHidden;
+            OUString m_aHideCondition;
             vcl::KeyCode m_aCode;
             IDocumentMarkAccess::MarkType m_eOrigBkmType;
             sal_uLong m_nNode1;
diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx
index ef6642719a72..2abb4e4bfbb3 100644
--- a/sw/source/core/inc/rolbck.hxx
+++ b/sw/source/core/inc/rolbck.hxx
@@ -248,6 +248,8 @@ class SwHistoryBookmark : public SwHistoryHint
     private:
         const OUString m_aName;
         OUString m_aShortName;
+        bool m_bHidden;
+        OUString m_aHideCondition;
         vcl::KeyCode m_aKeycode;
         const sal_uLong m_nNode;
         const sal_uLong m_nOtherNode;
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index 835ad7f6a86e..f22b31f77d23 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -559,8 +559,7 @@ SwHistoryBookmark::SwHistoryBookmark(
     bool bSaveOtherPos)
     : SwHistoryHint(HSTRY_BOOKMARK)
     , m_aName(rBkmk.GetName())
-    , m_aShortName()
-    , m_aKeycode()
+    , m_bHidden(false)
     , m_nNode(bSavePos ?
         rBkmk.GetMarkPos().nNode.GetIndex() : 0)
     , m_nOtherNode(bSaveOtherPos ?
@@ -579,6 +578,8 @@ SwHistoryBookmark::SwHistoryBookmark(
     {
         m_aKeycode = pBookmark->GetKeyCode();
         m_aShortName = pBookmark->GetShortName();
+        m_bHidden = pBookmark->IsHidden();
+        m_aHideCondition = pBookmark->GetHideCondition();
 
         ::sfx2::Metadatable const*const pMetadatable(
                 dynamic_cast< ::sfx2::Metadatable const* >(pBookmark));
@@ -653,6 +654,9 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool )
         {
             pBookmark->SetKeyCode(m_aKeycode);
             pBookmark->SetShortName(m_aShortName);
+            pBookmark->Hide(m_bHidden);
+            pBookmark->SetHideCondition(m_aHideCondition);
+
             if (m_pMetadataUndo)
             {
                 ::sfx2::Metadatable * const pMeta(


More information about the Libreoffice-commits mailing list