From 7553ed5a48ee9d1eff4dce30509ce0d682687b20 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Tue, 14 Sep 2010 10:50:46 +0200 Subject: win32-pdfimport-use-temporary-file.diff: avoid locking issues on win32 --- sdext/source/pdfimport/pdfiadaptor.cxx | 2 +- sdext/source/pdfimport/wrapper/wrapper.cxx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sdext/source/pdfimport/pdfiadaptor.cxx b/sdext/source/pdfimport/pdfiadaptor.cxx index 9ece9ef..7c00239 100644 --- a/sdext/source/pdfimport/pdfiadaptor.cxx +++ b/sdext/source/pdfimport/pdfiadaptor.cxx @@ -250,7 +250,7 @@ bool PDFIRawAdaptor::parse( const uno::Reference& xInput bool bSuccess=false; - if( xInput.is() && (!rURL.getLength() || rURL.compareToAscii( "file:", 5 ) != 0) ) + if( xInput.is() ) bSuccess = xpdf_ImportFromStream( xInput, pSink, xIHdl, rPwd, m_xContext ); else bSuccess = xpdf_ImportFromFile( rURL, pSink, xIHdl, rPwd, m_xContext ); diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx index cd89d8f..27b440c 100755 --- a/sdext/source/pdfimport/wrapper/wrapper.cxx +++ b/sdext/source/pdfimport/wrapper/wrapper.cxx @@ -1105,7 +1105,11 @@ bool xpdf_ImportFromStream( const uno::Reference< io::XInputStream >& xI osl_closeFile( aFile ); - return bSuccess && xpdf_ImportFromFile( aURL, rSink, xIHdl, rPwd, xContext ); + if ( bSuccess ) + bSuccess = xpdf_ImportFromFile( aURL, rSink, xIHdl, rPwd, xContext ); + osl_removeFile( aURL.pData ); + + return bSuccess; } } -- cgit v1.2.3