[Libreoffice-commits] .: svx/inc svx/source
Joseph Powers
jpowers at kemper.freedesktop.org
Mon Jan 3 20:22:22 PST 2011
svx/inc/svx/gridctrl.hxx | 11 ++++++-----
svx/source/fmcomp/gridctrl.cxx | 8 ++++----
2 files changed, 10 insertions(+), 9 deletions(-)
New commits:
commit a47051680ae8438d8571bbf4fb40471df8755bc4
Author: Joseph Powers <jpowers27 at cox.net>
Date: Mon Jan 3 20:22:08 2011 -0800
Remove DECLARE_LIST(DbDataColumns, ::svxform::DataColumn*)
diff --git a/svx/inc/svx/gridctrl.hxx b/svx/inc/svx/gridctrl.hxx
index a685b27..1428fdc 100644
--- a/svx/inc/svx/gridctrl.hxx
+++ b/svx/inc/svx/gridctrl.hxx
@@ -47,6 +47,7 @@
#include <comphelper/propmultiplex.hxx>
#include <svtools/transfer.hxx>
#include "svx/svxdllapi.h"
+#include <vector>
class DbGridControl;
class CursorWrapper;
@@ -57,7 +58,7 @@ namespace svxform
{
class DataColumn;
}
-DECLARE_LIST(DbDataColumns, ::svxform::DataColumn*)
+typedef ::std::vector< ::svxform::DataColumn* > DbDataColumns;
enum GridRowStatus
{
@@ -73,10 +74,10 @@ enum GridRowStatus
class DbGridRow : public SvRefBase
{
- ::com::sun::star::uno::Any m_aBookmark; // ::com::sun::star::text::Bookmark of the row, can be set
+ ::com::sun::star::uno::Any m_aBookmark; // ::com::sun::star::text::Bookmark of the row, can be set
DbDataColumns m_aVariants;
GridRowStatus m_eStatus;
- sal_Bool m_bIsNew;
+ sal_Bool m_bIsNew;
// row is no longer valid
// is removed on the next positioning
public:
@@ -86,8 +87,8 @@ public:
~DbGridRow();
- sal_Bool HasField(sal_uInt32 nPos) const {return nPos < m_aVariants.Count();}
- const ::svxform::DataColumn& GetField(sal_uInt32 nPos) const { return *m_aVariants.GetObject(nPos); }
+ sal_Bool HasField(sal_uInt32 nPos) const { return nPos < m_aVariants.size(); }
+ const ::svxform::DataColumn& GetField(sal_uInt32 nPos) const { return *m_aVariants[ nPos ]; }
void SetStatus(GridRowStatus _eStat) { m_eStatus = _eStat; }
GridRowStatus GetStatus() const { return m_eStatus; }
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index c4475a4..ddd2400 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -821,7 +821,7 @@ DbGridRow::DbGridRow(CursorWrapper* pCur, sal_Bool bPaintCursor)
Reference< XPropertySet > xColSet;
::cppu::extractInterface(xColSet, xColumns->getByIndex(i));
pColumn = new DataColumn(xColSet);
- m_aVariants.Insert(pColumn, LIST_APPEND);
+ m_aVariants.push_back( pColumn );
}
if (pCur->rowDeleted())
@@ -859,9 +859,9 @@ DbGridRow::DbGridRow(CursorWrapper* pCur, sal_Bool bPaintCursor)
//------------------------------------------------------------------------------
DbGridRow::~DbGridRow()
{
- sal_uInt32 nCount = m_aVariants.Count();
- for (sal_uInt32 i = 0; i < nCount; i++)
- delete m_aVariants.GetObject(i);
+ for ( size_t i = 0, n = m_aVariants.size(); i < n; ++i )
+ delete m_aVariants[ i ];
+ m_aVariants.clear();
}
//------------------------------------------------------------------------------
More information about the Libreoffice-commits
mailing list