summaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-12-20 11:18:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-12-21 12:21:49 +0100
commite06a097b70077476f88065a3bda7c57b4b8e83b5 (patch)
treeb3d957638859db14d129931e7398752294afdfb8 /filter
parentuse unique_ptr in hwpfilter (diff)
downloadcore-e06a097b70077476f88065a3bda7c57b4b8e83b5.tar.gz
core-e06a097b70077476f88065a3bda7c57b4b8e83b5.zip
use unique_ptr in SVGFilter
Change-Id: I58d352f5f9d689b268ab499f811be54020fcb458 Reviewed-on: https://gerrit.libreoffice.org/65521 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/svg/svgexport.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 6a80a3889fd2..2058ede1242f 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -1004,7 +1004,7 @@ void SVGFilter::implExportDocumentHeaderWriterOrCalc(sal_Int32 nDocX, sal_Int32
/// Append aField to aFieldSet if it is not already present in the set and create the field id sFieldId
template< typename TextFieldType >
-static OUString implGenerateFieldId( std::vector< TextField* > & aFieldSet,
+static OUString implGenerateFieldId( std::vector< std::unique_ptr<TextField> > & aFieldSet,
const TextFieldType & aField,
const OUString & sOOOElemField,
const Reference< css::drawing::XDrawPage >& xMasterPage )
@@ -1023,7 +1023,7 @@ static OUString implGenerateFieldId( std::vector< TextField* > & aFieldSet,
OUString sFieldId(sOOOElemField + "_");
if( !bFound )
{
- aFieldSet.push_back( new TextFieldType( aField ) );
+ aFieldSet.emplace_back( new TextFieldType( aField ) );
}
aFieldSet[i]->insertMasterPage( xMasterPage );
sFieldId += OUString::number( i );
@@ -1094,7 +1094,7 @@ void SVGFilter::implGenerateMetaData()
SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", true, true );
const OUString aId( NSPREFIX "meta_slide" );
const OUString aElemTextFieldId( aOOOElemTextField );
- std::vector< TextField* > aFieldSet;
+ std::vector< std::unique_ptr<TextField> > aFieldSet;
// dummy slide - used as leaving slide for transition on the first slide
if( mbPresentation )
@@ -1235,7 +1235,7 @@ void SVGFilter::implGenerateMetaData()
}
if( mpSVGExport->IsEmbedFonts() && mpSVGExport->IsUsePositionedCharacters() )
{
- for(TextField* i : aFieldSet)
+ for(std::unique_ptr<TextField>& i : aFieldSet)
{
i->growCharSet( mTextFieldCharSets );
}
@@ -1243,10 +1243,7 @@ void SVGFilter::implGenerateMetaData()
}
// text fields are used only for generating meta info so we don't need them anymore
- for(TextField* i : aFieldSet)
- {
- delete i;
- }
+ aFieldSet.clear();
}
}
}