summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-03-02 11:28:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-03-02 11:28:37 +0200
commit4730b23b1da929b802d527611e974ff1b1e6d6c5 (patch)
tree0809450a51e0aae057f19a1acd84dad5ec77a9b5
parent42460fd4eb4757dcdf3b3e533aafabda77751321 (diff)
use std::vector::insert when inserting multiple of the same thing
instead of looping Change-Id: I7b8c1663e303449302e0b96dc5b483367c2a52ba
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx3
-rw-r--r--dbaccess/source/ui/querydesign/TableFieldDescription.cxx3
-rw-r--r--sc/source/filter/oox/worksheethelper.cxx3
-rw-r--r--sw/source/ui/frmdlg/cption.cxx4
-rw-r--r--xmloff/source/chart/SchXMLExport.cxx7
5 files changed, 8 insertions, 12 deletions
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index b0d0581bacf6..d0ba3523d217 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -140,8 +140,7 @@ OSelectionBrowseBox::OSelectionBrowseBox( vcl::Window* pParent )
for (sal_Int32 nIdx = 0; nIdx < nCount; nIdx++)
m_pOrderCell->InsertEntry(aTxt.getToken(nIdx, ';'));
- for(long i=0;i < BROW_ROW_CNT;i++)
- m_bVisibleRow.push_back(true);
+ m_bVisibleRow.insert(m_bVisibleRow.end(), BROW_ROW_CNT, true);
m_bVisibleRow[BROW_FUNCTION_ROW] = false; // first hide
diff --git a/dbaccess/source/ui/querydesign/TableFieldDescription.cxx b/dbaccess/source/ui/querydesign/TableFieldDescription.cxx
index 21e7348d9d2f..20298d11006b 100644
--- a/dbaccess/source/ui/querydesign/TableFieldDescription.cxx
+++ b/dbaccess/source/ui/querydesign/TableFieldDescription.cxx
@@ -104,8 +104,7 @@ void OTableFieldDesc::SetCriteria( sal_uInt16 nIdx, const OUString& rCrit)
m_aCriteria[nIdx] = rCrit;
else
{
- for(sal_Int32 i=m_aCriteria.size();i<nIdx;++i)
- m_aCriteria.push_back( OUString());
+ m_aCriteria.insert(m_aCriteria.end(), nIdx - m_aCriteria.size(), OUString());
m_aCriteria.push_back(rCrit);
}
}
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index 14a021af27dd..0f01e0d777b2 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -1248,8 +1248,7 @@ void WorksheetGlobals::convertOutlines( OutlineLevelVec& orLevels,
if( nSize < nLevel )
{
// Outline level increased. Push the begin column position.
- for( sal_Int32 nIndex = nSize; nIndex < nLevel; ++nIndex )
- orLevels.push_back( nColRow );
+ orLevels.insert(orLevels.end(), nLevel - nSize, nColRow);
}
else if( nLevel < nSize )
{
diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx
index 4d0bac6b27ef..ae9cf890278e 100644
--- a/sw/source/ui/frmdlg/cption.cxx
+++ b/sw/source/ui/frmdlg/cption.cxx
@@ -366,10 +366,8 @@ void SwCaptionDialog::DrawSample()
RES_SETEXPFLD, sFieldTypeName ));
if( pFieldType && pFieldType->GetOutlineLvl() < MAXLEVEL )
{
- sal_Int8 nLvl = pFieldType->GetOutlineLvl();
SwNumberTree::tNumberVector aNumVector;
- for( sal_Int8 i = 0; i <= nLvl; ++i )
- aNumVector.push_back(1);
+ aNumVector.insert(aNumVector.end(), pFieldType->GetOutlineLvl(), 1);
OUString sNumber( rSh.GetOutlineNumRule()->
MakeNumString(aNumVector, false ));
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index ef7d581edd96..9b8c205fa038 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -739,12 +739,13 @@ void lcl_ReorderInternalSequencesAccordingToTheirRangeName(
if( aIt->first < 0 )
continue;
// fill empty columns
- for( ; nIndex < aIt->first; ++nIndex )
- rInOutSequences.push_back(
+ rInOutSequences.insert(
+ rInOutSequences.end(),
+ aIt->first - nIndex,
SchXMLExportHelper_Impl::tDataSequenceCont::value_type(
uno::Reference< chart2::data::XDataSequence >(),
uno::Reference< chart2::data::XDataSequence >() ));
- OSL_ASSERT( nIndex == aIt->first );
+ nIndex = aIt->first;
rInOutSequences.push_back( aIt->second );
}
}