diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-10-05 23:12:03 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-10-05 23:28:08 +0200 |
commit | f03417389e70a6312a42468baaf55b2080a61675 (patch) | |
tree | 210c5aac2ebade4d721c25365da01618cadc1088 /sw/source | |
parent | 6e3188efd513b2447dd8335567742c013fd6c265 (diff) |
sw: replace boost::ptr_vector with std::vector<std::unique_ptr>
Change-Id: I1f77947b6f9fde4c949d32d524740be0951572af
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/ui/dbui/dbinsdlg.cxx | 16 | ||||
-rw-r--r-- | sw/source/uibase/inc/dbinsdlg.hxx | 7 |
2 files changed, 12 insertions, 11 deletions
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index 2e818a160b83..5777bfc1569c 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -90,6 +90,8 @@ #include <unomid.h> #include <IDocumentMarkAccess.hxx> +#include <o3tl/make_unique.hxx> + #include <boost/noncopyable.hpp> #include <memory> #include <swuiexp.hxx> @@ -856,23 +858,19 @@ IMPL_LINK_TYPED( SwInsertDBColAutoPilot, HeaderHdl, Button*, pButton, void ) static void lcl_InsTextInArr( const OUString& rText, DB_Columns& rColArr ) { - DB_Column* pNew; sal_Int32 nSttPos = 0, nFndPos; while( -1 != ( nFndPos = rText.indexOf( '\x0A', nSttPos )) ) { if( 1 < nFndPos ) { - pNew = new DB_Column( rText.copy( nSttPos, nFndPos -1 ) ); - rColArr.push_back( pNew ); + rColArr.push_back(o3tl::make_unique<DB_Column>(rText.copy(nSttPos, nFndPos -1))); } - pNew = new DB_Column; - rColArr.push_back( pNew ); + rColArr.push_back(o3tl::make_unique<DB_Column>()); nSttPos = nFndPos + 1; } if( nSttPos < rText.getLength() ) { - pNew = new DB_Column( rText.copy( nSttPos ) ); - rColArr.push_back( pNew ); + rColArr.push_back(o3tl::make_unique<DB_Column>(rText.copy(nSttPos))); } } @@ -940,7 +938,7 @@ bool SwInsertDBColAutoPilot::SplitTextToColArr( const OUString& rText, else pNew = new DB_Column( rFndCol, nFormat ); - rColArr.push_back( pNew ); + rColArr.push_back( std::unique_ptr<DB_Column>(pNew) ); } } } @@ -1276,7 +1274,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, for( size_t n = 0; n < nCols; ++n ) { - DB_Column* pDBCol = &aColArr[ n ]; + DB_Column* pDBCol = aColArr[ n ].get(); OUString sIns; switch( pDBCol->eColType ) { diff --git a/sw/source/uibase/inc/dbinsdlg.hxx b/sw/source/uibase/inc/dbinsdlg.hxx index 7f25de924ef6..55d5105f33c4 100644 --- a/sw/source/uibase/inc/dbinsdlg.hxx +++ b/sw/source/uibase/inc/dbinsdlg.hxx @@ -33,9 +33,11 @@ #include <swdbdata.hxx> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/uno/Sequence.h> -#include <boost/ptr_container/ptr_vector.hpp> #include <o3tl/sorted_vector.hxx> +#include <memory> +#include <vector> + namespace com{namespace sun{namespace star{ namespace sdbcx{ class XColumnsSupplier; @@ -52,7 +54,8 @@ class SwView; class SfxItemSet; class SwTableRep; struct DB_Column; -typedef boost::ptr_vector<DB_Column> DB_Columns; + +typedef std::vector<std::unique_ptr<DB_Column>> DB_Columns; struct SwInsDBColumn { |