diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-26 14:23:00 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-26 18:50:45 +0200 |
commit | aded8531db7247cceb8960278169bd7eff918ca7 (patch) | |
tree | 585440372b5e0893657ac49563f4e5b215f419f7 | |
parent | b5317b2a41e6369e2804462e2ab73f1447f1533a (diff) |
enum SvLBoxButtonKind is effectively unused
since
commit e569b9d40eb02f53a3f13024af4ab1dc9ca7634a
Date: Tue Jul 30 17:07:41 2019 +0100
weld OfaMSFilterTabPage2
Change-Id: If8777180aec04336eda08c75bbee400de2ccb43b
Reviewed-on: https://gerrit.libreoffice.org/78136
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | dbaccess/source/ui/control/dbtreelistbox.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/control/tabletree.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/WNameMatch.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/dbtreelistbox.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/tabletree.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/WNameMatch.cxx | 4 | ||||
-rw-r--r-- | include/vcl/svlbitm.hxx | 13 | ||||
-rw-r--r-- | include/vcl/svtabbx.hxx | 8 | ||||
-rw-r--r-- | include/vcl/treelistbox.hxx | 14 | ||||
-rw-r--r-- | sc/source/ui/inc/content.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/navipi/content.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/dlg/sdtreelb.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/inc/sdtreelb.hxx | 2 | ||||
-rw-r--r-- | svx/source/form/filtnav.cxx | 5 | ||||
-rw-r--r-- | svx/source/inc/filtnav.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/inc/conttree.hxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/utlui/glbltree.cxx | 5 | ||||
-rw-r--r-- | vcl/source/app/salvtables.cxx | 2 | ||||
-rw-r--r-- | vcl/source/treelist/svlbitm.cxx | 27 | ||||
-rw-r--r-- | vcl/source/treelist/svtabbx.cxx | 10 | ||||
-rw-r--r-- | vcl/source/treelist/treelistbox.cxx | 23 |
22 files changed, 54 insertions, 94 deletions
diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx index 0d8912d92bcb..0bc9e569dbb4 100644 --- a/dbaccess/source/ui/control/dbtreelistbox.cxx +++ b/dbaccess/source/ui/control/dbtreelistbox.cxx @@ -138,9 +138,9 @@ void DBTreeListBox::RequestingChildren( SvTreeListEntry* pParent ) } } -void DBTreeListBox::InitEntry(SvTreeListEntry* _pEntry, const OUString& aStr, const Image& _rCollEntryBmp, const Image& _rExpEntryBmp, SvLBoxButtonKind eButtonKind) +void DBTreeListBox::InitEntry(SvTreeListEntry* _pEntry, const OUString& aStr, const Image& _rCollEntryBmp, const Image& _rExpEntryBmp) { - SvTreeListBox::InitEntry( _pEntry, aStr, _rCollEntryBmp,_rExpEntryBmp, eButtonKind); + SvTreeListBox::InitEntry( _pEntry, aStr, _rCollEntryBmp,_rExpEntryBmp); SvLBoxItem* pTextItem(_pEntry->GetFirstItem(SvLBoxItemType::String)); _pEntry->ReplaceItem(std::make_unique<OBoldListboxString>(aStr), _pEntry->GetPos(pTextItem)); } diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx index 19dd1429eefb..be884d43a15c 100644 --- a/dbaccess/source/ui/control/tabletree.cxx +++ b/dbaccess/source/ui/control/tabletree.cxx @@ -605,9 +605,9 @@ void TableTreeListBox::implEmphasize(weld::TreeIter& rEntry, bool _bChecked, boo } } -void OTableTreeListBox::InitEntry(SvTreeListEntry* _pEntry, const OUString& _rString, const Image& _rCollapsedBitmap, const Image& _rExpandedBitmap, SvLBoxButtonKind _eButtonKind) +void OTableTreeListBox::InitEntry(SvTreeListEntry* _pEntry, const OUString& _rString, const Image& _rCollapsedBitmap, const Image& _rExpandedBitmap) { - OMarkableTreeListBox::InitEntry(_pEntry, _rString, _rCollapsedBitmap, _rExpandedBitmap, _eButtonKind); + OMarkableTreeListBox::InitEntry(_pEntry, _rString, _rCollapsedBitmap, _rExpandedBitmap); // replace the text item with our own one SvLBoxItem* pTextItem = _pEntry->GetFirstItem(SvLBoxItemType::String); diff --git a/dbaccess/source/ui/inc/WNameMatch.hxx b/dbaccess/source/ui/inc/WNameMatch.hxx index fd34b5437aeb..642ff1f85198 100644 --- a/dbaccess/source/ui/inc/WNameMatch.hxx +++ b/dbaccess/source/ui/inc/WNameMatch.hxx @@ -33,7 +33,7 @@ namespace dbaui { bool m_bReadOnly; protected: - virtual void InitEntry(SvTreeListEntry* pEntry, const OUString& rStr, const Image& rImg1, const Image& rImg2, SvLBoxButtonKind eButtonKind) override; + virtual void InitEntry(SvTreeListEntry* pEntry, const OUString& rStr, const Image& rImg1, const Image& rImg2) override; public: OColumnTreeBox( vcl::Window* pParent ); diff --git a/dbaccess/source/ui/inc/dbtreelistbox.hxx b/dbaccess/source/ui/inc/dbtreelistbox.hxx index f66b07a5ffc2..b8bf380a71f9 100644 --- a/dbaccess/source/ui/inc/dbtreelistbox.hxx +++ b/dbaccess/source/ui/inc/dbtreelistbox.hxx @@ -102,7 +102,7 @@ namespace dbaui virtual void KeyInput( const KeyEvent& rKEvt ) override; virtual void StateChanged( StateChangedType nStateChange ) override; - virtual void InitEntry(SvTreeListEntry* pEntry, const OUString& aStr, const Image& aCollEntryBmp, const Image& aExpEntryBmp, SvLBoxButtonKind eButtonKind) override; + virtual void InitEntry(SvTreeListEntry* pEntry, const OUString& aStr, const Image& aCollEntryBmp, const Image& aExpEntryBmp) override; // enable editing for tables/views and queries virtual bool EditingEntry( SvTreeListEntry* pEntry, Selection& ) override; diff --git a/dbaccess/source/ui/inc/tabletree.hxx b/dbaccess/source/ui/inc/tabletree.hxx index 46487fc78b8d..85921215bc33 100644 --- a/dbaccess/source/ui/inc/tabletree.hxx +++ b/dbaccess/source/ui/inc/tabletree.hxx @@ -102,7 +102,7 @@ public: SvTreeListEntry* getEntryByQualifiedName( const OUString& _rName ); private: - virtual void InitEntry(SvTreeListEntry* _pEntry, const OUString& _rString, const Image& _rCollapsedBitmap, const Image& _rExpandedBitmap, SvLBoxButtonKind _eButtonKind) override; + virtual void InitEntry(SvTreeListEntry* _pEntry, const OUString& _rString, const Image& _rCollapsedBitmap, const Image& _rExpandedBitmap) override; virtual void checkedButton_noBroadcast(SvTreeListEntry* _pEntry) override; diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index 237ba44929d6..8fd6226b43ed 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -378,9 +378,9 @@ OColumnTreeBox::OColumnTreeBox( vcl::Window* pParent ) VCL_BUILDER_FACTORY(OColumnTreeBox) -void OColumnTreeBox::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr, const Image& rImg1, const Image& rImg2, SvLBoxButtonKind eButtonKind) +void OColumnTreeBox::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr, const Image& rImg1, const Image& rImg2) { - DBTreeListBox::InitEntry(pEntry, rStr, rImg1, rImg2, eButtonKind); + DBTreeListBox::InitEntry(pEntry, rStr, rImg1, rImg2); pEntry->ReplaceItem(std::make_unique<OColumnString>(rStr,false), pEntry->ItemCount() - 1); } diff --git a/include/vcl/svlbitm.hxx b/include/vcl/svlbitm.hxx index 9484535ce81f..08b1604dd8b8 100644 --- a/include/vcl/svlbitm.hxx +++ b/include/vcl/svlbitm.hxx @@ -144,17 +144,15 @@ class VCL_DLLPUBLIC SvLBoxButton : public SvLBoxItem { bool isVis; SvLBoxButtonData* pData; - SvLBoxButtonKind const eKind; SvItemStateFlags nItemFlags; static void ImplAdjustBoxSize( Size& io_rCtrlSize, ControlType i_eType, vcl::RenderContext const & pRenderContext); public: - // An SvLBoxButton can be of three different kinds: an - // enabled checkbox (the normal kind), a disabled checkbox - // (which cannot be modified via UI), or a static image + // An SvLBoxButton can be of two different kinds: an + // enabled checkbox (the normal kind), or a static image // (see SV_BMP_STATICIMAGE; nFlags are effectively ignored // for that kind). - SvLBoxButton( SvLBoxButtonKind eTheKind, SvLBoxButtonData* pBData ); + SvLBoxButton( SvLBoxButtonData* pBData ); SvLBoxButton(); virtual ~SvLBoxButton() override; virtual void InitViewData(SvTreeListBox* pView, @@ -196,11 +194,6 @@ public: void SetStateUnchecked(); void SetStateTristate(); void SetStateHilighted(bool bHilight); - - SvLBoxButtonKind GetKind() const { return eKind; } - - // Check whether this button can be modified via UI - bool CheckModification() const; }; inline void SvLBoxButton::SetStateChecked() diff --git a/include/vcl/svtabbx.hxx b/include/vcl/svtabbx.hxx index 3e5f68bf146c..baabd46d4409 100644 --- a/include/vcl/svtabbx.hxx +++ b/include/vcl/svtabbx.hxx @@ -55,7 +55,7 @@ protected: static OUString GetToken( const OUString &sStr, sal_Int32 &nIndex ); virtual void SetTabs() override; - virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&, SvLBoxButtonKind) override; + virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&) override; OUString GetTabEntryText( sal_uLong nPos, sal_uInt16 nCol ) const; SvTreeListEntry* GetEntryOnPos( sal_uLong _nEntryPos ) const; @@ -74,16 +74,14 @@ public: virtual SvTreeListEntry* InsertEntry( const OUString& rText, SvTreeListEntry* pParent = nullptr, bool bChildrenOnDemand = false, - sal_uLong nPos=TREELIST_APPEND, void* pUserData = nullptr, - SvLBoxButtonKind eButtonKind = SvLBoxButtonKind::EnabledCheckbox ) override; + sal_uLong nPos=TREELIST_APPEND, void* pUserData = nullptr ) override; virtual SvTreeListEntry* InsertEntry( const OUString& rText, const Image& rExpandedEntryBmp, const Image& rCollapsedEntryBmp, SvTreeListEntry* pParent = nullptr, bool bChildrenOnDemand = false, - sal_uLong nPos = TREELIST_APPEND, void* pUserData = nullptr, - SvLBoxButtonKind eButtonKind = SvLBoxButtonKind::EnabledCheckbox ) override; + sal_uLong nPos = TREELIST_APPEND, void* pUserData = nullptr ) override; virtual SvTreeListEntry* InsertEntryToColumn( const OUString&, sal_uLong nPos = TREELIST_APPEND, sal_uInt16 nCol = 0xffff, void* pUserData = nullptr ); diff --git a/include/vcl/treelistbox.hxx b/include/vcl/treelistbox.hxx index ef515aebf5a8..470299180818 100644 --- a/include/vcl/treelistbox.hxx +++ b/include/vcl/treelistbox.hxx @@ -54,12 +54,6 @@ namespace utl { class AccessibleStateSetHelper; } -enum class SvLBoxButtonKind -{ - EnabledCheckbox, - DisabledCheckbox -}; - enum class SvButtonState { Unchecked, Checked, Tristate }; // ********************************************************************* @@ -531,7 +525,7 @@ protected: SvLBoxTab* GetTab( SvTreeListEntry const *, SvLBoxItem const * ) const; void ClearTabList(); - virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&, SvLBoxButtonKind); + virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&); virtual void NotifyEndScroll(); virtual void NotifyScrolled(); @@ -589,16 +583,14 @@ public: virtual SvTreeListEntry* InsertEntry( const OUString& rText, SvTreeListEntry* pParent = nullptr, bool bChildrenOnDemand = false, - sal_uLong nPos=TREELIST_APPEND, void* pUserData = nullptr, - SvLBoxButtonKind eButtonKind = SvLBoxButtonKind::EnabledCheckbox ); + sal_uLong nPos=TREELIST_APPEND, void* pUserData = nullptr); virtual SvTreeListEntry* InsertEntry( const OUString& rText, const Image& rExpandedEntryBmp, const Image& rCollapsedEntryBmp, SvTreeListEntry* pParent = nullptr, bool bChildrenOnDemand = false, - sal_uLong nPos = TREELIST_APPEND, void* pUserData = nullptr, - SvLBoxButtonKind eButtonKind = SvLBoxButtonKind::EnabledCheckbox ); + sal_uLong nPos = TREELIST_APPEND, void* pUserData = nullptr ); const Image& GetDefaultExpandedEntryBmp( ) const; const Image& GetDefaultCollapsedEntryBmp( ) const; diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx index 024bde841d57..ce290d824c9a 100644 --- a/sc/source/ui/inc/content.hxx +++ b/sc/source/ui/inc/content.hxx @@ -109,7 +109,7 @@ protected: virtual void Command( const CommandEvent& rCEvt ) override; virtual void RequestHelp( const HelpEvent& rHEvt ) override; - virtual void InitEntry(SvTreeListEntry*,const OUString&,const Image&,const Image&, SvLBoxButtonKind) override; + virtual void InitEntry(SvTreeListEntry*,const OUString&,const Image&,const Image&) override; public: ScContentTree(vcl::Window* pParent, ScNavigatorDlg* pNavigatorDlg); diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index e3c1f0c724ef..5c46df802295 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -1695,10 +1695,10 @@ void ScContentTree::StoreNavigatorSettings() const } void ScContentTree::InitEntry(SvTreeListEntry* pEntry, - const OUString& rStr, const Image& rImg1, const Image& rImg2, SvLBoxButtonKind eButtonKind) + const OUString& rStr, const Image& rImg1, const Image& rImg2) { sal_uInt16 nColToHilite = 1; //0==Bitmap;1=="Spalte1";2=="Spalte2" - SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind ); + SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2 ); SvLBoxString& rCol = static_cast<SvLBoxString&>(pEntry->GetItem( nColToHilite )); pEntry->ReplaceItem(std::make_unique<SvLBoxString>(rCol.GetText()), nColToHilite); } diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 10af8fb6559b..b60125f167bf 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -288,10 +288,10 @@ OUString SdPageObjsTLB::GetEntryLongDescription( SvTreeListEntry* pEntry ) const } void SdPageObjsTLB::InitEntry(SvTreeListEntry* pEntry, - const OUString& rStr, const Image& rImg1, const Image& rImg2, SvLBoxButtonKind eButtonKind) + const OUString& rStr, const Image& rImg1, const Image& rImg2) { sal_uInt16 nColToHilite = 1; //0==Bitmap;1=="Spalte1";2=="Spalte2" - SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind ); + SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2 ); SvLBoxString& rCol = static_cast<SvLBoxString&>(pEntry->GetItem( nColToHilite )); pEntry->ReplaceItem(std::make_unique<SvLBoxString>(rCol.GetText()), nColToHilite ); } diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx index 12d7a7eededc..f4c62ba1f207 100644 --- a/sd/source/ui/inc/sdtreelb.hxx +++ b/sd/source/ui/inc/sdtreelb.hxx @@ -174,7 +174,7 @@ private: using Window::GetDropTarget; virtual SvTreeListEntry* GetDropTarget (const Point& rLocation) override; - virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&,SvLBoxButtonKind) override; + virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&) override; public: diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index 3886630dcf58..0d29422d6429 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -1333,10 +1333,9 @@ sal_Int8 FmFilterNavigator::ExecuteDrop( const ExecuteDropEvent& rEvt ) void FmFilterNavigator::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr, const Image& rImg1, - const Image& rImg2, - SvLBoxButtonKind eButtonKind) + const Image& rImg2) { - SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind ); + SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2 ); std::unique_ptr<SvLBoxString> pString; if (dynamic_cast<const FmFilterItem*>(static_cast<FmFilterData*>(pEntry->GetUserData())) != nullptr) diff --git a/svx/source/inc/filtnav.hxx b/svx/source/inc/filtnav.hxx index cd61c69bfbe7..cac94f4a159a 100644 --- a/svx/source/inc/filtnav.hxx +++ b/svx/source/inc/filtnav.hxx @@ -254,7 +254,7 @@ private: virtual void KeyInput( const KeyEvent& rKEvt ) override; virtual void Command( const CommandEvent& rEvt ) override; virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; - virtual void InitEntry(SvTreeListEntry* pEntry, const OUString& rStr, const Image& rImg1, const Image& rImg2, SvLBoxButtonKind eButtonKind) override; + virtual void InitEntry(SvTreeListEntry* pEntry, const OUString& rStr, const Image& rImg1, const Image& rImg2) override; virtual bool Select( SvTreeListEntry* pEntry, bool bSelect=true ) override; virtual bool EditingEntry( SvTreeListEntry* pEntry, Selection& rSelection ) override; virtual bool EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewText ) override; diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx index 8a6793a2b5ab..f748759e97ec 100644 --- a/sw/source/uibase/inc/conttree.hxx +++ b/sw/source/uibase/inc/conttree.hxx @@ -129,7 +129,7 @@ class SwContentTree final using SvTreeListBox::EditEntry; virtual void RequestHelp( const HelpEvent& rHEvt ) override; - virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&, SvLBoxButtonKind) override; + virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&) override; virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; SwNavigationPI* GetParentWindow(); @@ -318,7 +318,7 @@ private: virtual void GetFocus() override; virtual void SelectHdl() override; virtual void DeselectHdl() override; - virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&, SvLBoxButtonKind) override; + virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&) override; void Clear(); diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index c8bfe4411688..f979bf97d915 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -3786,11 +3786,10 @@ public: }; void SwContentTree::InitEntry(SvTreeListEntry* pEntry, - const OUString& rStr ,const Image& rImg1,const Image& rImg2, - SvLBoxButtonKind eButtonKind) + const OUString& rStr ,const Image& rImg1,const Image& rImg2) { const size_t nColToHilite = 1; //0==Bitmap;1=="Column1";2=="Column2" - SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind ); + SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2 ); SvLBoxString& rCol = static_cast<SvLBoxString&>(pEntry->GetItem( nColToHilite )); pEntry->ReplaceItem(std::make_unique<SwContentLBoxString>(rCol.GetText()), nColToHilite); } diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index 9dce946dc90b..59fe11eb9145 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -1224,11 +1224,10 @@ IMPL_STATIC_LINK_NOARG(SwGlobalTree, ShowFrameHdl, void*, void) } void SwGlobalTree::InitEntry(SvTreeListEntry* pEntry, - const OUString& rStr ,const Image& rImg1,const Image& rImg2, - SvLBoxButtonKind eButtonKind) + const OUString& rStr ,const Image& rImg1,const Image& rImg2) { const size_t nColToHilite = 1; //0==Bitmap;1=="Column1";2=="Column2" - SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind ); + SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2 ); SvLBoxString& rCol = static_cast<SvLBoxString&>(pEntry->GetItem( nColToHilite )); pEntry->ReplaceItem(std::make_unique<SwLBoxString>(rCol.GetText()), nColToHilite); } diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index b13ecb37645f..3812375462cb 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -3574,7 +3574,7 @@ public: } } - pEntry->AddItem(std::make_unique<SvLBoxButton>(SvLBoxButtonKind::EnabledCheckbox, pData)); + pEntry->AddItem(std::make_unique<SvLBoxButton>(pData)); SvViewDataEntry* pViewData = m_xTreeView->GetViewDataEntry(pEntry); m_xTreeView->InitViewData(pViewData, pEntry); diff --git a/vcl/source/treelist/svlbitm.cxx b/vcl/source/treelist/svlbitm.cxx index e484a04fb568..6e4c2d14be2d 100644 --- a/vcl/source/treelist/svlbitm.cxx +++ b/vcl/source/treelist/svlbitm.cxx @@ -261,11 +261,9 @@ int SvLBoxString::CalcWidth(const SvTreeListBox* pView) const // *************************************************************** -SvLBoxButton::SvLBoxButton( SvLBoxButtonKind eTheKind, - SvLBoxButtonData* pBData ) +SvLBoxButton::SvLBoxButton( SvLBoxButtonData* pBData ) : isVis(true) , pData(pBData) - , eKind(eTheKind) , nItemFlags(SvItemStateFlags::NONE) { SetStateUnchecked(); @@ -275,7 +273,6 @@ SvLBoxButton::SvLBoxButton() : SvLBoxItem() , isVis(false) , pData(nullptr) - , eKind(SvLBoxButtonKind::EnabledCheckbox) , nItemFlags(SvItemStateFlags::NONE) { SetStateUnchecked(); @@ -292,15 +289,12 @@ SvLBoxItemType SvLBoxButton::GetType() const void SvLBoxButton::ClickHdl( SvTreeListEntry* pEntry ) { - if ( CheckModification() ) - { - if ( IsStateChecked() ) - SetStateUnchecked(); - else - SetStateChecked(); - pData->StoreButtonState(pEntry, this); - pData->CallLink(); - } + if ( IsStateChecked() ) + SetStateUnchecked(); + else + SetStateChecked(); + pData->StoreButtonState(pEntry, this); + pData->CallLink(); } void SvLBoxButton::Paint( @@ -308,7 +302,7 @@ void SvLBoxButton::Paint( const SvViewDataEntry* /*pView*/, const SvTreeListEntry& /*rEntry*/) { SvBmp nIndex = SvLBoxButtonData::GetIndex(nItemFlags); - DrawImageFlags nStyle = eKind != SvLBoxButtonKind::DisabledCheckbox && rDev.IsEnabled() ? DrawImageFlags::NONE : DrawImageFlags::Disable; + DrawImageFlags nStyle = rDev.IsEnabled() ? DrawImageFlags::NONE : DrawImageFlags::Disable; //Native drawing bool bNativeOK = false; @@ -391,11 +385,6 @@ void SvLBoxButton::InitViewData(SvTreeListBox* pView,SvTreeListEntry* pEntry, Sv pViewData->mnHeight = aSize.Height(); } -bool SvLBoxButton::CheckModification() const -{ - return eKind == SvLBoxButtonKind::EnabledCheckbox; -} - // *************************************************************** // class SvLBoxContextBmp // *************************************************************** diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx index e2f0c2705ed0..dd21c3e6d75d 100644 --- a/vcl/source/treelist/svtabbx.cxx +++ b/vcl/source/treelist/svtabbx.cxx @@ -78,9 +78,9 @@ void SvTabListBox::SetTabs() } void SvTabListBox::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr, - const Image& rColl, const Image& rExp, SvLBoxButtonKind eButtonKind) + const Image& rColl, const Image& rExp) { - SvTreeListBox::InitEntry(pEntry, rStr, rColl, rExp, eButtonKind); + SvTreeListBox::InitEntry(pEntry, rStr, rColl, rExp); sal_Int32 nIndex = 0; // TODO: verify if nTabCount is always >0 here! @@ -148,8 +148,7 @@ void SvTabListBox::SetTab( sal_uInt16 nTab,long nValue,MapUnit eMapUnit ) SvTreeListEntry* SvTabListBox::InsertEntry( const OUString& rText, SvTreeListEntry* pParent, bool /*bChildrenOnDemand*/, - sal_uLong nPos, void* pUserData, - SvLBoxButtonKind ) + sal_uLong nPos, void* pUserData ) { return InsertEntryToColumn( rText, pParent, nPos, 0xffff, pUserData ); } @@ -159,8 +158,7 @@ SvTreeListEntry* SvTabListBox::InsertEntry( const OUString& rText, const Image& rCollapsedEntryBmp, SvTreeListEntry* pParent, bool /*bChildrenOnDemand*/, - sal_uLong nPos, void* pUserData, - SvLBoxButtonKind ) + sal_uLong nPos, void* pUserData ) { return InsertEntryToColumn( rText, rExpandedEntryBmp, rCollapsedEntryBmp, pParent, nPos, 0xffff, pUserData ); diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx index 35ef312d9687..afb62de37ae8 100644 --- a/vcl/source/treelist/treelistbox.cxx +++ b/vcl/source/treelist/treelistbox.cxx @@ -1551,12 +1551,11 @@ void SvTreeListBox::SetTabs() } void SvTreeListBox::InitEntry(SvTreeListEntry* pEntry, - const OUString& aStr, const Image& aCollEntryBmp, const Image& aExpEntryBmp, - SvLBoxButtonKind eButtonKind) + const OUString& aStr, const Image& aCollEntryBmp, const Image& aExpEntryBmp) { if( nTreeFlags & SvTreeFlags::CHKBTN ) { - pEntry->AddItem(std::make_unique<SvLBoxButton>(eButtonKind, pCheckButtonData)); + pEntry->AddItem(std::make_unique<SvLBoxButton>(pCheckButtonData)); } pEntry->AddItem(std::make_unique<SvLBoxContextBmp>( aCollEntryBmp,aExpEntryBmp, mbContextBmpExpanded)); @@ -1598,8 +1597,7 @@ SvTreeListEntry* SvTreeListBox::InsertEntry( const OUString& rText, SvTreeListEntry* pParent, bool bChildrenOnDemand, sal_uLong nPos, - void* pUser, - SvLBoxButtonKind eButtonKind + void* pUser ) { nTreeFlags |= SvTreeFlags::MANINS; @@ -1612,7 +1610,7 @@ SvTreeListEntry* SvTreeListBox::InsertEntry( SvTreeListEntry* pEntry = new SvTreeListEntry; pEntry->SetUserData( pUser ); - InitEntry( pEntry, rText, rDefColBmp, rDefExpBmp, eButtonKind ); + InitEntry( pEntry, rText, rDefColBmp, rDefExpBmp ); pEntry->EnableChildrenOnDemand( bChildrenOnDemand ); if( !pParent ) @@ -1630,8 +1628,7 @@ SvTreeListEntry* SvTreeListBox::InsertEntry( SvTreeListEntry* SvTreeListBox::InsertEntry( const OUString& rText, const Image& aExpEntryBmp, const Image& aCollEntryBmp, - SvTreeListEntry* pParent, bool bChildrenOnDemand, sal_uLong nPos, void* pUser, - SvLBoxButtonKind eButtonKind ) + SvTreeListEntry* pParent, bool bChildrenOnDemand, sal_uLong nPos, void* pUser ) { nTreeFlags |= SvTreeFlags::MANINS; @@ -1640,7 +1637,7 @@ SvTreeListEntry* SvTreeListBox::InsertEntry( const OUString& rText, SvTreeListEntry* pEntry = new SvTreeListEntry; pEntry->SetUserData( pUser ); - InitEntry( pEntry, rText, aCollEntryBmp, aExpEntryBmp, eButtonKind ); + InitEntry( pEntry, rText, aCollEntryBmp, aExpEntryBmp ); pEntry->EnableChildrenOnDemand( bChildrenOnDemand ); @@ -1758,7 +1755,7 @@ void SvTreeListBox::SetCheckButtonState( SvTreeListEntry* pEntry, SvButtonState return; SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SvLBoxItemType::Button)); - if(!(pItem && pItem->CheckModification())) + if(!pItem) return ; switch( eState ) { @@ -1810,7 +1807,6 @@ SvTreeListEntry* SvTreeListBox::CloneEntry( SvTreeListEntry* pSource ) OUString aStr; Image aCollEntryBmp; Image aExpEntryBmp; - SvLBoxButtonKind eButtonKind = SvLBoxButtonKind::EnabledCheckbox; SvLBoxString* pStringItem = static_cast<SvLBoxString*>(pSource->GetFirstItem(SvLBoxItemType::String)); if( pStringItem ) @@ -1821,11 +1817,8 @@ SvTreeListEntry* SvTreeListBox::CloneEntry( SvTreeListEntry* pSource ) aCollEntryBmp = pBmpItem->GetBitmap1( ); aExpEntryBmp = pBmpItem->GetBitmap2( ); } - SvLBoxButton* pButtonItem = static_cast<SvLBoxButton*>(pSource->GetFirstItem(SvLBoxItemType::Button)); - if( pButtonItem ) - eButtonKind = pButtonItem->GetKind(); SvTreeListEntry* pClone = new SvTreeListEntry; - InitEntry( pClone, aStr, aCollEntryBmp, aExpEntryBmp, eButtonKind ); + InitEntry( pClone, aStr, aCollEntryBmp, aExpEntryBmp ); pClone->SvTreeListEntry::Clone( pSource ); pClone->EnableChildrenOnDemand( pSource->HasChildrenOnDemand() ); pClone->SetUserData( pSource->GetUserData() ); |