diff options
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 54 |
1 files changed, 15 insertions, 39 deletions
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index c015edebeff6..6fad98d00222 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -2260,33 +2260,9 @@ CmisPropertyLine::CmisPropertyLine(vcl::Window* pParent) CmisPropertyLine::~CmisPropertyLine( ) { - std::vector< CmisValue* >::iterator pIter; - for ( pIter = m_aValues.begin(); - pIter != m_aValues.end(); ++pIter ) - { - CmisValue* pValue = *pIter; - delete pValue; - } m_aValues.clear(); - - std::vector< CmisYesNo* >::iterator pIterYesNo; - for ( pIterYesNo = m_aYesNos.begin(); - pIterYesNo != m_aYesNos.end(); ++pIterYesNo ) - { - CmisYesNo* pYesNo = *pIterYesNo; - delete pYesNo; - } m_aYesNos.clear(); - - std::vector< CmisDateTime* >::iterator pIterDateTime; - for ( pIterDateTime = m_aDateTimes.begin(); - pIterDateTime != m_aDateTimes.end(); ++pIterDateTime ) - { - CmisDateTime* pDateTime = *pIterDateTime; - delete pDateTime; - } m_aDateTimes.clear(); - } long CmisPropertyLine::getItemHeight() const @@ -2346,9 +2322,9 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName, { OUString sValue; m_aNumberFormatter.GetInputLineString( seqValue[i], nIndex, sValue ); - CmisValue* pValue = new CmisValue( m_pBox, sValue ); + std::unique_ptr<CmisValue> pValue(new CmisValue( m_pBox, sValue )); pValue->m_aValueEdit->SetReadOnly( !bUpdatable ); - pNewLine->m_aValues.push_back( pValue ); + pNewLine->m_aValues.push_back( std::move(pValue) ); } } else if ( sType == CMIS_TYPE_DECIMAL ) @@ -2361,9 +2337,9 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName, { OUString sValue; m_aNumberFormatter.GetInputLineString( seqValue[i], nIndex, sValue ); - CmisValue* pValue = new CmisValue( m_pBox, sValue ); + std::unique_ptr<CmisValue> pValue(new CmisValue( m_pBox, sValue )); pValue->m_aValueEdit->SetReadOnly( !bUpdatable ); - pNewLine->m_aValues.push_back( pValue ); + pNewLine->m_aValues.push_back( std::move(pValue) ); } } @@ -2374,10 +2350,10 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName, sal_Int32 nNumValue = seqValue.getLength( ); for ( sal_Int32 i = 0; i < nNumValue; ++i ) { - CmisYesNo* pYesNo = new CmisYesNo( m_pBox, seqValue[i] ); + std::unique_ptr<CmisYesNo> pYesNo(new CmisYesNo( m_pBox, seqValue[i] )); pYesNo->m_aYesButton->Enable( bUpdatable ); pYesNo->m_aNoButton->Enable( bUpdatable ); - pNewLine->m_aYesNos.push_back( pYesNo ); + pNewLine->m_aYesNos.push_back( std::move(pYesNo) ); } } else if ( sType == CMIS_TYPE_STRING ) @@ -2387,9 +2363,9 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName, sal_Int32 nNumValue = seqValue.getLength( ); for ( sal_Int32 i = 0; i < nNumValue; ++i ) { - CmisValue* pValue = new CmisValue( m_pBox, seqValue[i] ); + std::unique_ptr<CmisValue> pValue(new CmisValue( m_pBox, seqValue[i] )); pValue->m_aValueEdit->SetReadOnly( !bUpdatable ); - pNewLine->m_aValues.push_back( pValue ); + pNewLine->m_aValues.push_back( std::move(pValue) ); } } else if ( sType == CMIS_TYPE_DATETIME ) @@ -2399,10 +2375,10 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName, sal_Int32 nNumValue = seqValue.getLength( ); for ( sal_Int32 i = 0; i < nNumValue; ++i ) { - CmisDateTime* pDateTime = new CmisDateTime( m_pBox, seqValue[i]); + std::unique_ptr<CmisDateTime> pDateTime(new CmisDateTime( m_pBox, seqValue[i])); pDateTime->m_aDateField->SetReadOnly( !bUpdatable ); pDateTime->m_aTimeField->SetReadOnly( !bUpdatable ); - pNewLine->m_aDateTimes.push_back( pDateTime ); + pNewLine->m_aDateTimes.push_back( std::move(pDateTime) ); } } pNewLine->m_aName->SetText( sName ); @@ -2446,7 +2422,7 @@ Sequence< document::CmisProperty > CmisPropertiesWindow::GetCmisProperties() con m_aNumberFormatter ).GetFormatIndex( NF_NUMBER_SYSTEM ); Sequence< double > seqValue( pLine->m_aValues.size( ) ); sal_Int32 k = 0; - for ( std::vector< CmisValue*>::const_iterator it = pLine->m_aValues.begin(); + for ( auto it = pLine->m_aValues.begin(); it != pLine->m_aValues.end(); ++it, ++k) { double dValue = 0.0; @@ -2464,7 +2440,7 @@ Sequence< document::CmisProperty > CmisPropertiesWindow::GetCmisProperties() con m_aNumberFormatter ).GetFormatIndex( NF_NUMBER_SYSTEM ); Sequence< sal_Int64 > seqValue( pLine->m_aValues.size( ) ); sal_Int32 k = 0; - for ( std::vector< CmisValue*>::const_iterator it = pLine->m_aValues.begin(); + for ( auto it = pLine->m_aValues.begin(); it != pLine->m_aValues.end(); ++it, ++k) { double dValue = 0; @@ -2480,7 +2456,7 @@ Sequence< document::CmisProperty > CmisPropertiesWindow::GetCmisProperties() con { Sequence<sal_Bool> seqValue( pLine->m_aYesNos.size( ) ); sal_Int32 k = 0; - for ( std::vector< CmisYesNo*>::const_iterator it = pLine->m_aYesNos.begin(); + for ( auto it = pLine->m_aYesNos.begin(); it != pLine->m_aYesNos.end(); ++it, ++k) { bool bValue = (*it)->m_aYesButton->IsChecked(); @@ -2493,7 +2469,7 @@ Sequence< document::CmisProperty > CmisPropertiesWindow::GetCmisProperties() con { Sequence< util::DateTime > seqValue( pLine->m_aDateTimes.size( ) ); sal_Int32 k = 0; - for ( std::vector< CmisDateTime*>::const_iterator it = pLine->m_aDateTimes.begin(); + for ( auto it = pLine->m_aDateTimes.begin(); it != pLine->m_aDateTimes.end(); ++it, ++k) { Date aTmpDate = (*it)->m_aDateField->GetDate(); @@ -2510,7 +2486,7 @@ Sequence< document::CmisProperty > CmisPropertiesWindow::GetCmisProperties() con { Sequence< OUString > seqValue( pLine->m_aValues.size( ) ); sal_Int32 k = 0; - for ( std::vector< CmisValue*>::const_iterator it = pLine->m_aValues.begin(); + for ( auto it = pLine->m_aValues.begin(); it != pLine->m_aValues.end(); ++it, ++k) { OUString sValue( (*it)->m_aValueEdit->GetText() ); |