diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-14 10:06:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-16 11:51:10 +0200 |
commit | fbba9324c7df5f459dfe10795021ad3bf77da423 (patch) | |
tree | 9eef75aaeb92cb154e298fcdd5c6966950f29980 /filter | |
parent | 469debe65029cd78423e68ee82f0377714e89d11 (diff) |
loplugin:useuniqueptr in swf::Writer
Change-Id: Id10d9b120cf81b1576da48840f84353537466d17
Reviewed-on: https://gerrit.libreoffice.org/59027
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/flash/swfwriter.cxx | 5 | ||||
-rw-r--r-- | filter/source/flash/swfwriter.hxx | 5 | ||||
-rw-r--r-- | filter/source/flash/swfwriter1.cxx | 2 |
3 files changed, 5 insertions, 7 deletions
diff --git a/filter/source/flash/swfwriter.cxx b/filter/source/flash/swfwriter.cxx index b2e22b9685c0..04b47a640e25 100644 --- a/filter/source/flash/swfwriter.cxx +++ b/filter/source/flash/swfwriter.cxx @@ -128,11 +128,12 @@ void ImplCopySvStreamToXOutputStream( SvStream& rIn, Reference< XOutputStream > void Writer::storeTo( Reference< XOutputStream > const &xOutStream ) { - for (auto const& font : maFonts) + for (auto & font : maFonts) { font->write( *mpFontsStream ); - delete font; + font.reset(); } + maFonts.clear(); // Endtag mpMovieStream->WriteUInt16( 0 ); diff --git a/filter/source/flash/swfwriter.hxx b/filter/source/flash/swfwriter.hxx index da781c2cf4da..68c349934ba5 100644 --- a/filter/source/flash/swfwriter.hxx +++ b/filter/source/flash/swfwriter.hxx @@ -156,9 +156,6 @@ private: std::vector< sal_uInt16 > maGlyphOffsets; }; -typedef std::vector<FlashFont*> FontMap; - - /** this class helps creating flash tags */ class Tag : public SvMemoryStream { @@ -363,7 +360,7 @@ private: private: css::uno::Reference< css::i18n::XBreakIterator > mxBreakIterator; - FontMap maFonts; + std::vector<std::unique_ptr<FlashFont>> maFonts; sal_Int32 mnDocWidth; sal_Int32 mnDocHeight; diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx index 882a4794401d..067f238bd31c 100644 --- a/filter/source/flash/swfwriter1.cxx +++ b/filter/source/flash/swfwriter1.cxx @@ -376,7 +376,7 @@ FlashFont& Writer::Impl_getFont( const vcl::Font& rFont ) } FlashFont* pFont = new FlashFont( rFont, createID() ); - maFonts.push_back( pFont ); + maFonts.emplace_back( pFont ); return *pFont; } |