diff options
author | Serge Krot <Serge.Krot@cib.de> | 2018-02-12 10:19:10 +0100 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-07-06 10:23:22 +0200 |
commit | 97de51107824b5b3452e5343672c838da4b04b84 (patch) | |
tree | 1a3adef1c016d9898e8271628601f1d906e5e9fb | |
parent | 8c2545153572b32ecba202e52aade84b188dac73 (diff) |
tdf#101856: Use bookmark attributes at load
Conflicts:
sw/source/core/text/porlay.cxx
Change-Id: I935c50f8b3a1d7179121b9230a7f7f25fa6aea22
(cherry picked from commit f8afdb8ba99074a85b331065b4642081467557ec)
Reviewed-on: https://gerrit.libreoffice.org/49578
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
-rw-r--r-- | sw/source/core/text/porlay.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index d7d7ad015e77..7d5b87b8437a 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -54,6 +54,7 @@ #include <IDocumentRedlineAccess.hxx> #include <IDocumentSettingAccess.hxx> #include <IDocumentContentOperations.hxx> +#include <IMark.hxx> using namespace ::com::sun::star; using namespace i18n::ScriptType; @@ -2251,6 +2252,25 @@ void SwScriptInfo::selectHiddenTextProperty(const SwTextNode& rNode, MultiSelect } } } + + for (const SwIndex* pIndex = rNode.GetFirstIndex(); pIndex; pIndex = pIndex->GetNext()) + { + const sw::mark::IMark* pMark = pIndex->GetMark(); + const sw::mark::IBookmark* pBookmark = dynamic_cast<const sw::mark::IBookmark*>(pMark); + if (pBookmark && pBookmark->IsHidden()) + { + // intersect bookmark range with textnode range and add the intersection to rHiddenMulti + + const sal_Int32 nSt = pBookmark->GetMarkStart().nContent.GetIndex(); + const sal_Int32 nEnd = pBookmark->GetMarkEnd().nContent.GetIndex(); + + if( nEnd > nSt ) + { + Range aTmp( nSt, nEnd - 1 ); + rHiddenMulti.Select(aTmp, true); + } + } + } } void SwScriptInfo::selectRedLineDeleted(const SwTextNode& rNode, MultiSelection &rHiddenMulti, bool bSelect) |