summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorOliver Specht <oliver.specht@cib.de>2016-02-23 12:13:21 +0100
committerAndras Timar <andras.timar@collabora.com>2016-03-17 14:26:02 +0100
commit1db35d937d74c9bcfcc489a6bacc3e3e873d1da6 (patch)
treeb4fb56334db2c061158c8ceadace6f8cdf7a8a2d /sw
parent647c6ba339ec57580c7eee3c98553c8f65a4e2d3 (diff)
tdf#97139: prevent loop while formatting small text lines
when text is inserted at the end of a line then text formatting starts some characters (platform and ENABLE_GRAPHITE dependent) before the insert position. In case of small lines this might even be the start of the line. To prevent going back to the previous line the cursor right margin flag needs to be reset. Change-Id: I73a62ce6c7707469fddeeffe0d7eec064c5989ea Reviewed-on: https://gerrit.libreoffice.org/22641 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Oliver Specht <oliver.specht@cib.de> Reviewed-on: https://gerrit.libreoffice.org/22667 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 40a304eb1f47f27e1a5c2ebda06a0726f22c36e3)
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/text/itrform2.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index a8f5ff228ddd..f1937ca3cd2f 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -2686,7 +2686,7 @@ namespace {
const sal_Int32 nOldLineEnd,
const std::vector<long> &rFlyStarts )
{
- SwTextFormatInfo txtFormatInfo = rThis.GetInfo();
+ SwTextFormatInfo& txtFormatInfo = rThis.GetInfo();
if ( txtFormatInfo.GetIdx() < txtFormatInfo.GetReformatStart() )
// the reformat position is behind our new line, that means
// something of our text has moved to the next line
@@ -2733,7 +2733,11 @@ namespace {
if ( nReformat > txtFormatInfo.GetLineStart() + nMaxContext )
nReformat = nReformat - nMaxContext;
else
+ {
nReformat = txtFormatInfo.GetLineStart();
+ //reset the margin flag - prevent loops
+ SwTextCursor::SetRightMargin(false);
+ }
}
// Weird situation: Our line used to end with a hole portion