LibreOffice Module svx (master) 1
StylesPropertyPanel.cxx
Go to the documentation of this file.
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.
4 *
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>
10
11#include <com/sun/star/lang/IllegalArgumentException.hpp>
12
14
15using namespace css;
16using namespace css::uno;
17
18namespace svx::sidebar {
19
20std::unique_ptr<PanelLayout> StylesPropertyPanel::Create (
21 weld::Widget* pParent,
22 const css::uno::Reference<css::frame::XFrame>& rxFrame)
23{
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);
28
29 return std::make_unique<StylesPropertyPanel>(pParent, rxFrame);
30}
31
32StylesPropertyPanel::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))
38{
39}
40
42{
43 m_xStyleDispatch.reset();
44 m_xStyle.reset();
46 m_xFontStyle.reset();
47}
48
49}
50/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
std::unique_ptr< weld::Toolbar > m_xFontStyle
std::unique_ptr< ToolbarUnoDispatcher > m_xFontStyleDispatch
static std::unique_ptr< PanelLayout > Create(weld::Widget *pParent, const css::uno::Reference< css::frame::XFrame > &rxFrame)
StylesPropertyPanel(weld::Widget *pParent, const css::uno::Reference< css::frame::XFrame > &rxFrame)
std::unique_ptr< ToolbarUnoDispatcher > m_xStyleDispatch
std::unique_ptr< weld::Toolbar > m_xStyle