Kaydet (Commit) f0341738 authored tarafından Michael Stahl's avatar Michael Stahl

sw: replace boost::ptr_vector with std::vector<std::unique_ptr>

Change-Id: I1f77947b6f9fde4c949d32d524740be0951572af
üst 6e3188ef
......@@ -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 )
{
......
......@@ -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
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment