diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2015-10-19 10:19:07 +0200 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2015-10-20 18:49:49 +0000 |
commit | 07f75f6e645eca4825541f57e9d5e9479a17c559 (patch) | |
tree | 412c561fb09553860112e9ecf9dea4148569f543 /sfx2 | |
parent | 17aaa3fed1fcb0319d76e51a39888b9216f8f16b (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>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/sidebar/SidebarToolBox.cxx | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/sfx2/source/sidebar/SidebarToolBox.cxx b/sfx2/source/sidebar/SidebarToolBox.cxx index 542088a437a9..87e1833a7a72 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(); } |