diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-19 12:22:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-25 11:09:41 +0200 |
commit | e68520937281cc97542b7eb27e8736148d16fae4 (patch) | |
tree | ddfa9c323f823abd11af5ef191b886acb23086e6 /sfx2 | |
parent | 7658798496b1b3705155d1289f0fc82eab7cab7d (diff) |
loplugin:useuniqueptr in CmisPropertiesWindow
Change-Id: I113160675aa7af0a3a425fe0cab4f68ee24adf27
Reviewed-on: https://gerrit.libreoffice.org/60956
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index a42a83f4be62..c68ba3876925 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -2278,13 +2278,6 @@ CmisPropertiesWindow::~CmisPropertiesWindow() void CmisPropertiesWindow::ClearAllLines() { - std::vector< CmisPropertyLine* >::iterator pIter; - for ( pIter = m_aCmisPropertiesLines.begin(); - pIter != m_aCmisPropertiesLines.end(); ++pIter ) - { - CmisPropertyLine* pLine = *pIter; - delete pLine; - } m_aCmisPropertiesLines.clear(); } @@ -2293,7 +2286,7 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName, const bool bRequired, const bool bMultiValued, const bool bOpenChoice, Any& /*aChoices*/, Any const & rAny ) { - CmisPropertyLine* pNewLine = new CmisPropertyLine( m_pBox ); + std::unique_ptr<CmisPropertyLine> pNewLine(new CmisPropertyLine( m_pBox )); pNewLine->m_sId = sId; pNewLine->m_sType = sType; @@ -2376,7 +2369,7 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName, pNewLine->m_aType->SetText( sType ); pNewLine->m_aType->Show(); - m_aCmisPropertiesLines.push_back( pNewLine ); + m_aCmisPropertiesLines.push_back( std::move(pNewLine) ); } void CmisPropertiesWindow::DoScroll( sal_Int32 nNewPos ) @@ -2388,11 +2381,10 @@ Sequence< document::CmisProperty > CmisPropertiesWindow::GetCmisProperties() con { Sequence< document::CmisProperty > aPropertiesSeq( m_aCmisPropertiesLines.size() ); sal_Int32 i = 0; - std::vector< CmisPropertyLine* >::const_iterator pIter; - for ( pIter = m_aCmisPropertiesLines.begin(); + for ( auto pIter = m_aCmisPropertiesLines.begin(); pIter != m_aCmisPropertiesLines.end(); ++pIter, ++i ) { - CmisPropertyLine* pLine = *pIter; + CmisPropertyLine* pLine = pIter->get(); aPropertiesSeq[i].Id = pLine->m_sId; aPropertiesSeq[i].Type = pLine->m_sType; |