Kaydet (Commit) 07f75f6e authored tarafından Katarina Behrens's avatar Katarina Behrens Kaydeden (comit) Maxim Monastirsky

tdf#85767: Make also sidebar toolbox item order RTL-sensitive

do more-less the same as 2fd93f19 does for main app
toolbars

Change-Id: If271bbb049915f4201fbce2ea587b753940a8de7
Reviewed-on: https://gerrit.libreoffice.org/19451Reviewed-by: 's avatarMaxim Monastirsky <momonasmon@gmail.com>
Tested-by: 's avatarMaxim Monastirsky <momonasmon@gmail.com>
üst 17aaa3fe
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <vcl/builderfactory.hxx> #include <vcl/builderfactory.hxx>
#include <vcl/gradient.hxx> #include <vcl/gradient.hxx>
#include <vcl/settings.hxx>
#include <toolkit/helper/vclunohelper.hxx> #include <toolkit/helper/vclunohelper.hxx>
#include <svtools/miscopt.hxx> #include <svtools/miscopt.hxx>
#include <framework/imageproducer.hxx> #include <framework/imageproducer.hxx>
...@@ -32,6 +33,24 @@ ...@@ -32,6 +33,24 @@
using namespace css; using namespace css;
using namespace css::uno; 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 { namespace sfx2 { namespace sidebar {
SidebarToolBox::SidebarToolBox (vcl::Window* pParentWindow) SidebarToolBox::SidebarToolBox (vcl::Window* pParentWindow)
...@@ -87,9 +106,16 @@ void SidebarToolBox::InsertItem(const OUString& rCommand, ...@@ -87,9 +106,16 @@ void SidebarToolBox::InsertItem(const OUString& rCommand,
const css::uno::Reference<css::frame::XFrame>& rFrame, const css::uno::Reference<css::frame::XFrame>& rFrame,
ToolBoxItemBits nBits, const Size& rRequestedSize, sal_uInt16 nPos) 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(); RegisterHandlers();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment