summaryrefslogtreecommitdiff
path: root/unotools/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-06-27 13:24:23 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-06-28 14:56:46 +0200
commit9ba8b37db55d210b915170528fd87df196ab29e7 (patch)
treeae12802b319d7a7dea3f2f357c752b2c7e03c798 /unotools/source
parent7ce1674658bef5bc4da7984c396b77ec09e3670f (diff)
use utl::TempFile directly in package
so we can (a) control the lifetime of the temp file properly and (b) we don't need to use file URLs which means we stay on the efficient path on Windows Change-Id: I2b1eed5f5afc8f89f53bde35ebb44e9922889817 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136557 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools/source')
-rw-r--r--unotools/source/streaming/streamwrap.cxx16
1 files changed, 11 insertions, 5 deletions
diff --git a/unotools/source/streaming/streamwrap.cxx b/unotools/source/streaming/streamwrap.cxx
index 6a6cbbd20142..2361d80cd886 100644
--- a/unotools/source/streaming/streamwrap.cxx
+++ b/unotools/source/streaming/streamwrap.cxx
@@ -132,12 +132,13 @@ sal_Int32 SAL_CALL OInputStreamWrapper::available()
void SAL_CALL OInputStreamWrapper::closeInput()
{
std::scoped_lock aGuard( m_aMutex );
- checkConnected();
-
- if (m_bSvStreamOwner)
- delete m_pSvStream;
+ if (m_pSvStream)
+ {
+ if (m_bSvStreamOwner)
+ delete m_pSvStream;
- m_pSvStream = nullptr;
+ m_pSvStream = nullptr;
+ }
}
void OInputStreamWrapper::checkConnected() const
@@ -297,6 +298,11 @@ OStreamWrapper::OStreamWrapper(std::unique_ptr<SvStream> pStream)
SetStream( pStream.release(), true );
}
+OStreamWrapper::OStreamWrapper(SvStream* pStream, bool bOwner)
+{
+ SetStream( pStream, bOwner );
+}
+
css::uno::Reference< css::io::XInputStream > SAL_CALL OStreamWrapper::getInputStream( )
{
return this;