summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2021-01-02 22:58:23 +0800
committerXisco Fauli <xiscofauli@libreoffice.org>2021-01-04 21:51:27 +0100
commite865a170a3a964dfa28ca51789801691932827e9 (patch)
treec33d5578db0979ba96a06a1949248fe523d7552f /editeng
parent75596e1254f284fca22efc8e6cba158bd6c50b15 (diff)
tdf#120171 editeng: don't reduce nBreakPos
even if it is greater then nMaxBreakPos. The only situation that happens is when there is a hanging punctuation. Reducing nBreakPos to nMaxBreakPos always break that punctuation to the next line. Change-Id: Ie4b61d21f4d8f6f874e2a969260c13a3bca2a049 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108594 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com> (cherry picked from commit 2ffa6c897379bf07367d445918b4c142cd493e7f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108591 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/impedit3.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index a271aa37c1e6..7df8aaa92bf4 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -1900,10 +1900,9 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te
OSL_FAIL( "I18N: XBreakIterator::getLineBreak returns position > Max" );
nBreakPos = nMaxBreakPos;
}
-
- // nBreakPos can never be outside the portion, even not with hanging punctuation
- if ( nBreakPos > nMaxBreakPos )
- nBreakPos = nMaxBreakPos;
+ // Hanging punctuation is the only case that increases nBreakPos and makes
+ // nBreakPos > nMaxBreakPos. It's expected that the hanging punctuation goes over
+ // the border of the object.
}
// BUG in I18N - the japanese dot is in the next line!