diff options
Diffstat (limited to 'svtools/source/brwbox/brwbox2.cxx')
-rw-r--r-- | svtools/source/brwbox/brwbox2.cxx | 176 |
1 files changed, 78 insertions, 98 deletions
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index c37fb6915725..9c9796baa90b 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,8 +34,6 @@ #include <svtools/colorcfg.hxx> #include <vcl/salgtype.hxx> -#ifndef GCC -#endif #include <tools/multisel.hxx> #include <algorithm> @@ -51,8 +50,6 @@ DBG_NAMEEX(BrowseBox) extern const char* BrowseBoxCheckInvariants( const void * pVoid ); -DECLARE_LIST( BrowserColumns, BrowserColumn* ) - //=================================================================== void BrowseBox::StartDrag( sal_Int8 /* _nAction */, const Point& /* _rPosPixel */ ) @@ -205,11 +202,11 @@ void BrowseBox::StateChanged( StateChangedType nStateChange ) pHeaderBar->SetZoom(GetZoom()); // let the cols calc their new widths and adjust the header bar - for ( sal_uInt16 nPos = 0; nPos < pCols->Count(); ++nPos ) + for ( size_t nPos = 0; nPos < pCols->size(); ++nPos ) { - pCols->GetObject(nPos)->ZoomChanged(GetZoom()); + (*pCols)[ nPos ]->ZoomChanged(GetZoom()); if ( pHeaderBar ) - pHeaderBar->SetItemSize( pCols->GetObject(nPos)->GetId(), pCols->GetObject(nPos)->Width() ); + pHeaderBar->SetItemSize( (*pCols)[ nPos ]->GetId(), (*pCols)[ nPos ]->Width() ); } // all our controls have to be repositioned @@ -218,7 +215,7 @@ void BrowseBox::StateChanged( StateChangedType nStateChange ) else if (STATE_CHANGE_ENABLE == nStateChange) { // do we have a handle column? - sal_Bool bHandleCol = pCols->Count() && (0 == pCols->GetObject(0)->GetId()); + sal_Bool bHandleCol = !pCols->empty() && (0 == (*pCols)[ 0 ]->GetId()); // do we have a header bar sal_Bool bHeaderBar = (NULL != static_cast<BrowserDataWin&>(GetDataWindow()).pHeaderBar); @@ -310,7 +307,6 @@ void BrowseBox::ColumnMoved( sal_uInt16 ) void BrowseBox::StartScroll() { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); - //((Control*)pDataWin)->HideFocus(); DoHideCursor( "StartScroll" ); } @@ -351,7 +347,7 @@ void BrowseBox::ToggleSelection( sal_Bool bForce ) long nLastRowInRect = 0; // fuer den CFront // Handle-Column nicht highlighten - BrowserColumn *pFirstCol = pCols->GetObject(0); + BrowserColumn *pFirstCol = pCols->empty() ? NULL : (*pCols)[ 0 ]; long nOfsX = (!pFirstCol || pFirstCol->GetId()) ? 0 : pFirstCol->Width(); // accumulate old row selection @@ -369,20 +365,21 @@ void BrowseBox::ToggleSelection( sal_Bool bForce ) Rectangle aAddRect( Point( nOfsX, (nRow-nTopRow)*GetDataRowHeight() ), Size( pDataWin->GetSizePixel().Width(), GetDataRowHeight() ) ); - if ( aHighlightList.Count() && nLastRowInRect == ( nRow - 1 ) ) - aHighlightList.First()->Union( aAddRect ); + if ( aHighlightList.size() && nLastRowInRect == ( nRow - 1 ) ) + aHighlightList[ 0 ]->Union( aAddRect ); else - aHighlightList.Insert( new Rectangle( aAddRect ), (sal_uLong) 0 ); + aHighlightList.insert( aHighlightList.begin(), new Rectangle( aAddRect ) ); nLastRowInRect = nRow; } // unhighlight the old selection (if any) - while ( aHighlightList.Count() ) + for ( size_t i = aHighlightList.size(); i > 0; ) { - Rectangle *pRect = aHighlightList.Remove( aHighlightList.Count() - 1 ); + Rectangle *pRect = aHighlightList[ --i ]; pDataWin->Invalidate( *pRect ); delete pRect; } + aHighlightList.clear(); // unhighlight old column selection (if any) for ( long nColId = pColSel ? pColSel->FirstSelected() : BROWSER_ENDOFSELECTION; @@ -390,7 +387,7 @@ void BrowseBox::ToggleSelection( sal_Bool bForce ) nColId = pColSel->NextSelected() ) { Rectangle aRect( GetFieldRectPixel(nCurRow, - pCols->GetObject(nColId)->GetId(), + (*pCols)[ nColId ]->GetId(), sal_False ) ); aRect.Left() -= MIN_COLUMNWIDTH; aRect.Right() += MIN_COLUMNWIDTH; @@ -437,15 +434,14 @@ void BrowseBox::DrawCursor() if ( bColumnCursor ) { aCursor = GetFieldRectPixel( nCurRow, nCurColId, sal_False ); - //! --aCursor.Bottom(); aCursor.Left() -= MIN_COLUMNWIDTH; aCursor.Right() += 1; aCursor.Bottom() += 1; } else aCursor = Rectangle( - Point( ( pCols->Count() && pCols->GetObject(0)->GetId() == 0 ) ? - pCols->GetObject(0)->Width() : 0, + Point( ( !pCols->empty() && (*pCols)[ 0 ]->GetId() == 0 ) ? + (*pCols)[ 0 ]->Width() : 0, (nCurRow - nTopRow) * GetDataRowHeight() + 1 ), Size( pDataWin->GetOutputSizePixel().Width() + 1, GetDataRowHeight() - 2 ) ); @@ -456,8 +452,6 @@ void BrowseBox::DrawCursor() --aCursor.Bottom(); } - //!mi_mac pDataWin->Update(); - if (m_aCursorColor == COL_TRANSPARENT) { // auf diesem Plattformen funktioniert der StarView-Focus richtig @@ -486,9 +480,9 @@ sal_uLong BrowseBox::GetColumnWidth( sal_uInt16 nId ) const DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); sal_uInt16 nItemPos = GetColumnPos( nId ); - if ( nItemPos >= pCols->Count() ) + if ( nItemPos >= pCols->size() ) return 0; - return pCols->GetObject(nItemPos)->Width(); + return (*pCols)[ nItemPos ]->Width(); } //------------------------------------------------------------------- @@ -497,9 +491,9 @@ sal_uInt16 BrowseBox::GetColumnId( sal_uInt16 nPos ) const { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); - if ( nPos >= pCols->Count() ) + if ( nPos >= pCols->size() ) return 0; - return pCols->GetObject(nPos)->GetId(); + return (*pCols)[ nPos ]->GetId(); } //------------------------------------------------------------------- @@ -508,8 +502,8 @@ sal_uInt16 BrowseBox::GetColumnPos( sal_uInt16 nId ) const { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); - for ( sal_uInt16 nPos = 0; nPos < pCols->Count(); ++nPos ) - if ( pCols->GetObject(nPos)->GetId() == nId ) + for ( sal_uInt16 nPos = 0; nPos < pCols->size(); ++nPos ) + if ( (*pCols)[ nPos ]->GetId() == nId ) return nPos; return BROWSER_INVALIDID; } @@ -520,9 +514,9 @@ sal_Bool BrowseBox::IsFrozen( sal_uInt16 nColumnId ) const { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); - for ( sal_uInt16 nPos = 0; nPos < pCols->Count(); ++nPos ) - if ( pCols->GetObject(nPos)->GetId() == nColumnId ) - return pCols->GetObject(nPos)->IsFrozen(); + for ( size_t nPos = 0; nPos < pCols->size(); ++nPos ) + if ( (*pCols)[ nPos ]->GetId() == nColumnId ) + return (*pCols)[ nPos ]->IsFrozen(); return sal_False; } @@ -599,7 +593,7 @@ void BrowseBox::Resize() DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); if ( !bBootstrapped && IsReallyVisible() ) BrowseBox::StateChanged( STATE_CHANGE_INITSHOW ); - if ( !pCols->Count() ) + if ( pCols->empty() ) { getDataWindow()->bResizeOnPaint = sal_True; return; @@ -619,7 +613,7 @@ void BrowseBox::Resize() // did we need a horiz. scroll bar oder gibt es eine Control Area? if ( !getDataWindow()->bNoHScroll && - ( ( pCols->Count() - FrozenColCount() ) > 1 ) ) + ( ( pCols->size() - FrozenColCount() ) > 1 ) ) aHScroll.Show(); else aHScroll.Hide(); @@ -659,7 +653,7 @@ void BrowseBox::Resize() if ( pHeaderBar ) { // Handle-Column beruecksichtigen - BrowserColumn *pFirstCol = pCols->GetObject(0); + BrowserColumn *pFirstCol = (*pCols)[ 0 ]; long nOfsX = pFirstCol->GetId() ? 0 : pFirstCol->Width(); pHeaderBar->SetPosSizePixel( Point( nOfsX, 0 ), Size( GetOutputSizePixel().Width() - nOfsX, GetTitleHeight() ) ); } @@ -677,10 +671,10 @@ void BrowseBox::Paint( const Rectangle& rRect ) // initializations if ( !bBootstrapped && IsReallyVisible() ) BrowseBox::StateChanged( STATE_CHANGE_INITSHOW ); - if ( !pCols->Count() ) + if ( pCols->empty() ) return; - BrowserColumn *pFirstCol = pCols->GetObject(0); + BrowserColumn *pFirstCol = (*pCols)[ 0 ]; sal_Bool bHandleCol = pFirstCol && pFirstCol->GetId() == 0; sal_Bool bHeaderBar = getDataWindow()->pHeaderBar != NULL; @@ -709,20 +703,20 @@ void BrowseBox::Paint( const Rectangle& rRect ) { // iterate through columns to redraw long nX = 0; - sal_uInt16 nCol; + size_t nCol; for ( nCol = 0; - nCol < pCols->Count() && nX < rRect.Right(); + nCol < pCols->size() && nX < rRect.Right(); ++nCol ) { // skip invisible colums between frozen and scrollable area - if ( nCol < nFirstCol && !pCols->GetObject(nCol)->IsFrozen() ) + if ( nCol < nFirstCol && !(*pCols)[ nCol ]->IsFrozen() ) nCol = nFirstCol; // nur die HandleCol ? if (bHeaderBar && bHandleCol && nCol > 0) break; - BrowserColumn *pCol = pCols->GetObject(nCol); + BrowserColumn *pCol = (*pCols)[ nCol ]; // draw the column and increment position if ( pCol->Width() > 4 ) @@ -749,7 +743,7 @@ void BrowseBox::Paint( const Rectangle& rRect ) } // retouching - if ( !bHeaderBar && nCol == pCols->Count() ) + if ( !bHeaderBar && nCol == pCols->size() ) { const StyleSettings &rSettings = GetSettings().GetStyleSettings(); Color aColFace( rSettings.GetFaceColor() ); @@ -820,10 +814,10 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, nDataRowHeight = nForeignHeightPixel; // this counts for the column widths, too - sal_uInt16 nPos; - for ( nPos = 0; nPos < pCols->Count(); ++nPos ) + size_t nPos; + for ( nPos = 0; nPos < pCols->size(); ++nPos ) { - BrowserColumn* pCurrent = pCols->GetObject(nPos); + BrowserColumn* pCurrent = (*pCols)[ nPos ]; long nWidthLogic = PixelToLogic(Size(pCurrent->Width(), 0), MAP_10TH_MM).Width(); long nForeignWidthPixel = pDev->LogicToPixel(Size(nWidthLogic, 0), MAP_10TH_MM).Width(); @@ -846,7 +840,7 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, long nTitleHeight = PixelToLogic(Size(0, GetTitleHeight()), MAP_10TH_MM).Height(); nTitleHeight = pDev->LogicToPixel(Size(0, nTitleHeight), MAP_10TH_MM).Height(); - BrowserColumn* pFirstCol = pCols->Count() ? pCols->GetObject(0) : NULL; + BrowserColumn* pFirstCol = !pCols->empty() ? (*pCols)[ 0 ] : NULL; Point aHeaderPos(pFirstCol && (pFirstCol->GetId() == 0) ? pFirstCol->Width() : 0, 0); Size aHeaderSize(aRealSize.Width() - aHeaderPos.X(), nTitleHeight); @@ -900,9 +894,9 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, // restore the column widths/data row height nDataRowHeight = nOriginalHeight; - for ( nPos = 0; nPos < pCols->Count(); ++nPos ) + for ( nPos = 0; nPos < pCols->size(); ++nPos ) { - BrowserColumn* pCurrent = pCols->GetObject(nPos); + BrowserColumn* pCurrent = (*pCols)[ nPos ]; long nForeignWidthLogic = pDev->PixelToLogic(Size(pCurrent->Width(), 0), MAP_10TH_MM).Width(); long nWidthPixel = LogicToPixel(Size(nForeignWidthLogic, 0), MAP_10TH_MM).Width(); @@ -939,15 +933,12 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, sal_ Color aOldTextColor = _rOut.GetTextColor(); Color aOldFillColor = _rOut.GetFillColor(); Color aOldLineColor = _rOut.GetLineColor(); - long nHLineX = 0 == pCols->GetObject(0)->GetId() - ? pCols->GetObject(0)->Width() - : 0; + long nHLineX = 0 == (*pCols)[ 0 ]->GetId() ? (*pCols)[ 0 ]->Width() : 0; nHLineX += aOverallAreaPos.X(); Color aDelimiterLineColor( ::svtools::ColorConfig().GetColorValue( ::svtools::CALCGRID ).nColor ); // redraw the invalid fields - sal_Bool bRetouching = sal_False; for ( sal_uLong nRelRow = nRelTopRow; nRelRow <= nRelBottomRow && (sal_uLong)nTopRow+nRelRow < (sal_uLong)nRowCount; ++nRelRow, aPos.Y() += nDataRowHeigt ) @@ -961,7 +952,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, sal_ // prepare row sal_uLong nRow = nTopRow+nRelRow; if ( !SeekRow( nRow) ) { - DBG_ERROR("BrowseBox::ImplPaintData: SeekRow gescheitert"); + OSL_FAIL("BrowseBox::ImplPaintData: SeekRow gescheitert"); } _rOut.SetClipRegion(); aPos.X() = aOverallAreaPos.X(); @@ -985,11 +976,11 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, sal_ } // iterate through columns to redraw - sal_uInt16 nCol; - for ( nCol = 0; nCol < pCols->Count(); ++nCol ) + size_t nCol; + for ( nCol = 0; nCol < pCols->size(); ++nCol ) { // get column - BrowserColumn *pCol = pCols->GetObject(nCol); + BrowserColumn *pCol = (*pCols)[ nCol ]; // at end of invalid area if ( aPos.X() >= _rRect.Right() ) @@ -999,11 +990,11 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, sal_ if ( nCol < nFirstCol && !pCol->IsFrozen() ) { nCol = nFirstCol; - pCol = pCols->GetObject(nCol); + pCol = (nCol < pCols->size() ) ? (*pCols)[ nCol ] : NULL; if (!pCol) { // FS - 21.05.99 - 66325 // ist zwar eigentlich woanders (an der richtigen Stelle) gefixt, aber sicher ist sicher ... - DBG_ERROR("BrowseBox::PaintData : nFirstCol is probably invalid !"); + OSL_FAIL("BrowseBox::PaintData : nFirstCol is probably invalid !"); break; } } @@ -1066,9 +1057,6 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, sal_ aPos.X() += pCol->Width(); } - if ( nCol == pCols->Count() ) - bRetouching = sal_True; - // reset auto-highlight if ( bRowSelected ) { @@ -1103,14 +1091,14 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, sal_ aOldLineColor = _rOut.GetLineColor(); aOldFillColor = _rOut.GetFillColor(); _rOut.SetFillColor( rSettings.GetFaceColor() ); - if ( pCols->Count() && ( pCols->GetObject(0)->GetId() == 0 ) && ( aPos.Y() <= _rRect.Bottom() ) ) + if ( !pCols->empty() && ( (*pCols)[ 0 ]->GetId() == 0 ) && ( aPos.Y() <= _rRect.Bottom() ) ) { // fill rectangle gray below handle column // DG: fill it only until the end of the drawing rect and not to the end, as this may overpaint handle columns _rOut.SetLineColor( Color( COL_BLACK ) ); _rOut.DrawRect( Rectangle( Point( aOverallAreaPos.X() - 1, aPos.Y() - 1 ), - Point( aOverallAreaPos.X() + pCols->GetObject(0)->Width() - 1, + Point( aOverallAreaPos.X() + (*pCols)[ 0 ]->Width() - 1, _rRect.Bottom() + 1) ) ); } _rOut.SetFillColor( aOldFillColor ); @@ -1129,16 +1117,16 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, sal_ _rOut.SetLineColor( aDelimiterLineColor ); Point aVertPos( aOverallAreaPos.X() - 1, aOverallAreaPos.Y() ); long nDeltaY = aOverallAreaBRPos.Y(); - for ( sal_uInt16 nCol = 0; nCol < pCols->Count(); ++nCol ) + for ( size_t nCol = 0; nCol < pCols->size(); ++nCol ) { // get column - BrowserColumn *pCol = pCols->GetObject(nCol); + BrowserColumn *pCol = (*pCols)[ nCol ]; // skip invisible colums between frozen and scrollable area if ( nCol < nFirstCol && !pCol->IsFrozen() ) { nCol = nFirstCol; - pCol = pCols->GetObject(nCol); + pCol = (*pCols)[ nCol ]; } // skip column @@ -1171,7 +1159,7 @@ void BrowseBox::PaintData( Window& rWin, const Rectangle& rRect ) BrowseBox::StateChanged( STATE_CHANGE_INITSHOW ); // initializations - if ( !pCols || !pCols->Count() || !rWin.IsUpdateMode() ) + if ( !pCols || pCols->empty() || !rWin.IsUpdateMode() ) return; if ( getDataWindow()->bResizeOnPaint ) Resize(); @@ -1231,7 +1219,7 @@ void BrowseBox::UpdateScrollbars() sal_uInt16 nFrozenCols = FrozenColCount(); sal_Bool bNeedsHScroll = getDataWindow()->bAutoHScroll - ? ( nFirstCol > nFrozenCols ) || ( nLastCol <= pCols->Count() ) + ? ( nFirstCol > nFrozenCols ) || ( nLastCol <= pCols->size() ) : !getDataWindow()->bNoHScroll; if ( !bNeedsHScroll ) { @@ -1260,19 +1248,11 @@ void BrowseBox::UpdateScrollbars() Size( aDataWinSize.Width() - nHScrX, nCornerSize ) ); // Scrollable Columns insgesamt - short nScrollCols = short(pCols->Count()) - (short)nFrozenCols; - /*short nVisibleHSize= std::max(nLastCol == BROWSER_INVALIDID - ? pCols->Count() - nFirstCol -1 - : nLastCol - nFirstCol - 1, 0); - - aHScroll.SetVisibleSize( nVisibleHSize ); - aHScroll.SetRange( Range( 0, Max( std::min(nScrollCols, nVisibleHSize), (short)0 ) ) ); - if ( bNeedsHScroll && !aHScroll.IsVisible() ) - aHScroll.Show();*/ + short nScrollCols = short(pCols->size()) - (short)nFrozenCols; // Sichtbare Columns short nVisibleHSize = nLastCol == BROWSER_INVALIDID - ? (short)( pCols->Count() - nFirstCol ) + ? (short)( pCols->size() - nFirstCol ) : (short)( nLastCol - nFirstCol ); short nRange = Max( nScrollCols, (short)0 ); @@ -1287,7 +1267,7 @@ void BrowseBox::UpdateScrollbars() if ( nTopRow > nRowCount ) { nTopRow = nRowCount - 1; - DBG_ERROR("BrowseBox: nTopRow > nRowCount"); + OSL_FAIL("BrowseBox: nTopRow > nRowCount"); } if ( pVScroll->GetThumbPos() != nTopRow ) @@ -1338,13 +1318,13 @@ void BrowseBox::UpdateScrollbars() if ( getDataWindow()->pHeaderBar ) { long nWidth = 0; - for ( sal_uInt16 nCol = 0; - nCol < pCols->Count() && nCol < nFirstCol; + for ( size_t nCol = 0; + nCol < pCols->size() && nCol < nFirstCol; ++nCol ) { // HandleColumn nicht - if ( pCols->GetObject(nCol)->GetId() ) - nWidth += pCols->GetObject(nCol)->Width(); + if ( (*pCols)[ nCol ]->GetId() ) + nWidth += (*pCols)[ nCol ]->Width(); } getDataWindow()->pHeaderBar->SetOffset( nWidth ); @@ -1406,10 +1386,10 @@ long BrowseBox::GetFrozenWidth() const DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); long nWidth = 0; - for ( sal_uInt16 nCol = 0; - nCol < pCols->Count() && pCols->GetObject(nCol)->IsFrozen(); + for ( size_t nCol = 0; + nCol < pCols->size() && (*pCols)[ nCol ]->IsFrozen(); ++nCol ) - nWidth += pCols->GetObject(nCol)->Width(); + nWidth += (*pCols)[ nCol ]->Width(); return nWidth; } @@ -1431,7 +1411,7 @@ sal_uInt16 BrowseBox::FrozenColCount() const DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); sal_uInt16 nCol; for ( nCol = 0; - nCol < pCols->Count() && pCols->GetObject(nCol)->IsFrozen(); + nCol < pCols->size() && (*pCols)[ nCol ]->IsFrozen(); ++nCol ) /* empty loop */; return nCol; @@ -1469,9 +1449,8 @@ IMPL_LINK( BrowseBox,EndScrollHdl,ScrollBar*, EMPTYARG ) // kein Focus grabben! /// GrabFocus(); - if ( /*pBar->GetDelta() <= 0 &&*/ getDataWindow()->bNoScrollBack ) + if ( getDataWindow()->bNoScrollBack ) { - // UpdateScrollbars(); EndScroll(); return 0; } @@ -1506,10 +1485,10 @@ void BrowseBox::MouseButtonDown( const MouseEvent& rEvt ) long nX = 0; long nWidth = GetOutputSizePixel().Width(); - for ( sal_uInt16 nCol = 0; nCol < pCols->Count() && nX < nWidth; ++nCol ) + for ( size_t nCol = 0; nCol < pCols->size() && nX < nWidth; ++nCol ) { // is this column visible? - BrowserColumn *pCol = pCols->GetObject(nCol); + BrowserColumn *pCol = (*pCols)[ nCol ]; if ( pCol->IsFrozen() || nCol >= nFirstCol ) { // compute right end of column @@ -1539,7 +1518,7 @@ void BrowseBox::MouseButtonDown( const MouseEvent& rEvt ) } } - // event occured out of data area + // event occurred out of data area if ( rEvt.IsRight() ) pDataWin->Command( CommandEvent( Point( 1, LONG_MAX ), COMMAND_CONTEXTMENU, sal_True ) ); @@ -1556,20 +1535,20 @@ void BrowseBox::MouseButtonDown( const MouseEvent& rEvt ) void BrowseBox::MouseMove( const MouseEvent& rEvt ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); - DBG_TRACE( "BrowseBox::MouseMove( MouseEvent )" ); + OSL_TRACE( "BrowseBox::MouseMove( MouseEvent )" ); Pointer aNewPointer; sal_uInt16 nX = 0; - for ( sal_uInt16 nCol = 0; - nCol < sal_uInt16(pCols->Count()) && - ( nX + pCols->GetObject(nCol)->Width() ) < sal_uInt16(GetOutputSizePixel().Width()); + for ( size_t nCol = 0; + nCol < pCols->size() && + ( nX + (*pCols)[ nCol ]->Width() ) < sal_uInt16(GetOutputSizePixel().Width()); ++nCol ) // is this column visible? - if ( pCols->GetObject(nCol)->IsFrozen() || nCol >= nFirstCol ) + if ( (*pCols)[ nCol ]->IsFrozen() || nCol >= nFirstCol ) { // compute right end of column - BrowserColumn *pCol = pCols->GetObject(nCol); + BrowserColumn *pCol = (*pCols)[ nCol ]; sal_uInt16 nR = (sal_uInt16)(nX + pCol->Width() - 1); // show resize-pointer? @@ -1618,7 +1597,7 @@ void BrowseBox::MouseButtonUp( const MouseEvent & rEvt ) // width changed? nDragX = Max( rEvt.GetPosPixel().X(), nMinResizeX ); - if ( (nDragX - nResizeX) != (long)pCols->GetObject(nResizeCol)->Width() ) + if ( (nDragX - nResizeX) != (long)(*pCols)[ nResizeCol ]->Width() ) { // resize column long nMaxX = pDataWin->GetSizePixel().Width(); @@ -1666,7 +1645,7 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt ) { if ( bColumnCursor && rEvt.GetColumn() != 0 ) { - if ( rEvt.GetColumn() < pCols->Count() ) + if ( rEvt.GetColumn() < pCols->size() ) SelectColumnPos( rEvt.GetColumn(), sal_True, sal_False); } } @@ -2175,3 +2154,4 @@ Rectangle BrowseBox::GetFieldRectPixelAbs( sal_Int32 _nRowId,sal_uInt16 _nColId, // ------------------------------------------------------------------------- EOF +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |