summaryrefslogtreecommitdiff
path: root/svtools/source/control
diff options
context:
space:
mode:
Diffstat (limited to 'svtools/source/control')
-rw-r--r--svtools/source/control/tabbar.cxx51
1 files changed, 27 insertions, 24 deletions
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 58b3d7f2eb23..5773a482768f 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -354,6 +354,9 @@ struct TabBar_Impl
// =======================================================================
+const sal_uInt16 TabBar::APPEND = ::std::numeric_limits<sal_uInt16>::max();
+const sal_uInt16 TabBar::PAGE_NOT_FOUND = ::std::numeric_limits<sal_uInt16>::max();
+
void TabBar::ImplInit( WinBits nWinStyle )
{
mpItemList = new ImplTabBarList;
@@ -1591,7 +1594,7 @@ void TabBar::InsertPage( USHORT nPageId, const XubString& rText,
TabBarPageBits nBits, USHORT nPos )
{
DBG_ASSERT( nPageId, "TabBar::InsertPage(): PageId == 0" );
- DBG_ASSERT( GetPagePos( nPageId ) == TABBAR_PAGE_NOTFOUND,
+ DBG_ASSERT( GetPagePos( nPageId ) == PAGE_NOT_FOUND,
"TabBar::InsertPage(): PageId already exists" );
DBG_ASSERT( nBits <= TPB_SPECIAL, "TabBar::InsertPage(): nBits is wrong" );
@@ -1617,7 +1620,7 @@ Color TabBar::GetTabBgColor( USHORT nPageId ) const
{
USHORT nPos = GetPagePos( nPageId );
- if ( nPos != TABBAR_PAGE_NOTFOUND )
+ if ( nPos != PAGE_NOT_FOUND )
return mpItemList->GetObject( nPos )->maTabBgColor;
else
return Color( COL_AUTO );
@@ -1627,7 +1630,7 @@ void TabBar::SetTabBgColor( USHORT nPageId, const Color& aTabBgColor )
{
USHORT nPos = GetPagePos( nPageId );
ImplTabBarItem* pItem;
- if ( nPos != TABBAR_PAGE_NOTFOUND )
+ if ( nPos != PAGE_NOT_FOUND )
{
pItem = mpItemList->GetObject( nPos );
// TODO: Need to take the text color specification out of this code!
@@ -1654,7 +1657,7 @@ void TabBar::RemovePage( USHORT nPageId )
USHORT nPos = GetPagePos( nPageId );
// Existiert Item
- if ( nPos != TABBAR_PAGE_NOTFOUND )
+ if ( nPos != PAGE_NOT_FOUND )
{
if ( mnCurPageId == nPageId )
mnCurPageId = 0;
@@ -1689,7 +1692,7 @@ void TabBar::MovePage( USHORT nPageId, USHORT nNewPos )
return;
// Existiert Item
- if ( nPos != TABBAR_PAGE_NOTFOUND )
+ if ( nPos != PAGE_NOT_FOUND )
{
// TabBar-Item in der Liste verschieben
ImplTabBarItem* pItem = mpItemList->Remove( nPos );
@@ -1727,7 +1730,7 @@ void TabBar::Clear()
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
- CallEventListeners( VCLEVENT_TABBAR_PAGEREMOVED, (void*) TABBAR_PAGE_NOTFOUND );
+ CallEventListeners( VCLEVENT_TABBAR_PAGEREMOVED, (void*) PAGE_NOT_FOUND );
}
// -----------------------------------------------------------------------
@@ -1736,7 +1739,7 @@ void TabBar::EnablePage( USHORT nPageId, BOOL bEnable )
{
USHORT nPos = GetPagePos( nPageId );
- if ( nPos != TABBAR_PAGE_NOTFOUND )
+ if ( nPos != PAGE_NOT_FOUND )
{
ImplTabBarItem* pItem = mpItemList->GetObject( nPos );
@@ -1759,7 +1762,7 @@ BOOL TabBar::IsPageEnabled( USHORT nPageId ) const
{
USHORT nPos = GetPagePos( nPageId );
- if ( nPos != TABBAR_PAGE_NOTFOUND )
+ if ( nPos != PAGE_NOT_FOUND )
return mpItemList->GetObject( nPos )->mbEnable;
else
return FALSE;
@@ -1771,7 +1774,7 @@ void TabBar::SetPageBits( USHORT nPageId, TabBarPageBits nBits )
{
USHORT nPos = GetPagePos( nPageId );
- if ( nPos != TABBAR_PAGE_NOTFOUND )
+ if ( nPos != PAGE_NOT_FOUND )
{
ImplTabBarItem* pItem = mpItemList->GetObject( nPos );
@@ -1792,7 +1795,7 @@ TabBarPageBits TabBar::GetPageBits( USHORT nPageId ) const
{
USHORT nPos = GetPagePos( nPageId );
- if ( nPos != TABBAR_PAGE_NOTFOUND )
+ if ( nPos != PAGE_NOT_FOUND )
return mpItemList->GetObject( nPos )->mnBits;
else
return FALSE;
@@ -1829,7 +1832,7 @@ USHORT TabBar::GetPagePos( USHORT nPageId ) const
pItem = mpItemList->Next();
}
- return TABBAR_PAGE_NOTFOUND;
+ return PAGE_NOT_FOUND;
}
// -----------------------------------------------------------------------
@@ -1854,7 +1857,7 @@ Rectangle TabBar::GetPageRect( USHORT nPageId ) const
{
USHORT nPos = GetPagePos( nPageId );
- if ( nPos != TABBAR_PAGE_NOTFOUND )
+ if ( nPos != PAGE_NOT_FOUND )
return mpItemList->GetObject( nPos )->maRect;
else
return Rectangle();
@@ -1867,7 +1870,7 @@ void TabBar::SetCurPageId( USHORT nPageId )
USHORT nPos = GetPagePos( nPageId );
// Wenn Item nicht existiert, dann nichts machen
- if ( nPos != TABBAR_PAGE_NOTFOUND )
+ if ( nPos != PAGE_NOT_FOUND )
{
// Wenn sich aktuelle Page nicht geaendert hat, dann muessen wir
// jetzt nichts mehr machen
@@ -1959,7 +1962,7 @@ void TabBar::MakeVisible( USHORT nPageId )
USHORT nPos = GetPagePos( nPageId );
// Wenn Item nicht existiert, dann nichts machen
- if ( nPos != TABBAR_PAGE_NOTFOUND )
+ if ( nPos != PAGE_NOT_FOUND )
{
if ( nPos < mnFirstPos )
SetFirstPageId( nPageId );
@@ -2008,7 +2011,7 @@ void TabBar::SetFirstPageId( USHORT nPageId )
USHORT nPos = GetPagePos( nPageId );
// Wenn Item nicht existiert, dann FALSE zurueckgeben
- if ( nPos != TABBAR_PAGE_NOTFOUND )
+ if ( nPos != PAGE_NOT_FOUND )
{
if ( nPos != mnFirstPos )
{
@@ -2042,7 +2045,7 @@ void TabBar::SelectPage( USHORT nPageId, BOOL bSelect )
{
USHORT nPos = GetPagePos( nPageId );
- if ( nPos != TABBAR_PAGE_NOTFOUND )
+ if ( nPos != PAGE_NOT_FOUND )
{
ImplTabBarItem* pItem = mpItemList->GetObject( nPos );
@@ -2123,7 +2126,7 @@ USHORT TabBar::GetSelectPageCount() const
BOOL TabBar::IsPageSelected( USHORT nPageId ) const
{
USHORT nPos = GetPagePos( nPageId );
- if ( nPos != TABBAR_PAGE_NOTFOUND )
+ if ( nPos != PAGE_NOT_FOUND )
return mpItemList->GetObject( nPos )->mbSelect;
else
return FALSE;
@@ -2134,7 +2137,7 @@ BOOL TabBar::IsPageSelected( USHORT nPageId ) const
BOOL TabBar::StartEditMode( USHORT nPageId )
{
USHORT nPos = GetPagePos( nPageId );
- if ( mpEdit || (nPos == TABBAR_PAGE_NOTFOUND) || (mnLastOffX < 8) )
+ if ( mpEdit || (nPos == PAGE_NOT_FOUND) || (mnLastOffX < 8) )
return FALSE;
mnEditId = nPageId;
@@ -2355,7 +2358,7 @@ void TabBar::SetSelectTextColor( const Color& rColor )
void TabBar::SetPageText( USHORT nPageId, const XubString& rText )
{
USHORT nPos = GetPagePos( nPageId );
- if ( nPos != TABBAR_PAGE_NOTFOUND )
+ if ( nPos != PAGE_NOT_FOUND )
{
mpItemList->GetObject( nPos )->maText = rText;
mbSizeFormat = TRUE;
@@ -2373,7 +2376,7 @@ void TabBar::SetPageText( USHORT nPageId, const XubString& rText )
XubString TabBar::GetPageText( USHORT nPageId ) const
{
USHORT nPos = GetPagePos( nPageId );
- if ( nPos != TABBAR_PAGE_NOTFOUND )
+ if ( nPos != PAGE_NOT_FOUND )
return mpItemList->GetObject( nPos )->maText;
else
return XubString();
@@ -2384,7 +2387,7 @@ XubString TabBar::GetPageText( USHORT nPageId ) const
void TabBar::SetHelpText( USHORT nPageId, const XubString& rText )
{
USHORT nPos = GetPagePos( nPageId );
- if ( nPos != TABBAR_PAGE_NOTFOUND )
+ if ( nPos != PAGE_NOT_FOUND )
mpItemList->GetObject( nPos )->maHelpText = rText;
}
@@ -2393,7 +2396,7 @@ void TabBar::SetHelpText( USHORT nPageId, const XubString& rText )
XubString TabBar::GetHelpText( USHORT nPageId ) const
{
USHORT nPos = GetPagePos( nPageId );
- if ( nPos != TABBAR_PAGE_NOTFOUND )
+ if ( nPos != PAGE_NOT_FOUND )
{
ImplTabBarItem* pItem = mpItemList->GetObject( nPos );
if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
@@ -2414,7 +2417,7 @@ XubString TabBar::GetHelpText( USHORT nPageId ) const
void TabBar::SetHelpId( USHORT nPageId, ULONG nHelpId )
{
USHORT nPos = GetPagePos( nPageId );
- if ( nPos != TABBAR_PAGE_NOTFOUND )
+ if ( nPos != PAGE_NOT_FOUND )
mpItemList->GetObject( nPos )->mnHelpId = nHelpId;
}
@@ -2423,7 +2426,7 @@ void TabBar::SetHelpId( USHORT nPageId, ULONG nHelpId )
ULONG TabBar::GetHelpId( USHORT nPageId ) const
{
USHORT nPos = GetPagePos( nPageId );
- if ( nPos != TABBAR_PAGE_NOTFOUND )
+ if ( nPos != PAGE_NOT_FOUND )
return mpItemList->GetObject( nPos )->mnHelpId;
else
return 0;