Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


---
 vcl/inc/vcl/cvtsvm.hxx    |    5 ++---
 vcl/source/gdi/cvtsvm.cxx |   16 ++++++++++------
 2 files changed, 12 insertions(+), 9 deletions(-)


diff --git a/vcl/inc/vcl/cvtsvm.hxx b/vcl/inc/vcl/cvtsvm.hxx
index de4158e..370871b 100644
--- a/vcl/inc/vcl/cvtsvm.hxx
+++ b/vcl/inc/vcl/cvtsvm.hxx
@@ -29,6 +29,7 @@
 #ifndef _SV_CVTMTF_HXX
 #define _SV_CVTMTF_HXX
 
+#include <stack>
 #include <vcl/dllapi.h>
 #include <vcl/metaact.hxx>
 #include <vcl/gdimtf.hxx>
@@ -91,8 +92,6 @@
 // - SVMConverter -
 // ----------------
 
-class Stack;
-
 class VCL_PLUGIN_PUBLIC SVMConverter
 {
 private:
@@ -100,7 +99,7 @@ private:
     SAL_DLLPRIVATE void             ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf );
     SAL_DLLPRIVATE sal_uLong            ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
                                           VirtualDevice& rSaveVDev, sal_Bool& rRop_0_1,
-                                          Color& rLineCol, Stack& rLineColStack,
+                                          Color& rLineCol, ::std::stack<Color*>& rLineColStack,
                                           rtl_TextEncoding& rActualCharSet );
 
 public:
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx
index 92b326c..7d9ec4d 100644
--- a/vcl/source/gdi/cvtsvm.cxx
+++ b/vcl/source/gdi/cvtsvm.cxx
@@ -1374,7 +1374,7 @@ void SVMConverter::ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf )
     sal_Bool                bRop_0_1 = sal_False;
     VirtualDevice       aSaveVDev;
     Color               aLineCol( COL_BLACK );
-    Stack               aLineColStack;
+    ::std::stack< Color* >  aLineColStack;
 
     rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
 
@@ -1399,15 +1399,18 @@ void SVMConverter::ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf )
     rOStm.SetNumberFormatInt( nOldFormat );
 
     // cleanup push-pop stack if neccessary
-    for( void* pCol = aLineColStack.Pop(); pCol; pCol = aLineColStack.Pop() )
-        delete (Color*) pCol;
+    while ( !aLineColStack.empty() )
+    {
+        delete aLineColStack.top();
+        aLineColStack.pop();
+    }
 }
 
 // ------------------------------------------------------------------------
 
 sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
                                       VirtualDevice& rSaveVDev, sal_Bool& rRop_0_1,
-                                      Color& rLineCol, Stack& rLineColStack,
+                                      Color& rLineCol, ::std::stack< Color* >& rLineColStack,
                                       rtl_TextEncoding& rActualCharSet )
 {
     sal_uLong nCount = 0;
@@ -2054,7 +2057,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
             case( META_PUSH_ACTION ):
             {
                 ImplWritePushAction( rOStm );
-                rLineColStack.Push( new Color( rLineCol ) );
+                rLineColStack.push( new Color( rLineCol ) );
                 rSaveVDev.Push();
                 nCount++;
             }
@@ -2062,7 +2065,8 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
 
             case( META_POP_ACTION ):
             {
-                Color* pCol = (Color*) rLineColStack.Pop();
+                Color* pCol = rLineColStack.top();
+                rLineColStack.pop();
 
                 if( pCol )
                 {


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.