From 5ab0d0a69ff65eaef1bf043526040b1230fcdb89 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 10 Apr 2017 09:26:16 +0200 Subject: [PATCH] loplugin:inlinefields in oox::vml::VMLExport Change-Id: Ia6880212503b2945953ca4c3d62d3ddb1d159c7b Reviewed-on: https://gerrit.libreoffice.org/36351 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/oox/export/vmlexport.hxx | 2 +- oox/source/export/vmlexport.cxx | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/oox/export/vmlexport.hxx b/include/oox/export/vmlexport.hxx index 222be73aa7bc..aac1811a4f17 100644 --- a/include/oox/export/vmlexport.hxx +++ b/include/oox/export/vmlexport.hxx @@ -102,7 +102,7 @@ class OOX_DLLPUBLIC VMLExport : public EscherEx OStringBuffer m_ShapeStyle; /// Remember which shape types we had already written. - bool *m_pShapeTypeWritten; + std::vector m_aShapeTypeWritten; public: VMLExport( ::sax_fastparser::FSHelperPtr const & pSerializer, VMLTextExport* pTextExport = nullptr ); diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index b68fa6452c73..89d8e5bfb95c 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -65,10 +65,9 @@ VMLExport::VMLExport( ::sax_fastparser::FSHelperPtr const & pSerializer, VMLText , m_nShapeType( ESCHER_ShpInst_Nil ) , m_nShapeFlags(0) , m_ShapeStyle( 200 ) - , m_pShapeTypeWritten( new bool[ ESCHER_ShpInst_COUNT ] ) + , m_aShapeTypeWritten( ESCHER_ShpInst_COUNT ) { mnGroupLevel = 1; - memset( m_pShapeTypeWritten, 0, ESCHER_ShpInst_COUNT * sizeof( bool ) ); } void VMLExport::SetFS( const ::sax_fastparser::FSHelperPtr& pSerializer ) @@ -80,8 +79,6 @@ VMLExport::~VMLExport() { delete mpOutStrm; mpOutStrm = nullptr; - delete[] m_pShapeTypeWritten; - m_pShapeTypeWritten = nullptr; } void VMLExport::OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance ) @@ -1039,10 +1036,10 @@ sal_Int32 VMLExport::StartShape() if ( aShapeType != "NULL" ) { bReferToShapeType = true; - if ( !m_pShapeTypeWritten[ m_nShapeType ] ) + if ( !m_aShapeTypeWritten[ m_nShapeType ] ) { m_pSerializer->write( aShapeType.getStr() ); - m_pShapeTypeWritten[ m_nShapeType ] = true; + m_aShapeTypeWritten[ m_nShapeType ] = true; } } else