[Libreoffice-commits] core.git: sw/source
Serge Krot (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jun 11 09:56:23 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 ddd9b1bccd87c6913ba4576da8af2d59daf106e9
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: Thu Jun 11 11:55:50 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>
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 4151f9d6b562..12350ceb49d9 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -298,6 +298,8 @@ namespace sw
{
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 d18d020e8c88..429c2e1129f6 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1690,7 +1690,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))
{
@@ -1699,6 +1699,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));
@@ -1767,6 +1769,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 64064a858023..b0b0c4fc3e34 100644
--- a/sw/source/core/inc/mvsave.hxx
+++ b/sw/source/core/inc/mvsave.hxx
@@ -58,6 +58,8 @@ namespace sw::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 f473ad63b753..1882a68d1d0e 100644
--- a/sw/source/core/inc/rolbck.hxx
+++ b/sw/source/core/inc/rolbck.hxx
@@ -249,6 +249,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 ceac742f9bbc..2de4c627109e 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