[Libreoffice-commits] core.git: Branch 'distro/suse/suse-3.6' - sw/source

Miklos Vajna vmiklos at suse.cz
Wed Mar 6 01:03:28 PST 2013


 sw/source/core/text/itrform2.cxx |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

New commits:
commit 96ce8e09ee44b6ec601c65eb16a9102253b7a369
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Tue Mar 5 16:25:57 2013 +0100

    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)

diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index e33666a..2144e56 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -1606,6 +1606,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 )
     {


More information about the Libreoffice-commits mailing list