diff --git a/starmath/source/SmPanelFactory.cxx b/starmath/source/SmPanelFactory.cxx index 8e9f146a1959..df35dcadffbc 100644 --- a/starmath/source/SmPanelFactory.cxx +++ b/starmath/source/SmPanelFactory.cxx @@ -83,7 +83,7 @@ css::uno::Reference SAL_CALL SmPanelFactory::createUIElemen css::ui::LayoutSize aLayoutSize{ -1, -1, -1 }; if (ResourceURL.endsWith("/MathPropertiesPanel")) { - pPanel = sm::sidebar::SmPropertiesPanel::Create(*pParent); + pPanel = sm::sidebar::SmPropertiesPanel::Create(*pParent, xFrame); } else if (ResourceURL.endsWith("/MathElementsPanel")) { diff --git a/starmath/source/SmPropertiesPanel.cxx b/starmath/source/SmPropertiesPanel.cxx index 3ffd25c40e79..48f2c6897cd1 100644 --- a/starmath/source/SmPropertiesPanel.cxx +++ b/starmath/source/SmPropertiesPanel.cxx @@ -32,13 +32,17 @@ namespace sm::sidebar { // static -std::unique_ptr SmPropertiesPanel::Create(weld::Widget& rParent) +std::unique_ptr +SmPropertiesPanel::Create(weld::Widget& rParent, + const css::uno::Reference& xFrame) { - return std::make_unique(rParent); + return std::make_unique(rParent, xFrame); } -SmPropertiesPanel::SmPropertiesPanel(weld::Widget& rParent) +SmPropertiesPanel::SmPropertiesPanel(weld::Widget& rParent, + const css::uno::Reference& xFrame) : PanelLayout(&rParent, "MathPropertiesPanel", "modules/smath/ui/sidebarproperties_math.ui") + , mxFrame(xFrame) , mpFormatFontsButton(m_xBuilder->weld_button("btnFormatFonts")) , mpFormatFontSizeButton(m_xBuilder->weld_button("btnFormatFontSize")) , mpFormatSpacingButton(m_xBuilder->weld_button("btnFormatSpacing")) @@ -80,7 +84,7 @@ SmPropertiesPanel::~SmPropertiesPanel() IMPL_LINK(SmPropertiesPanel, ButtonClickHandler, weld::Button&, rButton, void) { if (OUString command = maButtonCommands[&rButton]; !command.isEmpty()) - comphelper::dispatchCommand(command, {}); + comphelper::dispatchCommand(command, mxFrame, {}); } } // end of namespace sm::sidebar diff --git a/starmath/source/SmPropertiesPanel.hxx b/starmath/source/SmPropertiesPanel.hxx index e81463f37022..f19316e3fac1 100644 --- a/starmath/source/SmPropertiesPanel.hxx +++ b/starmath/source/SmPropertiesPanel.hxx @@ -31,13 +31,16 @@ namespace sm::sidebar class SmPropertiesPanel : public PanelLayout { public: - static std::unique_ptr Create(weld::Widget& rParent); - SmPropertiesPanel(weld::Widget& rParent); + static std::unique_ptr + Create(weld::Widget& rParent, const css::uno::Reference& xFrame); + SmPropertiesPanel(weld::Widget& rParent, const css::uno::Reference& xFrame); ~SmPropertiesPanel(); private: DECL_LINK(ButtonClickHandler, weld::Button&, void); + css::uno::Reference mxFrame; + std::unique_ptr mpFormatFontsButton; std::unique_ptr mpFormatFontSizeButton; std::unique_ptr mpFormatSpacingButton;