summaryrefslogtreecommitdiff
path: root/sw/inc/swtable.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-18 18:04:44 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-20 19:46:40 +0200
commitd69fdd1ed634be8426f9ff80f9411187da29f00a (patch)
tree2d16935eccaab7779929f9d4d1b12a07a888733b /sw/inc/swtable.hxx
parent05d46a4a5afc447ece8e4297b1a9b8e9e9b99b90 (diff)
Convert SV_DECL_PTRARR_DEL(SwTableLines) to std::vector
Along the way, simplify a lot of the ForEach callback methods. Change-Id: I54bc87c1060f1d73470ca8b7fd645ffa23059606
Diffstat (limited to 'sw/inc/swtable.hxx')
-rw-r--r--sw/inc/swtable.hxx18
1 files changed, 14 insertions, 4 deletions
diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx
index 29c779a51ed2..8a6624eb2c1d 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -73,7 +73,18 @@ struct Parm;
SV_DECL_REF( SwServerObject )
#endif
-SV_DECL_PTRARR_DEL(SwTableLines, SwTableLine*, 10)
+class SwTableLines : public std::vector<SwTableLine*> {
+public:
+ // free's any remaining child objects
+ ~SwTableLines();
+
+ // return USHRT_MAX if not found, else index of position
+ sal_uInt16 GetPos(const SwTableLine* pBox) const
+ {
+ const_iterator it = std::find(begin(), end(), pBox);
+ return it == end() ? USHRT_MAX : it - begin();
+ }
+};
class SwTableBoxes : public std::vector<SwTableBox*> {
public:
@@ -89,7 +100,6 @@ public:
// (for calculation in table).
typedef SwTableBox* SwTableBoxPtr;
SV_DECL_PTRARR_SORT( SwTableSortBoxes, SwTableBoxPtr, 25 )
-typedef SwTableLine* SwTableLinePtr;
class SW_DLLPUBLIC SwTable: public SwClient //Client of FrmFmt.
{
@@ -176,7 +186,7 @@ public:
void SetTableModel( sal_Bool bNew ){ bNewModel = bNew; }
sal_Bool IsNewModel() const { return bNewModel; }
- sal_uInt16 GetRowsToRepeat() const { return Min( GetTabLines().Count(), nRowsToRepeat ); }
+ sal_uInt16 GetRowsToRepeat() const { return Min( (sal_uInt16)GetTabLines().size(), nRowsToRepeat ); }
sal_uInt16 _GetRowsToRepeat() const { return nRowsToRepeat; }
void SetRowsToRepeat( sal_uInt16 nNumOfRows ) { nRowsToRepeat = nNumOfRows; }
@@ -252,7 +262,7 @@ public:
void FindSuperfluousRows( SwSelBoxes& rBoxes )
{ _FindSuperfluousRows( rBoxes, 0, 0 ); }
- void CheckRowSpan( SwTableLinePtr &rpLine, bool bUp ) const;
+ void CheckRowSpan( SwTableLine* &rpLine, bool bUp ) const;
SwTableSortBoxes& GetTabSortBoxes() { return aSortCntBoxes; }
const SwTableSortBoxes& GetTabSortBoxes() const { return aSortCntBoxes; }