[Libreoffice-commits] .: vcl/inc vcl/win

Caolán McNamara caolan at kemper.freedesktop.org
Mon Nov 21 04:51:57 PST 2011


 vcl/inc/salprn.hxx            |    2 +-
 vcl/win/source/gdi/salprn.cxx |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 054568fea71c493746a11569427169b718c6c5e4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Nov 21 12:49:42 2011 +0000

    this casting of a void* is a disaster waiting to happen
    
    only ever used for a string, to set it to a string type

diff --git a/vcl/inc/salprn.hxx b/vcl/inc/salprn.hxx
index 195bc80..0164acf 100644
--- a/vcl/inc/salprn.hxx
+++ b/vcl/inc/salprn.hxx
@@ -54,7 +54,7 @@ struct VCL_PLUGIN_PUBLIC SalPrinterQueueInfo
     rtl::OUString               maComment;
     sal_uLong                   mnStatus;
     sal_uLong                   mnJobs;
-    void*                   mpSysData;
+    rtl::OUString*              mpSysData;
 
                             SalPrinterQueueInfo();
                             ~SalPrinterQueueInfo();
diff --git a/vcl/win/source/gdi/salprn.cxx b/vcl/win/source/gdi/salprn.cxx
index 7a7c983..5f58cb7 100644
--- a/vcl/win/source/gdi/salprn.cxx
+++ b/vcl/win/source/gdi/salprn.cxx
@@ -236,7 +236,7 @@ void WinSalInstance::GetPrinterQueueState( SalPrinterQueueInfo* pInfo )
                 pInfo->mnStatus      = ImplWinQueueStatusToSal( pWinInfo2->Status );
                 pInfo->mnJobs        = pWinInfo2->cJobs;
                 if( ! pInfo->mpSysData )
-                    pInfo->mpSysData     = new XubString( aPortName );
+                    pInfo->mpSysData = new rtl::OUString(aPortName);
             }
             rtl_freeMemory(pWinInfo2);
         }
@@ -248,7 +248,7 @@ void WinSalInstance::GetPrinterQueueState( SalPrinterQueueInfo* pInfo )
 
 void WinSalInstance::DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo )
 {
-    delete (String*)(pInfo->mpSysData);
+    delete pInfo->mpSysData;
     delete pInfo;
 }
 


More information about the Libreoffice-commits mailing list