[Libreoffice-commits] core.git: include/svtools svtools/source sw/source

Abdulaziz A Alayed aalayed at kacst.edu.sa
Wed Sep 18 03:38:29 PDT 2013


 include/svtools/ruler.hxx        |    2 +-
 svtools/source/control/ruler.cxx |    6 +++++-
 sw/source/ui/misc/swruler.cxx    |    6 +++++-
 3 files changed, 11 insertions(+), 3 deletions(-)

New commits:
commit d86a72b64f208fe55f302d9fd8a7f578a4275bb8
Author: Abdulaziz A Alayed <aalayed at kacst.edu.sa>
Date:   Wed Sep 18 13:18:32 2013 +0300

    fdo#69280 fixing comments toggle button position when local
    
    set to RTL language
    
    Change-Id: I0c133e3bbb6801f56e9ac0f508961bfa07a19523
    
    Conflicts:
    	svtools/source/control/ruler.cxx

diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx
index 9382cb0..8f34c23 100644
--- a/include/svtools/ruler.hxx
+++ b/include/svtools/ruler.hxx
@@ -808,7 +808,7 @@ public:
     const Link&     GetExtraDownHdl() const { return maExtraDownHdl; }
 
     void            SetTextRTL(sal_Bool bRTL);
-
+    bool            GetTextRTL();
     void            SetCharWidth( long nWidth ) { mnCharWidth = nWidth ; }
     void            SetLineHeight( long nHeight ) { mnLineHeight = nHeight ; }
 
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 6a356c6..91bb084 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -2728,7 +2728,6 @@ void Ruler::DrawTab( OutputDevice* pDevice, const Color &rFillColor, const Point
     ImplDrawRulerTab( pDevice, aPos, nTabStyle, nStyle  );
     pDevice->Pop();
 }
-
 void Ruler::SetTextRTL(sal_Bool bRTL)
 {
     if(mpData->bTextRTL != (bool) bRTL)
@@ -2770,6 +2769,11 @@ long Ruler::GetRulerVirHeight() const
     return mnVirHeight;
 }
 
+bool Ruler::GetTextRTL()
+{
+    return mpData->bTextRTL;
+}
+
 RulerUnitData Ruler::GetCurrentRulerUnit() const
 {
     return aImplRulerUnitTab[mnUnitIndex];
diff --git a/sw/source/ui/misc/swruler.cxx b/sw/source/ui/misc/swruler.cxx
index 76fb8be..f0838f3 100644
--- a/sw/source/ui/misc/swruler.cxx
+++ b/sw/source/ui/misc/swruler.cxx
@@ -246,6 +246,7 @@ void SwCommentRuler::UpdateCommentHelpText()
 // TODO Make Ruler return its central rectangle instead of margins.
 Rectangle SwCommentRuler::GetCommentControlRegion()
 {
+    long nLeft = 0;
     SwPostItMgr *pPostItMgr = mpViewShell->GetPostItMgr();
 
     //rhbz#1006850 When the SwPostItMgr ctor is called from SwView::SwView it
@@ -255,7 +256,10 @@ Rectangle SwCommentRuler::GetCommentControlRegion()
         return Rectangle();
 
     //FIXME When the page width is larger then screen, the ruler is misplaced by one pixel
-    long nLeft   = GetWinOffset() + GetPageOffset() + mpSwWin->LogicToPixel(Size(GetPageWidth(), 0)).Width();
+    if (GetTextRTL())
+       nLeft = GetPageOffset() - pPostItMgr->GetSidebarWidth(true) + GetBorderOffset();
+    else
+       nLeft = GetWinOffset() + GetPageOffset() + mpSwWin->LogicToPixel(Size(GetPageWidth(), 0)).Width();
     long nTop    = 0 + 4; // Ruler::ImplDraw uses RULER_OFF (value: 3px) as offset, and Ruler::ImplFormat adds one extra pixel
     // Somehow pPostItMgr->GetSidebarBorderWidth() returns border width already doubled
     long nRight  = nLeft+ pPostItMgr->GetSidebarWidth(true) + pPostItMgr->GetSidebarBorderWidth(true);


More information about the Libreoffice-commits mailing list