summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2010-09-14 10:50:46 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2010-09-14 10:50:46 +0200
commit7553ed5a48ee9d1eff4dce30509ce0d682687b20 (patch)
tree935727125df3034c4f12009b10d7321e0d53325c
parent8483892bd836c37b4e4a171745e37ceae88d0a16 (diff)
win32-pdfimport-use-temporary-file.diff: avoid locking issues on win32
-rw-r--r--sdext/source/pdfimport/pdfiadaptor.cxx2
-rwxr-xr-xsdext/source/pdfimport/wrapper/wrapper.cxx6
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<io::XInputStream>& 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;
}
}