summaryrefslogtreecommitdiff
path: root/sw/source/core/text/portxt.cxx
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2023-11-15 23:31:12 +0100
committerLászló Németh <nemeth@numbertext.org>2023-11-16 16:21:06 +0100
commit17eaebee279772b6062ae3448012133897fc71bb (patch)
tree5ffd603be9cceb79c079c39912712b86eb99e4c3 /sw/source/core/text/portxt.cxx
parent454e5010aec9953f586fe8af671765358f6cafc4 (diff)
tdf#119908 sw smart justify: fix justification by shrinking
Shrink the exceeding lines by shrinking the spaces between the words. Because the negative spacing values are used for the extra space between the characters in the main data structure of the justified line layout, and not for the space between the words, like the positive values, the negative space values for shrinking are stored over LONG_MAX/2 as absolute values to avoid of bigger changes of the data structure before designing a better justification algorithm, where it's possible to mix different methods for the more visible text layout. Note: the text cursor doesn't follow the new word positions yet. Follow-up to commit 7d08767b890e723cd502b1c61d250924f695eb98 "tdf#130088 tdf#119908 smart justify: fix DOCX line count + compat opt." Change-Id: I9a63b5a93d6bce230e963ebc88ea2d0f9aa8fffb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159511 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/core/text/portxt.cxx')
-rw-r--r--sw/source/core/text/portxt.cxx7
1 files changed, 1 insertions, 6 deletions
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 99595c1a71f7..1e2f8d1823d0 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -394,12 +394,7 @@ bool SwTextPortion::Format_( SwTextFormatInfo &rInf )
! rInf.GetLast()->IsErgoSumPortion() &&
lcl_HasContent(*static_cast<SwFieldPortion*>(rInf.GetLast()),rInf ) ) ) ) )
{
- // GetLineWidth() takes care of DocumentSettingId::TAB_OVER_MARGIN.
- if (aGuess.BreakWidth() <= rInf.GetLineWidth())
- Width( aGuess.BreakWidth() );
- else
- // this actually should not happen
- Width( sal_uInt16(rInf.Width() - rInf.X()) );
+ Width( aGuess.BreakWidth() );
SetLen( aGuess.BreakPos() - rInf.GetIdx() );