[Libreoffice-commits] core.git: include/tools include/vcl vcl/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Mon May 3 09:02:14 UTC 2021


 include/tools/contnr.hxx              |    6 +-
 include/vcl/toolkit/svtabbx.hxx       |   28 +++++-----
 include/vcl/toolkit/treelist.hxx      |   61 +++++++++++------------
 include/vcl/toolkit/treelistbox.hxx   |   26 +++++-----
 include/vcl/toolkit/treelistentry.hxx |    7 +-
 include/vcl/toolkit/viewdataentry.hxx |    5 -
 vcl/source/treelist/svtabbx.cxx       |   44 ++++++++---------
 vcl/source/treelist/treelist.cxx      |   88 +++++++++++++++++-----------------
 vcl/source/treelist/treelistbox.cxx   |   56 ++++++++++-----------
 vcl/source/treelist/treelistentry.cxx |    8 +--
 10 files changed, 162 insertions(+), 167 deletions(-)

New commits:
commit d417d25f417cc79b480bdfa4b2776562ee10f8c1
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sun May 2 19:34:22 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon May 3 11:01:33 2021 +0200

    sal_uLong->sal_uInt32 in SvTreeList
    
    Change-Id: I0f543c6b2ce246cf603a3ccebfa6b815e7c2545c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115007
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/tools/contnr.hxx b/include/tools/contnr.hxx
index 3ff08c9688a1..090be0dbeead 100644
--- a/include/tools/contnr.hxx
+++ b/include/tools/contnr.hxx
@@ -19,10 +19,10 @@
 #ifndef INCLUDED_TOOLS_CONTNR_HXX
 #define INCLUDED_TOOLS_CONTNR_HXX
 
-#include <limits.h>
+#include <sal/types.h>
 
-#define TREELIST_APPEND (ULONG_MAX)
-#define TREELIST_ENTRY_NOTFOUND (ULONG_MAX)
+#define TREELIST_APPEND (SAL_MAX_UINT32)
+#define TREELIST_ENTRY_NOTFOUND (SAL_MAX_UINT32)
 
 #endif
 
diff --git a/include/vcl/toolkit/svtabbx.hxx b/include/vcl/toolkit/svtabbx.hxx
index e85fd85a61f1..1e9fdee29600 100644
--- a/include/vcl/toolkit/svtabbx.hxx
+++ b/include/vcl/toolkit/svtabbx.hxx
@@ -51,9 +51,9 @@ protected:
     virtual void                SetTabs() 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;
-    SvTreeListEntry*            GetChildOnPos( SvTreeListEntry* _pParent, sal_uLong _nEntryPos, sal_uLong& _rPos ) const;
+    OUString                    GetTabEntryText( sal_uInt32 nPos, sal_uInt16 nCol ) const;
+    SvTreeListEntry*            GetEntryOnPos( sal_uInt32 _nEntryPos ) const;
+    SvTreeListEntry*            GetChildOnPos( SvTreeListEntry* _pParent, sal_uInt32 _nEntryPos, sal_uInt32& _rPos ) const;
 
 public:
     SvTabListBox( vcl::Window* pParent, WinBits );
@@ -65,27 +65,27 @@ public:
 
     virtual SvTreeListEntry*    InsertEntry( const OUString& rText, SvTreeListEntry* pParent = nullptr,
                                          bool bChildrenOnDemand = false,
-                                         sal_uLong nPos=TREELIST_APPEND, void* pUserData = nullptr ) override;
+                                         sal_uInt32 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 ) override;
+                                         sal_uInt32 nPos = TREELIST_APPEND, void* pUserData = nullptr ) override;
 
     virtual SvTreeListEntry* InsertEntryToColumn( const OUString&, SvTreeListEntry* pParent,
-                                 sal_uLong nPos, sal_uInt16 nCol, void* pUserData = nullptr );
+                                 sal_uInt32 nPos, sal_uInt16 nCol, void* pUserData = nullptr );
     virtual SvTreeListEntry* InsertEntryToColumn( const OUString&, const Image& rExpandedEntryBmp,
                                  const Image& rCollapsedEntryBmp, SvTreeListEntry* pParent,
-                                 sal_uLong nPos = TREELIST_APPEND, sal_uInt16 nCol = 0xffff, void* pUserData = nullptr );
+                                 sal_uInt32 nPos = TREELIST_APPEND, sal_uInt16 nCol = 0xffff, void* pUserData = nullptr );
 
     virtual OUString GetEntryText( SvTreeListEntry* pEntry ) const override;
     static OUString  GetEntryText( const SvTreeListEntry*, sal_uInt16 nCol );
-    OUString         GetEntryText( sal_uLong nPos, sal_uInt16 nCol = 0xffff ) const;
+    OUString         GetEntryText( sal_uInt32 nPos, sal_uInt16 nCol = 0xffff ) const;
     using SvTreeListBox::SetEntryText;
-    OUString         GetCellText( sal_uLong nPos, sal_uInt16 nCol ) const;
-    sal_uLong        GetEntryPos( const SvTreeListEntry* pEntry ) const;
+    OUString         GetCellText( sal_uInt32 nPos, sal_uInt16 nCol ) const;
+    sal_uInt32       GetEntryPos( const SvTreeListEntry* pEntry ) const;
 
     void             SetTabJustify( sal_uInt16 nTab, SvTabJustify );
     void             SetTabEditable( sal_uInt16 nTab, bool bEditable );
@@ -127,12 +127,12 @@ public:
     static bool     IsItemChecked( SvTreeListEntry* pEntry, sal_uInt16 nCol );
 
     virtual SvTreeListEntry* InsertEntryToColumn( const OUString&, SvTreeListEntry* pParent,
-                                 sal_uLong nPos, sal_uInt16 nCol, void* pUserData = nullptr ) override;
+                                 sal_uInt32 nPos, sal_uInt16 nCol, void* pUserData = nullptr ) override;
     virtual SvTreeListEntry* InsertEntryToColumn( const OUString&, const Image& rExpandedEntryBmp,
                                  const Image& rCollapsedEntryBmp, SvTreeListEntry* pParent,
-                                 sal_uLong nPos = TREELIST_APPEND, sal_uInt16 nCol = 0xffff, void* pUserData = nullptr ) override;
-    virtual sal_uLong Insert( SvTreeListEntry* pEnt,SvTreeListEntry* pPar,sal_uLong nPos=TREELIST_APPEND) override;
-    virtual sal_uLong Insert( SvTreeListEntry* pEntry, sal_uLong nRootPos = TREELIST_APPEND ) override;
+                                 sal_uInt32 nPos = TREELIST_APPEND, sal_uInt16 nCol = 0xffff, void* pUserData = nullptr ) override;
+    virtual sal_uInt32 Insert( SvTreeListEntry* pEnt,SvTreeListEntry* pPar,sal_uInt32 nPos=TREELIST_APPEND) override;
+    virtual sal_uInt32 Insert( SvTreeListEntry* pEntry, sal_uInt32 nRootPos = TREELIST_APPEND ) override;
 
     // Accessible -------------------------------------------------------------
 
diff --git a/include/vcl/toolkit/treelist.hxx b/include/vcl/toolkit/treelist.hxx
index 09ed5da01df2..e45d0d933c01 100644
--- a/include/vcl/toolkit/treelist.hxx
+++ b/include/vcl/toolkit/treelist.hxx
@@ -26,7 +26,6 @@
 #include <vcl/dllapi.h>
 #include <vcl/toolkit/treelistentries.hxx>
 
-#include <tools/solar.h>
 #include <tools/link.hxx>
 #include <tools/contnr.hxx>
 
@@ -67,7 +66,7 @@ class VCL_DLLPUBLIC SvTreeList final
     friend class        SvListView;
 
     SvListView&         mrOwnerListView;
-    sal_uLong           nEntryCount;
+    sal_uInt32          nEntryCount;
 
     Link<SvTreeListEntry*, SvTreeListEntry*>  aCloneLink;
     Link<const SvSortData&, sal_Int32>        aCompareLink;
@@ -85,20 +84,20 @@ class VCL_DLLPUBLIC SvTreeList final
     SvTreeListEntry*        PrevVisible( const SvListView*,SvTreeListEntry* pEntry, sal_uInt16& rDelta ) const;
 
     bool               IsEntryVisible( const SvListView*,SvTreeListEntry* pEntry ) const;
