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

use std::vector::insert when inserting multiple of the same thing

instead of looping

Change-Id: I7b8c1663e303449302e0b96dc5b483367c2a52ba
üst 42460fd4
......@@ -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
......
......@@ -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);
}
}
......
......@@ -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 )
{
......
......@@ -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 ));
......
......@@ -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 );
}
}
......
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