From c43ee8d54ad44e01d0bba404e719d2b03a73959e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 23 Nov 2015 13:47:22 +0200 Subject: loplugin:unusedfields in sw/ Change-Id: I3e146c4287df70bbf58443caecfa62453c116ecb --- sw/source/uibase/sidebar/StylePresetsPanel.cxx | 13 ++++--------- sw/source/uibase/sidebar/StylePresetsPanel.hxx | 14 ++++---------- sw/source/uibase/sidebar/SwPanelFactory.cxx | 4 ++-- sw/source/uibase/sidebar/ThemePanel.cxx | 19 ++++++------------- sw/source/uibase/sidebar/ThemePanel.hxx | 8 ++------ 5 files changed, 18 insertions(+), 40 deletions(-) (limited to 'sw') 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 StylePresetsPanel::Create (vcl::Window* pParent, - const css::uno::Reference& rxFrame, - SfxBindings* pBindings) + const css::uno::Reference& 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::Create(pParent, rxFrame, pBindings); + return VclPtr::Create(pParent, rxFrame); } StylePresetsPanel::StylePresetsPanel(vcl::Window* pParent, - const css::uno::Reference& rxFrame, - SfxBindings* pBindings) + const css::uno::Reference& 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(new TemplateEntry(aName, aURL))); + maTemplateEntries.push_back(std::unique_ptr(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; public: static VclPtr Create(vcl::Window* pParent, - const css::uno::Reference& rxFrame, - SfxBindings* pBindings); + const css::uno::Reference& 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& rxFrame, - SfxBindings* pBindings); + const css::uno::Reference& rxFrame); virtual ~StylePresetsPanel(); virtual void dispose() override; - SfxBindings* mpBindings; - VclPtr mpValueSet; std::vector> 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 SAL_CALL SwPanelFactory::createUIElement ( } else if (rsResourceURL.endsWith("/StylePresetsPanel")) { - VclPtr pPanel = sw::sidebar::StylePresetsPanel::Create(pParentWindow, xFrame, pBindings); + VclPtr 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 pPanel = sw::sidebar::ThemePanel::Create(pParentWindow, xFrame, pBindings); + VclPtr 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 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 ThemePanel::Create (vcl::Window* pParent, - const css::uno::Reference& rxFrame, - SfxBindings* pBindings) + const css::uno::Reference& 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::Create(pParent, rxFrame, pBindings); + return VclPtr::Create(pParent, rxFrame); } ThemePanel::ThemePanel(vcl::Window* pParent, - const css::uno::Reference& rxFrame, - SfxBindings* pBindings) + const css::uno::Reference& 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; public: static VclPtr Create(vcl::Window* pParent, - const css::uno::Reference& rxFrame, - SfxBindings* pBindings); + const css::uno::Reference& 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& rxFrame, - SfxBindings* pBindings); + const css::uno::Reference& rxFrame); virtual ~ThemePanel(); virtual void dispose() override; - SfxBindings* mpBindings; - VclPtr mpListBoxFonts; VclPtr mpValueSetColors; VclPtr mpApplyButton; -- cgit v1.2.3