summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2015-10-19 10:19:07 +0200
committerAndras Timar <andras.timar@collabora.com>2015-11-03 18:10:27 +0100
commit304bf4dd8edec47cd2b14c05ee20a3600cd98edc (patch)
treefc56055a3894094142cd0e1b86d305ba531409c9 /sfx2/source
parent009ff1e9089d69f0936421ae51f45e585ab6208d (diff)
tdf#85767: Make also sidebar toolbox item order RTL-sensitive
do more-less the same as 2fd93f19cf6c1ce808214c does for main app toolbars Change-Id: If271bbb049915f4201fbce2ea587b753940a8de7 Reviewed-on: https://gerrit.libreoffice.org/19451 Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com> Tested-by: Maxim Monastirsky <momonasmon@gmail.com> (cherry picked from commit 07f75f6e645eca4825541f57e9d5e9479a17c559) Reviewed-on: https://gerrit.libreoffice.org/19728 Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 5a5963b2f1b108db4f0089f41db74b673ba038af)
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/sidebar/SidebarToolBox.cxx30
1 files changed, 28 insertions, 2 deletions
diff --git a/sfx2/source/sidebar/SidebarToolBox.cxx b/sfx2/source/sidebar/SidebarToolBox.cxx
index 46297a31501e..64df989c154e 100644
--- a/sfx2/source/sidebar/SidebarToolBox.cxx
+++ b/sfx2/source/sidebar/SidebarToolBox.cxx
@@ -24,6 +24,7 @@
#include <vcl/builderfactory.hxx>
#include <vcl/gradient.hxx>
+#include <vcl/settings.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <svtools/miscopt.hxx>
#include <framework/imageproducer.hxx>
@@ -32,6 +33,24 @@
using namespace css;
using namespace css::uno;
+namespace {
+ void lcl_RTLizeCommandURL( OUString& rCommandURL )
+ {
+ if (rCommandURL == ".uno:ParaLeftToRight")
+ rCommandURL = ".uno:ParaRightToLeft";
+ else if (rCommandURL == ".uno:ParaRightToLeft")
+ rCommandURL = ".uno:ParaLeftToRight";
+ else if (rCommandURL == ".uno:LeftPara")
+ rCommandURL = ".uno:RightPara";
+ else if (rCommandURL == ".uno:RightPara")
+ rCommandURL = ".uno:LeftPara";
+ else if (rCommandURL == ".uno:AlignLeft")
+ rCommandURL = ".uno:AlignRight";
+ else if (rCommandURL == ".uno:AlignRight")
+ rCommandURL = ".uno:AlignLeft";
+ }
+}
+
namespace sfx2 { namespace sidebar {
SidebarToolBox::SidebarToolBox (vcl::Window* pParentWindow)
@@ -87,9 +106,16 @@ void SidebarToolBox::InsertItem(const OUString& rCommand,
const css::uno::Reference<css::frame::XFrame>& rFrame,
ToolBoxItemBits nBits, const Size& rRequestedSize, sal_uInt16 nPos)
{
- ToolBox::InsertItem(rCommand, rFrame, nBits, rRequestedSize, nPos);
+ OUString aCommand( rCommand );
+
+ if( AllSettings::GetLayoutRTL() )
+ {
+ lcl_RTLizeCommandURL( aCommand );
+ }
+
+ ToolBox::InsertItem(aCommand, rFrame, nBits, rRequestedSize, nPos);
- CreateController(GetItemId(rCommand), rFrame, std::max(rRequestedSize.Width(), 0L));
+ CreateController(GetItemId(aCommand), rFrame, std::max(rRequestedSize.Width(), 0L));
RegisterHandlers();
}