22#include <com/sun/star/beans/PropertyValue.hpp>
23#include <com/sun/star/frame/theUICommandDescription.hpp>
24#include <com/sun/star/uno/Sequence.hxx>
35std::unique_ptr<PanelLayout>
37 const css::uno::Reference<css::frame::XFrame>& xFrame)
39 return std::make_unique<SmPropertiesPanel>(rParent,
xFrame);
43 const css::uno::Reference<css::frame::XFrame>& xFrame)
44 :
PanelLayout(&rParent,
"MathPropertiesPanel",
"modules/smath/ui/sidebarproperties_math.ui")
46 , mpFormatFontsButton(m_xBuilder->weld_button(
"btnFormatFonts"))
47 , mpFormatFontSizeButton(m_xBuilder->weld_button(
"btnFormatFontSize"))
48 , mpFormatSpacingButton(m_xBuilder->weld_button(
"btnFormatSpacing"))
49 , mpFormatAlignmentButton(m_xBuilder->weld_button(
"btnFormatAlignment"))
51 { mpFormatFontSizeButton.get(),
".uno:ChangeFontSize" },
52 { mpFormatSpacingButton.get(),
".uno:ChangeDistance" },
53 { mpFormatAlignmentButton.get(),
".uno:ChangeAlignment" } }
58 if (css::uno::Reference<css::container::XNameAccess> xConf{
59 xConfs->getByName(
"com.sun.star.formula.FormulaProperties"), css::uno::UNO_QUERY })
61 for (
const auto & [ button, command ] : maButtonCommands)
64 button->set_label(
props.getUnpackedValueOrDefault(
"Name", button->get_label()));
68 mpFormatFontsButton->connect_clicked(
LINK(
this, SmPropertiesPanel, ButtonClickHandler));
69 mpFormatFontSizeButton->connect_clicked(
LINK(
this, SmPropertiesPanel, ButtonClickHandler));
70 mpFormatSpacingButton->connect_clicked(
LINK(
this, SmPropertiesPanel, ButtonClickHandler));
71 mpFormatAlignmentButton->connect_clicked(
LINK(
this, SmPropertiesPanel, ButtonClickHandler));
74SmPropertiesPanel::~SmPropertiesPanel()
76 maButtonCommands.clear();
78 mpFormatFontsButton.reset();
79 mpFormatFontSizeButton.reset();
80 mpFormatSpacingButton.reset();
81 mpFormatAlignmentButton.reset();
86 if (OUString command = maButtonCommands[&rButton]; !command.isEmpty())
#define LINK(Instance, Class, Member)
bool dispatchCommand(const OUString &rCommand, const uno::Reference< css::frame::XFrame > &rFrame, const css::uno::Sequence< css::beans::PropertyValue > &rArguments, const uno::Reference< css::frame::XDispatchResultListener > &rListener)
Reference< XComponentContext > getProcessComponentContext()
Reference< XFrame > xFrame