summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorRafael Dominguez <venccsralph@gmail.com>2012-03-28 19:38:11 -0430
committerLuboš Luňák <l.lunak@suse.cz>2012-04-13 18:42:09 +0200
commitb1b309c970d040a1907fd83030fe09260c386894 (patch)
treea516ac924236f60f7604dfd66b6336057f554b1a /sd
parent77f8397f989785d2623cfffc63a584bd3af894d6 (diff)
Replace deprecated List for vector in SdTransferable.
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/app/sdxfer.cxx16
-rw-r--r--sd/source/ui/inc/sdxfer.hxx8
2 files changed, 10 insertions, 14 deletions
diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx
index 009a1b4a3e77..53c795ddf9b6 100644
--- a/sd/source/ui/app/sdxfer.cxx
+++ b/sd/source/ui/app/sdxfer.cxx
@@ -142,9 +142,6 @@ SdTransferable::~SdTransferable()
ObjectReleased();
- for( void* p = maPageBookmarks.First(); p; p = maPageBookmarks.Next() )
- delete static_cast< String* >( p );
-
if( mbOwnView )
delete mpSdViewIntern;
@@ -712,7 +709,7 @@ void SdTransferable::SetObjectDescriptor( const TransferableObjectDescriptor& rO
// -----------------------------------------------------------------------------
-void SdTransferable::SetPageBookmarks( const List& rPageBookmarks, sal_Bool bPersistent )
+void SdTransferable::SetPageBookmarks( const std::vector<rtl::OUString> &rPageBookmarks, sal_Bool bPersistent )
{
if( mpSourceDoc )
{
@@ -723,20 +720,19 @@ void SdTransferable::SetPageBookmarks( const List& rPageBookmarks, sal_Bool bPer
mpPageDocShell = NULL;
- for( void* p = maPageBookmarks.First(); p; p = maPageBookmarks.Next() )
- delete static_cast< String* >( p );
+ maPageBookmarks.clear();
if( bPersistent )
{
+ std::vector<rtl::OUString> aExchangeList;
mpSdDrawDocument->CreateFirstPages(mpSourceDoc);
- mpSdDrawDocument->InsertBookmarkAsPage( const_cast< List* >( &rPageBookmarks ), NULL, sal_False, sal_True, 1, sal_True, mpSourceDoc->GetDocSh(), sal_True, sal_True, sal_False );
+ mpSdDrawDocument->InsertBookmarkAsPage( rPageBookmarks, aExchangeList, sal_False, sal_True, 1, sal_True,
+ mpSourceDoc->GetDocSh(), sal_True, sal_True, sal_False );
}
else
{
mpPageDocShell = mpSourceDoc->GetDocSh();
-
- for( sal_uLong i = 0; i < rPageBookmarks.Count(); i++ )
- maPageBookmarks.Insert( new String( *static_cast< String* >( rPageBookmarks.GetObject( i ) ) ), LIST_APPEND );
+ maPageBookmarks = rPageBookmarks;
}
if( mpSdViewIntern && mpSdDrawDocument )
diff --git a/sd/source/ui/inc/sdxfer.hxx b/sd/source/ui/inc/sdxfer.hxx
index fdd2c9401acb..82f231f3375c 100644
--- a/sd/source/ui/inc/sdxfer.hxx
+++ b/sd/source/ui/inc/sdxfer.hxx
@@ -76,10 +76,10 @@ public:
sal_Bool HasSourceDoc( const SdDrawDocument* pDoc ) const { return( mpSourceDoc == pDoc ); }
- void SetPageBookmarks( const List& rPageBookmarks, sal_Bool bPersistent );
+ void SetPageBookmarks( const std::vector<rtl::OUString>& rPageBookmarks, sal_Bool bPersistent );
sal_Bool IsPageTransferable() const { return mbPageTransferable; }
- sal_Bool HasPageBookmarks() const { return( mpPageDocShell && ( maPageBookmarks.Count() > 0 ) ); }
- const List& GetPageBookmarks() const { return maPageBookmarks; }
+ sal_Bool HasPageBookmarks() const { return( mpPageDocShell && ( !maPageBookmarks.empty() ) ); }
+ const std::vector<rtl::OUString>& GetPageBookmarks() const { return maPageBookmarks; }
::sd::DrawDocShell* GetPageDocShell() const { return mpPageDocShell; }
sal_Bool SetTableRTF( SdDrawDocument*, const ::com::sun::star::datatransfer::DataFlavor& );
@@ -104,7 +104,7 @@ private:
SfxObjectShellRef maDocShellRef;
::sd::DrawDocShell* mpPageDocShell;
- List maPageBookmarks;
+ std::vector<rtl::OUString> maPageBookmarks;
TransferableDataHelper* mpOLEDataHelper;
TransferableObjectDescriptor* mpObjDesc;
const ::sd::View* mpSdView;