-    SvTreeListEntry*    GetEntryAtVisPos( const SvListView*,sal_uLong nVisPos ) const;
-    sal_uLong           GetVisiblePos( const SvListView*,SvTreeListEntry const * pEntry ) const;
-    sal_uLong           GetVisibleCount( SvListView* ) const;
-    sal_uLong           GetVisibleChildCount( const SvListView*,SvTreeListEntry* pParent ) const;
+    SvTreeListEntry*    GetEntryAtVisPos( const SvListView*, sal_uInt32 nVisPos ) const;
+    sal_uInt32           GetVisiblePos( const SvListView*,SvTreeListEntry const * pEntry ) const;
+    sal_uInt32           GetVisibleCount( SvListView* ) const;
+    sal_uInt32           GetVisibleChildCount( const SvListView*,SvTreeListEntry* pParent ) const;
 
     SvTreeListEntry*        FirstSelected( const SvListView*) const;
     SvTreeListEntry*        NextSelected( const SvListView*,SvTreeListEntry* pEntry ) const;
 
-    sal_uLong           GetChildSelectionCount( const SvListView*,SvTreeListEntry* pParent ) const;
+    sal_uInt32           GetChildSelectionCount( const SvListView*,SvTreeListEntry* pParent ) const;
 
     VCL_DLLPRIVATE void SetAbsolutePositions();
 
     VCL_DLLPRIVATE void CloneChildren(
-        SvTreeListEntries& rDst, sal_uLong& rCloneCount, SvTreeListEntries& rSrc, SvTreeListEntry& rNewParent) const;
+        SvTreeListEntries& rDst, sal_uInt32& rCloneCount, SvTreeListEntries& rSrc, SvTreeListEntry& rNewParent) const;
 
     /**
      * Invalidate the cached position data to have them re-generated before
@@ -110,7 +109,7 @@ class VCL_DLLPUBLIC SvTreeList final
     VCL_DLLPRIVATE void GetInsertionPos(
                             SvTreeListEntry const * pEntry,
                             SvTreeListEntry* pParent,
-                            sal_uLong& rPos
+                            sal_uInt32& rPos
                         );
 
     VCL_DLLPRIVATE void ResortChildren( SvTreeListEntry* pParent );
@@ -130,7 +129,7 @@ public:
                             SvListAction nActionId,
                             SvTreeListEntry* pEntry1=nullptr,
                             SvTreeListEntry* pEntry2=nullptr,
-                            sal_uLong nPos=0
+                            sal_uInt32 nPos=0
                         );
 
     void                EnableInvalidate( bool bEnable );
@@ -139,7 +138,7 @@ public:
     // Notify all Listeners
     void                InvalidateEntry( SvTreeListEntry* );
 
-    sal_uLong           GetEntryCount() const { return nEntryCount; }
+    sal_uInt32          GetEntryCount() const { return nEntryCount; }
     SvTreeListEntry*    First() const;
     SvTreeListEntry*    Next( SvTreeListEntry* pEntry, sal_uInt16* pDepth=nullptr ) const;
     SvTreeListEntry*    Prev( SvTreeListEntry* pEntry ) const;
@@ -147,26 +146,26 @@ public:
 
     SvTreeListEntry*    FirstChild( SvTreeListEntry* pParent ) const;
 
-    sal_uLong           Insert( SvTreeListEntry* pEntry,SvTreeListEntry* pPar,sal_uLong nPos = TREELIST_APPEND);
-    sal_uLong           Insert( SvTreeListEntry* pEntry,sal_uLong nRootPos = TREELIST_APPEND )
+    sal_uInt32          Insert( SvTreeListEntry* pEntry,SvTreeListEntry* pPar,sal_uInt32 nPos = TREELIST_APPEND);
+    sal_uInt32          Insert( SvTreeListEntry* pEntry,sal_uInt32 nRootPos = TREELIST_APPEND )
     { return Insert(pEntry, pRootItem.get(), nRootPos ); }
 
-    void                InsertTree( SvTreeListEntry* pTree, SvTreeListEntry* pTargetParent, sal_uLong nListPos );
+    void                InsertTree( SvTreeListEntry* pTree, SvTreeListEntry* pTargetParent, sal_uInt32 nListPos );
 
     // Entries need to be in the same Model!
     void                Move( SvTreeListEntry* pSource, SvTreeListEntry* pTarget );
 
     // Creates ChildList if needed
-    sal_uLong           Move( SvTreeListEntry* pSource, SvTreeListEntry* pTargetParent, sal_uLong nListPos);
-    sal_uLong           Copy( SvTreeListEntry* pSource, SvTreeListEntry* pTargetParent, sal_uLong nListPos);
+    sal_uInt32          Move( SvTreeListEntry* pSource, SvTreeListEntry* pTargetParent, sal_uInt32 nListPos);
+    sal_uInt32          Copy( SvTreeListEntry* pSource, SvTreeListEntry* pTargetParent, sal_uInt32 nListPos);
 
     bool Remove( const SvTreeListEntry* pEntry );
     void                Clear();
 
     bool                IsChild(const SvTreeListEntry* pParent, const SvTreeListEntry* pChild) const;
-    SvTreeListEntry*        GetEntry( SvTreeListEntry* pParent, sal_uLong nPos ) const;
-    SvTreeListEntry*        GetEntry( sal_uLong nRootPos ) const;
-    SvTreeListEntry*        GetEntryAtAbsPos( sal_uLong nAbsPos ) const;
+    SvTreeListEntry*        GetEntry( SvTreeListEntry* pParent, sal_uInt32 nPos ) const;
+    SvTreeListEntry*        GetEntry( sal_uInt32 nRootPos ) const;
+    SvTreeListEntry*        GetEntryAtAbsPos( sal_uInt32 nAbsPos ) const;
 
     const SvTreeListEntry* GetParent( const SvTreeListEntry* pEntry ) const;
     SvTreeListEntry* GetParent( SvTreeListEntry* pEntry );
@@ -175,17 +174,17 @@ public:
     const SvTreeListEntries& GetChildList( SvTreeListEntry* pParent ) const;
     SvTreeListEntries& GetChildList( SvTreeListEntry* pParent );
 
-    sal_uLong GetAbsPos( const SvTreeListEntry* pEntry ) const;
-    static sal_uLong GetRelPos( const SvTreeListEntry* pChild );
+    sal_uInt32 GetAbsPos( const SvTreeListEntry* pEntry ) const;
+    static sal_uInt32 GetRelPos( const SvTreeListEntry* pChild );
 
-    sal_uLong GetChildCount( const SvTreeListEntry* pParent ) const;
+    sal_uInt32 GetChildCount( const SvTreeListEntry* pParent ) const;
     sal_uInt16 GetDepth( const SvTreeListEntry* pEntry ) const;
     bool IsAtRootDepth( const SvTreeListEntry* pEntry ) const;
 
     // The Model calls the Clone Link to clone Entries.
     // Thus we do not need to derive from the Model if we derive from SvTreeListEntry.
     // The Handler needs to return a SvTreeListEntry*
-    SvTreeListEntry*    Clone( SvTreeListEntry* pEntry, sal_uLong& nCloneCount ) const;
+    SvTreeListEntry*    Clone( SvTreeListEntry* pEntry, sal_uInt32& nCloneCount ) const;
     void                SetCloneLink( const Link<SvTreeListEntry*,SvTreeListEntry*>& rLink )
     { aCloneLink=rLink; }
 
@@ -224,10 +223,10 @@ public:
                             SvListAction nActionId,
                             SvTreeListEntry* pEntry1,
                             SvTreeListEntry* pEntry2,
-                            sal_uLong nPos
+                            sal_uInt32 nPos
                         );
 
-    sal_uLong           GetVisibleCount() const
+    sal_uInt32          GetVisibleCount() const
     { return pModel->GetVisibleCount( const_cast<SvListView*>(this) ); }
 
     SvTreeListEntry*        FirstVisible() const
@@ -248,7 +247,7 @@ public:
     SvTreeListEntry*        PrevVisible( SvTreeListEntry* pEntry, sal_uInt16& rDelta ) const
     { return pModel->PrevVisible(this,pEntry,rDelta); }
 
-    sal_uLong           GetSelectionCount() const;
+    sal_uInt32              GetSelectionCount() const;
 
     SvTreeListEntry* FirstSelected() const
     { return pModel->FirstSelected(this); }
@@ -256,19 +255,19 @@ public:
     SvTreeListEntry*        NextSelected( SvTreeListEntry* pEntry ) const
     { return pModel->NextSelected(this,pEntry); }
 
-    SvTreeListEntry*        GetEntryAtAbsPos( sal_uLong nAbsPos ) const
+    SvTreeListEntry*        GetEntryAtAbsPos( sal_uInt32 nAbsPos ) const
     { return pModel->GetEntryAtAbsPos(nAbsPos); }
 
-    SvTreeListEntry*        GetEntryAtVisPos( sal_uLong nVisPos ) const
+    SvTreeListEntry*        GetEntryAtVisPos( sal_uInt32 nVisPos ) const
     { return pModel->GetEntryAtVisPos(this,nVisPos); }
 
-    sal_uLong           GetAbsPos( SvTreeListEntry const * pEntry ) const
+    sal_uInt32              GetAbsPos( SvTreeListEntry const * pEntry ) const
     { return pModel->GetAbsPos(pEntry); }
 
-    sal_uLong           GetVisiblePos( SvTreeListEntry const * pEntry ) const
+    sal_uInt32           GetVisiblePos( SvTreeListEntry const * pEntry ) const
     { return pModel->GetVisiblePos(this,pEntry); }
 
-    sal_uLong           GetVisibleChildCount(SvTreeListEntry* pParent ) const
+    sal_uInt32           GetVisibleChildCount(SvTreeListEntry* pParent ) const
     { return pModel->GetVisibleChildCount(this,pParent); }
 
     bool               IsEntryVisible( SvTreeListEntry* pEntry ) const
diff --git a/include/vcl/toolkit/treelistbox.hxx b/include/vcl/toolkit/treelistbox.hxx
index bc7fcd81ccc3..c2c2a2c05c84 100644
--- a/include/vcl/toolkit/treelistbox.hxx
+++ b/include/vcl/toolkit/treelistbox.hxx
@@ -300,8 +300,8 @@ protected:
     // Invalidate children on enable/disable
     virtual void StateChanged( StateChangedType eType ) override;
 
-    virtual sal_uLong Insert( SvTreeListEntry* pEnt,SvTreeListEntry* pPar,sal_uLong nPos=TREELIST_APPEND);
-    virtual sal_uLong Insert( SvTreeListEntry* pEntry,sal_uLong nRootPos = TREELIST_APPEND );
+    virtual sal_uInt32 Insert( SvTreeListEntry* pEnt,SvTreeListEntry* pPar,sal_uInt32 nPos=TREELIST_APPEND);
+    virtual sal_uInt32 Insert( SvTreeListEntry* pEntry,sal_uInt32 nRootPos = TREELIST_APPEND );
 
     // In-place editing
     std::unique_ptr<SvInplaceEdit2>  pEdCtrl;
@@ -343,7 +343,7 @@ public:
         return pModel.get();
     }
 
-    sal_uLong GetEntryCount() const
+    sal_uInt32 GetEntryCount() const
     {
         return pModel ? pModel->GetEntryCount() : 0;
     }
@@ -378,8 +378,8 @@ public:
     SelectionMode   GetSelectionMode() const { return eSelMode; }
 
     // pParent == 0 -> Root level
-    SvTreeListEntry* GetEntry( SvTreeListEntry* pParent, sal_uLong nPos ) const;
-    SvTreeListEntry* GetEntry( sal_uLong nRootPos ) const;
+    SvTreeListEntry* GetEntry( SvTreeListEntry* pParent, sal_uInt32 nPos ) const;
+    SvTreeListEntry* GetEntry( sal_uInt32 nRootPos ) const;
 
     SvTreeListEntry*    GetEntryFromPath( const ::std::deque< sal_Int32 >& _rPath ) const;
     void            FillEntryPath( SvTreeListEntry* pEntry, ::std::deque< sal_Int32 >& _rPath ) const;
@@ -388,8 +388,8 @@ public:
     SvTreeListEntry* GetParent( SvTreeListEntry* pEntry ) const;
 
     using Window::GetChildCount;
-    sal_uLong           GetChildCount( SvTreeListEntry const * pParent ) const;
-    sal_uLong           GetLevelChildCount( SvTreeListEntry* pParent ) const;
+    sal_uInt32          GetChildCount( SvTreeListEntry const * pParent ) const;
+    sal_uInt32          GetLevelChildCount( SvTreeListEntry* pParent ) const;
 
     SvViewDataEntry* GetViewDataEntry( SvTreeListEntry const * pEntry ) const;
     SvViewDataItem*  GetViewDataItem(SvTreeListEntry const *, SvLBoxItem const *);
@@ -439,14 +439,14 @@ public:
         SvTreeListEntry*  pTarget,       // D'n'D DropPosition in GetModel()
         const SvTreeListEntry*  pEntry,        // Entry to be moved from GetSourceListBox()->GetModel()
         SvTreeListEntry*& rpNewParent,   // New TargetParent
-        sal_uLong&        rNewChildPos); // The TargetParent's position in Childlist
+        sal_uInt32&        rNewChildPos); // The TargetParent's position in Childlist
 
     // Return value: TRISTATE_TRUE == Ok, TRISTATE_FALSE == Cancel, TRISTATE_INDET == Ok and Make visible moved entry
     TriState    NotifyCopying(
         SvTreeListEntry*  pTarget,       // D'n'D DropPosition in GetModel()
         const SvTreeListEntry*  pEntry,        // Entry to be copied from GetSourceListBox()->GetModel()
         SvTreeListEntry*& rpNewParent,   // New TargetParent
-        sal_uLong&        rNewChildPos); // The TargetParent's position in Childlist
+        sal_uInt32&        rNewChildPos); // The TargetParent's position in Childlist
 
     // ACCESSIBILITY ==========================================================
 
@@ -554,14 +554,14 @@ public:
 
     virtual SvTreeListEntry*    InsertEntry( const OUString& rText, SvTreeListEntry* pParent = nullptr,
                                          bool bChildrenOnDemand = false,
-                                         sal_uLong nPos=TREELIST_APPEND, void* pUserData = nullptr);
+                                         sal_uInt32 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 );
+                                         sal_uInt32 nPos = TREELIST_APPEND, void* pUserData = nullptr );
 
     const Image&    GetDefaultExpandedEntryBmp( ) const;
     const Image&    GetDefaultCollapsedEntryBmp( ) const;
@@ -645,7 +645,7 @@ public:
     bool            Expand( SvTreeListEntry* pParent );
     bool            Collapse( SvTreeListEntry* pParent );
     bool            Select( SvTreeListEntry* pEntry, bool bSelect=true );
-    sal_uLong       SelectChildren( SvTreeListEntry* pParent, bool bSelect );
+    sal_uInt32      SelectChildren( SvTreeListEntry* pParent, bool bSelect );
     void            SelectAll( bool bSelect );
 
     void SetCurEntry( SvTreeListEntry* _pEntry );
@@ -661,7 +661,7 @@ public:
 
     DECL_LINK( DefaultCompare, const SvSortData&, sal_Int32 );
     virtual void    ModelNotification( SvListAction nActionId, SvTreeListEntry* pEntry1,
-                        SvTreeListEntry* pEntry2, sal_uLong nPos ) override;
+                        SvTreeListEntry* pEntry2, sal_uInt32 nPos ) override;
 
     SvTreeListEntry*    GetFirstEntryInView() const;
     SvTreeListEntry*    GetNextEntryInView(SvTreeListEntry*) const;
diff --git a/include/vcl/toolkit/treelistentry.hxx b/include/vcl/toolkit/treelistentry.hxx
index dbfa87b204ac..7a35e8e0b222 100644
--- a/include/vcl/toolkit/treelistentry.hxx
+++ b/include/vcl/toolkit/treelistentry.hxx
@@ -24,7 +24,6 @@
 #endif
 
 #include <vcl/dllapi.h>
-#include <tools/solar.h>
 #include <tools/color.hxx>
 #include <vcl/toolkit/treelistbox.hxx>
 #include <vcl/toolkit/treelistentries.hxx>
@@ -63,8 +62,8 @@ class VCL_DLLPUBLIC SvTreeListEntry
 
     SvTreeListEntry*    pParent;
     SvTreeListEntries   m_Children;
-    sal_uLong           nAbsPos;
-    sal_uLong           nListPos;
+    sal_uInt32          nAbsPos;
+    sal_uInt32          nListPos;
     sal_uInt32          mnExtraIndent;
     ItemsType           m_Items;
     void*               pUserData;
@@ -88,7 +87,7 @@ public:
 
     bool HasChildren() const;
     bool HasChildListPos() const;
-    sal_uLong GetChildListPos() const;
+    sal_uInt32 GetChildListPos() const;
 
     SvTreeListEntries& GetChildEntries() { return m_Children; }
     const SvTreeListEntries& GetChildEntries() const { return m_Children; }
diff --git a/include/vcl/toolkit/viewdataentry.hxx b/include/vcl/toolkit/viewdataentry.hxx
index daac693d8893..b34a8e3ef5e2 100644
--- a/include/vcl/toolkit/viewdataentry.hxx
+++ b/include/vcl/toolkit/viewdataentry.hxx
@@ -23,8 +23,7 @@
 #error "don't use this in new code"
 #endif
 
-#include <tools/solar.h>
-
+#include <sal/types.h>
 #include <vector>
 
 class SvTreeListBox;
@@ -49,7 +48,7 @@ class SvViewDataEntry
     friend class SvTreeList;
 
     std::vector<SvViewDataItem> maItems;
-    sal_uLong nVisPos;
+    sal_uInt32 nVisPos;
     bool mbSelected:1;
     bool mbHighlighted:1;
     bool mbExpanded:1;
diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx
index c7fd080b68f9..c5d8119c0d98 100644
--- a/vcl/source/treelist/svtabbx.cxx
+++ b/vcl/source/treelist/svtabbx.cxx
@@ -215,7 +215,7 @@ void SvTabListBox::SetTabs(sal_uInt16 nTabs, tools::Long const pTabPositions[],
 
 SvTreeListEntry* SvTabListBox::InsertEntry( const OUString& rText, SvTreeListEntry* pParent,
                                         bool /*bChildrenOnDemand*/,
