summaryrefslogtreecommitdiff
path: root/sfx2/source/sidebar/SidebarToolBox.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/sidebar/SidebarToolBox.cxx')
-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();
}