summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svtools/tabbar.hxx3
-rw-r--r--svtools/source/control/tabbar.cxx184
2 files changed, 95 insertions, 92 deletions
diff --git a/include/svtools/tabbar.hxx b/include/svtools/tabbar.hxx
index ba2ecfdfcc19..4a403c4b7741 100644
--- a/include/svtools/tabbar.hxx
+++ b/include/svtools/tabbar.hxx
@@ -307,7 +307,7 @@ enum TabBarAllowRenamingReturnCode {
// - TabBar -
struct TabBar_Impl;
-struct ImplTabBarItem;
+typedef std::vector<ImplTabBarItem*> ImplTabBarList;
class SVT_DLLPUBLIC TabBar : public vcl::Window
{
@@ -317,7 +317,6 @@ class SVT_DLLPUBLIC TabBar : public vcl::Window
private:
std::unique_ptr<TabBar_Impl> mpImpl;
- ImplTabBarList* mpItemList;
OUString maEditText;
Color maSelColor;
Color maSelTextColor;
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index b38fe900b426..83c9ab01b742 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -358,6 +358,7 @@ struct TabBar_Impl
std::unique_ptr<ImplTabButton> mpNextButton;
std::unique_ptr<ImplTabButton> mpLastButton;
std::unique_ptr<TabBarEdit> mpEdit;
+ ImplTabBarList* mpItemList;
svt::AccessibleFactoryAccess maAccessibleFactory;
@@ -368,7 +369,16 @@ struct TabBar_Impl
, mpNextButton()
, mpLastButton()
, mpEdit()
+ , mpItemList(new ImplTabBarList)
{}
+
+ ~TabBar_Impl()
+ {
+ for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
+ delete (*mpItemList)[ i ];
+ }
+ delete mpItemList;
+ }
};
@@ -381,7 +391,6 @@ void TabBar::ImplInit( WinBits nWinStyle )
{
mpImpl.reset(new TabBar_Impl);
- mpItemList = new ImplTabBarList;
mnMaxPageWidth = 0;
mnCurMaxWidth = 0;
mnOffX = 0;
@@ -441,20 +450,15 @@ TabBar::TabBar( vcl::Window* pParent, WinBits nWinStyle ) :
TabBar::~TabBar()
{
EndEditMode( true );
-
- for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
- delete (*mpItemList)[ i ];
- }
- delete mpItemList;
}
ImplTabBarItem* TabBar::seek( size_t i )
{
- if ( i < mpItemList->size() )
+ if ( i < mpImpl->mpItemList->size() )
{
maCurrentItemList = i;
- return (*mpItemList)[ maCurrentItemList ];
+ return (*mpImpl->mpItemList)[ maCurrentItemList ];
}
return NULL;
}
@@ -462,15 +466,15 @@ ImplTabBarItem* TabBar::seek( size_t i )
ImplTabBarItem* TabBar::prev()
{
if ( maCurrentItemList > 0 ) {
- return (*mpItemList)[ --maCurrentItemList ];
+ return (*mpImpl->mpItemList)[ --maCurrentItemList ];
}
return NULL;
}
ImplTabBarItem* TabBar::next()
{
- if ( maCurrentItemList+1 < mpItemList->size() ) {
- return (*mpItemList)[ ++maCurrentItemList ];
+ if ( maCurrentItemList + 1 < mpImpl->mpItemList->size() ) {
+ return (*mpImpl->mpItemList)[ ++maCurrentItemList ];
}
return NULL;
}
@@ -574,9 +578,9 @@ bool TabBar::ImplCalcWidth()
mnCurMaxWidth = 0;
bool bChanged = false;
- for ( size_t i = 0, n = mpItemList->size(); i < n; ++i )
+ for ( size_t i = 0, n = mpImpl->mpItemList->size(); i < n; ++i )
{
- ImplTabBarItem* pItem = (*mpItemList)[ i ];
+ ImplTabBarItem* pItem = (*mpImpl->mpItemList)[ i ];
long nNewWidth = GetTextWidth( pItem->maText );
if ( mnCurMaxWidth && (nNewWidth > mnCurMaxWidth) )
{
@@ -615,9 +619,9 @@ void TabBar::ImplFormat()
sal_uInt16 n = 0;
long x = mnOffX;
- for ( size_t i = 0, nL = mpItemList->size(); i < nL; ++i )
+ for ( size_t i = 0, nL = mpImpl->mpItemList->size(); i < nL; ++i )
{
- ImplTabBarItem* pItem = (*mpItemList)[ i ];
+ ImplTabBarItem* pItem = (*mpImpl->mpItemList)[ i ];
// At all non-visible tabs an empty rectangle is set
if ( (n+1 < mnFirstPos) || (x > mnLastOffX) )
pItem->maRect.SetEmpty();
@@ -656,19 +660,19 @@ void TabBar::ImplFormat()
sal_uInt16 TabBar::ImplGetLastFirstPos()
{
- sal_uInt16 nCount = (sal_uInt16)(mpItemList->size());
+ sal_uInt16 nCount = (sal_uInt16)(mpImpl->mpItemList->size());
if ( !nCount || mbSizeFormat || mbFormat )
return 0;
sal_uInt16 nLastFirstPos = nCount-1;
long nWinWidth = mnLastOffX - mnOffX - ADDNEWPAGE_AREAWIDTH;
- long nWidth = (*mpItemList)[ nLastFirstPos ]->mnWidth;
+ long nWidth = (*mpImpl->mpItemList)[ nLastFirstPos ]->mnWidth;
while ( nLastFirstPos && (nWidth < nWinWidth) )
{
nLastFirstPos--;
- nWidth += (*mpItemList)[ nLastFirstPos ]->mnWidth;
+ nWidth += (*mpImpl->mpItemList)[ nLastFirstPos ]->mnWidth;
}
- if ( (nLastFirstPos != (sal_uInt16)(mpItemList->size()-1)) &&
+ if ( (nLastFirstPos != (sal_uInt16)(mpImpl->mpItemList->size()-1)) &&
(nWidth > nWinWidth) )
nLastFirstPos++;
return nLastFirstPos;
@@ -773,13 +777,13 @@ void TabBar::SetScrollAlwaysEnabled(bool bScrollAlwaysEnabled)
void TabBar::ImplShowPage( sal_uInt16 nPos )
{
- if (nPos >= mpItemList->size())
+ if (nPos >= mpImpl->mpItemList->size())
return;
// calculate width
long nWidth = GetOutputSizePixel().Width();
- ImplTabBarItem* pItem = (*mpItemList)[ nPos ];
+ ImplTabBarItem* pItem = (*mpImpl->mpItemList)[ nPos ];
if ( nPos < mnFirstPos )
SetFirstPageId( pItem->mnId );
else if ( pItem->maRect.Right() > nWidth )
@@ -864,7 +868,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
if ( (nSelId > 0) && (nSelId != mnCurPageId) )
{
sal_uInt16 nPos = GetPagePos( nSelId );
- pItem = (*mpItemList)[ nPos ];
+ pItem = (*mpImpl->mpItemList)[ nPos ];
if ( pItem->mbEnable )
{
@@ -892,7 +896,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
if ( nSelId )
{
sal_uInt16 nPos = GetPagePos( nSelId );
- pItem = (*mpItemList)[ nPos ];
+ pItem = (*mpImpl->mpItemList)[ nPos ];
if ( pItem->mbEnable )
{
@@ -920,7 +924,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
n = 0;
while ( n < nCurPos )
{
- pItem = (*mpItemList)[ n ];
+ pItem = (*mpImpl->mpItemList)[ n ];
if ( n < nPos )
bSelect = false;
else
@@ -942,11 +946,11 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
// Select all tabs from the actual position till the clicked tab
// and deselect all tabs from the actual position
// till the last tab
- sal_uInt16 nCount = (sal_uInt16)mpItemList->size();
+ sal_uInt16 nCount = (sal_uInt16) mpImpl->mpItemList->size();
n = nCurPos;
while ( n < nCount )
{
- pItem = (*mpItemList)[ n ];
+ pItem = (*mpImpl->mpItemList)[ n ];
if ( n <= nPos )
bSelect = true;
@@ -1004,7 +1008,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
if ( nSelId != mnCurPageId )
{
sal_uInt16 nPos = GetPagePos( nSelId );
- pItem = (*mpItemList)[ nPos ];
+ pItem = (*mpImpl->mpItemList)[ nPos ];
if ( pItem->mbEnable )
{
@@ -1016,9 +1020,9 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
bUpdate = true;
// deselect all selected items
- for ( size_t i = 0, n = mpItemList->size(); i < n; ++i )
+ for ( size_t i = 0, n = mpImpl->mpItemList->size(); i < n; ++i )
{
- pItem = (*mpItemList)[ i ];
+ pItem = (*mpImpl->mpItemList)[ i ];
if ( pItem->mbSelect || (pItem->mnId == mnCurPageId) )
{
pItem->mbSelect = false;
@@ -1267,7 +1271,7 @@ void TabBar::Paint( const Rectangle& rect )
ControlState::ENABLED,ImplControlValue(0),OUString());
// calculate items and emit
- sal_uInt16 nItemCount = (sal_uInt16)mpItemList->size();
+ sal_uInt16 nItemCount = (sal_uInt16)mpImpl->mpItemList->size();
if (!nItemCount)
return;
@@ -1544,7 +1548,7 @@ void TabBar::RequestHelp( const HelpEvent& rHEvt )
if ( rHEvt.GetMode() & (HelpEventMode::QUICK | HelpEventMode::BALLOON) )
{
sal_uInt16 nPos = GetPagePos( nItemId );
- ImplTabBarItem* pItem = (*mpItemList)[ nPos ];
+ ImplTabBarItem* pItem = (*mpImpl->mpItemList)[ nPos ];
if ( pItem->mbShort || (pItem->maRect.Right() - 5 > mnLastOffX) )
{
Rectangle aItemRect = GetPageRect( nItemId );
@@ -1554,7 +1558,7 @@ void TabBar::RequestHelp( const HelpEvent& rHEvt )
aPt = OutputToScreenPixel( aItemRect.BottomRight() );
aItemRect.Right() = aPt.X();
aItemRect.Bottom() = aPt.Y();
- OUString aStr = (*mpItemList)[ nPos ]->maText;
+ OUString aStr = (*mpImpl->mpItemList)[ nPos ]->maText;
if (!aStr.isEmpty())
{
if ( rHEvt.GetMode() & HelpEventMode::BALLOON )
@@ -1578,7 +1582,7 @@ void TabBar::StateChanged( StateChangedType nType )
if ( nType == StateChangedType::INITSHOW )
{
- if ( (mbSizeFormat || mbFormat) && !mpItemList->empty() )
+ if ( (mbSizeFormat || mbFormat) && !mpImpl->mpItemList->empty() )
ImplFormat();
}
else if ( (nType == StateChangedType::ZOOM) ||
@@ -1685,7 +1689,7 @@ bool TabBar::ImplDeactivatePage()
void TabBar::ImplPrePaint()
{
- sal_uInt16 nItemCount = (sal_uInt16)mpItemList->size();
+ sal_uInt16 nItemCount = (sal_uInt16) mpImpl->mpItemList->size();
if (!nItemCount)
return;
@@ -1700,7 +1704,7 @@ void TabBar::ImplPrePaint()
if ( mnCurPageId && (mnFirstPos == 0) && !mbDropPos )
{
- ImplTabBarItem* pItem = (*mpItemList)[ GetPagePos( mnCurPageId ) ];
+ ImplTabBarItem* pItem = (*mpImpl->mpItemList)[ GetPagePos( mnCurPageId ) ];
if ( pItem->maRect.IsEmpty() )
{
// set mbDropPos (or misuse) to prevent Invalidate()
@@ -1804,12 +1808,12 @@ void TabBar::InsertPage( sal_uInt16 nPageId, const OUString& rText,
// create PageItem and insert in the item list
ImplTabBarItem* pItem = new ImplTabBarItem( nPageId, rText, nBits );
- if ( nPos < mpItemList->size() ) {
- ImplTabBarList::iterator it = mpItemList->begin();
- ::std::advance( it, nPos );
- mpItemList->insert( it, pItem );
+ if ( nPos < mpImpl->mpItemList->size() ) {
+ ImplTabBarList::iterator it = mpImpl->mpItemList->begin();
+ std::advance( it, nPos );
+ mpImpl->mpItemList->insert( it, pItem );
} else {
- mpItemList->push_back( pItem );
+ mpImpl->mpItemList->push_back( pItem );
}
mbSizeFormat = true;
@@ -1831,7 +1835,7 @@ Color TabBar::GetTabBgColor( sal_uInt16 nPageId ) const
sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
- return (*mpItemList)[ nPos ]->maTabBgColor;
+ return (*mpImpl->mpItemList)[ nPos ]->maTabBgColor;
else
return Color( COL_AUTO );
}
@@ -1841,7 +1845,7 @@ void TabBar::SetTabBgColor( sal_uInt16 nPageId, const Color& aTabBgColor )
sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
{
- ImplTabBarItem* pItem = (*mpItemList)[ nPos ];
+ ImplTabBarItem* pItem = (*mpImpl->mpItemList)[ nPos ];
if ( aTabBgColor != Color( COL_AUTO ) )
{
pItem->maTabBgColor = aTabBgColor;
@@ -1875,10 +1879,10 @@ void TabBar::RemovePage( sal_uInt16 nPageId )
mnFirstPos--;
// delete item data
- ImplTabBarList::iterator it = mpItemList->begin();
- ::std::advance( it, nPos );
+ ImplTabBarList::iterator it = mpImpl->mpItemList->begin();
+ std::advance( it, nPos );
delete *it;
- mpItemList->erase( it );
+ mpImpl->mpItemList->erase( it );
// redraw bar
if ( IsReallyVisible() && IsUpdateMode() )
@@ -1905,16 +1909,16 @@ void TabBar::MovePage( sal_uInt16 nPageId, sal_uInt16 nNewPos )
if ( nPos != PAGE_NOT_FOUND )
{
// move tabbar item in the list
- ImplTabBarList::iterator it = mpItemList->begin();
- ::std::advance( it, nPos );
+ ImplTabBarList::iterator it = mpImpl->mpItemList->begin();
+ std::advance( it, nPos );
ImplTabBarItem* pItem = *it;
- mpItemList->erase( it );
- if ( nNewPos < mpItemList->size() ) {
- it = mpItemList->begin();
- ::std::advance( it, nNewPos );
- mpItemList->insert( it, pItem );
+ mpImpl->mpItemList->erase( it );
+ if ( nNewPos < mpImpl->mpItemList->size() ) {
+ it = mpImpl->mpItemList->begin();
+ std::advance( it, nNewPos );
+ mpImpl->mpItemList->insert( it, pItem );
} else {
- mpItemList->push_back( pItem );
+ mpImpl->mpItemList->push_back( pItem );
}
// redraw bar
@@ -1930,10 +1934,10 @@ void TabBar::MovePage( sal_uInt16 nPageId, sal_uInt16 nNewPos )
void TabBar::Clear()
{
// delete all items
- for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
- delete (*mpItemList)[ i ];
+ for ( size_t i = 0, n = mpImpl->mpItemList->size(); i < n; ++i ) {
+ delete (*mpImpl->mpItemList)[ i ];
}
- mpItemList->clear();
+ mpImpl->mpItemList->clear();
// remove items from the list
mbSizeFormat = true;
@@ -1955,7 +1959,7 @@ bool TabBar::IsPageEnabled( sal_uInt16 nPageId ) const
sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
- return (*mpItemList)[ nPos ]->mbEnable;
+ return (*mpImpl->mpItemList)[ nPos ]->mbEnable;
else
return false;
}
@@ -1968,7 +1972,7 @@ void TabBar::SetPageBits( sal_uInt16 nPageId, TabBarPageBits nBits )
if ( nPos != PAGE_NOT_FOUND )
{
- ImplTabBarItem* pItem = (*mpItemList)[ nPos ];
+ ImplTabBarItem* pItem = (*mpImpl->mpItemList)[ nPos ];
if ( pItem->mnBits != nBits )
{
@@ -1988,7 +1992,7 @@ TabBarPageBits TabBar::GetPageBits( sal_uInt16 nPageId ) const
sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
- return (*mpItemList)[ nPos ]->mnBits;
+ return (*mpImpl->mpItemList)[ nPos ]->mnBits;
else
return sal_False;
}
@@ -1997,22 +2001,22 @@ TabBarPageBits TabBar::GetPageBits( sal_uInt16 nPageId ) const
sal_uInt16 TabBar::GetPageCount() const
{
- return (sal_uInt16)mpItemList->size();
+ return (sal_uInt16) mpImpl->mpItemList->size();
}
sal_uInt16 TabBar::GetPageId( sal_uInt16 nPos ) const
{
- return ( nPos < mpItemList->size() ) ? (*mpItemList)[ nPos ]->mnId : 0;
+ return ( nPos < mpImpl->mpItemList->size() ) ? (*mpImpl->mpItemList)[ nPos ]->mnId : 0;
}
sal_uInt16 TabBar::GetPagePos( sal_uInt16 nPageId ) const
{
- for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
- if ( (*mpItemList)[ i ]->mnId == nPageId ) {
+ for ( size_t i = 0, n = mpImpl->mpItemList->size(); i < n; ++i ) {
+ if ( (*mpImpl->mpItemList)[ i ]->mnId == nPageId ) {
return sal_uInt16( i );
}
}
@@ -2023,16 +2027,16 @@ sal_uInt16 TabBar::GetPagePos( sal_uInt16 nPageId ) const
sal_uInt16 TabBar::GetPageId( const Point& rPos, bool bCheckInsTab ) const
{
- for ( size_t i = 0, n = mpItemList->size(); i < n; ++i )
+ for ( size_t i = 0, n = mpImpl->mpItemList->size(); i < n; ++i )
{
- ImplTabBarItem* pItem = (*mpItemList)[ i ];
+ ImplTabBarItem* pItem = (*mpImpl->mpItemList)[ i ];
if ( pItem->maRect.IsInside( rPos ) )
return pItem->mnId;
}
- if (bCheckInsTab && mbHasInsertTab && !mpItemList->empty())
+ if (bCheckInsTab && mbHasInsertTab && !mpImpl->mpItemList->empty())
{
- ImplTabBarItem* pItem = mpItemList->back();
+ ImplTabBarItem* pItem = mpImpl->mpItemList->back();
if (ImplGetInsertTabRect(pItem).IsInside(rPos))
return INSERT_TAB_POS;
}
@@ -2047,7 +2051,7 @@ Rectangle TabBar::GetPageRect( sal_uInt16 nPageId ) const
sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
- return (*mpItemList)[ nPos ]->maRect;
+ return (*mpImpl->mpItemList)[ nPos ]->maRect;
else
return Rectangle();
}
@@ -2070,11 +2074,11 @@ void TabBar::SetCurPageId( sal_uInt16 nPageId )
if ( IsReallyVisible() && IsUpdateMode() )
bUpdate = true;
- ImplTabBarItem* pItem = (*mpItemList)[ nPos ];
+ ImplTabBarItem* pItem = (*mpImpl->mpItemList)[ nPos ];
ImplTabBarItem* pOldItem;
if ( mnCurPageId )
- pOldItem = (*mpItemList)[ GetPagePos( mnCurPageId ) ];
+ pOldItem = (*mpImpl->mpItemList)[ GetPagePos( mnCurPageId ) ];
else
pOldItem = NULL;
@@ -2152,7 +2156,7 @@ void TabBar::MakeVisible( sal_uInt16 nPageId )
SetFirstPageId( nPageId );
else
{
- ImplTabBarItem* pItem = (*mpItemList)[ nPos ];
+ ImplTabBarItem* pItem = (*mpImpl->mpItemList)[ nPos ];
// calculate visible area
long nWidth = mnLastOffX;
@@ -2226,7 +2230,7 @@ void TabBar::SelectPage( sal_uInt16 nPageId, bool bSelect )
if ( nPos != PAGE_NOT_FOUND )
{
- ImplTabBarItem* pItem = (*mpItemList)[ nPos ];
+ ImplTabBarItem* pItem = (*mpImpl->mpItemList)[ nPos ];
if ( pItem->mbSelect != bSelect )
{
@@ -2244,9 +2248,9 @@ void TabBar::SelectPage( sal_uInt16 nPageId, bool bSelect )
sal_uInt16 TabBar::GetSelectPageCount() const
{
sal_uInt16 nSelected = 0;
- for ( size_t i = 0, n = mpItemList->size(); i < n; ++i )
+ for ( size_t i = 0, n = mpImpl->mpItemList->size(); i < n; ++i )
{
- ImplTabBarItem* pItem = (*mpItemList)[ i ];
+ ImplTabBarItem* pItem = (*mpImpl->mpItemList)[ i ];
if ( pItem->mbSelect )
nSelected++;
}
@@ -2260,7 +2264,7 @@ bool TabBar::IsPageSelected( sal_uInt16 nPageId ) const
{
sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
- return (*mpItemList)[ nPos ]->mbSelect;
+ return (*mpImpl->mpItemList)[ nPos ]->mbSelect;
else
return false;
}
@@ -2423,7 +2427,7 @@ void TabBar::SetPageText( sal_uInt16 nPageId, const OUString& rText )
sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
{
- (*mpItemList)[ nPos ]->maText = rText;
+ (*mpImpl->mpItemList)[ nPos ]->maText = rText;
mbSizeFormat = true;
// redraw bar
@@ -2440,7 +2444,7 @@ OUString TabBar::GetPageText( sal_uInt16 nPageId ) const
{
sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
- return (*mpItemList)[ nPos ]->maText;
+ return (*mpImpl->mpItemList)[ nPos ]->maText;
return OUString();
}
@@ -2451,7 +2455,7 @@ OUString TabBar::GetHelpText( sal_uInt16 nPageId ) const
sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
{
- ImplTabBarItem* pItem = (*mpItemList)[ nPos ];
+ ImplTabBarItem* pItem = (*mpImpl->mpItemList)[ nPos ];
if (pItem->maHelpText.isEmpty() && !pItem->maHelpId.isEmpty())
{
Help* pHelp = Application::GetHelp();
@@ -2471,7 +2475,7 @@ OString TabBar::GetHelpId( sal_uInt16 nPageId ) const
sal_uInt16 nPos = GetPagePos( nPageId );
OString aRet;
if ( nPos != PAGE_NOT_FOUND )
- return (*mpItemList)[ nPos ]->maHelpId;
+ return (*mpImpl->mpItemList)[ nPos ]->maHelpId;
return aRet;
}
@@ -2527,14 +2531,14 @@ sal_uInt16 TabBar::ShowDropPos( const Point& rPos )
ImplTabBarItem* pItem;
sal_uInt16 nDropId;
sal_uInt16 nNewDropPos;
- sal_uInt16 nItemCount = (sal_uInt16)mpItemList->size();
+ sal_uInt16 nItemCount = (sal_uInt16) mpImpl->mpItemList->size();
short nScroll = 0;
if ( rPos.X() > mnLastOffX-TABBAR_DRAG_SCROLLOFF )
{
- pItem = (*mpItemList)[ mpItemList->size()-1 ];
+ pItem = (*mpImpl->mpItemList)[ mpImpl->mpItemList->size()-1 ];
if ( !pItem->maRect.IsEmpty() && (rPos.X() > pItem->maRect.Right()) )
- nNewDropPos = (sal_uInt16)mpItemList->size();
+ nNewDropPos = (sal_uInt16) mpImpl->mpItemList->size();
else
{
nNewDropPos = mnFirstPos+1;
@@ -2601,7 +2605,7 @@ sal_uInt16 TabBar::ShowDropPos( const Point& rPos )
SetLineColor(aBlackColor);
SetFillColor(aBlackColor);
- pItem = (*mpItemList)[ mnDropPos ];
+ pItem = (*mpImpl->mpItemList)[ mnDropPos ];
nX = pItem->maRect.Left();
if ( mnDropPos == nCurPos )
nX--;
@@ -2624,7 +2628,7 @@ sal_uInt16 TabBar::ShowDropPos( const Point& rPos )
SetLineColor(aBlackColor);
SetFillColor(aBlackColor);
- pItem = (*mpItemList)[ mnDropPos-1 ];
+ pItem = (*mpImpl->mpItemList)[ mnDropPos-1 ];
nX = pItem->maRect.Right();
if ( mnDropPos == nCurPos )
nX++;
@@ -2653,11 +2657,11 @@ void TabBar::HideDropPos()
long nX;
long nY1 = (maWinSize.Height()/2)-3;
long nY2 = nY1 + 5;
- sal_uInt16 nItemCount = (sal_uInt16)mpItemList->size();
+ sal_uInt16 nItemCount = (sal_uInt16) mpImpl->mpItemList->size();
if ( mnDropPos < nItemCount )
{
- pItem = (*mpItemList)[ mnDropPos ];
+ pItem = (*mpImpl->mpItemList)[ mnDropPos ];
nX = pItem->maRect.Left();
// immediately call Paint, as it is not possible during drag and drop
Rectangle aRect( nX-1, nY1, nX+3, nY2 );
@@ -2668,7 +2672,7 @@ void TabBar::HideDropPos()
}
if ( (mnDropPos > 0) && (mnDropPos < nItemCount+1) )
{
- pItem = (*mpItemList)[ mnDropPos-1 ];
+ pItem = (*mpImpl->mpItemList)[ mnDropPos-1 ];
nX = pItem->maRect.Right();
// immediately call Paint, as it is not possible during drag and drop
Rectangle aRect( nX-2, nY1, nX+1, nY2 );
@@ -2748,12 +2752,12 @@ Size TabBar::CalcWindowSizePixel() const
{
long nWidth = 0;
- if ( mpItemList->size() )
+ if ( mpImpl->mpItemList->size() )
{
((TabBar*)this)->ImplCalcWidth();
- for ( size_t i = 0, n = mpItemList->size(); i < n; ++i )
+ for ( size_t i = 0, n = mpImpl->mpItemList->size(); i < n; ++i )
{
- ImplTabBarItem* pItem = (*mpItemList)[ i ];
+ ImplTabBarItem* pItem = (*mpImpl->mpItemList)[ i ];
nWidth += pItem->mnWidth;
}
}