10#include <officecfg/Office/Common.hxx>
11#include <com/sun/star/frame/XSubToolbarController.hpp>
20bool lcl_RTLizeCommandURL(OUString& rCommandURL)
22 if (rCommandURL ==
".uno:ParaLeftToRight")
24 rCommandURL =
".uno:ParaRightToLeft";
27 if (rCommandURL ==
".uno:ParaRightToLeft")
29 rCommandURL =
".uno:ParaLeftToRight";
32 if (rCommandURL ==
".uno:LeftPara")
34 rCommandURL =
".uno:RightPara";
37 if (rCommandURL ==
".uno:RightPara")
39 rCommandURL =
".uno:LeftPara";
42 if (rCommandURL ==
".uno:AlignLeft")
44 rCommandURL =
".uno:AlignRight";
47 if (rCommandURL ==
".uno:AlignRight")
49 rCommandURL =
".uno:AlignLeft";
60 switch (
static_cast<ToolBoxButtonSize>(officecfg::Office::Common::Misc::SidebarIconSize::get()))
62 case ToolBoxButtonSize::Large:
65 case ToolBoxButtonSize::Size32:
68 case ToolBoxButtonSize::DontCare:
69 case ToolBoxButtonSize::Small:
76 const css::uno::Reference<css::frame::XFrame>& rFrame,
79 , m_pToolbar(&rToolbar)
81 , m_bSideBar(bSideBar)
95 if (!sIdent.startsWith(
".uno:"))
97 OUString sCommand = sIdent;
98 if (bRTL && lcl_RTLizeCommandURL(sCommand))
120 css::uno::Reference<css::frame::XToolbarController>
xController(
128css::uno::Reference<css::frame::XToolbarController>
131 ControllerContainer::const_iterator iController(
maControllers.find(rCommand));
133 return iController->second;
135 return css::uno::Reference<css::frame::XToolbarController>();
140 css::uno::Reference<css::frame::XToolbarController>
xController(
141 GetControllerForCommand(rCommand));
149 css::uno::Reference<css::frame::XToolbarController>
xController(
150 GetControllerForCommand(rCommand));
159 m_pToolbar->set_icon_size(eSize);
161 for (
int i = 0, nItems = m_pToolbar->get_n_items();
i < nItems; ++
i)
163 OUString sIdent(m_pToolbar->get_item_ident(
i));
165 m_pToolbar->set_item_image(sIdent, xImage);
168 for (
auto const& it : maControllers)
170 css::uno::Reference<css::frame::XSubToolbarController>
xController(it.second,
171 css::uno::UNO_QUERY);
190 for (
auto const& controller : aControllers)
192 css::uno::Reference<css::lang::XComponent> xComponent(controller.second,
193 css::uno::UNO_QUERY);
195 xComponent->dispose();
PropertiesInfo aProperties
css::uno::Reference< css::lang::XComponent > m_xFrame
static bool GetLayoutRTL()
void RemoveListenerLink(const Link< LinkParamNone *, void > &rLink)
void AddListenerLink(const Link< LinkParamNone *, void > &rLink)
#define LINK(Instance, Class, Member)
Sequence< beans::PropertyValue > GetCommandProperties(const OUString &rsCommandName, const OUString &rsModuleName)
OUString GetTooltipForCommand(const OUString &rsCommandName, const css::uno::Sequence< css::beans::PropertyValue > &rProperties, const Reference< frame::XFrame > &rxFrame)
Reference< graphic::XGraphic > GetXGraphicForCommand(const OUString &rsCommandName, const Reference< frame::XFrame > &rxFrame, vcl::ImageType eImageType)
OUString GetModuleIdentifier(const Reference< frame::XFrame > &rxFrame)
OUString GetLabelForCommand(const css::uno::Sequence< css::beans::PropertyValue > &rProperties)
Reference< XController > xController
IMPL_LINK_NOARG(ToolbarUnoDispatcher, ChangedIconSizeHandler, LinkParamNone *, void)
IMPL_LINK(ToolbarUnoDispatcher, SelectHdl, const OUString &, rCommand, void)