summaryrefslogtreecommitdiff
path: root/include/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-12-06 16:36:25 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-12-07 10:42:55 +0100
commit74816dd665fb2980823e01f81446147fe7fe6688 (patch)
treea6df62c64863cf99084901c18dcaf62847dd5f25 /include/vcl
parent67ff7348756ec88d09fc00e6d284ba5b579e9b33 (diff)
SvTreeList only ever belongs to one and only one SvListView
so simplify that Change-Id: I6db807c5aa8ed1e6487bdb4f5ac5c96cf8abbcf6 Reviewed-on: https://gerrit.libreoffice.org/64752 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/vcl')
-rw-r--r--include/vcl/treelist.hxx19
-rw-r--r--include/vcl/treelistbox.hxx8
2 files changed, 6 insertions, 21 deletions
diff --git a/include/vcl/treelist.hxx b/include/vcl/treelist.hxx
index 48fb5cb26c82..e4e2f21c0b3e 100644
--- a/include/vcl/treelist.hxx
+++ b/include/vcl/treelist.hxx
@@ -65,19 +65,15 @@ struct SvSortData
class VCL_DLLPUBLIC SvTreeList final
{
- typedef std::vector<SvListView*> ListViewsType;
-
friend class SvListView;
- ListViewsType aViewList;
+ SvListView* const mpOwnerListView;
sal_uLong nEntryCount;
Link<SvTreeListEntry*, SvTreeListEntry*> aCloneLink;
Link<const SvSortData&, sal_Int32> aCompareLink;
SvSortMode eSortMode;
- sal_uInt16 nRefCount;
-
bool bAbsPositionsValid;
bool mbEnableInvalidate;
@@ -134,12 +130,10 @@ class VCL_DLLPUBLIC SvTreeList final
public:
- SvTreeList();
+ SvTreeList() = delete;
+ SvTreeList(SvListView*);
~SvTreeList();
- void InsertView( SvListView* );
- void RemoveView( SvListView const * );
-
void Broadcast(
SvListAction nActionId,
SvTreeListEntry* pEntry1=nullptr,
@@ -213,9 +207,6 @@ public:
SvTreeListEntry* CloneEntry( SvTreeListEntry* pSource ) const; // Calls the Clone Link
- sal_uInt16 GetRefCount() const { return nRefCount; }
- void SetRefCount( sal_uInt16 nRef ) { nRefCount = nRef; }
-
void SetSortMode( SvSortMode eMode ) { eSortMode = eMode; }
SvSortMode GetSortMode() const { return eSortMode; }
sal_Int32 Compare(const SvTreeListEntry* pLeft, const SvTreeListEntry* pRight) const;
@@ -232,7 +223,7 @@ class VCL_DLLPUBLIC SvListView
std::unique_ptr<Impl> m_pImpl;
protected:
- SvTreeList* pModel;
+ std::unique_ptr<SvTreeList> pModel;
void ExpandListEntry( SvTreeListEntry* pParent );
void CollapseListEntry( SvTreeListEntry* pParent );
@@ -240,9 +231,9 @@ protected:
public:
SvListView(); // Sets the Model to 0
+ void dispose();
virtual ~SvListView();
void Clear();
- virtual void SetModel( SvTreeList* );
virtual void ModelNotification(
SvListAction nActionId,
SvTreeListEntry* pEntry1,
diff --git a/include/vcl/treelistbox.hxx b/include/vcl/treelistbox.hxx
index 554bd734b421..43cee9dd8442 100644
--- a/include/vcl/treelistbox.hxx
+++ b/include/vcl/treelistbox.hxx
@@ -257,8 +257,6 @@ protected:
sal_uInt16 nCurEntrySelPos;
private:
- void SetBaseModel(SvTreeList* pNewModel);
-
DECL_DLLPRIVATE_LINK( CheckButtonClick, SvLBoxButtonData *, void );
DECL_DLLPRIVATE_LINK( TextEditEndedHdl_Impl, SvInplaceEdit2&, void );
// Handler that is called by TreeList to clone an Entry
@@ -335,13 +333,9 @@ public:
SvTreeList* GetModel() const
{
- return pModel;
+ return pModel.get();
}
- using SvListView::SetModel;
-
- void SetModel(SvTreeList* pNewModel) override;
-
sal_uLong GetEntryCount() const
{
return pModel ? pModel->GetEntryCount() : 0;