-                                        sal_uLong nPos, void* pUserData )
+                                        sal_uInt32 nPos, void* pUserData )
 {
     return InsertEntryToColumn( rText, pParent, nPos, 0xffff, pUserData );
 }
@@ -225,13 +225,13 @@ SvTreeListEntry* SvTabListBox::InsertEntry( const OUString& rText,
                                         const Image& rCollapsedEntryBmp,
                                         SvTreeListEntry* pParent,
                                         bool /*bChildrenOnDemand*/,
-                                        sal_uLong nPos, void* pUserData )
+                                        sal_uInt32 nPos, void* pUserData )
 {
     return InsertEntryToColumn( rText, rExpandedEntryBmp, rCollapsedEntryBmp,
                                 pParent, nPos, 0xffff, pUserData );
 }
 
-SvTreeListEntry* SvTabListBox::InsertEntryToColumn(const OUString& rStr,SvTreeListEntry* pParent,sal_uLong nPos,sal_uInt16 nCol,
+SvTreeListEntry* SvTabListBox::InsertEntryToColumn(const OUString& rStr,SvTreeListEntry* pParent,sal_uInt32 nPos,sal_uInt16 nCol,
     void* pUser )
 {
     OUString aStr;
@@ -258,7 +258,7 @@ SvTreeListEntry* SvTabListBox::InsertEntryToColumn(const OUString& rStr,SvTreeLi
 
 SvTreeListEntry* SvTabListBox::InsertEntryToColumn( const OUString& rStr,
     const Image& rExpandedEntryBmp, const Image& rCollapsedEntryBmp,
-    SvTreeListEntry* pParent,sal_uLong nPos,sal_uInt16 nCol, void* pUser )
+    SvTreeListEntry* pParent,sal_uInt32 nPos,sal_uInt16 nCol, void* pUser )
 {
     OUString aStr;
     if( nCol != 0xffff )
@@ -323,13 +323,13 @@ OUString SvTabListBox::GetEntryText( const SvTreeListEntry* pEntry, sal_uInt16 n
     return aResult.makeStringAndClear();
 }
 
-OUString SvTabListBox::GetEntryText( sal_uLong nPos, sal_uInt16 nCol ) const
+OUString SvTabListBox::GetEntryText( sal_uInt32 nPos, sal_uInt16 nCol ) const
 {
     SvTreeListEntry* pEntry = GetEntryOnPos( nPos );
     return GetEntryText( pEntry, nCol );
 }
 
-OUString SvTabListBox::GetCellText( sal_uLong nPos, sal_uInt16 nCol ) const
+OUString SvTabListBox::GetCellText( sal_uInt32 nPos, sal_uInt16 nCol ) const
 {
     SvTreeListEntry* pEntry = GetEntryOnPos( nPos );
     DBG_ASSERT( pEntry, "SvTabListBox::GetCellText(): Invalid Entry" );
@@ -343,9 +343,9 @@ OUString SvTabListBox::GetCellText( sal_uLong nPos, sal_uInt16 nCol ) const
     return aResult;
 }
 
-sal_uLong SvTabListBox::GetEntryPos( const SvTreeListEntry* pEntry ) const
+sal_uInt32 SvTabListBox::GetEntryPos( const SvTreeListEntry* pEntry ) const
 {
-    sal_uLong nPos = 0;
+    sal_uInt32 nPos = 0;
     SvTreeListEntry* pTmpEntry = First();
     while( pTmpEntry )
     {
@@ -363,7 +363,7 @@ OUString SvTabListBox::GetToken( const OUString &sStr, sal_Int32& nIndex )
     return sStr.getToken(0, '\t', nIndex);
 }
 
-OUString SvTabListBox::GetTabEntryText( sal_uLong nPos, sal_uInt16 nCol ) const
+OUString SvTabListBox::GetTabEntryText( sal_uInt32 nPos, sal_uInt16 nCol ) const
 {
     SvTreeListEntry* pEntry = SvTreeListBox::GetEntry( nPos );
     DBG_ASSERT( pEntry, "GetTabEntryText(): Invalid entry " );
@@ -401,10 +401,10 @@ OUString SvTabListBox::GetTabEntryText( sal_uLong nPos, sal_uInt16 nCol ) const
     return aResult.makeStringAndClear();
 }
 
-SvTreeListEntry* SvTabListBox::GetEntryOnPos( sal_uLong _nEntryPos ) const
+SvTreeListEntry* SvTabListBox::GetEntryOnPos( sal_uInt32 _nEntryPos ) const
 {
     SvTreeListEntry* pEntry = nullptr;
-    sal_uLong i, nPos = 0, nCount = GetLevelChildCount( nullptr );
+    sal_uInt32 i, nPos = 0, nCount = GetLevelChildCount( nullptr );
     for ( i = 0; i < nCount; ++i )
     {
         SvTreeListEntry* pParent = GetEntry(i);
@@ -425,9 +425,9 @@ SvTreeListEntry* SvTabListBox::GetEntryOnPos( sal_uLong _nEntryPos ) const
     return pEntry;
 }
 
-SvTreeListEntry* SvTabListBox::GetChildOnPos( SvTreeListEntry* _pParent, sal_uLong _nEntryPos, sal_uLong& _rPos ) const
+SvTreeListEntry* SvTabListBox::GetChildOnPos( SvTreeListEntry* _pParent, sal_uInt32 _nEntryPos, sal_uInt32& _rPos ) const
 {
-    sal_uLong i, nCount = GetLevelChildCount( _pParent );
+    sal_uInt32 i, nCount = GetLevelChildCount( _pParent );
     for ( i = 0; i < nCount; ++i )
     {
         SvTreeListEntry* pParent = GetEntry( _pParent, i );
@@ -550,7 +550,7 @@ bool SvHeaderTabListBox::IsItemChecked( SvTreeListEntry* pEntry, sal_uInt16 nCol
 }
 
 SvTreeListEntry* SvHeaderTabListBox::InsertEntryToColumn(
-    const OUString& rStr, SvTreeListEntry* pParent, sal_uLong nPos, sal_uInt16 nCol, void* pUserData )
+    const OUString& rStr, SvTreeListEntry* pParent, sal_uInt32 nPos, sal_uInt16 nCol, void* pUserData )
 {
     SvTreeListEntry* pEntry = SvTabListBox::InsertEntryToColumn( rStr, pParent, nPos, nCol, pUserData );
     RecalculateAccessibleChildren();
@@ -559,7 +559,7 @@ SvTreeListEntry* SvHeaderTabListBox::InsertEntryToColumn(
 
 SvTreeListEntry* SvHeaderTabListBox::InsertEntryToColumn(
     const OUString& rStr, const Image& rExpandedEntryBmp, const Image& rCollapsedEntryBmp,
-    SvTreeListEntry* pParent, sal_uLong nPos, sal_uInt16 nCol, void* pUserData )
+    SvTreeListEntry* pParent, sal_uInt32 nPos, sal_uInt16 nCol, void* pUserData )
 {
     SvTreeListEntry* pEntry = SvTabListBox::InsertEntryToColumn(
         rStr, rExpandedEntryBmp, rCollapsedEntryBmp, pParent, nPos, nCol, pUserData );
@@ -567,17 +567,17 @@ SvTreeListEntry* SvHeaderTabListBox::InsertEntryToColumn(
     return pEntry;
 }
 
-sal_uLong SvHeaderTabListBox::Insert(
-    SvTreeListEntry* pEnt, SvTreeListEntry* pPar, sal_uLong nPos )
+sal_uInt32 SvHeaderTabListBox::Insert(
+    SvTreeListEntry* pEnt, SvTreeListEntry* pPar, sal_uInt32 nPos )
 {
-    sal_uLong n = SvTabListBox::Insert( pEnt, pPar, nPos );
+    sal_uInt32 n = SvTabListBox::Insert( pEnt, pPar, nPos );
     RecalculateAccessibleChildren();
     return n;
 }
 
-sal_uLong SvHeaderTabListBox::Insert( SvTreeListEntry* pEntry, sal_uLong nRootPos )
+sal_uInt32 SvHeaderTabListBox::Insert( SvTreeListEntry* pEntry, sal_uInt32 nRootPos )
 {
-    sal_uLong nPos = SvTabListBox::Insert( pEntry, nRootPos );
+    sal_uInt32 nPos = SvTabListBox::Insert( pEntry, nRootPos );
     RecalculateAccessibleChildren();
     return nPos;
 }
@@ -671,8 +671,8 @@ sal_Int32 SvHeaderTabListBox::GetCurrRow() const
     SvTreeListEntry* pEntry = GetCurEntry();
     if ( pEntry )
     {
-        sal_uLong nCount = GetEntryCount();
-        for ( sal_uLong i = 0; i < nCount; ++i )
+        sal_uInt32 nCount = GetEntryCount();
+        for ( sal_uInt32 i = 0; i < nCount; ++i )
         {
             if ( pEntry == GetEntry(i) )
             {
diff --git a/vcl/source/treelist/treelist.cxx b/vcl/source/treelist/treelist.cxx
index 38067fde34e7..6809eddb6a84 100644
--- a/vcl/source/treelist/treelist.cxx
+++ b/vcl/source/treelist/treelist.cxx
@@ -35,8 +35,8 @@ struct SvListView::Impl
 
     SvDataTable m_DataTable;  // Mapping SvTreeListEntry -> ViewData
 
-    sal_uLong   m_nVisibleCount;
-    sal_uLong   m_nSelectionCount;
+    sal_uInt32  m_nVisibleCount;
+    sal_uInt32  m_nSelectionCount;
     bool        m_bVisPositionsValid;
 
     explicit Impl(SvListView & rThis)
@@ -76,7 +76,7 @@ void SvTreeList::Broadcast(
     SvListAction nActionId,
     SvTreeListEntry* pEntry1,
     SvTreeListEntry* pEntry2,
-    sal_uLong nPos
+    sal_uInt32 nPos
 )
 {
     mrOwnerListView.ModelNotification(nActionId, pEntry1, pEntry2, nPos);
@@ -161,18 +161,18 @@ public:
     }
 };
 
-sal_uLong findEntryPosition(const SvTreeListEntries& rDst, const SvTreeListEntry* pEntry)
+sal_uInt32 findEntryPosition(const SvTreeListEntries& rDst, const SvTreeListEntry* pEntry)
 {
     SvTreeListEntries::const_iterator itPos = std::find_if(rDst.begin(), rDst.end(), FindByPointer(pEntry));
     if (itPos == rDst.end())
-        return static_cast<sal_uLong>(~0);
+        return static_cast<sal_uInt32>(~0);
 
-    return static_cast<sal_uLong>(std::distance(rDst.begin(), itPos));
+    return static_cast<sal_uInt32>(std::distance(rDst.begin(), itPos));
 }
 
 }
 
-sal_uLong SvTreeList::Move(SvTreeListEntry* pSrcEntry,SvTreeListEntry* pTargetParent,sal_uLong nListPos)
+sal_uInt32 SvTreeList::Move(SvTreeListEntry* pSrcEntry,SvTreeListEntry* pTargetParent,sal_uInt32 nListPos)
 {
     // pDest may be 0!
     DBG_ASSERT(pSrcEntry,"Entry?");
@@ -261,13 +261,13 @@ sal_uLong SvTreeList::Move(SvTreeListEntry* pSrcEntry,SvTreeListEntry* pTargetPa
     if (!bSameParent)
         SetListPositions(rSrc);
 
-    sal_uLong nRetVal = findEntryPosition(rDst, pSrcEntry);
+    sal_uInt32 nRetVal = findEntryPosition(rDst, pSrcEntry);
     OSL_ENSURE(nRetVal == pSrcEntry->GetChildListPos(), "ListPos not valid");
     Broadcast( SvListAction::MOVED,pSrcEntry,pTargetParent,nRetVal);
     return nRetVal;
 }
 
-sal_uLong SvTreeList::Copy(SvTreeListEntry* pSrcEntry,SvTreeListEntry* pTargetParent,sal_uLong nListPos)
+sal_uInt32 SvTreeList::Copy(SvTreeListEntry* pSrcEntry,SvTreeListEntry* pTargetParent,sal_uInt32 nListPos)
 {
     // pDest may be 0!
     DBG_ASSERT(pSrcEntry,"Entry?");
@@ -276,7 +276,7 @@ sal_uLong SvTreeList::Copy(SvTreeListEntry* pSrcEntry,SvTreeListEntry* pTargetPa
 
     bAbsPositionsValid = false;
 
-    sal_uLong nCloneCount = 0;
+    sal_uInt32 nCloneCount = 0;
     SvTreeListEntry* pClonedEntry = Clone( pSrcEntry, nCloneCount );
     nEntryCount += nCloneCount;
 
@@ -296,14 +296,14 @@ sal_uLong SvTreeList::Copy(SvTreeListEntry* pSrcEntry,SvTreeListEntry* pTargetPa
     SetListPositions(rDst); // correct list position in target list
 
     Broadcast( SvListAction::INSERTED_TREE, pClonedEntry );
-    sal_uLong nRetVal = findEntryPosition(rDst, pClonedEntry);
+    sal_uInt32 nRetVal = findEntryPosition(rDst, pClonedEntry);
     return nRetVal;
 }
 
 void SvTreeList::Move( SvTreeListEntry* pSrcEntry, SvTreeListEntry* pDstEntry )
 {
     SvTreeListEntry* pParent;
-    sal_uLong nPos;
+    sal_uInt32 nPos;
 
     if ( !pDstEntry )
     {
@@ -320,7 +320,7 @@ void SvTreeList::Move( SvTreeListEntry* pSrcEntry, SvTreeListEntry* pDstEntry )
 }
 
 void SvTreeList::InsertTree(SvTreeListEntry* pSrcEntry,
-    SvTreeListEntry* pTargetParent,sal_uLong nListPos)
+    SvTreeListEntry* pTargetParent,sal_uInt32 nListPos)
 {
     DBG_ASSERT(pSrcEntry,"InsertTree:Entry?");
     if ( !pSrcEntry )
@@ -362,7 +362,7 @@ SvTreeListEntry* SvTreeList::CloneEntry( SvTreeListEntry* pSource ) const
     return pEntry;
 }
 
-SvTreeListEntry* SvTreeList::Clone( SvTreeListEntry* pEntry, sal_uLong& nCloneCount ) const
+SvTreeListEntry* SvTreeList::Clone( SvTreeListEntry* pEntry, sal_uInt32& nCloneCount ) const
 {
     SvTreeListEntry* pClonedEntry = CloneEntry( pEntry );
     nCloneCount = 1;
@@ -374,7 +374,7 @@ SvTreeListEntry* SvTreeList::Clone( SvTreeListEntry* pEntry, sal_uLong& nCloneCo
 }
 
 void SvTreeList::CloneChildren(
-        SvTreeListEntries& rDst, sal_uLong& rCloneCount, SvTreeListEntries& rSrc, SvTreeListEntry& rNewParent) const
+        SvTreeListEntries& rDst, sal_uInt32& rCloneCount, SvTreeListEntries& rSrc, SvTreeListEntry& rNewParent) const
 {
     SvTreeListEntries aClone;
     for (auto const& elem : rSrc)
@@ -393,7 +393,7 @@ void SvTreeList::CloneChildren(
     rDst.swap(aClone);
 }
 
-sal_uLong SvTreeList::GetChildCount( const SvTreeListEntry* pParent ) const
+sal_uInt32 SvTreeList::GetChildCount( const SvTreeListEntry* pParent ) const
 {
     if ( !pParent )
         return GetEntryCount();
@@ -401,7 +401,7 @@ sal_uLong SvTreeList::GetChildCount( const SvTreeListEntry* pParent ) const
     if (pParent->m_Children.empty())
         return 0;
 
-    sal_uLong nCount = 0;
+    sal_uInt32 nCount = 0;
     sal_uInt16 nRefDepth = GetDepth( pParent );
     sal_uInt16 nActDepth = nRefDepth;
     do
@@ -413,7 +413,7 @@ sal_uLong SvTreeList::GetChildCount( const SvTreeListEntry* pParent ) const
     return nCount;
 }
 
-sal_uLong SvTreeList::GetVisibleChildCount(const SvListView* pView, SvTreeListEntry* pParent) const
+sal_uInt32 SvTreeList::GetVisibleChildCount(const SvListView* pView, SvTreeListEntry* pParent) const
 {
     DBG_ASSERT(pView,"GetVisChildCount:No View");
     if ( !pParent )
@@ -422,7 +422,7 @@ sal_uLong SvTreeList::GetVisibleChildCount(const SvListView* pView, SvTreeListEn
     if (!pParent || !pView->IsExpanded(pParent) || pParent->m_Children.empty())
         return 0;
 
-    sal_uLong nCount = 0;
+    sal_uInt32 nCount = 0;
     sal_uInt16 nRefDepth = GetDepth( pParent );
     sal_uInt16 nActDepth = nRefDepth;
     do
@@ -434,7 +434,7 @@ sal_uLong SvTreeList::GetVisibleChildCount(const SvListView* pView, SvTreeListEn
     return nCount;
 }
 
-sal_uLong SvTreeList::GetChildSelectionCount(const SvListView* pView,SvTreeListEntry* pParent) const
+sal_uInt32 SvTreeList::GetChildSelectionCount(const SvListView* pView,SvTreeListEntry* pParent) const
 {
     DBG_ASSERT(pView,"GetChildSelCount:No View");
     if ( !pParent )
@@ -443,7 +443,7 @@ sal_uLong SvTreeList::GetChildSelectionCount(const SvListView* pView,SvTreeListE
     if (!pParent || pParent->m_Children.empty())
         return 0;
 
-    sal_uLong nCount = 0;
+    sal_uInt32 nCount = 0;
     sal_uInt16 nRefDepth = GetDepth( pParent );
     sal_uInt16 nActDepth = nRefDepth;
     do
@@ -480,7 +480,7 @@ SvTreeListEntry* SvTreeList::Next( SvTreeListEntry* pActEntry, sal_uInt16* pDept
 
     // Get the list where the current entry belongs to (from its parent).
     SvTreeListEntries* pActualList = &pActEntry->pParent->m_Children;
-    sal_uLong nActualPos = pActEntry->GetChildListPos();
+    sal_uInt32 nActualPos = pActEntry->GetChildListPos();
 
     if (!pActEntry->m_Children.empty())
     {
@@ -527,7 +527,7 @@ SvTreeListEntry* SvTreeList::Prev( SvTreeListEntry* pActEntry ) const
     DBG_ASSERT(pActEntry!=nullptr,"Entry?");
 
     SvTreeListEntries* pActualList = &pActEntry->pParent->m_Children;
-    sal_uLong nActualPos = pActEntry->GetChildListPos();
+    sal_uInt32 nActualPos = pActEntry->GetChildListPos();
 
     if ( nActualPos > 0 )
     {
@@ -563,7 +563,7 @@ SvTreeListEntry* SvTreeList::Last() const
     return pEntry;
 }
 
-sal_uLong SvTreeList::GetVisiblePos( const SvListView* pView, SvTreeListEntry const * pEntry ) const
+sal_uInt32 SvTreeList::GetVisiblePos( const SvListView* pView, SvTreeListEntry const * pEntry ) const
 {
     DBG_ASSERT(pView&&pEntry,"View/Entry?");
 
@@ -577,7 +577,7 @@ sal_uLong SvTreeList::GetVisiblePos( const SvListView* pView, SvTreeListEntry co
     return pViewData->nVisPos;
 }
 
-sal_uLong SvTreeList::GetVisibleCount( SvListView* pView ) const
+sal_uInt32 SvTreeList::GetVisibleCount( SvListView* pView ) const
 {
     assert(pView && "GetVisCount:No View");
     if( !pView->HasViewData() )
@@ -585,7 +585,7 @@ sal_uLong SvTreeList::GetVisibleCount( SvListView* pView ) const
     if (pView->m_pImpl->m_nVisibleCount)
         return pView->m_pImpl->m_nVisibleCount;
 
-    sal_uLong nPos = 0;
+    sal_uInt32 nPos = 0;
     SvTreeListEntry* pEntry = First();  // first entry is always visible
     while ( pEntry )
     {
@@ -623,7 +623,7 @@ SvTreeListEntry* SvTreeList::NextVisible(const SvListView* pView,SvTreeListEntry
     }
 
     SvTreeListEntries* pActualList = &pActEntry->pParent->m_Children;
-    sal_uLong nActualPos = pActEntry->GetChildListPos();
+    sal_uInt32 nActualPos = pActEntry->GetChildListPos();
 
     if ( pView->IsExpanded(pActEntry) )
     {
@@ -676,7 +676,7 @@ SvTreeListEntry* SvTreeList::PrevVisible(const SvListView* pView, SvTreeListEntr
     sal_uInt16 nDepth = 0;
 
     SvTreeListEntries* pActualList = &pActEntry->pParent->m_Children;
-    sal_uLong nActualPos = pActEntry->GetChildListPos();
+    sal_uInt32 nActualPos = pActEntry->GetChildListPos();
 
     if ( nActualPos > 0 )
     {
@@ -715,7 +715,7 @@ SvTreeListEntry* SvTreeList::NextVisible(const SvListView* pView,SvTreeListEntry
 {
     DBG_ASSERT(pView&&pEntry&&IsEntryVisible(pView,pEntry),"NextVis:Wrong Prms/!Vis");
 
-    sal_uLong nVisPos = GetVisiblePos( pView, pEntry );
+    sal_uInt32 nVisPos = GetVisiblePos( pView, pEntry );
     // nDelta entries existent?
     // example: 0,1,2,3,4,5,6,7,8,9 nVisPos=5 nDelta=7
     //           nNewDelta = 10-nVisPos-1 == 4
@@ -738,7 +738,7 @@ SvTreeListEntry* SvTreeList::PrevVisible( const SvListView* pView, SvTreeListEnt
 {
     DBG_ASSERT(pView&&pEntry&&IsEntryVisible(pView,pEntry),"PrevVis:Parms/!Vis");
 
-    sal_uLong nVisPos = GetVisiblePos( pView, pEntry );
+    sal_uInt32 nVisPos = GetVisiblePos( pView, pEntry );
     // nDelta entries existent?
     // example: 0,1,2,3,4,5,6,7,8,9 nVisPos=8 nDelta=20
     //           nNewDelta = nNewVisPos
@@ -787,7 +787,7 @@ SvTreeListEntry* SvTreeList::NextSelected( const SvListView* pView, SvTreeListEn
     return pEntry;
 }
 
-sal_uLong SvTreeList::Insert( SvTreeListEntry* pEntry,SvTreeListEntry* pParent,sal_uLong nPos )
+sal_uInt32 SvTreeList::Insert( SvTreeListEntry* pEntry,SvTreeListEntry* pParent,sal_uInt32 nPos )
 {
     DBG_ASSERT( pEntry,"Entry?");
 
@@ -821,21 +821,21 @@ sal_uLong SvTreeList::Insert( SvTreeListEntry* pEntry,SvTreeListEntry* pParent,s
     return nPos; // pEntry->nListPos;
 }
 
-sal_uLong SvTreeList::GetAbsPos( const SvTreeListEntry* pEntry) const
+sal_uInt32 SvTreeList::GetAbsPos( const SvTreeListEntry* pEntry) const
 {
     if ( !bAbsPositionsValid )
         const_cast<SvTreeList*>(this)->SetAbsolutePositions();
     return pEntry->nAbsPos;
 }
 
-sal_uLong SvTreeList::GetRelPos( const SvTreeListEntry* pChild )
+sal_uInt32 SvTreeList::GetRelPos( const SvTreeListEntry* pChild )
 {
     return pChild->GetChildListPos();
 }
 
 void SvTreeList::SetAbsolutePositions()
 {
-    sal_uLong nPos = 0;
+    sal_uInt32 nPos = 0;
     SvTreeListEntry* pEntry = First();
     while ( pEntry )
     {
@@ -925,7 +925,7 @@ bool SvTreeList::Remove( const SvTreeListEntry* pEntry )
     }
 
     Broadcast(SvListAction::REMOVING, const_cast<SvTreeListEntry*>(pEntry));
-    sal_uLong nRemoved = 1 + GetChildCount(pEntry);
+    sal_uInt32 nRemoved = 1 + GetChildCount(pEntry);
     bAbsPositionsValid = false;
 
     SvTreeListEntry* pParent = pEntry->pParent;
@@ -966,7 +966,7 @@ bool SvTreeList::Remove( const SvTreeListEntry* pEntry )
     return true;
 }
 
-SvTreeListEntry* SvTreeList::GetEntryAtAbsPos( sal_uLong nAbsPos ) const
+SvTreeListEntry* SvTreeList::GetEntryAtAbsPos( sal_uInt32 nAbsPos ) const
 {
     SvTreeListEntry* pEntry = First();
     while ( nAbsPos && pEntry )
@@ -977,7 +977,7 @@ SvTreeListEntry* SvTreeList::GetEntryAtAbsPos( sal_uLong nAbsPos ) const
     return pEntry;
 }
 
-SvTreeListEntry* SvTreeList::GetEntryAtVisPos( const SvListView* pView, sal_uLong nVisPos ) const
+SvTreeListEntry* SvTreeList::GetEntryAtVisPos( const SvListView* pView, sal_uInt32 nVisPos ) const
 {
     DBG_ASSERT(pView,"GetEntryAtVisPos:No View");
     SvTreeListEntry* pEntry = First();
@@ -1044,7 +1044,7 @@ SvListView::~SvListView()
     m_pImpl->m_DataTable.clear();
 }
 
-sal_uLong SvListView::GetSelectionCount() const
+sal_uInt32 SvListView::GetSelectionCount() const
 { return m_pImpl->m_nSelectionCount; }
 
 bool SvListView::HasViewData() const
@@ -1210,11 +1210,11 @@ void SvListView::Impl::ActionRemoving( SvTreeListEntry* pEntry )
     DBG_ASSERT(pEntry,"Remove:No Entry");
 
     SvViewDataEntry* pViewData = m_DataTable.find( pEntry )->second.get();
-    sal_uLong nSelRemoved = 0;
+    sal_uInt32 nSelRemoved = 0;
     if ( pViewData->IsSelected() )
         nSelRemoved = 1 + m_rThis.pModel->GetChildSelectionCount(&m_rThis, pEntry);
     m_nSelectionCount -= nSelRemoved;
-    sal_uLong nVisibleRemoved = 0;
+    sal_uInt32 nVisibleRemoved = 0;
     if (m_rThis.pModel->IsEntryVisible(&m_rThis, pEntry))
         nVisibleRemoved = 1 + m_rThis.pModel->GetVisibleChildCount(&m_rThis, pEntry);
     if( m_nVisibleCount )
@@ -1246,7 +1246,7 @@ void SvListView::Impl::ActionClear()
 }
 
 void SvListView::ModelNotification( SvListAction nActionId, SvTreeListEntry* pEntry1,
-                        SvTreeListEntry* /*pEntry2*/, sal_uLong /*nPos*/ )
+                        SvTreeListEntry* /*pEntry2*/, sal_uInt32 /*nPos*/ )
 {
 
     switch( nActionId )
@@ -1425,7 +1425,7 @@ void SvTreeList::ResortChildren( SvTreeListEntry* pParent )
 }
 
 void SvTreeList::GetInsertionPos( SvTreeListEntry const * pEntry, SvTreeListEntry* pParent,
-    sal_uLong& rPos )
+    sal_uInt32& rPos )
 {
     DBG_ASSERT(pEntry,"No Entry");
 
@@ -1472,7 +1472,7 @@ void SvTreeList::GetInsertionPos( SvTreeListEntry const * pEntry, SvTreeListEntr
         rPos = k;
 }
 
-SvTreeListEntry* SvTreeList::GetEntry( SvTreeListEntry* pParent, sal_uLong nPos ) const
+SvTreeListEntry* SvTreeList::GetEntry( SvTreeListEntry* pParent, sal_uInt32 nPos ) const
 {   if ( !pParent )
         pParent = pRootItem.get();
     SvTreeListEntry* pRet = nullptr;
@@ -1481,7 +1481,7 @@ SvTreeListEntry* SvTreeList::GetEntry( SvTreeListEntry* pParent, sal_uLong nPos
     return pRet;
 }
 
-SvTreeListEntry* SvTreeList::GetEntry( sal_uLong nRootPos ) const
+SvTreeListEntry* SvTreeList::GetEntry( sal_uInt32 nRootPos ) const
 {
     SvTreeListEntry* pRet = nullptr;
     if (nEntryCount && nRootPos < pRootItem->m_Children.size())
diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx
index 8fa1ff9bbd0f..b19118346b76 100644
--- a/vcl/source/treelist/treelistbox.cxx
+++ b/vcl/source/treelist/treelistbox.cxx
@@ -431,17 +431,17 @@ IMPL_LINK( SvTreeListBox, CloneHdl_Impl, SvTreeListEntry*, pEntry, SvTreeListEnt
     return CloneEntry(pEntry);
 }
 
-sal_uLong SvTreeListBox::Insert( SvTreeListEntry* pEntry, SvTreeListEntry* pParent, sal_uLong nPos )
+sal_uInt32 SvTreeListBox::Insert( SvTreeListEntry* pEntry, SvTreeListEntry* pParent, sal_uInt32 nPos )
 {
-    sal_uLong nInsPos = pModel->Insert( pEntry, pParent, nPos );
+    sal_uInt32 nInsPos = pModel->Insert( pEntry, pParent, nPos );
     pEntry->SetBackColor( GetBackground().GetColor() );
     SetAlternatingRowColors( mbAlternatingRowColors );
     return nInsPos;
 }
 
-sal_uLong SvTreeListBox::Insert( SvTreeListEntry* pEntry,sal_uLong nRootPos )
+sal_uInt32 SvTreeListBox::Insert( SvTreeListEntry* pEntry,sal_uInt32 nRootPos )
 {
-    sal_uLong nInsPos = pModel->Insert( pEntry, nRootPos );
+    sal_uInt32 nInsPos = pModel->Insert( pEntry, nRootPos );
     pEntry->SetBackColor( GetBackground().GetColor() );
     SetAlternatingRowColors( mbAlternatingRowColors );
     return nInsPos;
@@ -511,7 +511,7 @@ TriState SvTreeListBox::NotifyMoving(
     const SvTreeListEntry*  pEntry,        // entry that we want to move, from
                                  // GetSourceListBox()->GetModel()
     SvTreeListEntry*& rpNewParent,   // new target parent
-    sal_uLong&        rNewChildPos)  // position in childlist of target parent
+    sal_uInt32&        rNewChildPos)  // position in childlist of target parent
 {
     DBG_ASSERT(pEntry,"NotifyMoving:SourceEntry?");
     if( !pTarget )
@@ -545,7 +545,7 @@ TriState SvTreeListBox::NotifyCopying(
     const SvTreeListEntry*  pEntry,        // entry that we want to move, from
                                  // GetSourceListBox()->GetModel()
     SvTreeListEntry*& rpNewParent,   // new target parent
-    sal_uLong&        rNewChildPos)  // position in childlist of target parent
+    sal_uInt32&        rNewChildPos)  // position in childlist of target parent
 {
     return NotifyMoving(pTarget,pEntry,rpNewParent,rNewChildPos);
 }
@@ -580,19 +580,19 @@ bool SvTreeListBox::CopySelection( SvTreeListBox* pSource, SvTreeListEntry* pTar
     {
         pSourceEntry = elem;
         SvTreeListEntry* pNewParent = nullptr;
-        sal_uLong nInsertionPos = TREELIST_APPEND;
+        sal_uInt32 nInsertionPos = TREELIST_APPEND;
         TriState nOk = NotifyCopying(pTarget,pSourceEntry,pNewParent,nInsertionPos);
         if ( nOk )
         {
             if ( bClone )
             {
-                sal_uLong nCloneCount = 0;
+                sal_uInt32 nCloneCount = 0;
                 pSourceEntry = pModel->Clone(pSourceEntry, nCloneCount);
                 pModel->InsertTree(pSourceEntry, pNewParent, nInsertionPos);
             }
             else
             {
-                sal_uLong nListPos = pModel->Copy(pSourceEntry, pNewParent, nInsertionPos);
+                sal_uInt32 nListPos = pModel->Copy(pSourceEntry, pNewParent, nInsertionPos);
                 pSourceEntry = GetEntry( pNewParent, nListPos );
             }
         }
@@ -630,7 +630,7 @@ bool SvTreeListBox::MoveSelectionCopyFallbackPossible( SvTreeListBox* pSource, S
     {
         pSourceEntry = elem;
         SvTreeListEntry* pNewParent = nullptr;
-        sal_uLong nInsertionPos = TREELIST_APPEND;
+        sal_uInt32 nInsertionPos = TREELIST_APPEND;
         TriState nOk = NotifyMoving(pTarget,pSourceEntry,pNewParent,nInsertionPos);
         TriState nCopyOk = nOk;
         if ( !nOk && bAllowCopyFallback )
@@ -643,7 +643,7 @@ bool SvTreeListBox::MoveSelectionCopyFallbackPossible( SvTreeListBox* pSource, S
         {
             if ( bClone )
             {
-                sal_uLong nCloneCount = 0;
+                sal_uInt32 nCloneCount = 0;
                 pSourceEntry = pModel->Clone(pSourceEntry, nCloneCount);
                 pModel->InsertTree(pSourceEntry, pNewParent, nInsertionPos);
             }
@@ -725,12 +725,12 @@ void SvTreeListBox::OnCurrentEntryChanged()
         mpImpl->m_aQuickSelectionEngine.Reset();
 }
 
-SvTreeListEntry* SvTreeListBox::GetEntry( SvTreeListEntry* pParent, sal_uLong nPos ) const
+SvTreeListEntry* SvTreeListBox::GetEntry( SvTreeListEntry* pParent, sal_uInt32 nPos ) const
 {
     return pModel->GetEntry(pParent, nPos);
 }
 
-SvTreeListEntry* SvTreeListBox::GetEntry( sal_uLong nRootPos ) const
+SvTreeListEntry* SvTreeListBox::GetEntry( sal_uInt32 nRootPos ) const
 {
     return pModel->GetEntry(nRootPos);
 }
@@ -760,7 +760,7 @@ void SvTreeListBox::FillEntryPath( SvTreeListEntry* pEntry, ::std::deque< sal_In
     SvTreeListEntry* pParentEntry = GetParent( pEntry );
     while ( true )
     {
-        sal_uLong i, nCount = GetLevelChildCount( pParentEntry );
+        sal_uInt32 i, nCount = GetLevelChildCount( pParentEntry );
         for ( i = 0; i < nCount; ++i )
         {
             SvTreeListEntry* pTemp = GetEntry( pParentEntry, i );
@@ -787,12 +787,12 @@ SvTreeListEntry* SvTreeListBox::GetParent( SvTreeListEntry* pEntry ) const
     return pModel->GetParent(pEntry);
 }
 
-sal_uLong SvTreeListBox::GetChildCount( SvTreeListEntry const * pParent ) const
+sal_uInt32 SvTreeListBox::GetChildCount( SvTreeListEntry const * pParent ) const
 {
     return pModel->GetChildCount(pParent);
 }
 
-sal_uLong SvTreeListBox::GetLevelChildCount( SvTreeListEntry* _pParent ) const
+sal_uInt32 SvTreeListBox::GetLevelChildCount( SvTreeListEntry* _pParent ) const
 {
 
     //if _pParent is 0, then pEntry is the first child of the root.
@@ -1211,26 +1211,24 @@ DragDropMode SvTreeListBox::NotifyStartDrag()
 
 namespace
 {
-    struct SortLBoxes : public rtl::Static<std::set<sal_uLong>, SortLBoxes> {};
+    // void* to avoid loplugin:vclwidgets, we don't need ownership here
+    std::set<const void*> gSortLBoxes;
 }
 
 void SvTreeListBox::AddBoxToDDList_Impl( const SvTreeListBox& rB )
 {
-    sal_uLong nVal = reinterpret_cast<sal_uLong>(&rB);
-    SortLBoxes::get().insert( nVal );
+    gSortLBoxes.insert( &rB );
 }
 
 void SvTreeListBox::RemoveBoxFromDDList_Impl( const SvTreeListBox& rB )
 {
-    sal_uLong nVal = reinterpret_cast<sal_uLong>(&rB);
-    SortLBoxes::get().erase( nVal );
+    gSortLBoxes.erase( &rB );
 }
 
 IMPL_LINK( SvTreeListBox, DragFinishHdl_Impl, sal_Int8, nAction, void )
 {
-    sal_uLong nVal = reinterpret_cast<sal_uLong>(this);
-    std::set<sal_uLong> &rSortLBoxes = SortLBoxes::get();
-    std::set<sal_uLong>::const_iterator it = rSortLBoxes.find(nVal);
+    auto &rSortLBoxes = gSortLBoxes;
+    auto it = rSortLBoxes.find(this);
     if( it != rSortLBoxes.end() )
     {
         DragFinished( nAction );
@@ -1542,7 +1540,7 @@ IMPL_LINK( SvTreeListBox, CheckButtonClick, SvLBoxButtonData *, pData, void )
 SvTreeListEntry* SvTreeListBox::InsertEntry(
     const OUString& rText,
     SvTreeListEntry* pParent,
-    bool bChildrenOnDemand, sal_uLong nPos,
+    bool bChildrenOnDemand, sal_uInt32 nPos,
     void* pUser
 )
 {
@@ -1574,7 +1572,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 )
+    SvTreeListEntry* pParent, bool bChildrenOnDemand, sal_uInt32 nPos, void* pUser )
 {
     nTreeFlags |= SvTreeFlags::MANINS;
 
@@ -2149,10 +2147,10 @@ bool SvTreeListBox::Select( SvTreeListEntry* pEntry, bool bSelect )
     return bRetVal;
 }
 
-sal_uLong SvTreeListBox::SelectChildren( SvTreeListEntry* pParent, bool bSelect )
+sal_uInt32 SvTreeListBox::SelectChildren( SvTreeListEntry* pParent, bool bSelect )
 {
     pImpl->DestroyAnchor();
-    sal_uLong nRet = 0;
+    sal_uInt32 nRet = 0;
     if( !pParent->HasChildren() )
         return 0;
     sal_uInt16 nRefDepth = pModel->GetDepth( pParent );
@@ -3340,7 +3338,7 @@ IMPL_LINK( SvTreeListBox, DefaultCompare, const SvSortData&, rData, sal_Int32 )
 }
 
 void SvTreeListBox::ModelNotification( SvListAction nActionId, SvTreeListEntry* pEntry1,
-                        SvTreeListEntry* pEntry2, sal_uLong nPos )
+                        SvTreeListEntry* pEntry2, sal_uInt32 nPos )
 {
     SolarMutexGuard aSolarGuard;
 
diff --git a/vcl/source/treelist/treelistentry.cxx b/vcl/source/treelist/treelistentry.cxx
index 46f95aad2f15..c369b733283b 100644
--- a/vcl/source/treelist/treelistentry.cxx
+++ b/vcl/source/treelist/treelistentry.cxx
@@ -30,7 +30,7 @@ void SvTreeListEntry::ClearChildren()
 
 void SvTreeListEntry::SetListPositions()
 {
-    sal_uLong nCur = 0;
+    sal_uInt32 nCur = 0;
     for (auto const& pEntry : m_Children)
     {
         SvTreeListEntry& rEntry = *pEntry;
@@ -78,7 +78,7 @@ bool SvTreeListEntry::HasChildListPos() const
     return pParent && !(pParent->nListPos & 0x80000000);
 }
 
-sal_uLong SvTreeListEntry::GetChildListPos() const
+sal_uInt32 SvTreeListEntry::GetChildListPos() const
 {
     if( pParent && (pParent->nListPos & 0x80000000) )
         pParent->SetListPositions();
@@ -210,7 +210,7 @@ void SvTreeListEntry::SetFlags( SvTLEntryFlags nFlags )
 SvTreeListEntry* SvTreeListEntry::NextSibling() const
 {
     SvTreeListEntries& rList = pParent->m_Children;
-    sal_uLong nPos = GetChildListPos();
+    sal_uInt32 nPos = GetChildListPos();
     nPos++;
     return (nPos < rList.size()) ? rList[nPos].get() : nullptr;
 }
@@ -218,7 +218,7 @@ SvTreeListEntry* SvTreeListEntry::NextSibling() const
 SvTreeListEntry* SvTreeListEntry::PrevSibling() const
 {
     SvTreeListEntries& rList = pParent->m_Children;
-    sal_uLong nPos = GetChildListPos();
+    sal_uInt32 nPos = GetChildListPos();
     if ( nPos == 0 )
         return nullptr;
     nPos--;


More information about the Libreoffice-commits mailing list