summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-05-23 15:35:26 +0200
committerMichael Stahl <mstahl@redhat.com>2012-05-25 00:17:07 +0200
commit7d69ffe8c92521537521f3a66a089eb3ed5c2be2 (patch)
treea22ec5d5357976b4d3579da922ce4f9d1273a99c
parent4490eb8c9c701510a3370c900a6c6ec9e4f8a70d (diff)
Convert SV_DECL_PTRARR(SwMovedBoxes) to std::vector
Change-Id: I6df8a2929569ec0a2ee670002833b6a142d42318
-rw-r--r--sw/source/core/doc/docsort.cxx10
-rw-r--r--sw/source/core/inc/docsort.hxx10
-rw-r--r--sw/source/core/table/swtable.cxx1
-rw-r--r--sw/source/core/undo/unsort.cxx4
4 files changed, 18 insertions, 7 deletions
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index 512520711c4b..2412d981c260 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -633,7 +633,7 @@ void MoveRow(SwDoc* pDoc, const FlatFndBox& rBox, sal_uInt16 nS, sal_uInt16 nT,
// and move it
MoveCell(pDoc, pS, pT, bMoved, pUD);
- rMovedList.Insert(pS, rMovedList.Count() );
+ rMovedList.push_back(pS);
if( pS != pT )
{
@@ -679,7 +679,7 @@ void MoveCol(SwDoc* pDoc, const FlatFndBox& rBox, sal_uInt16 nS, sal_uInt16 nT,
sal_Bool bMoved = rMovedList.GetPos(pT) != USHRT_MAX;
MoveCell(pDoc, pS, pT, bMoved, pUD);
- rMovedList.Insert(pS, rMovedList.Count() );
+ rMovedList.push_back(pS);
if( pS != pT )
{
@@ -977,4 +977,10 @@ const SfxItemSet* FlatFndBox::GetItemSet(sal_uInt16 n_Col, sal_uInt16 n_Row) con
return ppItemSets ? *(ppItemSets + (n_Row * nCols + n_Col )) : 0;
}
+sal_uInt16 SwMovedBoxes::GetPos(const SwTableBox* pTableBox) const
+{
+ const_iterator it = std::find(begin(), end(), pTableBox);
+ return it == end() ? USHRT_MAX : it - begin();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/docsort.hxx b/sw/source/core/inc/docsort.hxx
index e3df48b2c1a2..f91be1ff25b6 100644
--- a/sw/source/core/inc/docsort.hxx
+++ b/sw/source/core/inc/docsort.hxx
@@ -31,6 +31,7 @@
#include <svl/svarray.hxx>
#include <ndindex.hxx>
+#include <vector>
class SwDoc;
@@ -54,10 +55,15 @@ namespace com { namespace sun { namespace star { namespace lang {
--------------------------------------------------------------------*/
typedef const _FndBox* _FndBoxPtr;
typedef SwSortElement* SwSortElementPtr;
-typedef const SwTableBox* SwMovedBoxPtr;
SV_DECL_PTRARR_SORT(SwSortElements, SwSortElementPtr, 0)
-SV_DECL_PTRARR(SwMovedBoxes, SwMovedBoxPtr, 10)
+
+class SwMovedBoxes : public std::vector<const SwTableBox*>
+{
+public:
+ sal_uInt16 GetPos(const SwTableBox* pTableBox) const;
+};
+
/*--------------------------------------------------------------------
Beschreibung: Funktionen zum Moven von Boxen
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 537c201478af..3a57a7586b4f 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -2826,5 +2826,4 @@ void SwTableBox::ForgetFrmFmt()
GetRegisteredInNonConst()->Remove(this);
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/unsort.cxx b/sw/source/core/undo/unsort.cxx
index 8712383b2c3d..22c9be77320c 100644
--- a/sw/source/core/undo/unsort.cxx
+++ b/sw/source/core/undo/unsort.cxx
@@ -121,7 +121,7 @@ void SwUndoSort::UndoImpl(::sw::UndoRedoContext & rContext)
USHRT_MAX != aMovedList.GetPos(pSource) );
// schon Verschobenen in der Liste merken
- aMovedList.Insert(pTarget, aMovedList.Count() );
+ aMovedList.push_back(pTarget);
}
// Restore table frames:
@@ -197,7 +197,7 @@ void SwUndoSort::RedoImpl(::sw::UndoRedoContext & rContext)
MoveCell(&rDoc, pSource, pTarget,
USHRT_MAX != aMovedList.GetPos( pTarget ) );
// schon Verschobenen in der Liste merken
- aMovedList.Insert( pSource, aMovedList.Count() );
+ aMovedList.push_back( pSource );
}
if( pUndoTblAttr )