[Libreoffice-commits] .: 3 commits - basctl/source svtools/inc svtools/source svtools/workben sw/inc sw/source
Michael Stahl
mst at kemper.freedesktop.org
Mon Apr 2 14:22:57 PDT 2012
basctl/source/basicide/baside2.hxx | 5 +
basctl/source/basicide/baside2b.cxx | 16 +---
svtools/inc/svtools/calendar.hxx | 16 ++--
svtools/source/control/calendar.cxx | 134 +++++++++++++++++-------------------
svtools/workben/svdem.cxx | 2
sw/inc/crsrsh.hxx | 1
sw/inc/tblsel.hxx | 3
sw/source/core/crsr/trvltbl.cxx | 2
sw/source/core/frmedt/fetab.cxx | 14 +--
sw/source/core/frmedt/tblsel.cxx | 25 ++----
10 files changed, 109 insertions(+), 109 deletions(-)
New commits:
commit 9ef0b8e3aa2137af67624dbd757fe464e44202ed
Author: Noel Grandin <noel at peralex.com>
Date: Mon Apr 2 23:18:19 2012 +0200
Convert tools/table.hxx to std::set in EditorWindow class in basctl module
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index c7b3f05..8adbe15 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -51,11 +51,11 @@ class SvxSearchItem;
#include <sfx2/progress.hxx>
#include <svtools/syntaxhighlight.hxx>
#include <unotools/options.hxx>
-#include <tools/table.hxx>
#include "breakpoint.hxx"
#include "linenumberwindow.hxx"
#include "objdlg.hxx"
+#include <set>
#include <tools/table.hxx>
@@ -95,6 +95,8 @@ inline void ProgressInfo::StepProgress()
SetState( ++nCurState );
}
+typedef std::set<sal_uInt16> SyntaxLineSet;
+
class EditorWindow : public Window, public SfxListener
{
private:
@@ -113,7 +115,7 @@ private:
SyntaxHighlighter aHighlighter;
Timer aSyntaxIdleTimer;
- Table aSyntaxLineTable;
+ SyntaxLineSet aSyntaxLineTable;
DECL_LINK(SyntaxTimerHdl, void *);
ProgressInfo* pProgress;
ModulWindow* pModulWindow;
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index efe352f..ef67435 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -628,7 +628,7 @@ void EditorWindow::CreateEditEngine()
for ( sal_uInt16 nLine = 0; nLine < nLines; nLine++ )
- aSyntaxLineTable.Insert( nLine, (void*)(sal_uInt16)1 );
+ aSyntaxLineTable.insert( nLine );
ForceSyntaxTimeout();
DELETEZ( pProgress );
@@ -793,7 +793,7 @@ void EditorWindow::ImpDoHighlight( sal_uLong nLine )
if ( aChanges.Len() )
{
for ( long n = aChanges.Min() + 1; n <= aChanges.Max(); n++ )
- aSyntaxLineTable.Insert( n, (void*)(sal_uLong)1 );
+ aSyntaxLineTable.insert( n );
aSyntaxIdleTimer.Start();
}
@@ -868,7 +868,7 @@ void EditorWindow::DoDelayedSyntaxHighlight( sal_uLong nPara )
{
if ( bDelayHighlight )
{
- aSyntaxLineTable.Insert( nPara, (void*)(sal_uLong)1 );
+ aSyntaxLineTable.insert( nPara );
aSyntaxIdleTimer.Start();
}
else
@@ -884,13 +884,11 @@ IMPL_LINK_NOARG(EditorWindow, SyntaxTimerHdl)
// pEditEngine->SetUpdateMode( sal_False );
bHighlightning = sal_True;
- sal_uInt16 nLine;
- void* p = aSyntaxLineTable.First();
- while ( p )
+ for ( SyntaxLineSet::const_iterator it = aSyntaxLineTable.begin();
+ it != aSyntaxLineTable.end(); ++it )
{
- nLine = (sal_uInt16)aSyntaxLineTable.GetCurKey();
+ sal_uInt16 nLine = *it;
DoSyntaxHighlight( nLine );
- p = aSyntaxLineTable.Next();
}
// #i45572#
@@ -899,7 +897,7 @@ IMPL_LINK_NOARG(EditorWindow, SyntaxTimerHdl)
pEditEngine->SetModified( bWasModified );
- aSyntaxLineTable.Clear();
+ aSyntaxLineTable.clear();
bHighlightning = sal_False;
return 0;
commit e5a916eeeed8e79a3d105040f3fb832134bf7b32
Author: Noel Grandin <noel at peralex.com>
Date: Thu Mar 29 18:14:00 2012 +0200
Convert tools/table.hxx usage to std::set in Calendar class in svtools module
Also change the API slightly, removing GetSelectedData(int index) and replacing
it with GetLastSelectedDate(), since the only usage of GetSelectedData in
the codebase only needed to get the last date.
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index 922be10..c7b3f05 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -51,6 +51,7 @@ class SvxSearchItem;
#include <sfx2/progress.hxx>
#include <svtools/syntaxhighlight.hxx>
#include <unotools/options.hxx>
+#include <tools/table.hxx>
#include "breakpoint.hxx"
#include "linenumberwindow.hxx"
diff --git a/svtools/inc/svtools/calendar.hxx b/svtools/inc/svtools/calendar.hxx
index 4d099d4..c9df5a1 100644
--- a/svtools/inc/svtools/calendar.hxx
+++ b/svtools/inc/svtools/calendar.hxx
@@ -36,8 +36,8 @@
#include <vcl/ctrl.hxx>
#include <vcl/timer.hxx>
#include <vcl/field.hxx>
+#include <set>
-class Table;
class MouseEvent;
class TrackingEvent;
class KeyEvent;
@@ -162,12 +162,15 @@ calls or by ending a selection.
// - Calendar -
// ------------
+typedef std::set<sal_uInt32> IntDateSet;
+
+
class SVT_DLLPUBLIC Calendar : public Control
{
private:
- Table* mpSelectTable;
- Table* mpOldSelectTable;
- Table* mpRestoreSelectTable;
+ IntDateSet* mpSelectTable;
+ IntDateSet* mpOldSelectTable;
+ IntDateSet* mpRestoreSelectTable;
XubString* mpDayText[31];
XubString maDayText;
XubString maWeekText;
@@ -250,7 +253,7 @@ private:
sal_uLong nToday = 0 );
SVT_DLLPRIVATE void ImplDraw( sal_Bool bPaint = sal_False );
SVT_DLLPRIVATE void ImplUpdateDate( const Date& rDate );
- SVT_DLLPRIVATE void ImplUpdateSelection( Table* pOld );
+ SVT_DLLPRIVATE void ImplUpdateSelection( IntDateSet* pOld );
SVT_DLLPRIVATE void ImplMouseSelect( const Date& rDate, sal_uInt16 nHitTest,
sal_Bool bMove, sal_Bool bExpand, sal_Bool bExtended );
SVT_DLLPRIVATE void ImplUpdate( sal_Bool bCalcNew = sal_False );
@@ -296,7 +299,8 @@ public:
void SelectDate( const Date& rDate, sal_Bool bSelect = sal_True );
void SetNoSelection();
sal_Bool IsDateSelected( const Date& rDate ) const;
- Date GetSelectDate( sal_uLong nIndex = 0 ) const;
+ Date GetFirstSelectedDate() const;
+ Date GetLastSelectedDate() const;
void EnableCallEverySelect( sal_Bool bEvery = sal_True ) { mbAllSel = bEvery; }
sal_Bool IsCallEverySelectEnabled() const { return mbAllSel; }
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index c82b29f..285e0d5 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -30,7 +30,6 @@
#include <rtl/oustringostreaminserter.hxx>
#include <rtl/strbuf.hxx>
#include <vcl/svapp.hxx>
-#include <tools/table.hxx>
#include <vcl/help.hxx>
#include <vcl/menu.hxx>
#include <vcl/decoview.hxx>
@@ -72,23 +71,21 @@
#define MENU_YEAR_COUNT 3
-#define TABLE_DATE_SELECTED ((void*)0x00000001)
-
using namespace ::com::sun::star;
// =======================================================================
-static void ImplCalendarSelectDate( Table* pTable, const Date& rDate, sal_Bool bSelect )
+static void ImplCalendarSelectDate( IntDateSet* pTable, const Date& rDate, sal_Bool bSelect )
{
if ( bSelect )
- pTable->Insert( rDate.GetDate(), TABLE_DATE_SELECTED );
+ pTable->insert( rDate.GetDate() );
else
- pTable->Remove( rDate.GetDate() );
+ pTable->erase( rDate.GetDate() );
}
// -----------------------------------------------------------------------
-static void ImplCalendarSelectDateRange( Table* pTable,
+static void ImplCalendarSelectDateRange( IntDateSet* pTable,
const Date& rStartDate,
const Date& rEndDate,
sal_Bool bSelect )
@@ -106,31 +103,30 @@ static void ImplCalendarSelectDateRange( Table* pTable,
{
while ( aStartDate <= aEndDate )
{
- pTable->Insert( aStartDate.GetDate(), TABLE_DATE_SELECTED );
+ pTable->insert( aStartDate.GetDate() );
aStartDate++;
}
}
else
{
- void* p = pTable->First();
- while ( p )
+ for ( IntDateSet::const_iterator it = pTable->begin(); it != pTable->end(); )
{
- Date aDate( pTable->GetCurKey() );
+ Date aDate( *it );
if ( aDate > aEndDate )
break;
if ( aDate >= aStartDate )
- pTable->Remove( aDate.GetDate() );
+ pTable->erase( it++ );
else
- p = pTable->Next();
+ ++it;
}
}
}
// -----------------------------------------------------------------------
-static void ImplCalendarUnSelectDateRange( Table* pTable,
- Table* pOldTable,
+static void ImplCalendarUnSelectDateRange( IntDateSet* pTable,
+ IntDateSet* pOldTable,
const Date& rStartDate,
const Date& rEndDate )
{
@@ -143,44 +139,40 @@ static void ImplCalendarUnSelectDateRange( Table* pTable,
aEndDate = aTempDate;
}
- void* p = pTable->First();
- while ( p )
+ for ( IntDateSet::const_iterator it = pTable->begin(); it != pTable->end(); )
{
- Date aDate( pTable->GetCurKey() );
+ Date aDate( *it );
if ( aDate > aEndDate )
break;
if ( aDate >= aStartDate )
- pTable->Remove( aDate.GetDate() );
+ pTable->erase( it++ );
else
- p = pTable->Next();
+ ++it;
}
- p = pOldTable->First();
- while ( p )
+ for ( IntDateSet::const_iterator it = pOldTable->begin(); it != pOldTable->end(); ++it )
{
- Date aDate( pOldTable->GetCurKey() );
+ Date aDate( *it );
if ( aDate > aEndDate )
break;
if ( aDate >= aStartDate )
- pTable->Insert( aDate.GetDate(), TABLE_DATE_SELECTED );
-
- p = pOldTable->Next();
+ pTable->insert( aDate.GetDate() );
}
}
// -----------------------------------------------------------------------
-inline void ImplCalendarClearSelectDate( Table* pTable )
+inline void ImplCalendarClearSelectDate( IntDateSet* pTable )
{
- pTable->Clear();
+ pTable->clear();
}
// =======================================================================
void Calendar::ImplInit( WinBits nWinStyle )
{
- mpSelectTable = new Table;
+ mpSelectTable = new IntDateSet;
mpOldSelectTable = NULL;
mpRestoreSelectTable = NULL;
mpStandardColor = NULL;
@@ -750,7 +742,7 @@ void Calendar::ImplDrawDate( long nX, long nY,
bFocus = sal_True;
if ( mpSelectTable )
{
- if ( mpSelectTable->IsKeyValid( Date( nDay, nMonth, nYear ).GetDate() ) )
+ if ( mpSelectTable->find( Date( nDay, nMonth, nYear ).GetDate() ) != mpSelectTable->end() )
bSel = sal_True;
}
@@ -1091,36 +1083,28 @@ void Calendar::ImplUpdateDate( const Date& rDate )
// -----------------------------------------------------------------------
-void Calendar::ImplUpdateSelection( Table* pOld )
+void Calendar::ImplUpdateSelection( IntDateSet* pOld )
{
- Table* pNew = mpSelectTable;
- void* p;
- sal_uLong nKey;
+ IntDateSet* pNew = mpSelectTable;
- p = pOld->First();
- while ( p )
+ for ( IntDateSet::const_iterator it = pOld->begin(); it != pOld->end(); ++it )
{
- nKey = pOld->GetCurKey();
- if ( !pNew->Get( nKey ) )
+ sal_uLong nKey = *it;
+ if ( pNew->find( nKey ) == pNew->end() )
{
Date aTempDate( nKey );
ImplUpdateDate( aTempDate );
}
-
- p = pOld->Next();
}
- p = pNew->First();
- while ( p )
+ for ( IntDateSet::const_iterator it = pNew->begin(); it != pNew->end(); ++it )
{
- nKey = pNew->GetCurKey();
- if ( !pOld->Get( nKey ) )
+ sal_uLong nKey = *it;
+ if ( pOld->find( nKey ) == pOld->end() )
{
Date aTempDate( nKey );
ImplUpdateDate( aTempDate );
}
-
- p = pNew->Next();
}
}
@@ -1129,7 +1113,7 @@ void Calendar::ImplUpdateSelection( Table* pOld )
void Calendar::ImplMouseSelect( const Date& rDate, sal_uInt16 nHitTest,
sal_Bool bMove, sal_Bool bExpand, sal_Bool bExtended )
{
- Table* pOldSel = new Table( *mpSelectTable );
+ IntDateSet* pOldSel = new IntDateSet( *mpSelectTable );
Date aOldDate = maCurDate;
Date aTempDate = rDate;
@@ -1194,7 +1178,7 @@ void Calendar::ImplMouseSelect( const Date& rDate, sal_uInt16 nHitTest,
ImplCalendarSelectDate( mpSelectTable, aTempDate, sal_True );
}
- mpRestoreSelectTable = new Table( *mpSelectTable );
+ mpRestoreSelectTable = new IntDateSet( *mpSelectTable );
}
}
else
@@ -1227,10 +1211,11 @@ void Calendar::ImplMouseSelect( const Date& rDate, sal_uInt16 nHitTest,
HideFocus();
if ( bNewSel )
ImplUpdateSelection( pOldSel );
- if ( !bNewSel || !pOldSel->Get( aOldDate.GetDate() ) )
+ if ( !bNewSel || pOldSel->find( aOldDate.GetDate() ) == pOldSel->end() )
ImplUpdateDate( aOldDate );
// Damit Focus-Rechteck auch wieder neu ausgegeben wird
- if ( HasFocus() || !bNewSel || !mpSelectTable->Get( maCurDate.GetDate() ) )
+ if ( HasFocus() || !bNewSel
+ || mpSelectTable->find( maCurDate.GetDate() ) == mpSelectTable->end() )
ImplUpdateDate( maCurDate );
}
delete pOldSel;
@@ -1399,16 +1384,16 @@ void Calendar::ImplEndTracking( sal_Bool bCancel )
if ( !bSpinDown )
{
- Table* pOldSel = new Table( *mpSelectTable );
+ IntDateSet* pOldSel = new IntDateSet( *mpSelectTable );
Date aOldDate = maCurDate;
maCurDate = maOldCurDate;
*mpSelectTable = *mpOldSelectTable;
HideFocus();
ImplUpdateSelection( pOldSel );
- if ( !pOldSel->Get( aOldDate.GetDate() ) )
+ if ( pOldSel->find( aOldDate.GetDate() ) == pOldSel->end() )
ImplUpdateDate( aOldDate );
// Damit Focus-Rechteck auch wieder neu ausgegeben wird
- if ( HasFocus() || !mpSelectTable->Get( maCurDate.GetDate() ) )
+ if ( HasFocus() || mpSelectTable->find( maCurDate.GetDate() ) == mpSelectTable->end() )
ImplUpdateDate( maCurDate );
delete pOldSel;
}
@@ -1419,11 +1404,11 @@ void Calendar::ImplEndTracking( sal_Bool bCancel )
if ( !bCancel )
{
// Feststellen, ob wir sichtbaren Bereich scrollen sollen
- sal_uLong nSelCount = mpSelectTable->Count();
+ sal_uLong nSelCount = mpSelectTable->size();
if ( nSelCount )
{
- Date aFirstSelDate( mpSelectTable->GetObjectKey( 0 ) );
- Date aLastSelDate( mpSelectTable->GetObjectKey( nSelCount-1 ) );
+ Date aFirstSelDate( *mpSelectTable->begin() );
+ Date aLastSelDate( *mpSelectTable->rbegin() );
if ( aLastSelDate < GetFirstMonth() )
ImplScroll( sal_True );
else if ( GetLastMonth() < aFirstSelDate )
@@ -1498,7 +1483,7 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt )
if ( mpOldSelectTable )
delete mpOldSelectTable;
maOldCurDate = maCurDate;
- mpOldSelectTable = new Table( *mpSelectTable );
+ mpOldSelectTable = new IntDateSet( *mpSelectTable );
if ( !mbSelection )
{
@@ -1629,7 +1614,7 @@ void Calendar::KeyInput( const KeyEvent& rKEvt )
{
if ( bMultiSel && bExpand )
{
- Table* pOldSel = new Table( *mpSelectTable );
+ IntDateSet* pOldSel = new IntDateSet( *mpSelectTable );
Date aOldAnchorDate = maAnchorDate;
mbSelLeft = aNewDate < maAnchorDate;
if ( !bExtended )
@@ -1868,10 +1853,10 @@ void Calendar::SelectDate( const Date& rDate, sal_Bool bSelect )
if ( !rDate.IsValidAndGregorian() )
return;
- Table* pOldSel;
+ IntDateSet* pOldSel;
if ( !mbInSelChange )
- pOldSel = new Table( *mpSelectTable );
+ pOldSel = new IntDateSet( *mpSelectTable );
else
pOldSel = NULL;
@@ -1888,10 +1873,10 @@ void Calendar::SelectDate( const Date& rDate, sal_Bool bSelect )
void Calendar::SetNoSelection()
{
- Table* pOldSel;
+ IntDateSet* pOldSel;
if ( !mbInSelChange )
- pOldSel = new Table( *mpSelectTable );
+ pOldSel = new IntDateSet( *mpSelectTable );
else
pOldSel = NULL;
@@ -1908,15 +1893,28 @@ void Calendar::SetNoSelection()
sal_Bool Calendar::IsDateSelected( const Date& rDate ) const
{
- return mpSelectTable->IsKeyValid( rDate.GetDate() );
+ return mpSelectTable->find( rDate.GetDate() ) != mpSelectTable->end();
+}
+
+// -----------------------------------------------------------------------
+
+Date Calendar::GetFirstSelectedDate() const
+{
+ if ( !mpSelectTable->empty() )
+ return Date( *mpSelectTable->begin() );
+ else
+ {
+ Date aDate( 0, 0, 0 );
+ return aDate;
+ }
}
// -----------------------------------------------------------------------
-Date Calendar::GetSelectDate( sal_uLong nIndex ) const
+Date Calendar::GetLastSelectedDate() const
{
- if ( nIndex < mpSelectTable->Count() )
- return Date( mpSelectTable->GetObjectKey( nIndex ) );
+ if ( !mpSelectTable->empty() )
+ return Date( *mpSelectTable->rbegin() );
else
{
Date aDate( 0, 0, 0 );
@@ -2155,7 +2153,7 @@ void Calendar::StartSelection()
if ( mpOldSelectTable )
delete mpOldSelectTable;
maOldCurDate = maCurDate;
- mpOldSelectTable = new Table( *mpSelectTable );
+ mpOldSelectTable = new IntDateSet( *mpSelectTable );
mbSelection = sal_True;
}
@@ -2459,7 +2457,7 @@ IMPL_LINK( CalendarField, ImplSelectHdl, Calendar*, pCalendar )
mpFloatWin->EndPopupMode();
EndDropDown();
GrabFocus();
- Date aNewDate = mpCalendar->GetSelectDate( 0 );
+ Date aNewDate = mpCalendar->GetFirstSelectedDate();
if ( IsEmptyDate() || ( aNewDate != GetDate() ) )
{
SetDate( aNewDate );
diff --git a/svtools/workben/svdem.cxx b/svtools/workben/svdem.cxx
index abb28ac..7aede1c 100644
--- a/svtools/workben/svdem.cxx
+++ b/svtools/workben/svdem.cxx
@@ -1006,7 +1006,7 @@ IMPL_LINK( MyWin, CalSelectHdl, CalendarField*, pCtrl )
if ( pCtrl == &aCalendarField )
{
Calendar* l_pCalendar = pCtrl->GetCalendar();
- aCalendarField2.SetDate( l_pCalendar->GetSelectDate( l_pCalendar->GetSelectDateCount()-1 ) );
+ aCalendarField2.SetDate( l_pCalendar->GetLastSelectDate() );
}
return 0;
commit 2f657dd568ce30ec9132892080c63578e4132908
Author: Bartosz Kosiorek <gang65 at poczta.onet.pl>
Date: Sat Mar 24 23:01:06 2012 +0100
Convert SV_PTRARRAY to ::std::deque
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index fba2e68..0c07972 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -69,7 +69,6 @@ class SwTxtINetFmt;
class SwFmtINetFmt;
class SwTxtAttr;
class SwTableBox;
-class SwCellFrms;
class SwTOXMark;
class SwRedline;
class IBlockCursor;
diff --git a/sw/inc/tblsel.hxx b/sw/inc/tblsel.hxx
index 5ecc65b..5725956 100644
--- a/sw/inc/tblsel.hxx
+++ b/sw/inc/tblsel.hxx
@@ -34,6 +34,7 @@
#include "swdllapi.h"
#include <map>
+#include <deque>
class SwCrsrShell;
class SwCursor;
@@ -49,7 +50,7 @@ class SwTable;
class SwUndoTblMerge;
class SwCellFrm;
-SV_DECL_PTRARR( SwCellFrms, SwCellFrm*, 16 )
+typedef ::std::deque< SwCellFrm* > SwCellFrms;
class SwSelBoxes : private std::map<sal_uLong, SwTableBox*>
diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx
index cae5aa8..44a2b95 100644
--- a/sw/source/core/crsr/trvltbl.cxx
+++ b/sw/source/core/crsr/trvltbl.cxx
@@ -217,7 +217,7 @@ sal_Bool SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple )
static_cast<const SwCellFrm*>(pEndFrm),
aBoxes, bSelectUp ? 0 : &aCells, eType );
- if( aBoxes.empty() || ( !bSelectUp && 4 != aCells.Count() ) )
+ if( aBoxes.empty() || ( !bSelectUp && 4 != aCells.size() ) )
return sal_False;
if ( bSelectUp )
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index 3d3a1ae..9da85cd 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -2345,12 +2345,12 @@ sal_Bool lcl_IsFormulaSelBoxes( const SwTable& rTbl, const SwTblBoxFormula& rFml
for( SwSelBoxes::reverse_iterator it = aBoxes.rbegin(); it != aBoxes.rend(); ++it )
{
SwTableBox* pBox = it->second;
- sal_uInt16 i;
- for( i = 0; i < rCells.Count(); ++i )
- if( rCells[ i ]->GetTabBox() == pBox )
+ SwCellFrms::iterator iC;
+ for( iC = rCells.begin(); iC != rCells.end(); ++iC )
+ if( (*iC)->GetTabBox() == pBox )
break; // found
- if( i == rCells.Count() )
+ if( iC == rCells.end() )
return sal_False;
}
@@ -2371,7 +2371,7 @@ sal_Bool SwFEShell::GetAutoSum( String& rFml ) const
if( ::GetAutoSumSel( *this, aCells ))
{
sal_uInt16 nW = 0, nInsPos = 0;
- for( sal_uInt16 n = aCells.Count(); n; )
+ for( size_t n = aCells.size(); n; )
{
SwCellFrm* pCFrm = aCells[ --n ];
sal_uInt16 nBoxW = pCFrm->GetTabBox()->IsFormulaOrValueBox();
@@ -2393,7 +2393,7 @@ sal_Bool SwFEShell::GetAutoSum( String& rFml ) const
{
nW = RES_BOXATR_VALUE;
// restore previous spaces!
- for( sal_uInt16 i = aCells.Count(); n+1 < i; )
+ for( size_t i = aCells.size(); n+1 < i; )
{
String sTmp( String::CreateFromAscii(
RTL_CONSTASCII_STRINGPARAM( "|<" )) );
@@ -2431,7 +2431,7 @@ sal_Bool SwFEShell::GetAutoSum( String& rFml ) const
nW = RES_BOXATR_VALUE;
rFml.Erase( nInsPos );
// restore previous spaces!
- for( sal_uInt16 i = aCells.Count(); n+1 < i; )
+ for( size_t i = aCells.size(); n+1 < i; )
{
String sTmp( String::CreateFromAscii(
RTL_CONSTASCII_STRINGPARAM( "|<" )) );
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 2a4123e..c8017c4 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -74,9 +74,6 @@
#undef DEL_EMPTY_BOXES_AT_START_AND_END
#define DEL_ALL_EMPTY_BOXES
-
-SV_IMPL_PTRARR( SwCellFrms, SwCellFrm* )
-
struct _CmpLPt
{
Point aPos;
@@ -403,11 +400,11 @@ void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
if ( pCells )
{
- pCells->Remove( 0, pCells->Count() );
- pCells->Insert( pCurrentTopLeftFrm, 0 );
- pCells->Insert( pCurrentTopRightFrm, 1 );
- pCells->Insert( pCurrentBottomLeftFrm, 2 );
- pCells->Insert( pCurrentBottomRightFrm, 3 );
+ pCells->clear();
+ pCells->push_back( const_cast< SwCellFrm* >(pCurrentTopLeftFrm) );
+ pCells->push_back( const_cast< SwCellFrm* >(pCurrentTopRightFrm) );
+ pCells->push_back( const_cast< SwCellFrm* >(pCurrentBottomLeftFrm) );
+ pCells->push_back( const_cast< SwCellFrm* >(pCurrentBottomRightFrm) );
}
if( bTblIsValid )
@@ -773,7 +770,7 @@ sal_Bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
if( pCell == pSttCell )
{
sal_uInt16 nWhichId = 0;
- for( sal_uInt16 n = rBoxes.Count(); n; )
+ for( size_t n = rBoxes.size(); n; )
if( USHRT_MAX != ( nWhichId = rBoxes[ --n ]
->GetTabBox()->IsFormulaOrValueBox() ))
break;
@@ -800,7 +797,7 @@ sal_Bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
}
if( pUpperCell )
- rBoxes.Insert( pUpperCell, rBoxes.Count() );
+ rBoxes.push_back( const_cast< SwCellFrm* >(pUpperCell) );
}
if( bFound )
{
@@ -817,7 +814,7 @@ sal_Bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
{
bFound = sal_False;
- rBoxes.Remove( 0, rBoxes.Count() );
+ rBoxes.clear();
aUnions.DeleteAndDestroy( 0, aUnions.Count() );
::MakeSelUnions( aUnions, pStart, pEnd, nsSwTblSearchType::TBLSEARCH_ROW );
@@ -842,7 +839,7 @@ sal_Bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
if( pCell == pSttCell )
{
sal_uInt16 nWhichId = 0;
- for( sal_uInt16 n = rBoxes.Count(); n; )
+ for( size_t n = rBoxes.size(); n; )
if( USHRT_MAX != ( nWhichId = rBoxes[ --n ]
->GetTabBox()->IsFormulaOrValueBox() ))
break;
@@ -857,8 +854,8 @@ sal_Bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
OSL_ENSURE( pCell->IsCellFrm(), "Frame without cell" );
if( ::IsFrmInTblSel( pUnion->GetUnion(), pCell ) )
{
- const SwCellFrm* pC = (SwCellFrm*)pCell;
- rBoxes.Insert( pC, rBoxes.Count() );
+ SwCellFrm* pC = (SwCellFrm*)pCell;
+ rBoxes.push_back( pC );
}
if( pCell->GetNext() )
{
More information about the Libreoffice-commits
mailing list