Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / svx / source / sidebar / styles / StylesPropertyPanel.cxx
blob4e6b2235d104f789e635bd105fd7120c7d6a0965
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9 #include <sal/config.h>
11 #include <com/sun/star/lang/IllegalArgumentException.hpp>
13 #include "StylesPropertyPanel.hxx"
15 using namespace css;
16 using namespace css::uno;
18 namespace svx::sidebar {
20 std::unique_ptr<PanelLayout> StylesPropertyPanel::Create (
21 weld::Widget* pParent,
22 const css::uno::Reference<css::frame::XFrame>& rxFrame)
24 if (pParent == nullptr)
25 throw lang::IllegalArgumentException("no parent Window given to StylesPropertyPanel::Create", nullptr, 0);
26 if ( ! rxFrame.is())
27 throw lang::IllegalArgumentException("no XFrame given to StylesPropertyPanel::Create", nullptr, 1);
29 return std::make_unique<StylesPropertyPanel>(pParent, rxFrame);
32 StylesPropertyPanel::StylesPropertyPanel(weld::Widget* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame)
33 : PanelLayout(pParent, "SidebarStylesPanel", "svx/ui/sidebarstylespanel.ui")
34 , m_xFontStyle(m_xBuilder->weld_toolbar("fontstyletoolbox"))
35 , m_xFontStyleDispatch(new ToolbarUnoDispatcher(*m_xFontStyle, *m_xBuilder, rxFrame))
36 , m_xStyle(m_xBuilder->weld_toolbar("style"))
37 , m_xStyleDispatch(new ToolbarUnoDispatcher(*m_xStyle, *m_xBuilder, rxFrame))
41 StylesPropertyPanel::~StylesPropertyPanel()
43 m_xStyleDispatch.reset();
44 m_xStyle.reset();
45 m_xFontStyleDispatch.reset();
46 m_xFontStyle.reset();
50 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */