summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-10-15 13:22:35 +0200
committerMichael Stahl <mstahl@redhat.com>2014-10-15 18:03:16 +0200
commita4c9c8b3fb50e5b0344f77b57db757ebbb679144 (patch)
tree64d42408e3b53543d6f9d6ce6b9ce37ec5c3db83 /sw
parentbeb45beba1529b0706a8dbe732c71b19493bcd7e (diff)
sw: simplify the temp-file leaking debug code in mail-merge
Change-Id: Ib0de8cc5977a8721511e62f39bf3a86a6a76250a
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index f3f9697e1553..a39ad546b17a 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -779,21 +779,20 @@ static void lcl_RemoveSectionLinks( SwWrtShell& rWorkShell )
static void lcl_SaveDoc( SfxObjectShell *xTargetDocShell,
const char *name, int no = 0 )
{
- boost::scoped_ptr< utl::TempFile > aTempFile;
OUString sExt( ".odt" );
OUString basename = OUString::createFromAscii( name );
if (no > 0)
basename += OUString::number(no) + "-";
- aTempFile.reset( new utl::TempFile( basename, true, &sExt ) );
- OSL_ENSURE( aTempFile.get(), "Temporary file not available" );
- INetURLObject aTempFileURL( aTempFile->GetURL() );
+ // aTempFile is not deleted, but that seems to be intentional
+ utl::TempFile aTempFile(basename, true, &sExt);
+ INetURLObject aTempFileURL( aTempFile.GetURL() );
SfxMedium* pDstMed = new SfxMedium(
aTempFileURL.GetMainURL( INetURLObject::NO_DECODE ),
STREAM_STD_READWRITE );
if( !xTargetDocShell->DoSaveAs( *pDstMed ) )
- SAL_WARN( "sw.mailmerge", "Error saving: " << aTempFile->GetURL() );
+ SAL_WARN( "sw.mailmerge", "Error saving: " << aTempFile.GetURL() );
else
- SAL_INFO( "sw.mailmerge", "Saved doc as: " << aTempFile->GetURL() );
+ SAL_INFO( "sw.mailmerge", "Saved doc as: " << aTempFile.GetURL() );
delete pDstMed;
}