summaryrefslogtreecommitdiff
path: root/sw/source/core/text/itrform2.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-03-05 16:25:57 +0100
committerMiklos Vajna <vmiklos@suse.cz>2013-03-05 17:16:28 +0100
commit5dc729cae00e6ea35f5dde13eba89434be2d7dc5 (patch)
treea277a6e744fe8fcf995e0aa3d06a3c3d1152ce90 /sw/source/core/text/itrform2.cxx
parent3554b3653049cb8fffa2a56ca0c9a2d8e972f5ec (diff)
bnc#793998 SwTxtFormatter::FormatLine: fix missing repaints
The incorrect SwLineLayout width caused a missing repaint when a character is inserted after the tab in the bugdoc, see the already existing sw/qa/extras/ooxmlimport/data/n793998.docx. Change-Id: I685203eeb2ed4236758d65132069cd894ece488c
Diffstat (limited to 'sw/source/core/text/itrform2.cxx')
-rw-r--r--sw/source/core/text/itrform2.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 4cee223db089..04cb5a386de0 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -1597,6 +1597,24 @@ xub_StrLen SwTxtFormatter::FormatLine( const xub_StrLen nStartPos )
}
}
+ // In case of compat mode, it's possible that a tab portion is wider after
+ // formatting than before. If this is the case, we also have to make sure
+ // the SwLineLayout is wider as well.
+ if (GetInfo().GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_OVER_MARGIN))
+ {
+ sal_uInt16 nSum = 0;
+ SwLinePortion* pPor = pCurr->GetFirstPortion();
+
+ while (pPor)
+ {
+ nSum += pPor->Width();
+ pPor = pPor->GetPortion();
+ }
+
+ if (nSum > pCurr->Width())
+ pCurr->Width(nSum);
+ }
+
// calculate optimal repaint rectangle
if ( bOptimizeRepaint )
{