From e367e59e37499d0efca381f0b41df52c7cfc2026 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 20 Aug 2021 10:13:13 +0200 Subject: loplugin:unusedfields Change-Id: Ie27afe4c2438c44baece4b926572584c6695dc39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120774 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sfx2/source/dialog/StyleList.cxx | 11 ++++------- sfx2/source/dialog/templdlg.cxx | 12 +----------- sfx2/source/inc/StyleList.hxx | 3 +-- sfx2/source/inc/templdgi.hxx | 10 ---------- 4 files changed, 6 insertions(+), 30 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx index 259113f62e96..b9d943cf519d 100644 --- a/sfx2/source/dialog/StyleList.cxx +++ b/sfx2/source/dialog/StyleList.cxx @@ -77,10 +77,9 @@ using namespace css::uno; // Constructor -StyleList::StyleList(weld::Builder* pBuilder, std::optional xFamilies, - SfxBindings* pBindings, SfxCommonTemplateDialog_Impl* Parent, - SfxModule* Module, weld::Container* pC, OString treeviewname, - OString flatviewname) +StyleList::StyleList(weld::Builder* pBuilder, SfxBindings* pBindings, + SfxCommonTemplateDialog_Impl* Parent, weld::Container* pC, + OString treeviewname, OString flatviewname) : m_bHierarchical(false) , m_bAllowReParentDrop(false) , m_bNewByExampleDisabled(false) @@ -97,13 +96,12 @@ StyleList::StyleList(weld::Builder* pBuilder, std::optional xF , m_nActFilter(0) , m_xFmtLb(pBuilder->weld_tree_view(flatviewname)) , m_xTreeBox(pBuilder->weld_tree_view(treeviewname)) - , m_xStyleFamilies(xFamilies) , m_pCurObjShell(nullptr) , m_nActFamily(0xffff) , m_nAppFilter(SfxStyleSearchBits::Auto) , m_pParentDialog(Parent) , m_pBindings(pBindings) - , m_Module(Module) + , m_Module(nullptr) , m_nModifier(0) , m_pContainer(pC) { @@ -925,7 +923,6 @@ IMPL_LINK(StyleList, EnableTreeDrag, bool, m_bEnable, void) m_bAllowReParentDrop = pStyle && pStyle->HasParentSupport() && m_bEnable; } m_bTreeDrag = m_bEnable; - m_pParentDialog->SetEnableDrag(m_bTreeDrag); } // Fill the treeview diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 0d17a7cbd4e4..bb27c5e51fb3 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -188,21 +188,18 @@ void SfxCommonTemplateDialog_Impl::connect_stylelist_set_water_can_state( SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl(SfxBindings* pB, weld::Container* pC, weld::Builder* pBuilder) : pBindings(pB) , mpContainer(pC) - , pModule(nullptr) , xModuleManager(frame::ModuleManager::create(::comphelper::getProcessComponentContext())) , m_pDeletionWatcher(nullptr) - , m_aStyleList(pBuilder, mxStyleFamilies, pB, this, pModule, pC, "treeview", "flatview") + , m_aStyleList(pBuilder, pB, this, pC, "treeview", "flatview") , mxPreviewCheckbox(pBuilder->weld_check_button("showpreview")) , mxFilterLb(pBuilder->weld_combo_box("filter")) , nActFamily(0xffff) , nActFilter(0) , bIsWater(false) , bUpdate(false) - , bUpdateFamily(false) , bWaterDisabled(false) , bNewByExampleDisabled(false) , bUpdateByExampleDisabled(false) - , bTreeDrag(true) , m_bWantHierarchical(false) { mxFilterLb->set_help_id(HID_TEMPLATE_FILTER); @@ -454,9 +451,6 @@ void SfxCommonTemplateDialog_Impl::SetFamilyState( sal_uInt16 nSlotId, const Sfx { m_aStyleList.SetFamilyState(nSlotId, pItem); bUpdate = true; - - // If used templates (how the hell you find this out??) - bUpdateFamily = true; } // Internal: Perform functions through the Dispatcher @@ -905,16 +899,12 @@ void SfxCommonTemplateDialog_Impl::SetFamily(SfxStyleFamily const nFamily) { m_aStyleListSetFamily.Call(nId); nActFamily = nId; - if ( nId != 0xFFFF ) - bUpdateFamily = true; } } IMPL_LINK(SfxCommonTemplateDialog_Impl, UpdateFamily_Hdl, StyleList&, rStyleList, void) { - bUpdateFamily = false; bWaterDisabled = false; - bTreeDrag = true; bUpdateByExampleDisabled = false; if (IsCheckedItem("watercan") && diff --git a/sfx2/source/inc/StyleList.hxx b/sfx2/source/inc/StyleList.hxx index 99889b15534b..ed228f869c1e 100644 --- a/sfx2/source/inc/StyleList.hxx +++ b/sfx2/source/inc/StyleList.hxx @@ -52,8 +52,7 @@ class StyleList : public SfxListener public: // Constructor - StyleList(weld::Builder* pBuilder, std::optional xFamilies, - SfxBindings* pBindings, SfxCommonTemplateDialog_Impl* Parent, SfxModule* Module, + StyleList(weld::Builder* pBuilder, SfxBindings* pBindings, SfxCommonTemplateDialog_Impl* Parent, weld::Container* pC, OString treeviewname, OString flatviewname); // Destructor diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx index 83192cbd6356..0b9753cccce1 100644 --- a/sfx2/source/inc/templdgi.hxx +++ b/sfx2/source/inc/templdgi.hxx @@ -74,9 +74,7 @@ protected: SfxBindings* pBindings; weld::Container* mpContainer; - SfxModule* pModule; - std::optional mxStyleFamilies; css::uno::Reference xModuleManager; DeletionWatcher* m_pDeletionWatcher; @@ -89,11 +87,9 @@ protected: bool bIsWater :1; bool bUpdate :1; - bool bUpdateFamily :1; bool bWaterDisabled :1; bool bNewByExampleDisabled :1; bool bUpdateByExampleDisabled :1; - bool bTreeDrag :1; bool m_bWantHierarchical :1; Link m_aStyleListReadResource; @@ -104,7 +100,6 @@ protected: Link m_aStyleListWaterCan; Link m_aStyleListHasSelectedStyle; Link m_aStyleListUpdateFamily; - Link m_aStyleListNotify; Link m_aStyleListUpdateStyleDependents; Link m_aStyleListEnableTreeDrag; Link m_aStyleListEnableDelete; @@ -172,10 +167,6 @@ public: // Used in TreeDrag void EnableTreeDrag(bool b); - // Dialog and StyleList have their own copies of variable bTreeDrag. - // When TreeDrag is enabled in StyleList, the value of m_bTreeDrag is updated in StyleList - // This function updates the value of bTreeDrag here too. - void SetEnableDrag(bool treedrag) { bTreeDrag = treedrag; } // It comes into action when a style is created or updated or newmenu is created void EnableExample_Impl(sal_uInt16 nId, bool bEnable); @@ -208,7 +199,6 @@ public: void connect_stylelist_has_selected_style(const Link& rLink); void connect_stylelist_update_style_dependents(const Link& rLink); void connect_stylelist_enable_tree_drag(const Link rLink); - void connect_stylelist_notify(const Link rLink) { m_aStyleListNotify = rLink; } void connect_stylelist_enable_delete(const Link rLink); void connect_stylelist_set_water_can_state(const Link rLink); void connect_set_family(const Link rLink) { m_aStyleListSetFamily = rLink; } -- cgit