diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-03-05 16:25:57 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-04-02 10:26:57 +0200 |
commit | cbb2863456cc71c44c8df70a4c4743537b0b0af9 (patch) | |
tree | 7fce203cea2d9afb4eede1fb612dece62da1f491 /sw | |
parent | 029ee0a0cb935283f0f0a997674944f1ea87c9f0 (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
(cherry picked from commit 5dc729cae00e6ea35f5dde13eba89434be2d7dc5)
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/itrform2.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index b36aa42d9690..60c17daa74ed 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -1595,6 +1595,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 ) { |