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

sw: replace boost::ptr_vector with std::vector

Change-Id: I477e7a809b572fd62b276afd44c8b140efb9d653
üst fdc83939
...@@ -21,7 +21,10 @@ ...@@ -21,7 +21,10 @@
#define INCLUDED_SW_SOURCE_CORE_INC_NOTEURL_HXX #define INCLUDED_SW_SOURCE_CORE_INC_NOTEURL_HXX
#include "swrect.hxx" #include "swrect.hxx"
#include <boost/ptr_container/ptr_vector.hpp>
#include <rtl/ustring.hxx>
#include <vector>
class ImageMap; class ImageMap;
class MapMode; class MapMode;
...@@ -44,7 +47,9 @@ public: ...@@ -44,7 +47,9 @@ public:
class SwNoteURL class SwNoteURL
{ {
boost::ptr_vector<SwURLNote> aList; private:
std::vector<SwURLNote> m_List;
public: public:
SwNoteURL() {} SwNoteURL() {}
void InsertURLNote( const OUString& rURL, const OUString& rTarget, void InsertURLNote( const OUString& rURL, const OUString& rTarget,
......
...@@ -17,39 +17,38 @@ ...@@ -17,39 +17,38 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include "noteurl.hxx"
#include "swtypes.hxx" #include "swtypes.hxx"
#include <vcl/outdev.hxx> #include <vcl/outdev.hxx>
#include <svtools/imaprect.hxx> #include <svtools/imaprect.hxx>
#include <svtools/imap.hxx> #include <svtools/imap.hxx>
#include "noteurl.hxx"
// Global variable // Global variable
SwNoteURL *pNoteURL = NULL; SwNoteURL *pNoteURL = NULL;
void SwNoteURL::InsertURLNote( const OUString& rURL, const OUString& rTarget, void SwNoteURL::InsertURLNote( const OUString& rURL, const OUString& rTarget,
const SwRect& rRect ) const SwRect& rRect )
{ {
const size_t nCount = aList.size(); const size_t nCount = m_List.size();
for( size_t i = 0; i < nCount; ++i ) for( size_t i = 0; i < nCount; ++i )
if( rRect == aList[i].GetRect() ) if (rRect == m_List[i].GetRect())
return; return;
SwURLNote *pNew = new SwURLNote( rURL, rTarget, rRect ); m_List.push_back(SwURLNote(rURL, rTarget, rRect));
aList.push_back( pNew );
} }
void SwNoteURL::FillImageMap( ImageMap *pMap, const Point &rPos, void SwNoteURL::FillImageMap( ImageMap *pMap, const Point &rPos,
const MapMode& rMap ) const MapMode& rMap )
{ {
OSL_ENSURE( pMap, "FillImageMap: No ImageMap, no cookies!" ); OSL_ENSURE( pMap, "FillImageMap: No ImageMap, no cookies!" );
const size_t nCount = aList.size(); const size_t nCount = m_List.size();
if( nCount ) if( nCount )
{ {
MapMode aMap( MAP_100TH_MM ); MapMode aMap( MAP_100TH_MM );
for( size_t i = 0; i < nCount; ++i ) for( size_t i = 0; i < nCount; ++i )
{ {
const SwURLNote &rNote = aList[i]; const SwURLNote &rNote = m_List[i];
SwRect aSwRect( rNote.GetRect() ); SwRect aSwRect( rNote.GetRect() );
aSwRect -= rPos; aSwRect -= rPos;
Rectangle aRect( OutputDevice::LogicToLogic( aSwRect.SVRect(), Rectangle aRect( OutputDevice::LogicToLogic( aSwRect.SVRect(),
......
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