summaryrefslogtreecommitdiffstats
path: root/sw/source/core/text/portxt.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/text/portxt.cxx')
-rw-r--r--sw/source/core/text/portxt.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 85691ef21e..e58021ef09 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -325,14 +325,20 @@ bool SwTextPortion::Format_( SwTextFormatInfo &rInf )
// call with an extra space: shrinking can result a new word in the line
// and a new space before that, which is also a shrank space
- // (except if the line was already broken at a soft hyphen, i.e. inside a word)
- if ( aGuess.BreakPos() < TextFrameIndex(rInf.GetText().getLength()) &&
+ // (except if the line was already broken inside a word with hyphenation)
+ // TODO: handle the case, if the line contains extra amount of spaces
+ if (
+ // no automatic hyphenation
+ !aGuess.HyphWord().is() &&
+ // no hyphenation at soft hyphen
+ aGuess.BreakPos() < TextFrameIndex(rInf.GetText().getLength()) &&
rInf.GetText()[sal_Int32(aGuess.BreakPos())] != CHAR_SOFTHYPHEN )
{
++nSpacesInLine;
}
- bFull = !aGuess.Guess( *this, rInf, Height(), nSpacesInLine );
+ if ( nSpacesInLine > 0 )
+ bFull = !aGuess.Guess( *this, rInf, Height(), nSpacesInLine );
}
// these are the possible cases: