diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-11-15 14:11:19 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-11-15 16:02:46 -0500 |
commit | a2baeffbde83535c8cb2056006345b4d01265b90 (patch) | |
tree | d3f2186d3bf6a225dd266868c82fe7ff28dd1139 /svtools | |
parent | 67582fd2e3180fde45c11e85f8c3eb5e20ef8bc0 (diff) |
Rename SvLBoxItem::IsA() to GetType(), and mark that const.
Change-Id: I542835154e40b25d68fc3995d911810e26e30501
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/inc/svtools/svlbitm.hxx | 8 | ||||
-rw-r--r-- | svtools/inc/svtools/treelistbox.hxx | 4 | ||||
-rw-r--r-- | svtools/source/contnr/svimpbox.cxx | 4 | ||||
-rw-r--r-- | svtools/source/contnr/svlbitm.cxx | 8 | ||||
-rw-r--r-- | svtools/source/contnr/svtabbx.cxx | 32 | ||||
-rw-r--r-- | svtools/source/contnr/treelistbox.cxx | 12 | ||||
-rw-r--r-- | svtools/source/contnr/treelistentry.cxx | 2 |
7 files changed, 35 insertions, 35 deletions
diff --git a/svtools/inc/svtools/svlbitm.hxx b/svtools/inc/svtools/svlbitm.hxx index a4e1d400c1e3..4b1ea591ca5d 100644 --- a/svtools/inc/svtools/svlbitm.hxx +++ b/svtools/inc/svtools/svlbitm.hxx @@ -122,7 +122,7 @@ public: SvLBoxString(SvTreeListEntry*, sal_uInt16 nFlags, const rtl::OUString& rStr); SvLBoxString(); virtual ~SvLBoxString(); - virtual sal_uInt16 IsA(); + virtual sal_uInt16 GetType() const; virtual void InitViewData(SvTreeListBox*, SvTreeListEntry*, SvViewDataItem*); rtl::OUString GetText() const { return maText; } void SetText( const rtl::OUString& rText ) { maText = rText; } @@ -137,7 +137,7 @@ class SvLBoxBmp : public SvLBoxItem public: SvLBoxBmp(); virtual ~SvLBoxBmp(); - virtual sal_uInt16 IsA(); + virtual sal_uInt16 GetType() const; virtual void InitViewData( SvTreeListBox*,SvTreeListEntry*,SvViewDataItem* ); virtual void Paint( const Point&, SvTreeListBox& rView, sal_uInt16 nFlags,SvTreeListEntry* ); virtual SvLBoxItem* Create() const; @@ -171,7 +171,7 @@ public: SvLBoxButton(); virtual ~SvLBoxButton(); virtual void InitViewData( SvTreeListBox*,SvTreeListEntry*,SvViewDataItem* ); - virtual sal_uInt16 IsA(); + virtual sal_uInt16 GetType() const; virtual sal_Bool ClickHdl(SvTreeListBox* pView, SvTreeListEntry* ); virtual void Paint( const Point&, SvTreeListBox& rView, sal_uInt16 nFlags,SvTreeListEntry* ); virtual SvLBoxItem* Create() const; @@ -229,7 +229,7 @@ public: sal_uInt16 nEntryFlagsBmp1); SvLBoxContextBmp(); virtual ~SvLBoxContextBmp(); - virtual sal_uInt16 IsA(); + virtual sal_uInt16 GetType() const; virtual void InitViewData( SvTreeListBox*,SvTreeListEntry*,SvViewDataItem* ); virtual void Paint( const Point&, SvTreeListBox& rView, sal_uInt16 nFlags,SvTreeListEntry* ); virtual SvLBoxItem* Create() const; diff --git a/svtools/inc/svtools/treelistbox.hxx b/svtools/inc/svtools/treelistbox.hxx index 4ce8c418de26..ce4bba1b170f 100644 --- a/svtools/inc/svtools/treelistbox.hxx +++ b/svtools/inc/svtools/treelistbox.hxx @@ -173,7 +173,7 @@ public: SvLBoxItem( SvTreeListEntry*, sal_uInt16 nFlags ); SvLBoxItem(); virtual ~SvLBoxItem(); - virtual sal_uInt16 IsA() = 0; + virtual sal_uInt16 GetType() const = 0; const Size& GetSize( SvTreeListBox* pView, SvTreeListEntry* pEntry ); const Size& GetSize( SvViewDataEntry* pData, sal_uInt16 nItemPos ) { @@ -211,7 +211,7 @@ public: // The DropTarget is 0 in that case #define SV_DRAGDROP_ENABLE_TOP (DragDropMode)0x0020 -#define SVLISTBOX_ID_LBOX 0 // for SvTreeListBox::IsA() +#define SVLISTBOX_ID_LBOX 0 // for SvTreeListBox::GetType() #define SVLBOX_IN_EDT 0x0001 #define SVLBOX_EDT_ENABLED 0x0002 diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index e0d874d23e9e..5f90b8fd7c7f 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -1885,7 +1885,7 @@ bool SvImpLBox::ButtonDownCheckCtrl( const MouseEvent& rMEvt, SvTreeListEntry* pEntry, long nY) { SvLBoxItem* pItem = pView->GetItem(pEntry,rMEvt.GetPosPixel().X(),&pActiveTab); - if( pItem && (pItem->IsA()==SV_ITEM_ID_LBOXBUTTON)) + if (pItem && pItem->GetType() == SV_ITEM_ID_LBOXBUTTON) { pActiveButton = (SvLBoxButton*)pItem; pActiveEntry = pEntry; @@ -3160,7 +3160,7 @@ bool SvImpLBox::RequestHelp( const HelpEvent& rHEvt ) // recalculate text rectangle SvLBoxTab* pTab; SvLBoxString* pItem = (SvLBoxString*)(pView->GetItem( pEntry, aPos.X(), &pTab )); - if( !pItem || pItem->IsA() != SV_ITEM_ID_LBOXSTRING ) + if (!pItem || pItem->GetType() != SV_ITEM_ID_LBOXSTRING) return false; aPos = GetEntryPosition( pEntry ); diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx index b1214111215b..314bc310a822 100644 --- a/svtools/source/contnr/svlbitm.cxx +++ b/svtools/source/contnr/svlbitm.cxx @@ -213,7 +213,7 @@ SvLBoxString::~SvLBoxString() DBG_DTOR(SvLBoxString,0); } -sal_uInt16 SvLBoxString::IsA() +sal_uInt16 SvLBoxString::GetType() const { DBG_CHKTHIS(SvLBoxString,0); return SV_ITEM_ID_LBOXSTRING; @@ -272,7 +272,7 @@ SvLBoxBmp::~SvLBoxBmp() DBG_DTOR(SvLBoxBmp,0); } -sal_uInt16 SvLBoxBmp::IsA() +sal_uInt16 SvLBoxBmp::GetType() const { DBG_CHKTHIS(SvLBoxBmp,0); return SV_ITEM_ID_LBOXBMP; @@ -338,7 +338,7 @@ SvLBoxButton::~SvLBoxButton() DBG_DTOR(SvLBoxButton,0); } -sal_uInt16 SvLBoxButton::IsA() +sal_uInt16 SvLBoxButton::GetType() const { DBG_CHKTHIS(SvLBoxButton,0); return SV_ITEM_ID_LBOXBUTTON; @@ -503,7 +503,7 @@ SvLBoxContextBmp::~SvLBoxContextBmp() DBG_DTOR(SvLBoxContextBmp,0); } -sal_uInt16 SvLBoxContextBmp::IsA() +sal_uInt16 SvLBoxContextBmp::GetType() const { DBG_CHKTHIS(SvLBoxContextBmp,0); return SV_ITEM_ID_LBOXCONTEXTBMP; diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx index ab3bf5cb101d..8938104c8937 100644 --- a/svtools/source/contnr/svtabbx.cxx +++ b/svtools/source/contnr/svtabbx.cxx @@ -279,19 +279,19 @@ String SvTabListBox::GetEntryText( SvTreeListEntry* pEntry, sal_uInt16 nCol ) co sal_uInt16 nCur = 0; while( nCur < nCount ) { - SvLBoxItem* pStr = pEntry->GetItem( nCur ); - if( pStr->IsA() == SV_ITEM_ID_LBOXSTRING ) + const SvLBoxItem* pStr = pEntry->GetItem( nCur ); + if (pStr->GetType() == SV_ITEM_ID_LBOXSTRING) { if( nCol == 0xffff ) { if( aResult.Len() ) aResult += '\t'; - aResult += static_cast<SvLBoxString*>( pStr )->GetText(); + aResult += static_cast<const SvLBoxString*>(pStr)->GetText(); } else { if( nCol == 0 ) - return static_cast<SvLBoxString*>( pStr )->GetText(); + return static_cast<const SvLBoxString*>(pStr)->GetText(); nCol--; } } @@ -334,7 +334,7 @@ void SvTabListBox::SetEntryText( const XubString& rStr, SvTreeListEntry* pEntry, while( nCur < nCount ) { SvLBoxItem* pStr = pEntry->GetItem( nCur ); - if( pStr && pStr->IsA() == SV_ITEM_ID_LBOXSTRING ) + if (pStr && pStr->GetType() == SV_ITEM_ID_LBOXSTRING) { if( nCol == 0xffff ) { @@ -377,9 +377,9 @@ String SvTabListBox::GetCellText( sal_uLong nPos, sal_uInt16 nCol ) const XubString aResult; if ( pEntry && pEntry->ItemCount() > ( nCol + 1 ) ) { - SvLBoxItem* pStr = pEntry->GetItem( nCol + 1 ); - if ( pStr && pStr->IsA() == SV_ITEM_ID_LBOXSTRING ) - aResult = static_cast< SvLBoxString* >( pStr )->GetText(); + const SvLBoxItem* pStr = pEntry->GetItem( nCol + 1 ); + if (pStr && pStr->GetType() == SV_ITEM_ID_LBOXSTRING) + aResult = static_cast<const SvLBoxString*>(pStr)->GetText(); } return aResult; } @@ -453,20 +453,20 @@ String SvTabListBox::GetTabEntryText( sal_uLong nPos, sal_uInt16 nCol ) const sal_uInt16 nCur = ( 0 == nCol && IsCellFocusEnabled() ) ? GetCurrentTabPos() : 0; while( nCur < nCount ) { - SvLBoxItem* pStr = pEntry->GetItem( nCur ); - if ( pStr->IsA() == SV_ITEM_ID_LBOXSTRING ) + const SvLBoxItem* pStr = pEntry->GetItem( nCur ); + if (pStr->GetType() == SV_ITEM_ID_LBOXSTRING) { if ( nCol == 0xffff ) { if ( aResult.Len() ) aResult += '\t'; - aResult += static_cast<SvLBoxString*>( pStr )->GetText(); + aResult += static_cast<const SvLBoxString*>(pStr)->GetText(); } else { if ( nCol == 0 ) { - String sRet = static_cast<SvLBoxString*>( pStr )->GetText(); + String sRet = static_cast<const SvLBoxString*>(pStr)->GetText(); if ( sRet.Len() == 0 ) sRet = SVT_RESSTR( STR_SVT_ACC_EMPTY_FIELD ); return sRet; @@ -621,7 +621,7 @@ sal_Bool SvHeaderTabListBox::IsItemChecked( SvTreeListEntry* pEntry, sal_uInt16 SvButtonState eState = SV_BUTTON_UNCHECKED; SvLBoxButton* pItem = (SvLBoxButton*)( pEntry->GetItem( nCol + 1 ) ); - if ( pItem && ( (SvLBoxItem*)pItem )->IsA() == SV_ITEM_ID_LBOXBUTTON ) + if (pItem && pItem->GetType() == SV_ITEM_ID_LBOXBUTTON) { sal_uInt16 nButtonFlags = pItem->GetButtonFlags(); eState = pCheckButtonData->ConvertToButtonState( nButtonFlags ); @@ -744,7 +744,7 @@ void SvHeaderTabListBox::RecalculateAccessibleChildren() sal_Bool SvHeaderTabListBox::IsCellCheckBox( long _nRow, sal_uInt16 _nColumn, TriState& _rState ) { - sal_Bool bRet = sal_False; + bool bRet = false; SvTreeListEntry* pEntry = GetEntry( _nRow ); if ( pEntry ) { @@ -752,9 +752,9 @@ sal_Bool SvHeaderTabListBox::IsCellCheckBox( long _nRow, sal_uInt16 _nColumn, Tr if ( nItemCount > ( _nColumn + 1 ) ) { SvLBoxButton* pItem = (SvLBoxButton*)( pEntry->GetItem( _nColumn + 1 ) ); - if ( pItem && ( (SvLBoxItem*)pItem )->IsA() == SV_ITEM_ID_LBOXBUTTON ) + if (pItem && pItem->GetType() == SV_ITEM_ID_LBOXBUTTON) { - bRet = sal_True; + bRet = true; _rState = ( ( pItem->GetButtonFlags() & SV_ITEMSTATE_UNCHECKED ) == 0 ) ? STATE_CHECK : STATE_NOCHECK; } diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index 5a2fea7b3fcc..5cdff0c52401 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -1790,9 +1790,9 @@ String SvTreeListBox::SearchEntryText( SvTreeListEntry* pEntry ) const while( nCur < nCount ) { pItem = pEntry->GetItem( nCur ); - if ( pItem->IsA() == SV_ITEM_ID_LBOXSTRING && !static_cast<SvLBoxString*>( pItem )->GetText().isEmpty() ) + if (pItem->GetType() == SV_ITEM_ID_LBOXSTRING && !static_cast<const SvLBoxString*>(pItem)->GetText().isEmpty()) { - sRet = static_cast<SvLBoxString*>( pItem )->GetText(); + sRet = static_cast<const SvLBoxString*>(pItem)->GetText(); break; } nCur++; @@ -2757,7 +2757,7 @@ void SvTreeListBox::ImplEditEntry( SvTreeListEntry* pEntry ) for( sal_uInt16 i = 0 ; i < nCount ; i++ ) { SvLBoxItem* pTmpItem = pEntry->GetItem( i ); - if( pTmpItem->IsA() != SV_ITEM_ID_LBOXSTRING ) + if (pTmpItem->GetType() != SV_ITEM_ID_LBOXSTRING) continue; SvLBoxTab* pTab = GetTab( pEntry, pTmpItem ); @@ -3017,7 +3017,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry,long nLine,sal_uInt16 nT Wallpaper aWallpaper = GetBackground(); int bSelTab = nFlags & SV_LBOXTAB_SHOW_SELECTION; - sal_uInt16 nItemType = pItem->IsA(); + sal_uInt16 nItemType = pItem->GetType(); if ( pViewDataEntry->IsSelected() && bSelTab && !pViewDataEntry->IsCursored() ) { @@ -3097,9 +3097,9 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry,long nLine,sal_uInt16 nT pItem->Paint( aEntryPos, *this, pViewDataEntry->GetFlags(), pEntry ); // division line between tabs - if( pNextTab && pItem->IsA() == SV_ITEM_ID_LBOXSTRING && + if (pNextTab && pItem->GetType() == SV_ITEM_ID_LBOXSTRING && // not at the right edge of the window! - aRect.Right() < nMaxRight ) + aRect.Right() < nMaxRight) { aRect.Left() = aRect.Right() - SV_TAB_BORDER; DrawRect( aRect ); diff --git a/svtools/source/contnr/treelistentry.cxx b/svtools/source/contnr/treelistentry.cxx index df6b5b7dd92e..b6a5977fe553 100644 --- a/svtools/source/contnr/treelistentry.cxx +++ b/svtools/source/contnr/treelistentry.cxx @@ -189,7 +189,7 @@ SvLBoxItem* SvTreeListEntry::GetFirstItem( sal_uInt16 nId ) const while( nCur < nCount ) { pItem = GetItem( nCur ); - if( pItem->IsA() == nId ) + if (pItem->GetType() == nId) return pItem; nCur++; } |