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

Joseph Powers jpowers at kemper.freedesktop.org
Sat Jul 9 18:54:22 PDT 2011


 svtools/inc/svtools/grfmgr.hxx    |    1 -
 svtools/source/graphic/grfmgr.cxx |    5 -----
 vcl/inc/impgraph.hxx              |    2 --
 vcl/inc/vcl/animate.hxx           |    2 --
 vcl/inc/vcl/graph.hxx             |    2 --
 vcl/source/gdi/animate.cxx        |   13 ++++++++-----
 vcl/source/gdi/graph.cxx          |    7 -------
 vcl/source/gdi/impgraph.cxx       |    7 -------
 8 files changed, 8 insertions(+), 31 deletions(-)

New commits:
commit 5439d9e8d09269bbd3cd7705f69f1f5fa0b07f6a
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Sat Jul 9 16:01:45 2011 -0700

    Replace List with std::vector< AInfo* >
    
    I actually moved the List member from the class to a class method. I think
    this is safe because the member was only used in one method and it's life-
    span was limited to the one method (populate, process, dispose - all in one
    "if" block.
    
    I also removed all the member's export methods since no one used them.

diff --git a/svtools/inc/svtools/grfmgr.hxx b/svtools/inc/svtools/grfmgr.hxx
index a45b05b..f45a069 100644
--- a/svtools/inc/svtools/grfmgr.hxx
+++ b/svtools/inc/svtools/grfmgr.hxx
@@ -409,7 +409,6 @@ public:
     sal_Bool				HasRenderGraphic() const { return mbHasRenderGraphic; }
 
     void					ResetAnimationLoopCount();
-    List*					GetAnimationInfoList() const;
     Link					GetAnimationNotifyHdl() const { return maGraphic.GetAnimationNotifyHdl(); }
     void					SetAnimationNotifyHdl( const Link& rLink );
 
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index 15de989..5a89b9f 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -547,11 +547,6 @@ void GraphicObject::SetAnimationNotifyHdl( const Link& rLink )
     maGraphic.SetAnimationNotifyHdl( rLink );
 }
 
-List* GraphicObject::GetAnimationInfoList() const
-{
-    return maGraphic.GetAnimationInfoList();
-}
-
 sal_Bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
                           const GraphicAttr* pAttr, sal_uLong nFlags )
 {
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx
index 6df6735..190de12 100644
--- a/vcl/inc/impgraph.hxx
+++ b/vcl/inc/impgraph.hxx
@@ -144,8 +144,6 @@ private:
     sal_uLong				ImplGetAnimationLoopCount() const;
     void				ImplResetAnimationLoopCount();
 
-    List*				ImplGetAnimationInfoList() const;
-
 private:
 
     GraphicReader*		ImplGetContext();
diff --git a/vcl/inc/vcl/animate.hxx b/vcl/inc/vcl/animate.hxx
index 687a430..90a49de 100644
--- a/vcl/inc/vcl/animate.hxx
+++ b/vcl/inc/vcl/animate.hxx
@@ -152,7 +152,6 @@ class VCL_DLLPUBLIC Animation
     SAL_DLLPRIVATE static sal_uLong     mnAnimCount;
 
     AnimationBitmapList_impl    maList;
-    List                    maAInfoList;
     Link                    maNotifyLink;
     BitmapEx                maBitmapEx;
     Timer                   maTimer;
@@ -241,7 +240,6 @@ public:
     const AnimationBitmap&  Get( sal_uInt16 nAnimation ) const;
     void                    Replace( const AnimationBitmap& rNewAnimationBmp, sal_uInt16 nAnimation );
 
-    List*                   GetAInfoList() { return &maAInfoList; }
     sal_uLong               GetSizeBytes() const;
     sal_uLong               GetChecksum() const;
 
diff --git a/vcl/inc/vcl/graph.hxx b/vcl/inc/vcl/graph.hxx
index c8b7516..3685cda 100644
--- a/vcl/inc/vcl/graph.hxx
+++ b/vcl/inc/vcl/graph.hxx
@@ -178,8 +178,6 @@ public:
     sal_uLong               GetAnimationLoopCount() const;
     void                ResetAnimationLoopCount();
 
-    List*               GetAnimationInfoList() const;
-
     sal_uLong               GetChecksum() const;
 
 public:
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx
index 1369bca..0a3bd19 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -455,10 +455,12 @@ void Animation::ImplRestartTimer( sal_uLong nTimeout )
 }
 
 // -----------------------------------------------------------------------
+typedef ::std::vector< AInfo* > AInfoList_impl;
 
 IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
 {
     const size_t nAnimCount = maList.size();
+    AInfoList_impl aAInfoList;
 
     if( nAnimCount )
     {
@@ -471,13 +473,14 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
 
             // create AInfo-List
             for( pView = (ImplAnimView*) mpViewList->First(); pView; pView = (ImplAnimView*) mpViewList->Next() )
-                maAInfoList.Insert( pView->ImplCreateAInfo() );
+                aAInfoList.push_back( pView->ImplCreateAInfo() );
 
             maNotifyLink.Call( this );
 
             // set view state from AInfo structure
-            for( pAInfo = (AInfo*) maAInfoList.First(); pAInfo; pAInfo = (AInfo*) maAInfoList.Next() )
+            for( size_t i = 0, n = aAInfoList.size(); i < n; ++i )
             {
+                pAInfo = aAInfoList[ i ];
                 if( !pAInfo->pViewData )
                 {
                     pView = new ImplAnimView( this, pAInfo->pOutDev,
@@ -493,9 +496,9 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
             }
 
             // delete AInfo structures
-            for( pAInfo = (AInfo*) maAInfoList.First(); pAInfo; pAInfo = (AInfo*) maAInfoList.Next() )
-                delete (AInfo*) pAInfo;
-            maAInfoList.Clear();
+            for( size_t i = 0, n = aAInfoList.size(); i < n; ++i )
+                delete aAInfoList[ i ];
+            aAInfoList.clear();
 
             // delete all unmarked views and reset marked state
             pView = (ImplAnimView*) mpViewList->First();
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index 89cbf14..962daad 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -662,13 +662,6 @@ void Graphic::ResetAnimationLoopCount()
 
 // ------------------------------------------------------------------------
 
-List* Graphic::GetAnimationInfoList() const
-{
-    return mpImpGraphic->ImplGetAnimationInfoList();
-}
-
-// ------------------------------------------------------------------------
-
 GraphicReader* Graphic::GetContext()
 {
     return mpImpGraphic->ImplGetContext();
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index ddbecf9..3b6d9a4 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -928,13 +928,6 @@ void ImpGraphic::ImplResetAnimationLoopCount()
 
 // ------------------------------------------------------------------------
 
-List* ImpGraphic::ImplGetAnimationInfoList() const
-{
-    return( mpAnimation ? mpAnimation->GetAInfoList() : NULL );
-}
-
-// ------------------------------------------------------------------------
-
 GraphicReader* ImpGraphic::ImplGetContext()
 {
     return mpContext;


More information about the Libreoffice-commits mailing list