Kaydet (Commit) b29f2683 authored tarafından Oliver Specht's avatar Oliver Specht

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/22641Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarOliver Specht <oliver.specht@cib.de>
üst 904eccc9
...@@ -2686,7 +2686,7 @@ namespace { ...@@ -2686,7 +2686,7 @@ namespace {
const sal_Int32 nOldLineEnd, const sal_Int32 nOldLineEnd,
const std::vector<long> &rFlyStarts ) const std::vector<long> &rFlyStarts )
{ {
SwTextFormatInfo txtFormatInfo = rThis.GetInfo(); SwTextFormatInfo& txtFormatInfo = rThis.GetInfo();
if ( txtFormatInfo.GetIdx() < txtFormatInfo.GetReformatStart() ) if ( txtFormatInfo.GetIdx() < txtFormatInfo.GetReformatStart() )
// the reformat position is behind our new line, that means // the reformat position is behind our new line, that means
// something of our text has moved to the next line // something of our text has moved to the next line
...@@ -2733,7 +2733,11 @@ namespace { ...@@ -2733,7 +2733,11 @@ namespace {
if ( nReformat > txtFormatInfo.GetLineStart() + nMaxContext ) if ( nReformat > txtFormatInfo.GetLineStart() + nMaxContext )
nReformat = nReformat - nMaxContext; nReformat = nReformat - nMaxContext;
else else
{
nReformat = txtFormatInfo.GetLineStart(); nReformat = txtFormatInfo.GetLineStart();
//reset the margin flag - prevent loops
rThis.SetRightMargin(false);
}
} }
// Weird situation: Our line used to end with a hole portion // Weird situation: Our line used to end with a hole portion
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment