summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-07-04 12:53:56 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2018-07-06 10:24:04 +0200
commitbf4d4a9cad6664bd5772618e31e998942caef77e (patch)
tree75d31da6d858d22ddbbf397ab5a57247b2fd758a
parent97de51107824b5b3452e5343672c838da4b04b84 (diff)
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/56959 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
-rw-r--r--sw/source/core/inc/scriptinfo.hxx1
-rw-r--r--sw/source/core/text/itrform2.cxx4
-rw-r--r--sw/source/core/text/porlay.cxx12
3 files changed, 17 insertions, 0 deletions
diff --git a/sw/source/core/inc/scriptinfo.hxx b/sw/source/core/inc/scriptinfo.hxx
index aab651e1511d..e3b532783439 100644
--- a/sw/source/core/inc/scriptinfo.hxx
+++ b/sw/source/core/inc/scriptinfo.hxx
@@ -177,6 +177,7 @@ public:
assert(nCnt < m_HiddenChg.size());
return m_HiddenChg[ nCnt ];
}
+ TextFrameIndex NextHiddenChg(TextFrameIndex 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 3949fc35bb71..2df29c9e8ff8 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -958,6 +958,10 @@ SwTextPortion *SwTextFormatter::NewTextPortion( SwTextFormatInfo &rInf )
const TextFrameIndex nNextDir = m_pScriptInfo->NextDirChg(rInf.GetIdx());
nNextChg = std::min( nNextChg, nNextDir );
+ // hidden change (potentially via bookmark):
+ const TextFrameIndex nNextHidden = m_pScriptInfo->NextHiddenChg(rInf.GetIdx());
+ nNextChg = std::min( nNextChg, nNextHidden );
+
// Turbo boost:
// We assume that font characters are not larger than twice
// as wide as height.
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 7d5b87b8437a..a5391aa817a6 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -1450,6 +1450,18 @@ sal_uInt8 SwScriptInfo::DirType(const TextFrameIndex nPos) const
return 0;
}
+TextFrameIndex SwScriptInfo::NextHiddenChg(TextFrameIndex const nPos) const
+{
+ for (auto const it : m_HiddenChg)
+ {
+ if (nPos < it)
+ {
+ return it;
+ }
+ }
+ return TextFrameIndex(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,