[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sw/source

Kohei Yoshida kohei.yoshida at collabora.com
Thu Mar 20 10:11:01 PDT 2014


 sw/source/core/layout/paintfrm.cxx |   32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)

New commits:
commit 0fbd73b8f02926664c9d04fc596f482f5977ae59
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Mar 18 16:59:20 2014 -0400

    fdo#75260: Apply the same fix from writer table to character bordering.
    
    And mirror the right and bottom borders while I'm at it. I guess it was
    originally meant to.
    
    Change-Id: I408b077c1524d19bbadd6f0b284ce204064eb735
    (cherry picked from commit 2cd1673f41cb5bd8502a9a48a5721244660fe3a0)
    Reviewed-on: https://gerrit.libreoffice.org/8650
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index ee0047e..3e4ed87 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -5050,23 +5050,25 @@ void PaintCharacterBorder(
 
     // Init borders, after this initialization top, bottom, right and left means the
     // absolute position
-    const boost::optional<editeng::SvxBorderLine> aTopBorder =
+    boost::optional<editeng::SvxBorderLine> aTopBorder =
         (bTop ? rFont.GetAbsTopBorder(bVerticalLayout) : boost::none);
-    const boost::optional<editeng::SvxBorderLine> aBottomBorder =
+    boost::optional<editeng::SvxBorderLine> aBottomBorder =
         (bBottom ? rFont.GetAbsBottomBorder(bVerticalLayout) : boost::none);
-    const boost::optional<editeng::SvxBorderLine> aLeftBorder =
+    boost::optional<editeng::SvxBorderLine> aLeftBorder =
         (bLeft ? rFont.GetAbsLeftBorder(bVerticalLayout) : boost::none);
-    const boost::optional<editeng::SvxBorderLine> aRightBorder =
+    boost::optional<editeng::SvxBorderLine> aRightBorder =
         (bRight ? rFont.GetAbsRightBorder(bVerticalLayout) : boost::none);
 
     if( aTopBorder )
     {
+        sal_uInt16 nOffset = aTopBorder->GetDistance();
+
         Point aLeftTop(
-            aAlignedRect.Left(),
-            aAlignedRect.Top());
+            aAlignedRect.Left() - nOffset,
+            aAlignedRect.Top() - nOffset);
         Point aRightBottom(
-            aAlignedRect.Right(),
-            aAlignedRect.Top() + aTopBorder.get().GetScaledWidth());
+            aAlignedRect.Right() + nOffset,
+            aAlignedRect.Top() - nOffset + aTopBorder->GetScaledWidth());
 
         lcl_MakeBorderLine(
             SwRect(aLeftTop, aRightBottom),
@@ -5078,6 +5080,8 @@ void PaintCharacterBorder(
 
     if( aBottomBorder )
     {
+        aBottomBorder->SetMirrorWidths(true);
+
         Point aLeftTop(
             aAlignedRect.Left(),
             aAlignedRect.Bottom() - aBottomBorder.get().GetScaledWidth());
@@ -5095,12 +5099,14 @@ void PaintCharacterBorder(
 
     if( aLeftBorder )
     {
+        sal_uInt16 nOffset = aLeftBorder->GetDistance();
+
         Point aLeftTop(
-            aAlignedRect.Left(),
-            aAlignedRect.Top());
+            aAlignedRect.Left() - nOffset,
+            aAlignedRect.Top() - nOffset);
         Point aRightBottom(
-            aAlignedRect.Left() + aLeftBorder.get().GetScaledWidth(),
-            aAlignedRect.Bottom());
+            aAlignedRect.Left() - nOffset + aLeftBorder->GetScaledWidth(),
+            aAlignedRect.Bottom() + nOffset);
 
         lcl_MakeBorderLine(
             SwRect(aLeftTop, aRightBottom),
@@ -5112,6 +5118,8 @@ void PaintCharacterBorder(
 
     if( aRightBorder )
     {
+        aRightBorder->SetMirrorWidths(true);
+
         Point aLeftTop(
             aAlignedRect.Right() - aRightBorder.get().GetScaledWidth(),
             aAlignedRect.Top());


More information about the Libreoffice-commits mailing list