summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdulaziz A Alayed <aalayed@kacst.edu.sa>2013-09-18 13:18:32 +0300
committerAbdulaziz A Alayed <aalayed@kacst.edu.sa>2013-09-18 13:37:54 +0300
commitd86a72b64f208fe55f302d9fd8a7f578a4275bb8 (patch)
tree94068463ef70a71006b3d055391c74c5ad7af5c6
parent8312c88dd59baf5e7fa88f15abf7f91e8d33defc (diff)
fdo#69280 fixing comments toggle button position when local
set to RTL language Change-Id: I0c133e3bbb6801f56e9ac0f508961bfa07a19523 Conflicts: svtools/source/control/ruler.cxx
-rw-r--r--include/svtools/ruler.hxx2
-rw-r--r--svtools/source/control/ruler.cxx6
-rw-r--r--sw/source/ui/misc/swruler.cxx6
3 files changed, 11 insertions, 3 deletions
diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx
index 9382cb0fa2db..8f34c23be8d6 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 6a356c6e45c4..91bb08400948 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 76fb8befc491..f0838f37ac2e 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);