[Libreoffice-commits] core.git: sfx2/source

Katarina Behrens Katarina.Behrens at cib.de
Tue Oct 20 11:50:13 PDT 2015


 sfx2/source/sidebar/SidebarToolBox.cxx |   30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

New commits:
commit 07f75f6e645eca4825541f57e9d5e9479a17c559
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Mon Oct 19 10:19:07 2015 +0200

    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 at gmail.com>
    Tested-by: Maxim Monastirsky <momonasmon at gmail.com>

diff --git a/sfx2/source/sidebar/SidebarToolBox.cxx b/sfx2/source/sidebar/SidebarToolBox.cxx
index 542088a..87e1833 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();
 }
 


More information about the Libreoffice-commits mailing list