summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2016-08-26 01:26:38 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-08-26 07:51:19 +0000
commitef699b4d41cc602322d980027956aab636c776d5 (patch)
tree65856032b9b3bd285558f5fb6d6b21598a50d548
parent213a11b94caf28ffae927169ebd372a866f8f9b2 (diff)
convert SV_ITEM_ID_LBOX defines to scoped enum
and remove unused SV_ITEM_ID_EXTENDRLBOXSTRING Change-Id: Ic84d9341d0225b01b9ef46814483c66b1af307b5 Reviewed-on: https://gerrit.libreoffice.org/28397 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--accessibility/source/extended/accessiblelistboxentry.cxx2
-rw-r--r--cui/source/options/fontsubs.cxx4
-rw-r--r--cui/source/options/optfltr.cxx8
-rw-r--r--cui/source/options/optlingu.cxx4
-rw-r--r--cui/source/tabpages/autocdlg.cxx4
-rw-r--r--cui/source/tabpages/macroass.cxx2
-rw-r--r--dbaccess/source/ui/app/AppDetailView.cxx2
-rw-r--r--dbaccess/source/ui/browser/dsEntriesNoExp.cxx2
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx4
-rw-r--r--dbaccess/source/ui/control/dbtreelistbox.cxx4
-rw-r--r--dbaccess/source/ui/control/listviewitems.cxx4
-rw-r--r--dbaccess/source/ui/control/tabletree.cxx4
-rw-r--r--dbaccess/source/ui/dlg/tablespage.cxx4
-rw-r--r--dbaccess/source/ui/inc/listviewitems.hxx4
-rw-r--r--include/svtools/svlbitm.hxx8
-rw-r--r--include/svtools/treelistbox.hxx8
-rw-r--r--include/svtools/treelistentry.hxx4
-rw-r--r--sc/source/ui/miscdlgs/acredlin.cxx8
-rw-r--r--sc/source/ui/miscdlgs/solveroptions.cxx4
-rw-r--r--sc/source/ui/xmlsource/xmlsourcedlg.cxx2
-rw-r--r--svtools/source/contnr/iconview.cxx4
-rw-r--r--svtools/source/contnr/simptabl.cxx8
-rw-r--r--svtools/source/contnr/svimpbox.cxx8
-rw-r--r--svtools/source/contnr/svlbitm.cxx16
-rw-r--r--svtools/source/contnr/svtabbx.cxx12
-rw-r--r--svtools/source/contnr/treelistbox.cxx45
-rw-r--r--svtools/source/contnr/treelistentry.cxx14
-rw-r--r--svx/source/dialog/checklbx.cxx2
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx8
-rw-r--r--sw/source/ui/index/cnttab.cxx2
-rw-r--r--sw/source/uibase/utlui/content.cxx2
-rw-r--r--sw/source/uibase/utlui/glbltree.cxx2
32 files changed, 102 insertions, 107 deletions
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx
index 0999c432a19a..a087d6f625bd 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -462,7 +462,7 @@ namespace accessibility
while( iCount < iTotleItemCount )
{
const SvLBoxItem& rItem = pEntry->GetItem( iCount );
- if ( rItem.GetType() == SV_ITEM_ID_LBOXSTRING &&
+ if ( rItem.GetType() == SvLBoxItemType::String &&
!static_cast<const SvLBoxString&>( rItem ).GetText().isEmpty() )
{
iRealItemCount++;
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx
index 458027530d46..239e6895b4d0 100644
--- a/cui/source/options/fontsubs.cxx
+++ b/cui/source/options/fontsubs.cxx
@@ -511,7 +511,7 @@ void SvxFontSubstCheckListBox::SetCheckButtonState( SvTreeListEntry* pEntry, sal
{
SvLBoxButton& rItem = static_cast<SvLBoxButton&>(pEntry->GetItem(nCol + 1));
- if (rItem.GetType() == SV_ITEM_ID_LBOXBUTTON)
+ if (rItem.GetType() == SvLBoxItemType::Button)
{
switch( eState )
{
@@ -536,7 +536,7 @@ SvButtonState SvxFontSubstCheckListBox::GetCheckButtonState( SvTreeListEntry* pE
SvButtonState eState = SvButtonState::Unchecked;
SvLBoxButton& rItem = static_cast<SvLBoxButton&>(pEntry->GetItem(nCol + 1));
- if (rItem.GetType() == SV_ITEM_ID_LBOXBUTTON)
+ if (rItem.GetType() == SvLBoxItemType::Button)
{
SvItemStateFlags nButtonFlags = rItem.GetButtonFlags();
eState = SvLBoxButtonData::ConvertToButtonState( nButtonFlags );
diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx
index 0602cef6ae78..e7f3057902a8 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -236,7 +236,7 @@ bool OfaMSFilterTabPage2::FillItemSet( SfxItemSet* )
if( pEntry )
{
SvLBoxButton& rItem = static_cast<SvLBoxButton&>(pEntry->GetItem( nCol ));
- if (rItem.GetType() == SV_ITEM_ID_LBOXBUTTON)
+ if (rItem.GetType() == SvLBoxItemType::Button)
{
SvItemStateFlags nButtonFlags = rItem.GetButtonFlags();
bCheck = SvButtonState::Checked ==
@@ -304,7 +304,7 @@ void OfaMSFilterTabPage2::Reset( const SfxItemSet* )
if( pEntry )
{
SvLBoxButton& rItem = static_cast<SvLBoxButton&>(pEntry->GetItem( nCol ));
- if (rItem.GetType() == SV_ITEM_ID_LBOXBUTTON)
+ if (rItem.GetType() == SvLBoxItemType::Button)
{
if( (rOpt.*pArr->FnIs)() )
rItem.SetStateChecked();
@@ -393,7 +393,7 @@ void OfaMSFilterTabPage2::MSFltrSimpleTable::SetCheckButtonState(
{
SvLBoxButton& rItem = static_cast<SvLBoxButton&>(pEntry->GetItem(nCol + 1));
- if (rItem.GetType() == SV_ITEM_ID_LBOXBUTTON)
+ if (rItem.GetType() == SvLBoxItemType::Button)
{
switch( eState )
{
@@ -419,7 +419,7 @@ SvButtonState OfaMSFilterTabPage2::MSFltrSimpleTable::GetCheckButtonState(
SvButtonState eState = SvButtonState::Unchecked;
SvLBoxButton& rItem = static_cast<SvLBoxButton&>(pEntry->GetItem(nCol + 1));
- if (rItem.GetType() == SV_ITEM_ID_LBOXBUTTON)
+ if (rItem.GetType() == SvLBoxItemType::Button)
{
SvItemStateFlags nButtonFlags = rItem.GetButtonFlags();
eState = SvLBoxButtonData::ConvertToButtonState( nButtonFlags );
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 887d5fd92e42..d9718f9ef618 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -243,10 +243,10 @@ DicUserData::DicUserData(
static void lcl_SetCheckButton( SvTreeListEntry* pEntry, bool bCheck )
{
- SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
+ SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SvLBoxItemType::Button));
DBG_ASSERT(pItem,"SetCheckButton:Item not found");
- if (pItem->GetType() == SV_ITEM_ID_LBOXBUTTON)
+ if (pItem->GetType() == SvLBoxItemType::Button)
{
if (bCheck)
pItem->SetStateChecked();
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index f19be92a7cd8..489ef2a00c03 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -796,7 +796,7 @@ void OfaACorrCheckListBox::SetCheckButtonState( SvTreeListEntry* pEntry, sal_uIn
{
SvLBoxButton& rItem = static_cast<SvLBoxButton&>(pEntry->GetItem(nCol + 1));
- if (rItem.GetType() == SV_ITEM_ID_LBOXBUTTON)
+ if (rItem.GetType() == SvLBoxItemType::Button)
{
switch( eState )
{
@@ -821,7 +821,7 @@ SvButtonState OfaACorrCheckListBox::GetCheckButtonState( SvTreeListEntry* pEntry
SvButtonState eState = SvButtonState::Unchecked;
SvLBoxButton& rItem = static_cast<SvLBoxButton&>(pEntry->GetItem(nCol + 1));
- if (rItem.GetType() == SV_ITEM_ID_LBOXBUTTON)
+ if (rItem.GetType() == SvLBoxItemType::Button)
{
SvItemStateFlags nButtonFlags = rItem.GetButtonFlags();
eState = SvLBoxButtonData::ConvertToButtonState( nButtonFlags );
diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx
index 7972967610f5..b95b6a14fe7d 100644
--- a/cui/source/tabpages/macroass.cxx
+++ b/cui/source/tabpages/macroass.cxx
@@ -436,7 +436,7 @@ void SfxMacroTabPage::FillEvents()
if( pE )
{
SvLBoxString& rLItem = static_cast<SvLBoxString&>( pE->GetItem( LB_MACROS_ITEMPOS ) );
- DBG_ASSERT( SV_ITEM_ID_LBOXSTRING == rLItem.GetType(), "SfxMacroTabPage::FillEvents(): no LBoxString" );
+ DBG_ASSERT( SvLBoxItemType::String == rLItem.GetType(), "SfxMacroTabPage::FillEvents(): no LBoxString" );
OUString sOld( rLItem.GetText() );
OUString sNew;
diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx
index 879dcd545e88..0b2e9b9c9b6d 100644
--- a/dbaccess/source/ui/app/AppDetailView.cxx
+++ b/dbaccess/source/ui/app/AppDetailView.cxx
@@ -155,7 +155,7 @@ Rectangle OCreationList::GetFocusRect( SvTreeListEntry* _pEntry, long _nLine )
aRect.Left() = 0;
// try to let the focus rect start before the bitmap item - this looks better
- SvLBoxItem* pBitmapItem = _pEntry->GetFirstItem( SV_ITEM_ID_LBOXCONTEXTBMP );
+ SvLBoxItem* pBitmapItem = _pEntry->GetFirstItem(SvLBoxItemType::ContextBmp);
SvLBoxTab* pTab = pBitmapItem ? GetTab( _pEntry, pBitmapItem ) : nullptr;
SvViewDataItem* pItemData = pBitmapItem ? GetViewDataItem( _pEntry, pBitmapItem ) : nullptr;
OSL_ENSURE( pTab && pItemData, "OCreationList::GetFocusRect: could not find the first bitmap item!" );
diff --git a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
index 17ea461e8c0e..76629da8f0ad 100644
--- a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
+++ b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx
@@ -232,7 +232,7 @@ void SbaTableQueryBrowser::notifyHiContrastChanged()
for (sal_uInt16 i=0;i<nCount;++i)
{
SvLBoxItem& rItem = pEntryLoop->GetItem(i);
- if (rItem.GetType() != SV_ITEM_ID_LBOXCONTEXTBMP)
+ if (rItem.GetType() != SvLBoxItemType::ContextBmp)
continue;
SvLBoxContextBmp& rContextBitmapItem = static_cast< SvLBoxContextBmp& >( rItem );
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index a0d9ac0f12bc..6069119ee8f8 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -3382,8 +3382,8 @@ IMPL_LINK_TYPED( SbaTableQueryBrowser, OnTreeEntryCompare, const SvSortData&, _r
return 0;
}
- const SvLBoxString* pLeftTextItem = static_cast<const SvLBoxString*>(pLHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
- const SvLBoxString* pRightTextItem = static_cast<const SvLBoxString*>(pRHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ const SvLBoxString* pLeftTextItem = static_cast<const SvLBoxString*>(pLHS->GetFirstItem(SvLBoxItemType::String));
+ const SvLBoxString* pRightTextItem = static_cast<const SvLBoxString*>(pRHS->GetFirstItem(SvLBoxItemType::String));
OSL_ENSURE(pLeftTextItem && pRightTextItem, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid text items!");
OUString sLeftText = pLeftTextItem->GetText();
diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx
index e75a7449f211..e196a06de816 100644
--- a/dbaccess/source/ui/control/dbtreelistbox.cxx
+++ b/dbaccess/source/ui/control/dbtreelistbox.cxx
@@ -104,7 +104,7 @@ SvTreeListEntry* DBTreeListBox::GetEntryPosByName( const OUString& aName, SvTree
{
pEntry = (*it).get();
const SvLBoxString* pItem = static_cast<const SvLBoxString*>(
- pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ pEntry->GetFirstItem(SvLBoxItemType::String));
if (pItem && pItem->GetText().equals(aName))
{
@@ -137,7 +137,7 @@ void DBTreeListBox::RequestingChildren( SvTreeListEntry* pParent )
void DBTreeListBox::InitEntry(SvTreeListEntry* _pEntry, const OUString& aStr, const Image& _rCollEntryBmp, const Image& _rExpEntryBmp, SvLBoxButtonKind eButtonKind)
{
SvTreeListBox::InitEntry( _pEntry, aStr, _rCollEntryBmp,_rExpEntryBmp, eButtonKind);
- SvLBoxItem* pTextItem(_pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ SvLBoxItem* pTextItem(_pEntry->GetFirstItem(SvLBoxItemType::String));
_pEntry->ReplaceItem(o3tl::make_unique<OBoldListboxString>(aStr), _pEntry->GetPos(pTextItem));
}
diff --git a/dbaccess/source/ui/control/listviewitems.cxx b/dbaccess/source/ui/control/listviewitems.cxx
index d1d6deedf4db..15c978e2e68b 100644
--- a/dbaccess/source/ui/control/listviewitems.cxx
+++ b/dbaccess/source/ui/control/listviewitems.cxx
@@ -39,9 +39,9 @@ namespace dbaui
pView->Pop();
}
- sal_uInt16 OBoldListboxString::GetType() const
+ SvLBoxItemType OBoldListboxString::GetType() const
{
- return SV_ITEM_ID_BOLDLBSTRING;
+ return SvLBoxItemType::String;
}
void OBoldListboxString::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext,
diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx
index ac69822cac49..2dbe195c3591 100644
--- a/dbaccess/source/ui/control/tabletree.cxx
+++ b/dbaccess/source/ui/control/tabletree.cxx
@@ -113,7 +113,7 @@ void OTableTreeListBox::notifyHiContrastChanged()
for (size_t i=0;i<nCount;++i)
{
SvLBoxItem& rItem = pEntryLoop->GetItem(i);
- if (rItem.GetType() == SV_ITEM_ID_LBOXCONTEXTBMP)
+ if (rItem.GetType() == SvLBoxItemType::ContextBmp)
{
SvLBoxContextBmp& rContextBitmapItem = static_cast< SvLBoxContextBmp& >( rItem );
@@ -404,7 +404,7 @@ void OTableTreeListBox::InitEntry(SvTreeListEntry* _pEntry, const OUString& _rSt
OMarkableTreeListBox::InitEntry(_pEntry, _rString, _rCollapsedBitmap, _rExpandedBitmap, _eButtonKind);
// replace the text item with our own one
- SvLBoxItem* pTextItem = _pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING);
+ SvLBoxItem* pTextItem = _pEntry->GetFirstItem(SvLBoxItemType::String);
OSL_ENSURE(pTextItem, "OTableTreeListBox::InitEntry: no text item!?");
size_t nTextPos = _pEntry->GetPos(pTextItem);
OSL_ENSURE(SvTreeListEntry::ITEM_NOT_FOUND != nTextPos, "OTableTreeListBox::InitEntry: no text item pos!");
diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx
index 53062db32fa9..7cacd382dc2c 100644
--- a/dbaccess/source/ui/dlg/tablespage.cxx
+++ b/dbaccess/source/ui/dlg/tablespage.cxx
@@ -411,8 +411,8 @@ namespace dbaui
const SvTreeListEntry* pRHS = static_cast<const SvTreeListEntry*>(_rSortData.pRight);
OSL_ENSURE(pLHS && pRHS, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid tree entries!");
- const SvLBoxString* pLeftTextItem = static_cast<const SvLBoxString*>(pLHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
- const SvLBoxString* pRightTextItem = static_cast<const SvLBoxString*>(pRHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ const SvLBoxString* pLeftTextItem = static_cast<const SvLBoxString*>(pLHS->GetFirstItem(SvLBoxItemType::String));
+ const SvLBoxString* pRightTextItem = static_cast<const SvLBoxString*>(pRHS->GetFirstItem(SvLBoxItemType::String));
OSL_ENSURE(pLeftTextItem && pRightTextItem, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid text items!");
OUString sLeftText = pLeftTextItem->GetText();
diff --git a/dbaccess/source/ui/inc/listviewitems.hxx b/dbaccess/source/ui/inc/listviewitems.hxx
index 134d0f641d28..15cc9c609eb2 100644
--- a/dbaccess/source/ui/inc/listviewitems.hxx
+++ b/dbaccess/source/ui/inc/listviewitems.hxx
@@ -25,7 +25,7 @@
namespace dbaui
{
- #define SV_ITEM_ID_BOLDLBSTRING SV_ITEM_ID_LBOXSTRING
+ #define SV_ITEM_ID_BOLDLBSTRING SvLBoxItemType::String
// OBoldListboxString
class OBoldListboxString : public SvLBoxString
@@ -39,7 +39,7 @@ namespace dbaui
{
}
- virtual sal_uInt16 GetType() const override;
+ virtual SvLBoxItemType GetType() const override;
virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext,
const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) override;
diff --git a/include/svtools/svlbitm.hxx b/include/svtools/svlbitm.hxx
index 83cbf2c2d68c..2e5f83e107ec 100644
--- a/include/svtools/svlbitm.hxx
+++ b/include/svtools/svlbitm.hxx
@@ -110,7 +110,7 @@ public:
SvLBoxString();
virtual ~SvLBoxString();
- virtual sal_uInt16 GetType() const override;
+ virtual SvLBoxItemType GetType() const override;
virtual void InitViewData(SvTreeListBox* pView,
SvTreeListEntry* pEntry,
SvViewDataItem* pViewData = nullptr) override;
@@ -139,7 +139,7 @@ class SvLBoxBmp : public SvLBoxItem
public:
SvLBoxBmp();
virtual ~SvLBoxBmp();
- virtual sal_uInt16 GetType() const override;
+ virtual SvLBoxItemType GetType() const override;
virtual void InitViewData( SvTreeListBox* ,SvTreeListEntry*, SvViewDataItem* = nullptr ) override;
virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext,
const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) override;
@@ -169,7 +169,7 @@ public:
SvTreeListEntry* pEntry,
SvViewDataItem* pViewData = nullptr) override;
- virtual sal_uInt16 GetType() const override;
+ virtual SvLBoxItemType GetType() const override;
bool ClickHdl(SvTreeListBox* pView, SvTreeListEntry* );
virtual void Paint(const Point& rPos,
@@ -249,7 +249,7 @@ public:
SvLBoxContextBmp();
virtual ~SvLBoxContextBmp();
- virtual sal_uInt16 GetType() const override;
+ virtual SvLBoxItemType GetType() const override;
virtual void InitViewData(SvTreeListBox* pView,
SvTreeListEntry* pEntry,
SvViewDataItem* pViewData = nullptr) override;
diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
index c5ac0a752f30..9898716dddd4 100644
--- a/include/svtools/treelistbox.hxx
+++ b/include/svtools/treelistbox.hxx
@@ -125,11 +125,7 @@ typedef sal_Int64 ExtendedWinBits;
// disable the behavior of automatically selecting a "CurEntry" upon painting the control
#define EWB_NO_AUTO_CURENTRY 0x00000001
-#define SV_ITEM_ID_LBOXSTRING 1
-#define SV_ITEM_ID_LBOXBMP 2
-#define SV_ITEM_ID_LBOXBUTTON 3
-#define SV_ITEM_ID_LBOXCONTEXTBMP 4
-#define SV_ITEM_ID_EXTENDRLBOXSTRING 5
+enum class SvLBoxItemType {String, Bmp, Button, ContextBmp};
class SvLBoxTab
{
@@ -156,7 +152,7 @@ class SVT_DLLPUBLIC SvLBoxItem
public:
SvLBoxItem();
virtual ~SvLBoxItem();
- virtual sal_uInt16 GetType() const = 0;
+ virtual SvLBoxItemType GetType() const = 0;
const Size& GetSize(const SvTreeListBox* pView, const SvTreeListEntry* pEntry) const;
static const Size& GetSize(const SvViewDataEntry* pData, sal_uInt16 nItemPos);
diff --git a/include/svtools/treelistentry.hxx b/include/svtools/treelistentry.hxx
index 8e9c677388ef..8851224fa111 100644
--- a/include/svtools/treelistentry.hxx
+++ b/include/svtools/treelistentry.hxx
@@ -98,8 +98,8 @@ public:
void ReplaceItem(std::unique_ptr<SvLBoxItem> pNewItem, size_t nPos);
const SvLBoxItem& GetItem( size_t nPos ) const;
SvLBoxItem& GetItem( size_t nPos );
- const SvLBoxItem* GetFirstItem( sal_uInt16 nId ) const;
- SvLBoxItem* GetFirstItem( sal_uInt16 nId );
+ const SvLBoxItem* GetFirstItem(SvLBoxItemType eType) const;
+ SvLBoxItem* GetFirstItem(SvLBoxItemType eType);
size_t GetPos( const SvLBoxItem* pItem ) const;
void* GetUserData() const { return pUserData;}
void SetUserData( void* pPtr );
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index b5f5b797d5ca..203314a06ba2 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -1879,11 +1879,11 @@ IMPL_LINK_TYPED( ScAcceptChgDlg, ColCompareHdl, const SvSortData*, pSortData, sa
if(pLeftItem != nullptr && pRightItem != nullptr)
{
- sal_uInt16 nLeftKind = pLeftItem->GetType();
- sal_uInt16 nRightKind = pRightItem->GetType();
+ SvLBoxItemType nLeftKind = pLeftItem->GetType();
+ SvLBoxItemType nRightKind = pRightItem->GetType();
- if(nRightKind == SV_ITEM_ID_LBOXSTRING &&
- nLeftKind == SV_ITEM_ID_LBOXSTRING )
+ if (nRightKind == SvLBoxItemType::String &&
+ nLeftKind == SvLBoxItemType::String)
{
nCompare = ScGlobal::GetCaseCollator()->compareString(
static_cast<SvLBoxString*>(pLeftItem)->GetText(),
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index bbe675ba623e..95c8239b4a32 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -381,8 +381,8 @@ IMPL_LINK_NOARG_TYPED(ScSolverOptionsDialog, SettingsSelHdl, SvTreeListBox*, voi
SvTreeListEntry* pEntry = m_pLbSettings->GetCurEntry();
if (pEntry)
{
- SvLBoxItem* pItem = pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON);
- if (pItem && pItem->GetType() == SV_ITEM_ID_LBOXBUTTON)
+ SvLBoxItem* pItem = pEntry->GetFirstItem(SvLBoxItemType::Button);
+ if (pItem && pItem->GetType() == SvLBoxItemType::Button)
bCheckbox = true;
}
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index 433e31a4831f..58b69b6141e9 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -47,7 +47,7 @@ OUString getXPath(
OUStringBuffer aBuf;
for (const SvTreeListEntry* p = &rEntry; p; p = rTree.GetParent(p))
{
- const SvLBoxItem* pItem = p->GetFirstItem(SV_ITEM_ID_LBOXSTRING);
+ const SvLBoxItem* pItem = p->GetFirstItem(SvLBoxItemType::String);
if (!pItem)
continue;
diff --git a/svtools/source/contnr/iconview.cxx b/svtools/source/contnr/iconview.cxx
index b2d3bca324f7..9681fa95e1ab 100644
--- a/svtools/source/contnr/iconview.cxx
+++ b/svtools/source/contnr/iconview.cxx
@@ -121,9 +121,9 @@ void IconView::PaintEntry(SvTreeListEntry& rEntry, long nX, long nY,
while (nCurItem < nItemCount)
{
SvLBoxItem* pItem = nCurItem < nItemCount ? &rEntry.GetItem(nCurItem) : nullptr;
- sal_uInt16 nItemType = pItem->GetType();
+ SvLBoxItemType nItemType = pItem->GetType();
- if(nItemType == SV_ITEM_ID_LBOXCONTEXTBMP)
+ if (nItemType == SvLBoxItemType::ContextBmp)
{
nIconItem = nCurItem;
nCurItem++;
diff --git a/svtools/source/contnr/simptabl.cxx b/svtools/source/contnr/simptabl.cxx
index 68c7d9404f54..8515183e66b6 100644
--- a/svtools/source/contnr/simptabl.cxx
+++ b/svtools/source/contnr/simptabl.cxx
@@ -451,11 +451,11 @@ sal_Int32 SvSimpleTable::ColCompare(SvTreeListEntry* pLeft,SvTreeListEntry* pRig
if(pLeftItem != nullptr && pRightItem != nullptr)
{
- sal_uInt16 nLeftKind = pLeftItem->GetType();
- sal_uInt16 nRightKind = pRightItem->GetType();
+ SvLBoxItemType nLeftKind = pLeftItem->GetType();
+ SvLBoxItemType nRightKind = pRightItem->GetType();
- if(nRightKind == SV_ITEM_ID_LBOXSTRING &&
- nLeftKind == SV_ITEM_ID_LBOXSTRING )
+ if (nRightKind == SvLBoxItemType::String &&
+ nLeftKind == SvLBoxItemType::String)
nCompare = aCollator.compareString( static_cast<SvLBoxString*>(pLeftItem)->GetText(),
static_cast<SvLBoxString*>(pRightItem)->GetText());
}
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index ccf9e6609e3e..fcaf870d0fc8 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -186,7 +186,7 @@ void SvImpLBox::UpdateContextBmpWidthVectorFromMovedEntry( SvTreeListEntry* pEnt
{
DBG_ASSERT( pEntry, "Moved Entry is invalid!" );
- SvLBoxContextBmp* pBmpItem = static_cast< SvLBoxContextBmp* >( pEntry->GetFirstItem( SV_ITEM_ID_LBOXCONTEXTBMP ) );
+ SvLBoxContextBmp* pBmpItem = static_cast< SvLBoxContextBmp* >( pEntry->GetFirstItem(SvLBoxItemType::ContextBmp) );
short nExpWidth = (short)pBmpItem->GetBitmap1().GetSizePixel().Width();
short nColWidth = (short)pBmpItem->GetBitmap2().GetSizePixel().Width();
short nMax = std::max(nExpWidth, nColWidth);
@@ -788,7 +788,7 @@ bool SvImpLBox::EntryReallyHit(SvTreeListEntry* pEntry, const Point& rPosPixel,
Rectangle aRect( pView->GetFocusRect( pEntry, nLine ));
aRect.Right() = GetOutputSize().Width() - pView->GetMapMode().GetOrigin().X();
- SvLBoxContextBmp* pBmp = static_cast<SvLBoxContextBmp*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ SvLBoxContextBmp* pBmp = static_cast<SvLBoxContextBmp*>(pEntry->GetFirstItem(SvLBoxItemType::ContextBmp));
aRect.Left() -= pBmp->GetSize(pView,pEntry).Width();
aRect.Left() -= 4; // a little tolerance
@@ -1869,7 +1869,7 @@ void SvImpLBox::EntryInserted( SvTreeListEntry* pEntry )
bool SvImpLBox::ButtonDownCheckCtrl(const MouseEvent& rMEvt, SvTreeListEntry* pEntry, long /*nY*/)
{
SvLBoxItem* pItem = pView->GetItem(pEntry,rMEvt.GetPosPixel().X(),&pActiveTab);
- if (pItem && pItem->GetType() == SV_ITEM_ID_LBOXBUTTON)
+ if (pItem && pItem->GetType() == SvLBoxItemType::Button)
{
pActiveButton = static_cast<SvLBoxButton*>(pItem);
pActiveEntry = pEntry;
@@ -3140,7 +3140,7 @@ bool SvImpLBox::RequestHelp( const HelpEvent& rHEvt )
// recalculate text rectangle
SvLBoxTab* pTab;
SvLBoxItem* pItem = pView->GetItem( pEntry, aPos.X(), &pTab );
- if (!pItem || pItem->GetType() != SV_ITEM_ID_LBOXSTRING)
+ if (!pItem || pItem->GetType() != SvLBoxItemType::String)
return false;
aPos = GetEntryPosition( pEntry );
diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx
index d12b792096b8..4aeb7eef7b79 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -180,9 +180,9 @@ SvLBoxString::~SvLBoxString()
{
}
-sal_uInt16 SvLBoxString::GetType() const
+SvLBoxItemType SvLBoxString::GetType() const
{
- return SV_ITEM_ID_LBOXSTRING;
+ return SvLBoxItemType::String;
}
void SvLBoxString::Paint(
@@ -250,9 +250,9 @@ SvLBoxBmp::~SvLBoxBmp()
{
}
-sal_uInt16 SvLBoxBmp::GetType() const
+SvLBoxItemType SvLBoxBmp::GetType() const
{
- return SV_ITEM_ID_LBOXBMP;
+ return SvLBoxItemType::Bmp;
}
void SvLBoxBmp::InitViewData( SvTreeListBox* pView,SvTreeListEntry* pEntry,
@@ -309,9 +309,9 @@ SvLBoxButton::~SvLBoxButton()
{
}
-sal_uInt16 SvLBoxButton::GetType() const
+SvLBoxItemType SvLBoxButton::GetType() const
{
- return SV_ITEM_ID_LBOXBUTTON;
+ return SvLBoxItemType::Button;
}
bool SvLBoxButton::ClickHdl( SvTreeListBox*, SvTreeListEntry* pEntry )
@@ -465,9 +465,9 @@ SvLBoxContextBmp::~SvLBoxContextBmp()
{
}
-sal_uInt16 SvLBoxContextBmp::GetType() const
+SvLBoxItemType SvLBoxContextBmp::GetType() const
{
- return SV_ITEM_ID_LBOXCONTEXTBMP;
+ return SvLBoxItemType::ContextBmp;
}
void SvLBoxContextBmp::SetModeImages( const Image& _rBitmap1, const Image& _rBitmap2 )
diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx
index c334f5addfa3..9b585688a856 100644
--- a/svtools/source/contnr/svtabbx.cxx
+++ b/svtools/source/contnr/svtabbx.cxx
@@ -263,7 +263,7 @@ OUString SvTabListBox::GetEntryText( SvTreeListEntry* pEntry, sal_uInt16 nCol )
while( nCur < nCount )
{
const SvLBoxItem& rStr = pEntry->GetItem( nCur );
- if (rStr.GetType() == SV_ITEM_ID_LBOXSTRING)
+ if (rStr.GetType() == SvLBoxItemType::String)
{
if( nCol == 0xffff )
{
@@ -312,7 +312,7 @@ void SvTabListBox::SetEntryText(const OUString& rStr, SvTreeListEntry* pEntry, s
for (sal_uInt16 nCur = 0; nCur < nCount; ++nCur)
{
SvLBoxItem& rBoxItem = pEntry->GetItem( nCur );
- if (rBoxItem.GetType() == SV_ITEM_ID_LBOXSTRING)
+ if (rBoxItem.GetType() == SvLBoxItemType::String)
{
if (!nCol || nCol==0xFFFF)
{
@@ -342,7 +342,7 @@ OUString SvTabListBox::GetCellText( sal_uLong nPos, sal_uInt16 nCol ) const
if (pEntry && pEntry->ItemCount() > static_cast<size_t>(nCol+1))
{
const SvLBoxItem& rStr = pEntry->GetItem( nCol + 1 );
- if (rStr.GetType() == SV_ITEM_ID_LBOXSTRING)
+ if (rStr.GetType() == SvLBoxItemType::String)
aResult = static_cast<const SvLBoxString&>(rStr).GetText();
}
return aResult;
@@ -395,7 +395,7 @@ OUString SvTabListBox::GetTabEntryText( sal_uLong nPos, sal_uInt16 nCol ) const
while( nCur < nCount )
{
const SvLBoxItem& rBoxItem = pEntry->GetItem( nCur );
- if (rBoxItem.GetType() == SV_ITEM_ID_LBOXSTRING)
+ if (rBoxItem.GetType() == SvLBoxItemType::String)
{
if ( nCol == 0xffff )
{
@@ -541,7 +541,7 @@ bool SvHeaderTabListBox::IsItemChecked( SvTreeListEntry* pEntry, sal_uInt16 nCol
SvButtonState eState = SvButtonState::Unchecked;
SvLBoxButton& rItem = static_cast<SvLBoxButton&>( pEntry->GetItem( nCol + 1 ) );
- if (rItem.GetType() == SV_ITEM_ID_LBOXBUTTON)
+ if (rItem.GetType() == SvLBoxItemType::Button)
{
SvItemStateFlags nButtonFlags = rItem.GetButtonFlags();
eState = SvLBoxButtonData::ConvertToButtonState( nButtonFlags );
@@ -648,7 +648,7 @@ bool SvHeaderTabListBox::IsCellCheckBox( long _nRow, sal_uInt16 _nColumn, TriSta
if ( nItemCount > ( _nColumn + 1 ) )
{
SvLBoxItem& rItem = pEntry->GetItem( _nColumn + 1 );
- if (rItem.GetType() == SV_ITEM_ID_LBOXBUTTON)
+ if (rItem.GetType() == SvLBoxItemType::Button)
{
bRet = true;
_rState = ( ( static_cast<SvLBoxButton&>(rItem).GetButtonFlags() & SvItemStateFlags::UNCHECKED ) == SvItemStateFlags::NONE )
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 14d1efc6e158..373b19159e6d 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -1391,9 +1391,8 @@ OUString SvTreeListBox::SearchEntryTextWithHeadTitle( SvTreeListEntry* pEntry )
sal_uInt16 nHeaderCur = 0;
while( nCur < nCount )
{
- // MT: SV_ITEM_ID_EXTENDRLBOXSTRING / GetExtendText() was in use in IA2 cws, but only used in sc: ScSolverOptionsString. Needed?
SvLBoxItem& rItem = pEntry->GetItem( nCur );
- if ( (rItem.GetType() == SV_ITEM_ID_LBOXSTRING ) &&
+ if ( (rItem.GetType() == SvLBoxItemType::String) &&
!static_cast<SvLBoxString&>( rItem ).GetText().isEmpty() )
{
//want the column header
@@ -1691,7 +1690,7 @@ void SvTreeListBox::InitEntry(SvTreeListEntry* pEntry,
OUString SvTreeListBox::GetEntryText(SvTreeListEntry* pEntry) const
{
DBG_ASSERT( pEntry, "SvTreeListBox::GetEntryText(): no entry" );
- SvLBoxString* pItem = static_cast<SvLBoxString*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ SvLBoxString* pItem = static_cast<SvLBoxString*>(pEntry->GetFirstItem(SvLBoxItemType::String));
DBG_ASSERT( pEntry, "SvTreeListBox::GetEntryText(): item not found" );
return pItem->GetText();
}
@@ -1699,7 +1698,7 @@ OUString SvTreeListBox::GetEntryText(SvTreeListEntry* pEntry) const
const Image& SvTreeListBox::GetExpandedEntryBmp(const SvTreeListEntry* pEntry)
{
DBG_ASSERT(pEntry,"Entry?");
- const SvLBoxContextBmp* pItem = static_cast<const SvLBoxContextBmp*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ const SvLBoxContextBmp* pItem = static_cast<const SvLBoxContextBmp*>(pEntry->GetFirstItem(SvLBoxItemType::ContextBmp));
DBG_ASSERT(pItem,"GetContextBmp:Item not found");
return pItem->GetBitmap2( );
}
@@ -1707,7 +1706,7 @@ const Image& SvTreeListBox::GetExpandedEntryBmp(const SvTreeListEntry* pEntry)
const Image& SvTreeListBox::GetCollapsedEntryBmp( const SvTreeListEntry* pEntry )
{
DBG_ASSERT(pEntry,"Entry?");
- const SvLBoxContextBmp* pItem = static_cast<const SvLBoxContextBmp*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ const SvLBoxContextBmp* pItem = static_cast<const SvLBoxContextBmp*>(pEntry->GetFirstItem(SvLBoxItemType::ContextBmp));
DBG_ASSERT(pItem,"GetContextBmp:Item not found");
return pItem->GetBitmap1( );
}
@@ -1783,7 +1782,7 @@ SvTreeListEntry* SvTreeListBox::InsertEntry( const OUString& rText,
void SvTreeListBox::SetEntryText(SvTreeListEntry* pEntry, const OUString& rStr)
{
- SvLBoxString* pItem = static_cast<SvLBoxString*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ SvLBoxString* pItem = static_cast<SvLBoxString*>(pEntry->GetFirstItem(SvLBoxItemType::String));
DBG_ASSERT(pItem,"SetText:Item not found");
pItem->SetText(rStr);
pItem->InitViewData( this, pEntry );
@@ -1792,7 +1791,7 @@ void SvTreeListBox::SetEntryText(SvTreeListEntry* pEntry, const OUString& rStr)
void SvTreeListBox::SetExpandedEntryBmp( SvTreeListEntry* pEntry, const Image& aBmp )
{
- SvLBoxContextBmp* pItem = static_cast<SvLBoxContextBmp*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ SvLBoxContextBmp* pItem = static_cast<SvLBoxContextBmp*>(pEntry->GetFirstItem(SvLBoxItemType::ContextBmp));
DBG_ASSERT(pItem,"SetExpBmp:Item not found");
pItem->SetBitmap2( aBmp );
@@ -1810,7 +1809,7 @@ void SvTreeListBox::SetExpandedEntryBmp( SvTreeListEntry* pEntry, const Image& a
void SvTreeListBox::SetCollapsedEntryBmp(SvTreeListEntry* pEntry,const Image& aBmp )
{
- SvLBoxContextBmp* pItem = static_cast<SvLBoxContextBmp*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ SvLBoxContextBmp* pItem = static_cast<SvLBoxContextBmp*>(pEntry->GetFirstItem(SvLBoxItemType::ContextBmp));
DBG_ASSERT(pItem,"SetExpBmp:Item not found");
pItem->SetBitmap1( aBmp );
@@ -1858,7 +1857,7 @@ void SvTreeListBox::ImpEntryInserted( SvTreeListEntry* pEntry )
if( nTreeFlags & SvTreeFlags::CHKBTN )
{
- SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
+ SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SvLBoxItemType::Button));
if( pItem )
{
long nWidth = pItem->GetSize(this, pEntry).Width();
@@ -1876,7 +1875,7 @@ void SvTreeListBox::SetCheckButtonState( SvTreeListEntry* pEntry, SvButtonState
{
if( nTreeFlags & SvTreeFlags::CHKBTN )
{
- SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
+ SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SvLBoxItemType::Button));
if(!(pItem && pItem->CheckModification()))
return ;
switch( eState )
@@ -1901,7 +1900,7 @@ void SvTreeListBox::SetCheckButtonInvisible( SvTreeListEntry* pEntry)
{
if( nTreeFlags & SvTreeFlags::CHKBTN )
{
- SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
+ SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SvLBoxItemType::Button));
pItem->SetStateInvisible();
InvalidateEntry( pEntry );
}
@@ -1912,7 +1911,7 @@ SvButtonState SvTreeListBox::GetCheckButtonState( SvTreeListEntry* pEntry ) cons
SvButtonState eState = SvButtonState::Unchecked;
if( pEntry && ( nTreeFlags & SvTreeFlags::CHKBTN ) )
{
- SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
+ SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SvLBoxItemType::Button));
if(!pItem)
return SvButtonState::Tristate;
SvItemStateFlags nButtonFlags = pItem->GetButtonFlags();
@@ -1942,16 +1941,16 @@ SvTreeListEntry* SvTreeListBox::CloneEntry( SvTreeListEntry* pSource )
Image aExpEntryBmp;
SvLBoxButtonKind eButtonKind = SvLBoxButtonKind::EnabledCheckbox;
- SvLBoxString* pStringItem = static_cast<SvLBoxString*>(pSource->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ SvLBoxString* pStringItem = static_cast<SvLBoxString*>(pSource->GetFirstItem(SvLBoxItemType::String));
if( pStringItem )
aStr = pStringItem->GetText();
- SvLBoxContextBmp* pBmpItem = static_cast<SvLBoxContextBmp*>(pSource->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ SvLBoxContextBmp* pBmpItem = static_cast<SvLBoxContextBmp*>(pSource->GetFirstItem(SvLBoxItemType::ContextBmp));
if( pBmpItem )
{
aCollEntryBmp = pBmpItem->GetBitmap1( );
aExpEntryBmp = pBmpItem->GetBitmap2( );
}
- SvLBoxButton* pButtonItem = static_cast<SvLBoxButton*>(pSource->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
+ SvLBoxButton* pButtonItem = static_cast<SvLBoxButton*>(pSource->GetFirstItem(SvLBoxItemType::Button));
if( pButtonItem )
eButtonKind = pButtonItem->GetKind();
SvTreeListEntry* pClone = CreateEntry();
@@ -2630,7 +2629,7 @@ void SvTreeListBox::ImplEditEntry( SvTreeListEntry* pEntry )
for( sal_uInt16 i = 0 ; i < nCount ; i++ )
{
SvLBoxItem& rTmpItem = pEntry->GetItem( i );
- if (rTmpItem.GetType() != SV_ITEM_ID_LBOXSTRING)
+ if (rTmpItem.GetType() != SvLBoxItemType::String)
continue;
SvLBoxTab* pTab = GetTab( pEntry, &rTmpItem );
@@ -2852,12 +2851,12 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render
Wallpaper aWallpaper = rRenderContext.GetBackground();
bool bSelTab = bool(nFlags & SvLBoxTabFlags::SHOW_SELECTION);
- sal_uInt16 nItemType = pItem->GetType();
+ SvLBoxItemType nItemType = pItem->GetType();
if (pViewDataEntry->IsHighlighted() && bSelTab)
{
Color aNewWallColor = rSettings.GetHighlightColor();
- if (!bInUse || nItemType != SV_ITEM_ID_LBOXCONTEXTBMP)
+ if (!bInUse || nItemType != SvLBoxItemType::ContextBmp)
{
// if the face color is bright then the deactive color is also bright
// -> so you can't see any deactive selection
@@ -2878,7 +2877,7 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render
}
else // no selection
{
- if (bInUse && nItemType == SV_ITEM_ID_LBOXCONTEXTBMP)
+ if (bInUse && nItemType == SvLBoxItemType::ContextBmp)
{
aWallpaper.SetColor(rSettings.GetFieldColor());
}
@@ -2948,7 +2947,7 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render
pItem->Paint(aEntryPos, *this, rRenderContext, pViewDataEntry, rEntry);
// division line between tabs
- if (pNextTab && pItem->GetType() == SV_ITEM_ID_LBOXSTRING &&
+ if (pNextTab && pItem->GetType() == SvLBoxItemType::String &&
// not at the right edge of the window!
aRect.Right() < nMaxRight)
{
@@ -3502,8 +3501,8 @@ IMPL_LINK_TYPED( SvTreeListBox, DefaultCompare, const SvSortData&, rData, sal_In
{
const SvTreeListEntry* pLeft = rData.pLeft;
const SvTreeListEntry* pRight = rData.pRight;
- OUString aLeft( static_cast<const SvLBoxString*>(pLeft->GetFirstItem(SV_ITEM_ID_LBOXSTRING))->GetText());
- OUString aRight( static_cast<const SvLBoxString*>(pRight->GetFirstItem(SV_ITEM_ID_LBOXSTRING))->GetText());
+ OUString aLeft( static_cast<const SvLBoxString*>(pLeft->GetFirstItem(SvLBoxItemType::String))->GetText());
+ OUString aRight( static_cast<const SvLBoxString*>(pRight->GetFirstItem(SvLBoxItemType::String))->GetText());
pImpl->UpdateStringSorter();
return pImpl->m_pStringSorter->compare(aLeft, aRight);
}
@@ -3528,7 +3527,7 @@ void SvTreeListBox::ModelNotification( SvListAction nActionId, SvTreeListEntry*
break;
}
- SvLBoxContextBmp* pBmpItem = static_cast< SvLBoxContextBmp* >( pEntry->GetFirstItem( SV_ITEM_ID_LBOXCONTEXTBMP ) );
+ SvLBoxContextBmp* pBmpItem = static_cast< SvLBoxContextBmp* >( pEntry->GetFirstItem( SvLBoxItemType::ContextBmp ) );
if ( !pBmpItem )
break;
const Image& rBitmap1( pBmpItem->GetBitmap1() );
diff --git a/svtools/source/contnr/treelistentry.cxx b/svtools/source/contnr/treelistentry.cxx
index 5d6105f38725..1576a6248b6b 100644
--- a/svtools/source/contnr/treelistentry.cxx
+++ b/svtools/source/contnr/treelistentry.cxx
@@ -168,12 +168,12 @@ namespace {
class FindByType : public std::unary_function<SvLBoxItem, void>
{
- sal_uInt16 mnId;
+ SvLBoxItemType meType;
public:
- explicit FindByType(sal_uInt16 nId) : mnId(nId) {}
+ explicit FindByType(SvLBoxItemType eType) : meType(eType) {}
bool operator() (const std::unique_ptr<SvLBoxItem>& rpItem) const
{
- return rpItem->GetType() == mnId;
+ return rpItem->GetType() == meType;
}
};
@@ -190,15 +190,15 @@ public:
}
-const SvLBoxItem* SvTreeListEntry::GetFirstItem( sal_uInt16 nId ) const
+const SvLBoxItem* SvTreeListEntry::GetFirstItem(SvLBoxItemType eType) const
{
- ItemsType::const_iterator it = std::find_if(m_Items.begin(), m_Items.end(), FindByType(nId));
+ ItemsType::const_iterator it = std::find_if(m_Items.begin(), m_Items.end(), FindByType(eType));
return (it == m_Items.end()) ? nullptr : (*it).get();
}
-SvLBoxItem* SvTreeListEntry::GetFirstItem( sal_uInt16 nId )
+SvLBoxItem* SvTreeListEntry::GetFirstItem(SvLBoxItemType eType)
{
- ItemsType::iterator it = std::find_if(m_Items.begin(), m_Items.end(), FindByType(nId));
+ ItemsType::iterator it = std::find_if(m_Items.begin(), m_Items.end(), FindByType(eType));
return (it == m_Items.end()) ? nullptr : (*it).get();
}
diff --git a/svx/source/dialog/checklbx.cxx b/svx/source/dialog/checklbx.cxx
index 11e4bda87eb8..e2c230272868 100644
--- a/svx/source/dialog/checklbx.cxx
+++ b/svx/source/dialog/checklbx.cxx
@@ -181,7 +181,7 @@ void SvxCheckListBox::MouseButtonDown( const MouseEvent& rMEvt )
bool bCheck = GetCheckButtonState( pEntry ) == SvButtonState::Checked;
SvLBoxItem* pItem = GetItem( pEntry, aPnt.X() );
- if (pItem && pItem->GetType() == SV_ITEM_ID_LBOXBUTTON)
+ if (pItem && pItem->GetType() == SvLBoxItemType::Button)
{
SvTreeListBox::MouseButtonDown( rMEvt );
Select( pEntry );
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
index 94d0b0cec0a9..778659cc7b43 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
@@ -305,11 +305,11 @@ sal_Int32 DictionaryList::ColumnCompare( SvTreeListEntry* pLeft, SvTreeListEntry
if(pLeftItem != nullptr && pRightItem != nullptr)
{
- sal_uInt16 nLeftKind = pLeftItem->GetType();
- sal_uInt16 nRightKind = pRightItem->GetType();
+ SvLBoxItemType nLeftKind = pLeftItem->GetType();
+ SvLBoxItemType nRightKind = pRightItem->GetType();
- if(nRightKind == SV_ITEM_ID_LBOXSTRING &&
- nLeftKind == SV_ITEM_ID_LBOXSTRING )
+ if (nRightKind == SvLBoxItemType::String &&
+ nLeftKind == SvLBoxItemType::String)
{
IntlWrapper aIntlWrapper( Application::GetSettings().GetLanguageTag() );
const CollatorWrapper* pCollator = aIntlWrapper.getCaseCollator();
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 214eb62e982e..096fc3f4f85a 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -1783,7 +1783,7 @@ void SwIdxTreeListBox::RequestHelp( const HelpEvent& rHEvt )
{
SvLBoxTab* pTab;
SvLBoxItem* pItem = GetItem( pEntry, aPos.X(), &pTab );
- if (pItem && SV_ITEM_ID_LBOXSTRING == pItem->GetType())
+ if (pItem && SvLBoxItemType::String == pItem->GetType())
{
aPos = GetEntryPosition( pEntry );
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 31e2d5508611..7ae9017c0e67 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -2808,7 +2808,7 @@ void SwContentTree::RequestHelp( const HelpEvent& rHEvt )
{
SvLBoxTab* pTab;
SvLBoxItem* pItem = GetItem( pEntry, aPos.X(), &pTab );
- if (pItem && SV_ITEM_ID_LBOXSTRING == pItem->GetType())
+ if (pItem && SvLBoxItemType::String == pItem->GetType())
{
aPos = GetEntryPosition( pEntry );
diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx
index e8e47994680d..1030003ba4a0 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -473,7 +473,7 @@ void SwGlobalTree::RequestHelp( const HelpEvent& rHEvt )
bParent = false;
SvLBoxTab* pTab;
SvLBoxItem* pItem = GetItem( pEntry, aPos.X(), &pTab );
- if (pItem && SV_ITEM_ID_LBOXSTRING == pItem->GetType())
+ if (pItem && SvLBoxItemType::String == pItem->GetType())
{
const SwSection* pSect = pCont->GetSection();
OUString sEntry = pSect->GetLinkFileName().getToken(0, sfx2::cTokenSeparator);