summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/xml/xmlxtexp.cxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/svx/source/xml/xmlxtexp.cxx b/svx/source/xml/xmlxtexp.cxx
index 2cb4fc05232f..4bb2e7484709 100644
--- a/svx/source/xml/xmlxtexp.cxx
+++ b/svx/source/xml/xmlxtexp.cxx
@@ -196,7 +196,7 @@ bool SvxXMLXTableExportComponent::save(
OUString *pOptName )
{
bool bRet = false;
- SfxMedium* pMedium = nullptr;
+ std::unique_ptr<SfxMedium> pMedium;
SvXMLGraphicHelper* pGraphicHelper = nullptr;
sal_Int32 eCreate = embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE;
@@ -227,7 +227,7 @@ bool SvxXMLXTableExportComponent::save(
xSubStorage = ::comphelper::OStorageHelper::GetStorageFromURL( rURL, eCreate );
else
{
- pMedium = new SfxMedium( rURL, StreamMode::WRITE | StreamMode::TRUNC );
+ pMedium.reset(new SfxMedium( rURL, StreamMode::WRITE | StreamMode::TRUNC ));
SvStream* pStream = pMedium->GetOutStream();
if( !pStream )
@@ -305,10 +305,7 @@ bool SvxXMLXTableExportComponent::save(
}
if( pMedium )
- {
pMedium->Commit();
- delete pMedium;
- }
return bRet;
}