diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport13.cxx | 2 | ||||
-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 |
4 files changed, 18 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index 23449e274557..27c66c141357 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -499,7 +499,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf124594, "tdf124594.docx") // only "Er horte leise Schritte hinter", which means the 1st line of the 2nd paragraph was // split into two by a Special portion, i.e. the top margin of the shape was too large. assertXPath(pDump, "/root/page/body/txt[2]/Text[1]", "Portion", - "Er horte leise Schritte hinter sich. Das bedeutete nichts Gutes. Wer wurde ihm "); + "Er horte leise Schritte hinter sich. Das bedeutete nichts Gutes. Wer wu"); // ... until the bookmark. } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTextInput, "textinput.odt") diff --git a/sw/source/core/inc/scriptinfo.hxx b/sw/source/core/inc/scriptinfo.hxx index e70ded7166b0..6d7ad0f4dfff 100644 --- a/sw/source/core/inc/scriptinfo.hxx +++ b/sw/source/core/inc/scriptinfo.hxx @@ -181,6 +181,7 @@ public: return m_HiddenChg[ nCnt ]; } TextFrameIndex NextHiddenChg(TextFrameIndex nPos) const; + TextFrameIndex NextBookmark(TextFrameIndex nPos) const; static void CalcHiddenRanges(const SwTextNode& rNode, MultiSelection& rHiddenMulti, std::vector<std::pair<sw::mark::IBookmark const*, MarkKind>> * pBookmarks); diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index e7d375299c26..3285f7f5ede9 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -962,6 +962,10 @@ SwTextPortion *SwTextFormatter::NewTextPortion( SwTextFormatInfo &rInf ) const TextFrameIndex nNextHidden = m_pScriptInfo->NextHiddenChg(rInf.GetIdx()); nNextChg = std::min( nNextChg, nNextHidden ); + // bookmarks + const TextFrameIndex nNextBookmark = m_pScriptInfo->NextBookmark(rInf.GetIdx()); + nNextChg = std::min(nNextChg, nNextBookmark); + // 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 b6f70e7da060..aa0bbf6860c3 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -1674,6 +1674,18 @@ TextFrameIndex SwScriptInfo::NextHiddenChg(TextFrameIndex const nPos) const return TextFrameIndex(COMPLETE_STRING); } +TextFrameIndex SwScriptInfo::NextBookmark(TextFrameIndex const nPos) const +{ + for (auto const& it : m_Bookmarks) + { + if (nPos < it.first) + { + return it.first; + } + } + 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, |