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

Faisal M. Al-Otaibi fmalotaibi at kacst.edu.sa
Mon Mar 18 05:42:51 PDT 2013


 sc/source/core/data/attarray.cxx |   39 ++++++++++++++++++++++++++++++++-------
 sc/source/ui/view/tabvwsha.cxx   |   19 ++++++++++++++++++-
 2 files changed, 50 insertions(+), 8 deletions(-)

New commits:
commit f6001794c67d76cb8efc7151263ae847c9137feb
Author: Faisal M. Al-Otaibi <fmalotaibi at kacst.edu.sa>
Date:   Sun Mar 17 09:39:50 2013 +0300

    Fix fdo#62399 Border incorrect for RTL
    
    this patch will fix the incorrect border when you use
    the cell format dialog.
    
    Change-Id: Ieeeae4060a15e96e0de0f335f3c460df86f7dbf9
    Reviewed-on: https://gerrit.libreoffice.org/2781
    Reviewed-by: Ahmad Harthi <aalharthi at kacst.edu.sa>
    Tested-by: Ahmad Harthi <aalharthi at kacst.edu.sa>
    (cherry picked from commit 02c04319376e2124336a864aaf8b7de3c824c2f4)

diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 45e9f02..543c70c 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -482,7 +482,24 @@ void ScTabViewShell::ExecuteCellFormatDlg( SfxRequest& rReq, sal_uInt16 nTabPage
 
     // Umrandungs-Items holen und in den Set packen:
     GetSelectionFrame( aLineOuter, aLineInner );
-    pOldSet->Put( aLineOuter );
+    //Fix border incorrect for RTL fdo#62399
+    if( pDoc->IsLayoutRTL( GetViewData()->GetTabNo() ) )
+    {
+        SvxBoxItem aNewFrame( aLineOuter );
+        if ( aLineInner.IsValid(VALID_LEFT) )
+            aNewFrame.SetLine( aLineOuter.GetLeft(), BOX_LINE_RIGHT );
+        if ( aLineInner.IsValid(VALID_RIGHT) )
+            aNewFrame.SetLine( aLineOuter.GetRight(), BOX_LINE_LEFT );
+        if ( aLineInner.IsValid(VALID_TOP) )
+            aNewFrame.SetLine( aLineOuter.GetTop(), BOX_LINE_TOP );
+        if ( aLineInner.IsValid(VALID_BOTTOM) )
+            aNewFrame.SetLine( aLineOuter.GetBottom() , BOX_LINE_BOTTOM );
+
+        pOldSet->Put( aNewFrame );
+    }
+    else
+        pOldSet->Put( aLineOuter );
+
     pOldSet->Put( aLineInner );
 
     // NumberFormat Value aus Value und Language erzeugen und eintueten
commit 86a73eb47ea7239182dafaf827ad43e3b09dc20e
Author: Faisal M. Al-Otaibi <fmalotaibi at kacst.edu.sa>
Date:   Sun Mar 17 10:03:06 2013 +0300

    Fix fdo#37464 - Cell Border works backwards on Right-to-Left sheet
    
    Change-Id: Idb73d3029880b66602f163b2ab03c2b37c2306db
    Reviewed-on: https://gerrit.libreoffice.org/2782
    Reviewed-by: Ahmad Harthi <aalharthi at kacst.edu.sa>
    Tested-by: Ahmad Harthi <aalharthi at kacst.edu.sa>
    (cherry picked from commit 84e4bf884718fcca8934b81b4037e063cf08c71e)

diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 8059b17..e7afd5d 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -1134,13 +1134,38 @@ bool ScAttrArray::ApplyFrame( const SvxBoxItem*     pBoxItem,
         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 );


More information about the Libreoffice-commits mailing list