summaryrefslogtreecommitdiffstats
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-04-25 12:12:51 +0200
committerMichael Stahl <mstahl@redhat.com>2012-04-25 12:35:35 +0200
commit12198134b1a7a467b8a6eb90ed4ade6dd2cbf58f (patch)
treed4799bc7b26267d87e818bbdd56022514068af5c /sw
parentConvert SV_DECL_PTRARR_DEL(TextBlockInfoArr) to boost::ptr_vector (diff)
downloadcore-12198134b1a7a467b8a6eb90ed4ade6dd2cbf58f.tar.gz
core-12198134b1a7a467b8a6eb90ed4ade6dd2cbf58f.zip
Convert SV_DECL_PTRARR_DEL(_DB_Columns) to boost::ptr_vector
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx17
-rw-r--r--sw/source/ui/inc/dbinsdlg.hxx4
2 files changed, 10 insertions, 11 deletions
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index f1ee6d8984a3..0151f0f58a45 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -176,9 +176,6 @@ struct _DB_Column
};
typedef _DB_Column* _DB_ColumnPtr;
-SV_DECL_PTRARR_DEL( _DB_Columns, _DB_ColumnPtr, 32 )
-SV_IMPL_PTRARR( _DB_Columns, _DB_ColumnPtr )
-
SV_IMPL_OP_PTRARR_SORT( SwInsDBColumns, SwInsDBColumnPtr )
@@ -885,16 +882,16 @@ static void lcl_InsTextInArr( const String& rTxt, _DB_Columns& rColArr )
if( 1 < nFndPos )
{
pNew = new _DB_Column( rTxt.Copy( nSttPos, nFndPos -1 ) );
- rColArr.Insert( pNew, rColArr.Count() );
+ rColArr.push_back( pNew );
}
pNew = new _DB_Column;
- rColArr.Insert( pNew, rColArr.Count() );
+ rColArr.push_back( pNew );
nSttPos = nFndPos + 1;
}
if( nSttPos < rTxt.Len() )
{
pNew = new _DB_Column( rTxt.Copy( nSttPos ) );
- rColArr.Insert( pNew, rColArr.Count() );
+ rColArr.push_back( pNew );
}
}
@@ -961,7 +958,7 @@ sal_Bool SwInsertDBColAutoPilot::SplitTextToColArr( const String& rTxt,
else
pNew = new _DB_Column( rFndCol, nFormat );
- rColArr.Insert( pNew, rColArr.Count() );
+ rColArr.push_back( pNew );
}
}
}
@@ -970,7 +967,7 @@ sal_Bool SwInsertDBColAutoPilot::SplitTextToColArr( const String& rTxt,
if( sTxt.Len() )
::lcl_InsTextInArr( sTxt, rColArr );
- return 0 != rColArr.Count();
+ return !rColArr.empty();
}
void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
@@ -1275,7 +1272,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
sal_Bool bSetCrsr = sal_True;
- sal_uInt16 n = 0, nCols = aColArr.Count();
+ sal_uInt16 n = 0, nCols = aColArr.size();
::sw::mark::IMark* pMark = NULL;
for( sal_Int32 i = 0 ; ; ++i )
{
@@ -1302,7 +1299,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
for( n = 0; n < nCols; ++n )
{
- _DB_Column* pDBCol = aColArr[ n ];
+ _DB_Column* pDBCol = &aColArr[ n ];
String sIns;
switch( pDBCol->eColType )
{
diff --git a/sw/source/ui/inc/dbinsdlg.hxx b/sw/source/ui/inc/dbinsdlg.hxx
index 7b879f9fa99f..30185065bb71 100644
--- a/sw/source/ui/inc/dbinsdlg.hxx
+++ b/sw/source/ui/inc/dbinsdlg.hxx
@@ -43,6 +43,7 @@
#include <swdbdata.hxx>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Sequence.h>
+#include <boost/ptr_container/ptr_vector.hpp>
namespace com{namespace sun{namespace star{
namespace sdbcx{
class XColumnsSupplier;
@@ -58,7 +59,8 @@ class SwTableAutoFmt;
class SwView;
class SfxItemSet;
class SwTableRep;
-class _DB_Columns;
+struct _DB_Column;
+typedef boost::ptr_vector<_DB_Column> _DB_Columns;
struct SwInsDBColumn
{