summaryrefslogtreecommitdiff
path: root/sfx2/source/doc/doctemplates.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-01-09 14:47:04 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-01-09 18:02:08 +0100
commita3fa2c3bad77b976e7f79de5d0f2abc0283e7b3e (patch)
tree9de61ffd3c1c50e23af81f02bff9a0892b0b0026 /sfx2/source/doc/doctemplates.cxx
parent9754b3feb4092243f30c665abc0344b1a665b5f6 (diff)
Simplify some TempFile service code
Change-Id: Id39be33dcc5aa9378e29c850cb71d3662093ab25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128189 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/doc/doctemplates.cxx')
-rw-r--r--sfx2/source/doc/doctemplates.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index f2e13da357e2..9ac236b3b4f4 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -1269,15 +1269,13 @@ bool SfxDocTplService_Impl::WriteUINamesForTemplateDir_Impl( const OUString& aUs
{
bool bResult = false;
try {
- uno::Reference< beans::XPropertySet > xTempFile(
+ uno::Reference< io::XTempFile > xTempFile(
io::TempFile::create(mxContext),
- uno::UNO_QUERY_THROW );
+ uno::UNO_SET_THROW );
- OUString aTempURL;
- uno::Any aUrl = xTempFile->getPropertyValue("Uri");
- aUrl >>= aTempURL;
+ OUString aTempURL = xTempFile->getUri();
- uno::Reference< io::XStream > xStream( xTempFile, uno::UNO_QUERY_THROW );
+ uno::Reference< io::XStream > xStream( xTempFile );
uno::Reference< io::XOutputStream > xOutStream = xStream->getOutputStream();
if ( !xOutStream.is() )
throw uno::RuntimeException();