summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsj <sj@openoffice.org>2010-07-08 16:46:28 +0200
committersj <sj@openoffice.org>2010-07-08 16:46:28 +0200
commitd4b20337f69340abd5cc9bc3e72c617876cc15d6 (patch)
treea07c1fa02f6733e194bf308aad0f5e2545d60884
parentbe588658ea127a6a05390435126f1d739a477b58 (diff)
impress194: #i112166# always removing tempfile (now removing file via osl_removeFile instead of ucb::content - delete)
-rw-r--r--vcl/inc/vcl/gfxlink.hxx7
-rw-r--r--vcl/source/gdi/gfxlink.cxx59
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx1
3 files changed, 11 insertions, 56 deletions
diff --git a/vcl/inc/vcl/gfxlink.hxx b/vcl/inc/vcl/gfxlink.hxx
index 3b3938ec848b..dced5a19c461 100644
--- a/vcl/inc/vcl/gfxlink.hxx
+++ b/vcl/inc/vcl/gfxlink.hxx
@@ -33,9 +33,6 @@
#include <vcl/mapmod.hxx>
#include <tools/stream.hxx>
-//#if 0 // _SOLAR__PRIVATE
-#include <tools/urlobj.hxx>
-
// -------------
// - ImpBuffer -
// -------------
@@ -62,7 +59,7 @@ struct ImpBuffer
struct ImpSwap
{
- INetURLObject maURL;
+ rtl::OUString maURL;
ULONG mnDataSize;
ULONG mnRefCount;
@@ -71,7 +68,7 @@ struct ImpSwap
BYTE* GetData() const;
- BOOL IsSwapped() const { return maURL.GetMainURL( INetURLObject::NO_DECODE ).getLength() > 0; }
+ BOOL IsSwapped() const { return maURL.getLength() > 0; }
void WriteTo( SvStream& rOStm ) const;
};
diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx
index 4d32990f9335..60ad94a63273 100644
--- a/vcl/source/gdi/gfxlink.cxx
+++ b/vcl/source/gdi/gfxlink.cxx
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
+#include <osl/file.h>
#include <tools/vcompat.hxx>
#include <tools/urlobj.hxx>
#include <tools/debug.hxx>
@@ -398,12 +399,10 @@ ImpSwap::ImpSwap( BYTE* pData, ULONG nDataSize ) :
{
::utl::TempFile aTempFile;
- maURL = INetURLObject(aTempFile.GetURL());
-
- if( maURL.GetMainURL( INetURLObject::NO_DECODE ).getLength() )
+ maURL = aTempFile.GetURL();
+ if( maURL.getLength() )
{
- SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( maURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READWRITE | STREAM_SHARE_DENYWRITE );
-
+ SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( maURL, STREAM_READWRITE | STREAM_SHARE_DENYWRITE );
if( pOStm )
{
pOStm->Write( pData, mnDataSize );
@@ -412,28 +411,8 @@ ImpSwap::ImpSwap( BYTE* pData, ULONG nDataSize ) :
if( bError )
{
- try
- {
- ::ucbhelper::Content aCnt( maURL.GetMainURL( INetURLObject::NO_DECODE ),
- ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
-
- aCnt.executeCommand( ::rtl::OUString::createFromAscii( "delete" ),
- ::com::sun::star::uno::makeAny( sal_Bool( sal_True ) ) );
- }
- catch( const ::com::sun::star::ucb::ContentCreationException& )
- {
- }
- catch( const ::com::sun::star::uno::RuntimeException& )
- {
- }
- catch( const ::com::sun::star::ucb::CommandAbortedException& )
- {
- }
- catch( const ::com::sun::star::uno::Exception& )
- {
- }
-
- maURL = INetURLObject();
+ osl_removeFile( maURL.pData );
+ maURL = String();
}
}
}
@@ -445,28 +424,7 @@ ImpSwap::ImpSwap( BYTE* pData, ULONG nDataSize ) :
ImpSwap::~ImpSwap()
{
if( IsSwapped() )
- {
- try
- {
- ::ucbhelper::Content aCnt( maURL.GetMainURL( INetURLObject::NO_DECODE ),
- ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
-
- aCnt.executeCommand( ::rtl::OUString::createFromAscii( "delete" ),
- ::com::sun::star::uno::makeAny( sal_Bool( sal_True ) ) );
- }
- catch( const ::com::sun::star::ucb::ContentCreationException& )
- {
- }
- catch( const ::com::sun::star::uno::RuntimeException& )
- {
- }
- catch( const ::com::sun::star::ucb::CommandAbortedException& )
- {
- }
- catch( const ::com::sun::star::uno::Exception& )
- {
- }
- }
+ osl_removeFile( maURL.pData );
}
// ------------------------------------------------------------------------
@@ -477,8 +435,7 @@ BYTE* ImpSwap::GetData() const
if( IsSwapped() )
{
- SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( maURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READWRITE );
-
+ SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( maURL, STREAM_READWRITE );
if( pIStm )
{
pData = new BYTE[ mnDataSize ];
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 6cb0a7d07697..7b7f3bbcb4d3 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -32,6 +32,7 @@
#include <math.h>
#include <algorithm>
+#include <tools/urlobj.hxx>
#include <pdfwriter_impl.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>