[PATCH] Fix fdo#37464 - Cell Border works backwards on Right-to-Left...

Faisal al-otaibi (via Code Review) gerrit at gerrit.libreoffice.org
Sun Mar 17 00:04:27 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2782

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/82/2782/1

Fix fdo#37464 - Cell Border works backwards on Right-to-Left sheet

Change-Id: Idb73d3029880b66602f163b2ab03c2b37c2306db
---
M sc/source/core/data/attarray.cxx
1 file changed, 32 insertions(+), 7 deletions(-)



diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index ebf246a..bf75271 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -1105,13 +1105,38 @@
         nDistBottom = 0;
 
     SvxBoxItem aNewFrame( *pOldFrame );
-
-    if ( bLeft ? pBoxInfoItem->IsValid(VALID_LEFT) : pBoxInfoItem->IsValid(VALID_VERT) )
-        aNewFrame.SetLine( bLeft ? pBoxItem->GetLeft() : pBoxInfoItem->GetVert(),
-            BOX_LINE_LEFT );
-    if ( (nDistRight==0) ? pBoxInfoItem->IsValid(VALID_RIGHT) : pBoxInfoItem->IsValid(VALID_VERT) )
-        aNewFrame.SetLine( (nDistRight==0) ? pBoxItem->GetRight() : pBoxInfoItem->GetVert(),
-            BOX_LINE_RIGHT );
+    bool bRTL=pDocument->IsLayoutRTL(nTab);
+    // fdo#37464 check if the sheet are RTL then replace right <=> left
+    if (bRTL)
+    {
+        if( bLeft && nDistRight==0)
+        {
+            if ( bLeft ? pBoxInfoItem->IsValid(VALID_LEFT) : pBoxInfoItem->IsValid(VALID_VERT) )
+                aNewFrame.SetLine( bLeft ? pBoxItem->GetLeft() : pBoxInfoItem->GetVert(),
+                    BOX_LINE_RIGHT );
+            if ( (nDistRight==0) ? pBoxInfoItem->IsValid(VALID_RIGHT) : pBoxInfoItem->IsValid(VALID_VERT) )
+                aNewFrame.SetLine( (nDistRight==0) ? pBoxItem->GetRight() : pBoxInfoItem->GetVert(),
+                    BOX_LINE_LEFT );
+        }
+        else
+        {
+            if ( (nDistRight==0) ? pBoxInfoItem->IsValid(VALID_LEFT) : pBoxInfoItem->IsValid(VALID_VERT) )
+                aNewFrame.SetLine( (nDistRight==0) ? pBoxItem->GetLeft() : pBoxInfoItem->GetVert(),
+                    BOX_LINE_RIGHT );
+            if ( bLeft ? pBoxInfoItem->IsValid(VALID_RIGHT) : pBoxInfoItem->IsValid(VALID_VERT) )
+                aNewFrame.SetLine( bLeft ? pBoxItem->GetRight() : pBoxInfoItem->GetVert(),
+                    BOX_LINE_LEFT );
+        }
+    }
+    else
+    {
+        if ( bLeft ? pBoxInfoItem->IsValid(VALID_LEFT) : pBoxInfoItem->IsValid(VALID_VERT) )
+            aNewFrame.SetLine( bLeft ? pBoxItem->GetLeft() : pBoxInfoItem->GetVert(),
+                BOX_LINE_LEFT );
+        if ( (nDistRight==0) ? pBoxInfoItem->IsValid(VALID_RIGHT) : pBoxInfoItem->IsValid(VALID_VERT) )
+            aNewFrame.SetLine( (nDistRight==0) ? pBoxItem->GetRight() : pBoxInfoItem->GetVert(),
+                BOX_LINE_RIGHT );
+    }
     if ( bTop ? pBoxInfoItem->IsValid(VALID_TOP) : pBoxInfoItem->IsValid(VALID_HORI) )
         aNewFrame.SetLine( bTop ? pBoxItem->GetTop() : pBoxInfoItem->GetHori(),
             BOX_LINE_TOP );

-- 
To view, visit https://gerrit.libreoffice.org/2782
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb73d3029880b66602f163b2ab03c2b37c2306db
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Faisal al-otaibi <fmalotaibi at kacst.edu.sa>



More information about the LibreOffice mailing list