diff options
Diffstat (limited to 'sfx2/source/dialog/dinfdlg.cxx')
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 6049c9e8462c..07cd83366b8f 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -38,6 +38,7 @@ #include <memory> +#include <comphelper/sequence.hxx> #include <comphelper/string.hxx> #include <com/sun/star/security/DocumentSignatureInformation.hpp> #include <com/sun/star/security/DocumentDigitalSignatures.hpp> @@ -2353,10 +2354,9 @@ Sequence< document::CmisProperty > CmisPropertiesWindow::GetCmisProperties() con { Sequence< document::CmisProperty > aPropertiesSeq( m_aCmisPropertiesLines.size() ); sal_Int32 i = 0; - for ( auto pIter = m_aCmisPropertiesLines.begin(); - pIter != m_aCmisPropertiesLines.end(); ++pIter, ++i ) + for ( auto& rxLine : m_aCmisPropertiesLines ) { - CmisPropertyLine* pLine = pIter->get(); + CmisPropertyLine* pLine = rxLine.get(); aPropertiesSeq[i].Id = pLine->m_sId; aPropertiesSeq[i].Type = pLine->m_sType; @@ -2376,15 +2376,15 @@ Sequence< document::CmisProperty > CmisPropertiesWindow::GetCmisProperties() con m_aNumberFormatter ).GetFormatIndex( NF_NUMBER_SYSTEM ); Sequence< double > seqValue( pLine->m_aValues.size( ) ); sal_Int32 k = 0; - for ( auto it = pLine->m_aValues.begin(); - it != pLine->m_aValues.end(); ++it, ++k) + for ( auto& rxValue : pLine->m_aValues ) { double dValue = 0.0; - OUString sValue( (*it)->m_aValueEdit->GetText() ); + OUString sValue( rxValue->m_aValueEdit->GetText() ); bool bIsNum = const_cast< SvNumberFormatter& >( m_aNumberFormatter ). IsNumberFormat( sValue, nIndex, dValue ); if ( bIsNum ) seqValue[k] = dValue; + ++k; } aPropertiesSeq[i].Value <<= seqValue; } @@ -2394,15 +2394,15 @@ 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 ( auto it = pLine->m_aValues.begin(); - it != pLine->m_aValues.end(); ++it, ++k) + for ( auto& rxValue : pLine->m_aValues ) { double dValue = 0; - OUString sValue( (*it)->m_aValueEdit->GetText() ); + OUString sValue( rxValue->m_aValueEdit->GetText() ); bool bIsNum = const_cast< SvNumberFormatter& >( m_aNumberFormatter ). IsNumberFormat( sValue, nIndex, dValue ); if ( bIsNum ) seqValue[k] = static_cast<sal_Int64>(dValue); + ++k; } aPropertiesSeq[i].Value <<= seqValue; } @@ -2410,11 +2410,11 @@ Sequence< document::CmisProperty > CmisPropertiesWindow::GetCmisProperties() con { Sequence<sal_Bool> seqValue( pLine->m_aYesNos.size( ) ); sal_Int32 k = 0; - for ( auto it = pLine->m_aYesNos.begin(); - it != pLine->m_aYesNos.end(); ++it, ++k) + for ( auto& rxYesNo : pLine->m_aYesNos ) { - bool bValue = (*it)->m_aYesButton->IsChecked(); + bool bValue = rxYesNo->m_aYesButton->IsChecked(); seqValue[k] = bValue; + ++k; } aPropertiesSeq[i].Value <<= seqValue; @@ -2423,16 +2423,16 @@ Sequence< document::CmisProperty > CmisPropertiesWindow::GetCmisProperties() con { Sequence< util::DateTime > seqValue( pLine->m_aDateTimes.size( ) ); sal_Int32 k = 0; - for ( auto it = pLine->m_aDateTimes.begin(); - it != pLine->m_aDateTimes.end(); ++it, ++k) + for ( auto& rxDateTime : pLine->m_aDateTimes ) { - Date aTmpDate = (*it)->m_aDateField->GetDate(); - tools::Time aTmpTime = (*it)->m_aTimeField->GetTime(); + Date aTmpDate = rxDateTime->m_aDateField->GetDate(); + tools::Time aTmpTime = rxDateTime->m_aTimeField->GetTime(); util::DateTime aDateTime( aTmpTime.GetNanoSec(), aTmpTime.GetSec(), aTmpTime.GetMin(), aTmpTime.GetHour(), aTmpDate.GetDay(), aTmpDate.GetMonth(), aTmpDate.GetYear(), true ); seqValue[k] = aDateTime; + ++k; } aPropertiesSeq[i].Value <<= seqValue; } @@ -2440,15 +2440,16 @@ Sequence< document::CmisProperty > CmisPropertiesWindow::GetCmisProperties() con { Sequence< OUString > seqValue( pLine->m_aValues.size( ) ); sal_Int32 k = 0; - for ( auto it = pLine->m_aValues.begin(); - it != pLine->m_aValues.end(); ++it, ++k) + for ( auto& rxValue : pLine->m_aValues ) { - OUString sValue( (*it)->m_aValueEdit->GetText() ); + OUString sValue( rxValue->m_aValueEdit->GetText() ); seqValue[k] = sValue; + ++k; } aPropertiesSeq[i].Value <<= seqValue; } } + ++i; } return aPropertiesSeq; @@ -2592,11 +2593,7 @@ bool SfxCmisPropertiesPage::FillItemSet( SfxItemSet* rSet ) } } } - Sequence< document::CmisProperty> aModifiedProps( modifiedNum ); - sal_Int32 nCount = 0; - for( std::vector< document::CmisProperty>::const_iterator pIter = changedProps.begin(); - pIter != changedProps.end( ); ++pIter ) - aModifiedProps[ nCount++ ] = *pIter; + Sequence< document::CmisProperty> aModifiedProps( comphelper::containerToSequence(changedProps) ); pInfo->SetCmisProperties( aModifiedProps ); rSet->Put( *pInfo ); if ( bMustDelete ) |