summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-04-26 14:04:59 +0200
committerMichael Stahl <mstahl@redhat.com>2012-05-09 08:53:00 +0200
commitb9d7b38ff260b227a70b8298c8c4956d48b8fa11 (patch)
treeb9ffd7370bcf9c2d1d2088b25e9d0c1f596aa229
parent47c8927f37a682578861a22d8b40013c20544054 (diff)
Convert SV_DECL_PTRARR_DEL(SwURLNoteList) to boost::ptr_vector
-rw-r--r--sw/source/core/inc/noteurl.hxx8
-rw-r--r--sw/source/core/text/noteurl.cxx8
2 files changed, 7 insertions, 9 deletions
diff --git a/sw/source/core/inc/noteurl.hxx b/sw/source/core/inc/noteurl.hxx
index 095c63e3ec92..00fbaaa6a19e 100644
--- a/sw/source/core/inc/noteurl.hxx
+++ b/sw/source/core/inc/noteurl.hxx
@@ -33,6 +33,7 @@
#include <svl/svarray.hxx>
#include <tools/string.hxx>
#include "swrect.hxx"
+#include <boost/ptr_container/ptr_vector.hpp>
class ImageMap;
class MapMode;
@@ -53,19 +54,18 @@ public:
{ return aRect == rSwURLNote.aRect; }
};
-typedef SwURLNote* SwURLNotePtr;
-SV_DECL_PTRARR_DEL(SwURLNoteList, SwURLNotePtr, 0)
+typedef boost::ptr_vector<SwURLNote> SwURLNoteList;
class SwNoteURL
{
SwURLNoteList aList;
public:
SwNoteURL() {}
- sal_uInt16 Count() const { return aList.Count(); }
+ sal_uInt16 Count() const { return aList.size(); }
void InsertURLNote( const String& rURL, const String& rTarget,
const SwRect& rRect );
const SwURLNote& GetURLNote( sal_uInt16 nPos ) const
- { return *aList.GetObject( nPos ); }
+ { return aList[ nPos ]; }
void FillImageMap( ImageMap* pMap, const Point& rPos, const MapMode& rMap );
};
diff --git a/sw/source/core/text/noteurl.cxx b/sw/source/core/text/noteurl.cxx
index 8a08e09e30b9..12d1ea0c7a0a 100644
--- a/sw/source/core/text/noteurl.cxx
+++ b/sw/source/core/text/noteurl.cxx
@@ -40,21 +40,19 @@
// Global variable
SwNoteURL *pNoteURL = NULL;
-SV_IMPL_PTRARR( SwURLNoteList, SwURLNotePtr )
-
void SwNoteURL::InsertURLNote( const XubString& rURL, const XubString& rTarget,
const SwRect& rRect )
{
MSHORT i;
- MSHORT nCount = aList.Count();
+ MSHORT nCount = aList.size();
for( i = 0; i < nCount; i++ )
- if( rRect == aList.GetObject(i)->GetRect() )
+ if( rRect == aList[i].GetRect() )
break;
if( i == nCount )
{
SwURLNote *pNew = new SwURLNote( rURL, rTarget, rRect );
- aList.Insert( pNew, nCount );
+ aList.push_back( pNew );
}
}