[Libreoffice-commits] .: toolkit/source vcl/inc

Joseph Powers jpowers at kemper.freedesktop.org
Mon Jul 11 06:17:45 PDT 2011


 toolkit/source/awt/vclxgraphics.cxx  |   16 ++++++++++++----
 toolkit/source/helper/unowrapper.cxx |   20 ++++++++++----------
 vcl/inc/vcl/outdev.hxx               |   25 ++++++++++++++++---------
 3 files changed, 38 insertions(+), 23 deletions(-)

New commits:
commit 6a95442d42af12b7b5707ea12e84fbafd3c4d0a1
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Mon Jul 11 05:34:30 2011 -0700

    Replace List with std::vector< VCLXGraphics* >

diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx
index dc3dc87..38923f2 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 0a15b91..e613cfa 100644
--- a/toolkit/source/helper/unowrapper.cxx
+++ b/toolkit/source/helper/unowrapper.cxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -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 );
         }
     }
@@ -264,34 +264,34 @@ void UnoWrapper::WindowDestroyed( Window* pWindow )
     // ggf. existieren noch von ::com::sun::star::loader::Java erzeugte Childs, die sonst erst
     // im Garbage-Collector zerstoert werden...
     Window* pChild = pWindow->GetWindow( WINDOW_FIRSTCHILD );
-    while ( pChild ) 
+    while ( pChild )
     {
         Window* pNextChild = pChild->GetWindow( WINDOW_NEXT );
 
         Window* pClient = pChild->GetWindow( WINDOW_CLIENT );
-        if ( pClient->GetWindowPeer() ) 
+        if ( pClient->GetWindowPeer() )
         {
             ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > xComp( pClient->GetComponentInterface( sal_False ), ::com::sun::star::uno::UNO_QUERY );
             xComp->dispose();
         }
-        
+
         pChild = pNextChild;
     }
 
     // ::com::sun::star::chaos::System-Windows suchen...
     Window* pOverlap = pWindow->GetWindow( WINDOW_OVERLAP );
     pOverlap = pOverlap->GetWindow( WINDOW_FIRSTOVERLAP );
-    while ( pOverlap ) 
+    while ( pOverlap )
     {
         Window* pNextOverlap = pOverlap->GetWindow( WINDOW_NEXT );
         Window* pClient = pOverlap->GetWindow( WINDOW_CLIENT );
-        
+
         if ( pClient->GetWindowPeer() && lcl_ImplIsParent( pWindow, pClient ) )
         {
             ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > xComp( pClient->GetComponentInterface( sal_False ), ::com::sun::star::uno::UNO_QUERY );
             xComp->dispose();
         }
-        
+
         pOverlap = pNextOverlap;
     }
 
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index dba65fe..b808f1b 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;
@@ -547,7 +550,7 @@ public:
 
     SAL_DLLPRIVATE static FontEmphasisMark ImplGetEmphasisMarkStyle( const Font& rFont );
     SAL_DLLPRIVATE static sal_Bool ImplIsUnderlineAbove( const Font& );
- 
+
     // tells whether this output device is RTL in an LTR UI or LTR in a RTL UI
     SAL_DLLPRIVATE bool ImplIsAntiparallel() const ;
 
@@ -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();


More information about the Libreoffice-commits mailing list