[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source

Justin Luth justin_luth at sil.org
Fri Jan 29 02:11:43 PST 2016


 sw/source/core/text/itrpaint.cxx |   19 ++++++++++++++++++-
 sw/source/core/text/porlin.hxx   |    1 +
 2 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 7b644045bebcd70e7324beac793b5018da1c4de5
Author: Justin Luth <justin_luth at sil.org>
Date:   Wed Oct 28 11:12:17 2015 +0300

    tdf#93637 TAB_OVER_MARGIN support for a few more cases
    
    Extending nMaxRight when TAB_OVER_MARGIN compatibility is set and
    the right tabstop goes beyond the right margin fixes PDF output
    as well as certain cases of screen display.
    
    Reviewed-on: https://gerrit.libreoffice.org/19635
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    (cherry picked from commit d1bd4465be649a4078c3a2f85a64c8a6300dd65d)
    Reviewed-on: https://gerrit.libreoffice.org/21561
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 8c564a1fd313da29088bed6453c5e16876690d24)
    
    Change-Id: Ida4b4f399f06670d9bdefdc21978adf19a81d53a
    Reviewed-on: https://gerrit.libreoffice.org/21694
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index 2461b8b..c4b20d1 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -37,6 +37,7 @@
 #include <tgrditem.hxx>
 
 #include <EnhancedPDFExportHelper.hxx>
+#include <IDocumentSettingAccess.hxx>
 
 #include "flyfrms.hxx"
 #include "viewsh.hxx"
@@ -161,8 +162,24 @@ void SwTextPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip,
     SwLinePortion *pPor = bEndPor ? pCurr->GetFirstPortion() : CalcPaintOfst( rPaint );
 
     // Optimization!
-    const SwTwips nMaxRight = std::min( rPaint.Right(), Right() );
+    SwTwips nMaxRight = std::min( rPaint.Right(), Right() );
     const SwTwips nTmpLeft = GetInfo().X();
+    //compatibility setting: allow tabstop text to exceed right margin
+    if( GetInfo().GetTextFrm()->GetTextNode()->getIDocumentSettingAccess()->get(DocumentSettingId::TAB_OVER_MARGIN) )
+    {
+        SwLinePortion* pPorIter = pPor;
+        while( pPorIter )
+        {
+            if( pPorIter->IsTabRightPortion() )
+            {
+               const SwTabRightPortion *pRightTabPor = static_cast<SwTabRightPortion*>(pPorIter);
+               const SwTwips nTabPos = nTmpLeft + pRightTabPor->GetTabPos();
+                if( nMaxRight < nTabPos )
+                    nMaxRight = std::min( rPaint.Right(), nTabPos );
+            }
+            pPorIter = pPorIter->GetPortion();
+        }
+    }
     if( !bEndPor && nTmpLeft >= nMaxRight )
         return;
 
diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx
index 792c9ef..1a3f4f8 100644
--- a/sw/source/core/text/porlin.hxx
+++ b/sw/source/core/text/porlin.hxx
@@ -130,6 +130,7 @@ public:
     inline bool IsTabCntPortion() const { return nWhichPor == POR_TABCENTER; }
     inline bool IsTabDecimalPortion() const { return nWhichPor == POR_TABDECIMAL; }
     inline bool IsTabLeftPortion() const { return nWhichPor == POR_TABLEFT; }
+    inline bool IsTabRightPortion() const { return nWhichPor == POR_TABRIGHT; }
     inline bool IsFootnoteNumPortion() const { return nWhichPor == POR_FTNNUM; }
     inline bool IsFootnotePortion() const { return nWhichPor == POR_FTN; }
     inline bool IsTmpEndPortion() const { return nWhichPor == POR_TMPEND; }


More information about the Libreoffice-commits mailing list