summaryrefslogtreecommitdiff
path: root/svtools/source/brwbox/datwin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svtools/source/brwbox/datwin.cxx')
-rw-r--r--svtools/source/brwbox/datwin.cxx65
1 files changed, 27 insertions, 38 deletions
diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx
index 377180653780..f944908c269d 100644
--- a/svtools/source/brwbox/datwin.cxx
+++ b/svtools/source/brwbox/datwin.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.
@@ -30,24 +31,13 @@
#include "datwin.hxx"
-#ifndef GCC
-#endif
-
-#ifndef _APP_HXX //autogen
#include <vcl/svapp.hxx>
-#endif
-#ifndef _HELP_HXX
#include <vcl/help.hxx>
-#endif
-#ifndef _IMAGE_HXX
#include <vcl/image.hxx>
-#endif
#include <tools/debug.hxx>
-DECLARE_LIST( BrowserColumns, BrowserColumn* )
-
//===================================================================
void ButtonFrame::Draw( OutputDevice& rDev )
{
@@ -242,6 +232,10 @@ BrowserDataWin::~BrowserDataWin()
{
if( pDtorNotify )
*pDtorNotify = sal_True;
+
+ for ( size_t i = 0, n = aInvalidRegion.size(); i < n; ++i )
+ delete aInvalidRegion[ i ];
+ aInvalidRegion.clear();
}
//-------------------------------------------------------------------
@@ -325,7 +319,7 @@ void BrowserDataWin::Paint( const Rectangle& rRect )
{
if ( bInPaint )
{
- aInvalidRegion.Insert( new Rectangle( rRect ) );
+ aInvalidRegion.push_back( new Rectangle( rRect ) );
return;
}
bInPaint = sal_True;
@@ -334,7 +328,7 @@ void BrowserDataWin::Paint( const Rectangle& rRect )
DoOutstandingInvalidations();
}
else
- aInvalidRegion.Insert( new Rectangle( rRect ) );
+ aInvalidRegion.push_back( new Rectangle( rRect ) );
}
//-------------------------------------------------------------------
@@ -352,28 +346,28 @@ BrowseEvent BrowserDataWin::CreateBrowseEvent( const Point& rPosPixel )
// find column under mouse
long nMouseX = rPosPixel.X();
long nColX = 0;
- sal_uInt16 nCol;
+ size_t nCol;
for ( nCol = 0;
- nCol < pBox->pCols->Count() && nColX < GetSizePixel().Width();
+ nCol < pBox->pCols->size() && nColX < GetSizePixel().Width();
++nCol )
- if ( pBox->pCols->GetObject(nCol)->IsFrozen() || nCol >= pBox->nFirstCol )
+ if ( (*pBox->pCols)[ nCol ]->IsFrozen() || nCol >= pBox->nFirstCol )
{
- nColX += pBox->pCols->GetObject(nCol)->Width();
+ nColX += (*pBox->pCols)[ nCol ]->Width();
if ( nMouseX < nColX )
break;
}
sal_uInt16 nColId = BROWSER_INVALIDID;
- if ( nCol < pBox->pCols->Count() )
- nColId = pBox->pCols->GetObject(nCol)->GetId();
+ if ( nCol < pBox->pCols->size() )
+ nColId = (*pBox->pCols)[ nCol ]->GetId();
// compute the field rectangle and field relative MouseEvent
Rectangle aFieldRect;
- if ( nCol < pBox->pCols->Count() )
+ if ( nCol < pBox->pCols->size() )
{
- nColX -= pBox->pCols->GetObject(nCol)->Width();
+ nColX -= (*pBox->pCols)[ nCol ]->Width();
aFieldRect = Rectangle(
Point( nColX, nRelRow * pBox->GetDataRowHeight() ),
- Size( pBox->pCols->GetObject(nCol)->Width(),
+ Size( (*pBox->pCols)[ nCol ]->Width(),
pBox->GetDataRowHeight() ) );
}
@@ -695,8 +689,7 @@ BrowserExecuteDropEvent::BrowserExecuteDropEvent( BrowserDataWin *pWindow, const
void BrowserDataWin::SetUpdateMode( sal_Bool bMode )
{
- DBG_ASSERT( !bUpdateMode || aInvalidRegion.Count() == 0,
- "invalid region not empty" );
+ DBG_ASSERT( !bUpdateMode || aInvalidRegion.empty(), "invalid region not empty" );
if ( bMode == bUpdateMode )
return;
@@ -708,14 +701,11 @@ void BrowserDataWin::SetUpdateMode( sal_Bool bMode )
//-------------------------------------------------------------------
void BrowserDataWin::DoOutstandingInvalidations()
{
- for ( Rectangle* pRect = aInvalidRegion.First();
- pRect;
- pRect = aInvalidRegion.Next() )
- {
- Control::Invalidate( *pRect );
- delete pRect;
+ for ( size_t i = 0, n = aInvalidRegion.size(); i < n; ++i ) {
+ Control::Invalidate( *aInvalidRegion[ i ] );
+ delete aInvalidRegion[ i ];
}
- aInvalidRegion.Clear();
+ aInvalidRegion.clear();
}
//-------------------------------------------------------------------
@@ -724,12 +714,10 @@ void BrowserDataWin::Invalidate( sal_uInt16 nFlags )
{
if ( !GetUpdateMode() )
{
- for ( Rectangle* pRect = aInvalidRegion.First();
- pRect;
- pRect = aInvalidRegion.Next() )
- delete pRect;
- aInvalidRegion.Clear();
- aInvalidRegion.Insert( new Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) );
+ for ( size_t i = 0, n = aInvalidRegion.size(); i < n; ++i )
+ delete aInvalidRegion[ i ];
+ aInvalidRegion.clear();
+ aInvalidRegion.push_back( new Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) );
}
else
Window::Invalidate( nFlags );
@@ -740,7 +728,7 @@ void BrowserDataWin::Invalidate( sal_uInt16 nFlags )
void BrowserDataWin::Invalidate( const Rectangle& rRect, sal_uInt16 nFlags )
{
if ( !GetUpdateMode() )
- aInvalidRegion.Insert( new Rectangle( rRect ) );
+ aInvalidRegion.push_back( new Rectangle( rRect ) );
else
Window::Invalidate( rRect, nFlags );
}
@@ -781,3 +769,4 @@ void BrowserScrollBar::EndScroll()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */