summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/uibase/sidebar/StylePresetsPanel.cxx13
-rw-r--r--sw/source/uibase/sidebar/StylePresetsPanel.hxx14
-rw-r--r--sw/source/uibase/sidebar/SwPanelFactory.cxx4
-rw-r--r--sw/source/uibase/sidebar/ThemePanel.cxx19
-rw-r--r--sw/source/uibase/sidebar/ThemePanel.hxx8
5 files changed, 18 insertions, 40 deletions
diff --git a/sw/source/uibase/sidebar/StylePresetsPanel.cxx b/sw/source/uibase/sidebar/StylePresetsPanel.cxx
index 656054d07f14..db3b7600e546 100644
--- a/sw/source/uibase/sidebar/StylePresetsPanel.cxx
+++ b/sw/source/uibase/sidebar/StylePresetsPanel.cxx
@@ -144,24 +144,19 @@ BitmapEx CreatePreview(OUString& aUrl, OUString& aName)
}
VclPtr<vcl::Window> StylePresetsPanel::Create (vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings)
+ const css::uno::Reference<css::frame::XFrame>& rxFrame)
{
if (pParent == nullptr)
throw css::lang::IllegalArgumentException("no parent Window given to StylePresetsPanel::Create", nullptr, 0);
if (!rxFrame.is())
throw css::lang::IllegalArgumentException("no XFrame given to StylePresetsPanel::Create", nullptr, 1);
- if (pBindings == nullptr)
- throw css::lang::IllegalArgumentException("no SfxBindings given to StylePresetsPanel::Create", nullptr, 2);
- return VclPtr<StylePresetsPanel>::Create(pParent, rxFrame, pBindings);
+ return VclPtr<StylePresetsPanel>::Create(pParent, rxFrame);
}
StylePresetsPanel::StylePresetsPanel(vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings)
+ const css::uno::Reference<css::frame::XFrame>& rxFrame)
: PanelLayout(pParent, "StylePresetsPanel", "modules/swriter/ui/sidebarstylepresets.ui", rxFrame)
- , mpBindings(pBindings)
{
get(mpValueSet, "valueset");
@@ -187,7 +182,7 @@ void StylePresetsPanel::RefreshList()
OUString aURL = aTemplates.GetPath(i,j);
BitmapEx aPreview = CreatePreview(aURL, aName);
mpValueSet->InsertItem(j, Image(aPreview), aName);
- maTemplateEntries.push_back(std::unique_ptr<TemplateEntry>(new TemplateEntry(aName, aURL)));
+ maTemplateEntries.push_back(std::unique_ptr<TemplateEntry>(new TemplateEntry(aURL)));
mpValueSet->SetItemData(j, maTemplateEntries.back().get());
}
}
diff --git a/sw/source/uibase/sidebar/StylePresetsPanel.hxx b/sw/source/uibase/sidebar/StylePresetsPanel.hxx
index 921c056ddbf9..d0ca77567c2e 100644
--- a/sw/source/uibase/sidebar/StylePresetsPanel.hxx
+++ b/sw/source/uibase/sidebar/StylePresetsPanel.hxx
@@ -48,8 +48,7 @@ class StylePresetsPanel : public PanelLayout,
friend class VclPtr<StylePresetsPanel>;
public:
static VclPtr<vcl::Window> Create(vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
+ const css::uno::Reference<css::frame::XFrame>& rxFrame);
virtual void NotifyItemUpdate(const sal_uInt16 nSId,
const SfxItemState eState,
@@ -59,26 +58,21 @@ public:
private:
struct TemplateEntry
{
- TemplateEntry(OUString& rName, OUString& rURL)
- : maName(rName)
- , maURL(rURL)
+ TemplateEntry(OUString& rURL)
+ : maURL(rURL)
{}
- OUString maName;
OUString maURL;
};
void RefreshList();
StylePresetsPanel(vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
+ const css::uno::Reference<css::frame::XFrame>& rxFrame);
virtual ~StylePresetsPanel();
virtual void dispose() override;
- SfxBindings* mpBindings;
-
VclPtr<ValueSet> mpValueSet;
std::vector<std::unique_ptr<TemplateEntry>> maTemplateEntries;
diff --git a/sw/source/uibase/sidebar/SwPanelFactory.cxx b/sw/source/uibase/sidebar/SwPanelFactory.cxx
index 4a5d33a1c73e..dc0487452a0d 100644
--- a/sw/source/uibase/sidebar/SwPanelFactory.cxx
+++ b/sw/source/uibase/sidebar/SwPanelFactory.cxx
@@ -156,13 +156,13 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
}
else if (rsResourceURL.endsWith("/StylePresetsPanel"))
{
- VclPtr<vcl::Window> pPanel = sw::sidebar::StylePresetsPanel::Create(pParentWindow, xFrame, pBindings);
+ VclPtr<vcl::Window> pPanel = sw::sidebar::StylePresetsPanel::Create(pParentWindow, xFrame);
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL, xFrame, pPanel, ui::LayoutSize(-1,-1,-1));
}
else if (rsResourceURL.endsWith("/ThemePanel"))
{
- VclPtr<vcl::Window> pPanel = sw::sidebar::ThemePanel::Create(pParentWindow, xFrame, pBindings);
+ VclPtr<vcl::Window> pPanel = sw::sidebar::ThemePanel::Create(pParentWindow, xFrame);
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL, xFrame, pPanel, ui::LayoutSize(-1,-1,-1));
}
diff --git a/sw/source/uibase/sidebar/ThemePanel.cxx b/sw/source/uibase/sidebar/ThemePanel.cxx
index 90694ef79a0c..81bf6a486ae2 100644
--- a/sw/source/uibase/sidebar/ThemePanel.cxx
+++ b/sw/source/uibase/sidebar/ThemePanel.cxx
@@ -108,13 +108,11 @@ public:
class StyleSet
{
- OUString maName;
std::vector<StyleRedefinition> maStyles;
public:
- explicit StyleSet(const OUString& aName)
- : maName(aName)
- , maStyles()
+ explicit StyleSet()
+ : maStyles()
{}
void add(StyleRedefinition aRedefinition)
@@ -137,7 +135,7 @@ public:
StyleSet setupThemes()
{
- StyleSet aSet("Default");
+ StyleSet aSet;
{
StyleRedefinition aRedefinition("Heading 1");
@@ -428,24 +426,19 @@ BitmapEx GenerateColorPreview(const svx::ColorSet& rColorSet)
namespace sw { namespace sidebar {
VclPtr<vcl::Window> ThemePanel::Create (vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings)
+ const css::uno::Reference<css::frame::XFrame>& rxFrame)
{
if (pParent == nullptr)
throw css::lang::IllegalArgumentException("no parent Window given to PagePropertyPanel::Create", nullptr, 0);
if (!rxFrame.is())
throw css::lang::IllegalArgumentException("no XFrame given to PagePropertyPanel::Create", nullptr, 1);
- if (pBindings == nullptr)
- throw css::lang::IllegalArgumentException("no SfxBindings given to PagePropertyPanel::Create", nullptr, 2);
- return VclPtr<ThemePanel>::Create(pParent, rxFrame, pBindings);
+ return VclPtr<ThemePanel>::Create(pParent, rxFrame);
}
ThemePanel::ThemePanel(vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings)
+ const css::uno::Reference<css::frame::XFrame>& rxFrame)
: PanelLayout(pParent, "ThemePanel", "modules/swriter/ui/sidebartheme.ui", rxFrame)
- , mpBindings(pBindings)
, maColorSets()
{
get(mpListBoxFonts, "listbox_fonts");
diff --git a/sw/source/uibase/sidebar/ThemePanel.hxx b/sw/source/uibase/sidebar/ThemePanel.hxx
index ae8a37ecc51f..07d89dab34be 100644
--- a/sw/source/uibase/sidebar/ThemePanel.hxx
+++ b/sw/source/uibase/sidebar/ThemePanel.hxx
@@ -48,8 +48,7 @@ class ThemePanel : public PanelLayout,
friend class VclPtr<ThemePanel>;
public:
static VclPtr<vcl::Window> Create(vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
+ const css::uno::Reference<css::frame::XFrame>& rxFrame);
virtual void NotifyItemUpdate(const sal_uInt16 nSId,
const SfxItemState eState,
@@ -58,14 +57,11 @@ public:
private:
ThemePanel(vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
+ const css::uno::Reference<css::frame::XFrame>& rxFrame);
virtual ~ThemePanel();
virtual void dispose() override;
- SfxBindings* mpBindings;
-
VclPtr<ListBox> mpListBoxFonts;
VclPtr<ValueSet> mpValueSetColors;
VclPtr<PushButton> mpApplyButton;