Kaydet (Commit) b9d7b38f authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Stahl

Convert SV_DECL_PTRARR_DEL(SwURLNoteList) to boost::ptr_vector

üst 47c8927f
......@@ -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 );
};
......
......@@ -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 );
}
}
......
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