Kaydet (Commit) e6852093 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in CmisPropertiesWindow

Change-Id: I113160675aa7af0a3a425fe0cab4f68ee24adf27
Reviewed-on: https://gerrit.libreoffice.org/60956
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 76587984
......@@ -570,7 +570,7 @@ private:
VclPtr<VclBox> m_pBox;
sal_Int32 m_nItemHeight;
SvNumberFormatter m_aNumberFormatter;
std::vector< CmisPropertyLine* > m_aCmisPropertiesLines;
std::vector< std::unique_ptr<CmisPropertyLine> > m_aCmisPropertiesLines;
public:
CmisPropertiesWindow(SfxTabPage* pParent);
~CmisPropertiesWindow();
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment