diff options
-rw-r--r-- | toolkit/source/awt/vclxgraphics.cxx | 16 | ||||
-rw-r--r-- | toolkit/source/helper/unowrapper.cxx | 6 | ||||
-rw-r--r-- | vcl/inc/vcl/outdev.hxx | 23 |
3 files changed, 30 insertions, 15 deletions
diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx index dc2c84702664..8f29a5e5e86f 100644 --- a/toolkit/source/awt/vclxgraphics.cxx +++ b/toolkit/source/awt/vclxgraphics.cxx @@ -73,9 +73,17 @@ VCLXGraphics::VCLXGraphics() VCLXGraphics::~VCLXGraphics() { - List* pLst = mpOutputDevice ? mpOutputDevice->GetUnoGraphicsList() : NULL; + VCLXGraphicsList_impl* pLst = mpOutputDevice ? mpOutputDevice->GetUnoGraphicsList() : NULL; if ( pLst ) - pLst->Remove( this ); + { + for( VCLXGraphicsList_impl::iterator it = pLst->begin(); it < pLst->end(); ++it ) + { + if( *it == this ) { + pLst->erase( it ); + break; + } + } + } delete mpClipRegion; } @@ -100,10 +108,10 @@ void VCLXGraphics::Init( OutputDevice* pOutDev ) mpClipRegion = NULL; // Register at OutputDevice - List* pLst = mpOutputDevice->GetUnoGraphicsList(); + VCLXGraphicsList_impl* pLst = mpOutputDevice->GetUnoGraphicsList(); if ( !pLst ) pLst = mpOutputDevice->CreateUnoGraphicsList(); - pLst->Insert( this, LIST_APPEND ); + pLst->push_back( this ); } void VCLXGraphics::InitOutputDevice( sal_uInt16 nFlags ) diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index b5abb11d632e..cc4992d250e0 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -206,12 +206,12 @@ void UnoWrapper::SetWindowInterface( Window* pWindow, ::com::sun::star::uno::Ref void UnoWrapper::ReleaseAllGraphics( OutputDevice* pOutDev ) { - List* pLst = pOutDev->GetUnoGraphicsList(); + VCLXGraphicsList_impl* pLst = pOutDev->GetUnoGraphicsList(); if ( pLst ) { - for ( sal_uInt32 n = 0; n < pLst->Count(); n++ ) + for ( size_t n = 0; n < pLst->size(); n++ ) { - VCLXGraphics* pGrf = (VCLXGraphics*)pLst->GetObject( n ); + VCLXGraphics* pGrf = (*pLst)[ n ]; pGrf->SetOutputDevice( NULL ); } } diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx index b0d694c5e75e..78c7ad938d1a 100644 --- a/vcl/inc/vcl/outdev.hxx +++ b/vcl/inc/vcl/outdev.hxx @@ -282,6 +282,9 @@ class VirtualDevice; class Printer; class ImplFontSelectData; class ImplFontMetricData; +class VCLXGraphics; + +typedef ::std::vector< VCLXGraphics* > VCLXGraphicsList_impl; const char* ImplDbgCheckOutputDevice( const void* pObj ); @@ -305,17 +308,17 @@ private: mutable SalGraphics* mpGraphics; mutable OutputDevice* mpPrevGraphics; mutable OutputDevice* mpNextGraphics; - GDIMetaFile* mpMetaFile; + GDIMetaFile* mpMetaFile; mutable ImplFontEntry* mpFontEntry; mutable ImplFontCache* mpFontCache; mutable ImplDevFontList* mpFontList; mutable ImplGetDevFontList* mpGetDevFontList; mutable ImplGetDevSizeList* mpGetDevSizeList; - ImplObjStack* mpObjStack; - ImplOutDevData* mpOutDevData; - List* mpUnoGraphicsList; - vcl::PDFWriterImpl* mpPDFWriter; - vcl::ExtOutDevData* mpExtOutDevData; + ImplObjStack* mpObjStack; + ImplOutDevData* mpOutDevData; + VCLXGraphicsList_impl* mpUnoGraphicsList; + vcl::PDFWriterImpl* mpPDFWriter; + vcl::ExtOutDevData* mpExtOutDevData; // TEMP TEMP TEMP VirtualDevice* mpAlphaVDev; @@ -1141,8 +1144,12 @@ public: ::com::sun::star::rendering::XCanvas > GetCanvas() const; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > CreateUnoGraphics(); - List* GetUnoGraphicsList() const { return mpUnoGraphicsList; } - List* CreateUnoGraphicsList() { mpUnoGraphicsList = new List; return mpUnoGraphicsList; } + VCLXGraphicsList_impl* GetUnoGraphicsList() const { return mpUnoGraphicsList; } + VCLXGraphicsList_impl* CreateUnoGraphicsList() + { + mpUnoGraphicsList = new VCLXGraphicsList_impl(); + return mpUnoGraphicsList; + } static void BeginFontSubstitution(); static void EndFontSubstitution(); |