[Libreoffice-commits] core.git: svtools/source
Tomaž Vajngerl
tomaz.vajngerl at collabora.co.uk
Sun Dec 21 20:20:32 PST 2014
svtools/source/control/tabbar.cxx | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
New commits:
commit 87f3ff202efc3a4445d5af1a9526fb0369fa9371
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date: Mon Dec 22 13:10:46 2014 +0900
fdo#56970 Show insert tab at the correct position when RTL is on
Change-Id: I1e7e751123fa3c3f365e5342211a0b75395a1711
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 90d3edc..a7f8d0a 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -35,13 +35,14 @@
#include <svtools/svtools.hrc>
#include <limits>
-
+namespace {
#define TABBAR_DRAG_SCROLLOFF 5
#define TABBAR_MINSIZE 5
const sal_uInt16 ADDNEWPAGE_AREAWIDTH = 10;
+const sal_uInt16 INSERT_TAB_WIDTH = 32;
-
+} // anonymous namespace
struct ImplTabBarItem
{
@@ -1730,12 +1731,14 @@ Rectangle TabBar::ImplGetInsertTabRect(ImplTabBarItem* pItem) const
{
if (mbHasInsertTab && pItem)
{
+ sal_Int32 aScaleFactor = GetDPIScaleFactor();
+ sal_Int32 nInsertTabWidth = aScaleFactor * INSERT_TAB_WIDTH;
Rectangle aInsTabRect = pItem->maRect;
if ( !mbMirrored )
aInsTabRect.setX(aInsTabRect.getX() + aInsTabRect.getWidth());
else
- aInsTabRect.setX(aInsTabRect.getX());
- aInsTabRect.setWidth(32);
+ aInsTabRect.setX(aInsTabRect.getX() - nInsertTabWidth);
+ aInsTabRect.setWidth(nInsertTabWidth);
return aInsTabRect;
}
return Rectangle();
More information about the Libreoffice-commits
mailing list