diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-07-04 12:53:56 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-07-05 14:55:13 +0200 |
commit | 088d73b863b151ca11e23fd924c8d5a86c074e47 (patch) | |
tree | 960ec9ddb14d2e6d44261e11e7f24394f6fb343c | |
parent | gcc7: disable -Wdeprecated for dynamic excpt specs (diff) | |
download | core-088d73b863b151ca11e23fd924c8d5a86c074e47.tar.gz core-088d73b863b151ca11e23fd924c8d5a86c074e47.zip |
tdf#101856 sw: hidden bookmark portions in SwTextFormatter::NewTextPortion()
All other hidden-text features already have a AUTOFMT hint or a TXTFIELD
hint, so the SwAttrIter already creates new portions for them.
The bookmarks aren't considered by SwTextFormatter currently, but
SwScriptInfo already has all of the required info.
Change-Id: I451ce331110aa58df8955e1a3ffa339e6f905b22
Reviewed-on: https://gerrit.libreoffice.org/56937
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r-- | sw/source/core/inc/scriptinfo.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/text/itrform2.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/text/porlay.cxx | 12 |
3 files changed, 17 insertions, 0 deletions
diff --git a/sw/source/core/inc/scriptinfo.hxx b/sw/source/core/inc/scriptinfo.hxx index 865bac95bb24..17ec3f67059f 100644 --- a/sw/source/core/inc/scriptinfo.hxx +++ b/sw/source/core/inc/scriptinfo.hxx @@ -173,6 +173,7 @@ public: OSL_ENSURE( nCnt < aHiddenChg.size(),"No HiddenChg today!"); return aHiddenChg[ nCnt ]; } + sal_Int32 NextHiddenChg(sal_Int32 nPos) const; static void CalcHiddenRanges(const SwTextNode& rNode, MultiSelection& rHiddenMulti); static void selectHiddenTextProperty(const SwTextNode& rNode, MultiSelection &rHiddenMulti); static void selectRedLineDeleted(const SwTextNode& rNode, MultiSelection &rHiddenMulti, bool bSelect=true); diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 4adfddceef88..437b80b3794e 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -939,6 +939,10 @@ SwTextPortion *SwTextFormatter::NewTextPortion( SwTextFormatInfo &rInf ) const sal_Int32 nNextDir = pScriptInfo->NextDirChg( rInf.GetIdx() ); nNextChg = std::min( nNextChg, nNextDir ); + // hidden change (potentially via bookmark): + const sal_Int32 nNextHidden = pScriptInfo->NextHiddenChg(rInf.GetIdx()); + nNextChg = std::min( nNextChg, nNextHidden ); + // Turbo boost: // We assume that a font's characters are not larger than twice // as wide as heigh. diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 66d86985e653..5a415e11da9d 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -1287,6 +1287,18 @@ sal_uInt8 SwScriptInfo::DirType(const sal_Int32 nPos) const return 0; } +sal_Int32 SwScriptInfo::NextHiddenChg(sal_Int32 const nPos) const +{ + for (auto const it : aHiddenChg) + { + if (nPos < it) + { + return it; + } + } + return COMPLETE_STRING; +} + // Takes a string and replaced the hidden ranges with cChar. sal_Int32 SwScriptInfo::MaskHiddenRanges( const SwTextNode& rNode, OUStringBuffer & rText, const sal_Int32 nStt, const sal_Int32 nEnd, |