diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-12 08:14:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-12 09:42:55 +0200 |
commit | b6819a53c0b56a47d6ac7c6eb5aa7d82ca49136c (patch) | |
tree | 393e90116f9b141c5f1e189dbc48ca774f171967 /sc/source | |
parent | da705eff910f512623a689aaf28604270fb8f1c4 (diff) |
clang-tidy modernize-use-emplace in sc
Change-Id: Ifc38e1fc188fe957a0c717aec19cdd6637e4c658
Reviewed-on: https://gerrit.libreoffice.org/42183
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source')
99 files changed, 244 insertions, 254 deletions
diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx index bdcee982a5c1..756b63d93ead 100644 --- a/sc/source/core/data/bcaslot.cxx +++ b/sc/source/core/data/bcaslot.cxx @@ -94,7 +94,7 @@ static SCSIZE initSlotDistribution( ScSlotDistribution & rSD, SCSIZE & rBSR ) // Must be sorted by row1,row2! while (nRow2 <= MAXROWCOUNT) { - rSD.push_back( ScSlotData( nRow1, nRow2, nSlice, nSlots)); + rSD.emplace_back( nRow1, nRow2, nSlice, nSlots); nSlots += (nRow2 - nRow1) / nSlice; nRow1 = nRow2; nRow2 *= 2; @@ -1173,7 +1173,7 @@ void ScBroadcastAreaSlotMachine::RemoveBulkGroupArea( ScBroadcastArea* pArea ) void ScBroadcastAreaSlotMachine::PushAreaToBeErased( ScBroadcastAreaSlot* pSlot, ScBroadcastAreas::iterator& rIter ) { - maAreasToBeErased.push_back( ::std::make_pair( pSlot, rIter)); + maAreasToBeErased.emplace_back( pSlot, rIter); } void ScBroadcastAreaSlotMachine::FinallyEraseAreas( ScBroadcastAreaSlot* pSlot ) diff --git a/sc/source/core/data/cellvalues.cxx b/sc/source/core/data/cellvalues.cxx index bad15747d064..4b3842b74b03 100644 --- a/sc/source/core/data/cellvalues.cxx +++ b/sc/source/core/data/cellvalues.cxx @@ -149,7 +149,7 @@ std::vector<CellValueSpan> CellValues::getNonEmptySpans() const // Record this span. size_t nRow1 = it->position; size_t nRow2 = nRow1 + it->size - 1; - aRet.push_back(CellValueSpan(nRow1, nRow2)); + aRet.emplace_back(nRow1, nRow2); } } return aRet; diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 4b0a5655d462..520f06daefcd 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -2348,12 +2348,12 @@ public: virtual void processNonShared( ScFormulaCell* pCell, size_t nRow ) override { - mrGroups.push_back(sc::FormulaGroupEntry(pCell, nRow)); + mrGroups.emplace_back(pCell, nRow); } virtual void processSharedTop( ScFormulaCell** ppCells, size_t nRow, size_t nLength ) override { - mrGroups.push_back(sc::FormulaGroupEntry(ppCells, nRow, nLength)); + mrGroups.emplace_back(ppCells, nRow, nLength); } }; diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 33b7cd71bb40..5591f570e462 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -645,7 +645,7 @@ sal_uInt16 ScColumn::GetOptimalColWidth( } else // "Select" the entire column if no selection exists. - aMarkedSpans.push_back(sc::RowSpan(0, MAXROW)); + aMarkedSpans.emplace_back(0, MAXROW); sal_uInt16 nWidth = static_cast<sal_uInt16>(nOldWidth*nPPTX); bool bFound = false; @@ -1117,7 +1117,7 @@ public: { // Store the string replacement for later commits. OUString aText = ScEditUtil::GetSpaceDelimitedString(*mpEngine); - maStrEntries.push_back(StrEntry(nRow, aText)); + maStrEntries.emplace_back(nRow, aText); } } }; diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx index 1fcc84f20b79..711223d314e8 100644 --- a/sc/source/core/data/column4.cxx +++ b/sc/source/core/data/column4.cxx @@ -138,7 +138,7 @@ void ScColumn::DeleteBeforeCopyFromClip( bContinue = false; } - aDestSpans.push_back(sc::RowSpan(nDestRow1, nDestRow2)); + aDestSpans.emplace_back(nDestRow1, nDestRow2); } nDestOffset += nClipRowLen; @@ -271,7 +271,7 @@ void ScColumn::CopyOneCellFromClip( sc::CopyFromClipContext& rCxt, SCROW nRow1, { std::vector<sc::RowSpan> aRanges; aRanges.reserve(1); - aRanges.push_back(sc::RowSpan(nRow1, nRow2)); + aRanges.emplace_back(nRow1, nRow2); CloneFormulaCell(*rSrcCell.mpFormula, rSrcAttr, aRanges); } break; @@ -741,7 +741,7 @@ public: ++it, ++nOffset) { ScAddress aPos(mnCol, nTopRow + nOffset, mnTab); - mrNotes.push_back(sc::NoteEntry(aPos, *it)); + mrNotes.emplace_back(aPos, *it); } } }; diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 019ee463bacd..46a01927eafb 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -2204,7 +2204,7 @@ void ScDocument::CopyToClip(const ScClipParam& rClipParam, pClipDoc->maTabNames.push_back(aTabName); } else - pClipDoc->maTabNames.push_back(OUString()); + pClipDoc->maTabNames.emplace_back(); } pClipDoc->aDocName = aDocName; @@ -2304,7 +2304,7 @@ void ScDocument::CopyTabToClip(SCCOL nCol1, SCROW nRow1, pClipDoc->maTabNames.push_back(aTabName); } else - pClipDoc->maTabNames.push_back(OUString()); + pClipDoc->maTabNames.emplace_back(); } PutInOrder( nCol1, nCol2 ); diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx index 59eed87330c9..6e2d817b531e 100644 --- a/sc/source/core/data/dpcache.cxx +++ b/sc/source/core/data/dpcache.cxx @@ -655,7 +655,7 @@ bool ScDPCache::InitFromDataBase(DBConnector& rDB) short nFormatType = css::util::NumberFormat::UNDEFINED; aData.SetEmpty(); rDB.getValue(nCol, aData, nFormatType); - aBuckets.push_back(Bucket(aData, nRow)); + aBuckets.emplace_back(aData, nRow); if (!aData.IsEmpty()) { maEmptyRows.insert_back(nRow, nRow+1, false); diff --git a/sc/source/core/data/dpfilteredcache.cxx b/sc/source/core/data/dpfilteredcache.cxx index d4b85c4369e0..72ef7c773536 100644 --- a/sc/source/core/data/dpfilteredcache.cxx +++ b/sc/source/core/data/dpfilteredcache.cxx @@ -143,7 +143,7 @@ void ScDPFilteredCache::fillTable( // Build unique field entries. for (SCCOL nCol = 0; nCol < nColCount; ++nCol) { - maFieldEntries.push_back( vector<SCROW>() ); + maFieldEntries.emplace_back( ); SCROW nMemCount = getCache().GetDimMemberCount( nCol ); if (!nMemCount) continue; @@ -206,7 +206,7 @@ void ScDPFilteredCache::fillTable() // Data rows for (SCCOL nCol = 0; nCol < nColCount; ++nCol) { - maFieldEntries.push_back( vector<SCROW>() ); + maFieldEntries.emplace_back( ); SCROW nMemCount = getCache().GetDimMemberCount( nCol ); if (!nMemCount) continue; diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index b68be09951e5..6e2368d4c25e 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -2259,7 +2259,7 @@ void lcl_FillOldFields( ScPivotFieldVector& rFields, nDupCount = it->mnDupCount + 1; } - aFields.push_back(ScPivotField()); + aFields.emplace_back(); ScPivotField& rField = aFields.back(); if (bDataLayout) { @@ -2309,7 +2309,7 @@ void lcl_FillOldFields( ScPivotFieldVector& rFields, } if (bAddData && !bDataFound) - aFields.push_back(ScPivotField(PIVOT_DATA_FIELD)); + aFields.emplace_back(PIVOT_DATA_FIELD); rFields.swap(aFields); } diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index 89ac10dcd473..2bd362e30762 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -491,7 +491,7 @@ uno::Sequence<sheet::MemberResult> getVisiblePageMembersAsResults( const uno::Re /* TODO: any numeric value to obtain? */ double fValue; rtl::math::setNan(&fValue); - aRes.push_back(sheet::MemberResult(rName, aCaption, 0, fValue)); + aRes.emplace_back(rName, aCaption, 0, fValue); } } diff --git a/sc/source/core/data/dpoutputgeometry.cxx b/sc/source/core/data/dpoutputgeometry.cxx index 23138d2fe7af..16011cf31243 100644 --- a/sc/source/core/data/dpoutputgeometry.cxx +++ b/sc/source/core/data/dpoutputgeometry.cxx @@ -99,7 +99,7 @@ void ScDPOutputGeometry::getColumnFieldPositions(vector<ScAddress>& rAddrs) cons SCCOL nColEnd = nColStart + static_cast<SCCOL>(nColumnFields-1); for (SCCOL nCol = nColStart; nCol <= nColEnd; ++nCol) - aAddrs.push_back(ScAddress(nCol, nRow, nTab)); + aAddrs.emplace_back(nCol, nRow, nTab); rAddrs.swap(aAddrs); } @@ -121,7 +121,7 @@ void ScDPOutputGeometry::getRowFieldPositions(vector<ScAddress>& rAddrs) const SCCOL nColEnd = nColStart + static_cast<SCCOL>(nRowFields-1); for (SCCOL nCol = nColStart; nCol <= nColEnd; ++nCol) - aAddrs.push_back(ScAddress(nCol, nRow, nTab)); + aAddrs.emplace_back(nCol, nRow, nTab); rAddrs.swap(aAddrs); } @@ -141,7 +141,7 @@ void ScDPOutputGeometry::getPageFieldPositions(vector<ScAddress>& rAddrs) const SCROW nRowEnd = nRowStart + static_cast<SCCOL>(mnPageFields-1); for (SCROW nRow = nRowStart; nRow <= nRowEnd; ++nRow) - aAddrs.push_back(ScAddress(nCol, nRow, nTab)); + aAddrs.emplace_back(nCol, nRow, nTab); rAddrs.swap(aAddrs); } diff --git a/sc/source/core/data/dptabdat.cxx b/sc/source/core/data/dptabdat.cxx index 461e1a3d41fb..23c8f1984470 100644 --- a/sc/source/core/data/dptabdat.cxx +++ b/sc/source/core/data/dptabdat.cxx @@ -160,7 +160,7 @@ void ScDPTableData::FillRowDataFromCacheTable(sal_Int32 nRow, const ScDPFiltered for (sal_Int32 i = 0; i < n; ++i) { long nDim = rInfo.aDataSrcCols[i]; - rData.aValues.push_back( ScDPValue() ); + rData.aValues.emplace_back( ); // #i111435# GetItemData needs dimension indexes including groups, // so the index must be checked here (groups aren't useful as data fields). if ( nDim < nCacheColumnCount ) diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx index f0fd4fd87c05..0d7a0af4de3f 100644 --- a/sc/source/core/data/dptabres.cxx +++ b/sc/source/core/data/dptabres.cxx @@ -108,7 +108,7 @@ public: void pushDimName(const OUString& rName, bool bDataLayout) { - mrFilters.push_back(ScDPResultFilter(rName, bDataLayout)); + mrFilters.emplace_back(rName, bDataLayout); } void pushDimValue(const OUString& rValueName, const OUString& rValue) @@ -253,7 +253,7 @@ ScDPInitState::Member::Member(long nSrcIndex, SCROW nNameIndex) : void ScDPInitState::AddMember( long nSourceIndex, SCROW nMember ) { - maMembers.push_back(Member(nSourceIndex, nMember)); + maMembers.emplace_back(nSourceIndex, nMember); } void ScDPInitState::RemoveMember() @@ -772,7 +772,7 @@ void ScDPResultData::SetMeasureData( maMeasureRefs.swap(rRefs); if (maMeasureRefs.empty()) - maMeasureRefs.push_back(sheet::DataPilotFieldReference()); // default ctor is ok. + maMeasureRefs.emplace_back(); // default ctor is ok. maMeasureRefOrients.swap(rRefOrient); if (maMeasureRefOrients.empty()) diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index 20e95b37cd98..e98ed9ebfa8e 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -459,7 +459,7 @@ Sequence< Sequence<Any> > SAL_CALL ScDPSource::getDrillDownData(const Sequence<s if ( nIndex >= 0 ) { ScDPItemData aItem(pMembers->getByIndex(nIndex)->FillItemData()); - aFilterCriteria.push_back( ScDPFilteredCache::Criterion() ); + aFilterCriteria.emplace_back( ); aFilterCriteria.back().mnFieldIndex = nCol; aFilterCriteria.back().mpFilter.reset( new ScDPFilteredCache::SingleFilter(aItem)); @@ -743,7 +743,7 @@ void ScDPSource::FilterCacheByPageDimensions() continue; const ScDPItemData& rData = pDim->GetSelectedData(); - aCriteria.push_back(ScDPFilteredCache::Criterion()); + aCriteria.emplace_back(); ScDPFilteredCache::Criterion& r = aCriteria.back(); r.mnFieldIndex = static_cast<sal_Int32>(nField); r.mpFilter.reset(new ScDPFilteredCache::SingleFilter(rData)); diff --git a/sc/source/core/data/markdata.cxx b/sc/source/core/data/markdata.cxx index 67c309169c53..8c94f196f45d 100644 --- a/sc/source/core/data/markdata.cxx +++ b/sc/source/core/data/markdata.cxx @@ -511,7 +511,7 @@ std::vector<sc::ColRowSpan> ScMarkData::GetMarkedColSpans() const std::vector<sc::ColRowSpan> aVec; if (aMultiSel.GetRowSelArray().HasMarks()) { - aVec.push_back( sc::ColRowSpan( nStartCol, nEndCol)); + aVec.emplace_back( nStartCol, nEndCol); return aVec; // all columns marked } sc::ColRowSpan aSpan( -1, -1); @@ -545,7 +545,7 @@ std::vector<sc::ColRowSpan> ScMarkData::GetMarkedColSpans() const std::vector<sc::ColRowSpan> aVec; if (bMarked) { - aVec.push_back( sc::ColRowSpan( aMarkRange.aStart.Col(), aMarkRange.aEnd.Col())); + aVec.emplace_back( aMarkRange.aStart.Col(), aMarkRange.aEnd.Col()); } return aVec; } diff --git a/sc/source/core/data/sortparam.cxx b/sc/source/core/data/sortparam.cxx index 5ab81b70d3a3..a0f1cd4e7369 100644 --- a/sc/source/core/data/sortparam.cxx +++ b/sc/source/core/data/sortparam.cxx @@ -279,7 +279,7 @@ void ReorderParam::reverse() { SCCOLROW nPos1 = i + nStart; SCCOLROW nPos2 = maOrderIndices[i]; - aBucket.push_back(ReorderIndex(nPos1, nPos2)); + aBucket.emplace_back(nPos1, nPos2); } std::sort(aBucket.begin(), aBucket.end(), ReorderIndex::LessByPos2()); diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 9f1fcc7ef81b..fbf73c9a9607 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -1210,7 +1210,7 @@ void ScTable::FillFormulaVertical( if (nRowStart >= 0) { nRowEnd = rInner - 1; - aSpans.push_back(sc::RowSpan(nRowStart, nRowEnd)); + aSpans.emplace_back(nRowStart, nRowEnd); nRowStart = -1; } rInner = nHiddenLast; @@ -1224,7 +1224,7 @@ void ScTable::FillFormulaVertical( if (nRowStart >= 0) { nRowEnd = rInner - 1; - aSpans.push_back(sc::RowSpan(nRowStart, nRowEnd)); + aSpans.emplace_back(nRowStart, nRowEnd); } if (aSpans.empty()) diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index 03ca038d306a..99d07a9242f4 100644 --- a/sc/source/core/data/validat.cxx +++ b/sc/source/core/data/validat.cxx @@ -822,9 +822,8 @@ bool ScValidationData::FillSelectionList(std::vector<ScTypedStrData>& rStrColl, double fValue; OUString aStr(pString); bool bIsValue = GetDocument()->GetFormatTable()->IsNumberFormat(aStr, nFormat, fValue); - rStrColl.push_back( - ScTypedStrData( - aStr, fValue, bIsValue ? ScTypedStrData::Value : ScTypedStrData::Standard)); + rStrColl.emplace_back( + aStr, fValue, bIsValue ? ScTypedStrData::Value : ScTypedStrData::Standard); } bOk = aIt.Ok(); diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index c423d794d53f..f665c223f571 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -2304,11 +2304,11 @@ public: e = mvSubArguments.end(); it != e; ++it) { if (VectorRef* VR = dynamic_cast<VectorRef*>(it->get())) - vclmem.push_back(SumIfsArgs(VR->GetCLBuffer())); + vclmem.emplace_back(VR->GetCLBuffer()); else if (DynamicKernelConstantArgument* CA = dynamic_cast<DynamicKernelConstantArgument*>(it->get())) - vclmem.push_back(SumIfsArgs(CA->GetDouble())); + vclmem.emplace_back(CA->GetDouble()); else - vclmem.push_back(SumIfsArgs(nullptr)); + vclmem.emplace_back(nullptr); } mpClmem2 = clCreateBuffer(kEnv.mpkContext, CL_MEM_READ_WRITE, sizeof(double) * nVectorWidth, nullptr, &err); diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index d5eb4cf23eeb..ee13fc553d7b 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -115,9 +115,9 @@ const ::std::vector<ScUnoAddInFuncData::LocalizedName>& ScUnoAddInFuncData::GetC const sheet::LocalizedName* pArray = aCompNames.getArray(); for (sal_Int32 i=0; i<nSeqLen; i++) { - maCompNames.push_back( LocalizedName( + maCompNames.emplace_back( LanguageTag::convertToBcp47( pArray[i].Locale, false), - pArray[i].Name)); + pArray[i].Name); } } } @@ -161,10 +161,10 @@ bool ScUnoAddInFuncData::GetExcelName( LanguageType eDestLang, OUString& rRetExc ::std::vector< OUString > aFallbackSearch( aLanguageTag.getFallbackStrings( true)); if (aSearch != "en-US") { - aFallbackSearch.push_back( "en-US"); + aFallbackSearch.emplace_back("en-US"); if (aSearch != "en") { - aFallbackSearch.push_back( "en"); + aFallbackSearch.emplace_back("en"); } } ::std::vector< OUString >::const_iterator itSearch( aFallbackSearch.begin()); @@ -471,7 +471,7 @@ void ScUnoAddInCollection::ReadConfiguration() // PropertyValue value is the localized value (string in this case) OUString aName; pConfigArray[nLocale].Value >>= aName; - aCompNames.push_back( ScUnoAddInFuncData::LocalizedName( aLocale, aName)); + aCompNames.emplace_back( aLocale, aName); } } } diff --git a/sc/source/core/tool/chartlock.cxx b/sc/source/core/tool/chartlock.cxx index 95a398e1538a..82b40d476d9e 100644 --- a/sc/source/core/tool/chartlock.cxx +++ b/sc/source/core/tool/chartlock.cxx @@ -65,7 +65,7 @@ std::vector< WeakReference< frame::XModel > > lcl_getAllLivingCharts( ScDocument { Reference< frame::XModel > xModel( xCompSupp->getComponent(), uno::UNO_QUERY ); if( xModel.is() ) - aRet.push_back( xModel ); + aRet.emplace_back(xModel ); } } pObject = aIter.Next(); @@ -132,7 +132,7 @@ void ScChartLockGuard::AlsoLockThisChart( const Reference< frame::XModel >& xMod try { xModel->lockControllers(); - maChartModels.push_back( xModel ); + maChartModels.emplace_back(xModel ); } catch ( uno::Exception& ) { diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index f0db22edf738..21142d23b610 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -4574,7 +4574,7 @@ ScTokenArray* ScCompiler::CompileString( const OUString& rFormula ) if (pPrev && pPrev->GetOpCode() == ocDBArea) { FormulaToken* pTableRefToken = new ScTableRefToken( pPrev->GetIndex(), ScTableRefToken::TABLE); - maTableRefs.push_back( TableRefEntry( pTableRefToken)); + maTableRefs.emplace_back( pTableRefToken); // pPrev may be dead hereafter. static_cast<ScTokenArray*>(pArr)->ReplaceToken( nIdx, pTableRefToken, FormulaTokenArray::ReplaceMode::CODE_ONLY); diff --git a/sc/source/core/tool/editdataarray.cxx b/sc/source/core/tool/editdataarray.cxx index fc3f9bbcf85f..5f5b7ecac67e 100644 --- a/sc/source/core/tool/editdataarray.cxx +++ b/sc/source/core/tool/editdataarray.cxx @@ -30,7 +30,7 @@ ScEditDataArray::~ScEditDataArray() void ScEditDataArray::AddItem(SCTAB nTab, SCCOL nCol, SCROW nRow, EditTextObject* pOldData, EditTextObject* pNewData) { - maArray.push_back(Item(nTab, nCol, nRow, pOldData, pNewData)); + maArray.emplace_back(nTab, nCol, nRow, pOldData, pNewData); } const ScEditDataArray::Item* ScEditDataArray::First() diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx index 389c223c2d69..07bea611d5f8 100644 --- a/sc/source/core/tool/interpr8.cxx +++ b/sc/source/core/tool/interpr8.cxx @@ -162,7 +162,7 @@ bool ScETSForecastCalculation::PreprocessDataRange( const ScMatrixRef& rMatX, co // maRange needs to be sorted by X for ( SCSIZE i = 0; i < mnCount; i++ ) - maRange.push_back( DataPoint( rMatX->GetDouble( i ), rMatY->GetDouble( i ) ) ); + maRange.emplace_back( rMatX->GetDouble( i ), rMatY->GetDouble( i ) ); sort( maRange.begin(), maRange.end(), lcl_SortByX ); if ( rTMat ) @@ -1564,7 +1564,7 @@ void ScInterpreter::ScTextJoin_MS() } } else - aDelimiters.push_back( "" ); + aDelimiters.emplace_back("" ); } } } @@ -1597,7 +1597,7 @@ void ScInterpreter::ScTextJoin_MS() } } else - aDelimiters.push_back( "" ); + aDelimiters.emplace_back("" ); } } } diff --git a/sc/source/core/tool/queryentry.cxx b/sc/source/core/tool/queryentry.cxx index 749b1424cb0b..953e291b880a 100644 --- a/sc/source/core/tool/queryentry.cxx +++ b/sc/source/core/tool/queryentry.cxx @@ -146,7 +146,7 @@ void ScQueryEntry::Clear() eConnect = SC_AND; nField = 0; maQueryItems.clear(); - maQueryItems.push_back(Item()); + maQueryItems.emplace_back(); delete pSearchParam; delete pSearchText; diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx index dc2ba3832dca..b45a12c3cf38 100644 --- a/sc/source/core/tool/rangelst.cxx +++ b/sc/source/core/tool/rangelst.cxx @@ -448,8 +448,8 @@ void ScRangeList::InsertRow( SCTAB nTab, SCCOL nColStart, SCCOL nColEnd, SCROW n SCCOL nNewRangeEndCol = std::min<SCCOL>(nColEnd, pRange->aEnd.Col()); SCROW nNewRangeStartRow = pRange->aEnd.Row() + 1; SCROW nNewRangeEndRow = nRowPos + nSize - 1; - aNewRanges.push_back(ScRange(nNewRangeStartCol, nNewRangeStartRow, nTab, nNewRangeEndCol, - nNewRangeEndRow, nTab)); + aNewRanges.emplace_back(nNewRangeStartCol, nNewRangeStartRow, nTab, nNewRangeEndCol, + nNewRangeEndRow, nTab); if (mnMaxRowUsed < nNewRangeEndRow) mnMaxRowUsed = nNewRangeEndRow; } @@ -481,8 +481,8 @@ void ScRangeList::InsertCol( SCTAB nTab, SCROW nRowStart, SCROW nRowEnd, SCCOL n SCROW nNewRangeEndRow = std::min<SCROW>(nRowEnd, pRange->aEnd.Row()); SCCOL nNewRangeStartCol = pRange->aEnd.Col() + 1; SCCOL nNewRangeEndCol = nColPos + nSize - 1; - aNewRanges.push_back(ScRange(nNewRangeStartCol, nNewRangeStartRow, nTab, nNewRangeEndCol, - nNewRangeEndRow, nTab)); + aNewRanges.emplace_back(nNewRangeStartCol, nNewRangeStartRow, nTab, nNewRangeEndCol, + nNewRangeEndRow, nTab); } } } diff --git a/sc/source/core/tool/reftokenhelper.cxx b/sc/source/core/tool/reftokenhelper.cxx index 938a990e236f..da42511970bd 100644 --- a/sc/source/core/tool/reftokenhelper.cxx +++ b/sc/source/core/tool/reftokenhelper.cxx @@ -113,7 +113,7 @@ void ScRefTokenHelper::compileRangeRepresentation( break; } if (!bFailure) - rRefTokens.push_back(ScTokenRef(p->Clone())); + rRefTokens.emplace_back(p->Clone()); } if (bFailure) diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index 27836073b491..2de6ea8d5c52 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -3445,7 +3445,7 @@ void flushStrSegment( std::vector<svl::SharedString> aStrs; aStrs.reserve(pCur - pHead); for (; pHead != pCur; ++pHead) - aStrs.push_back(svl::SharedString(*pHead, *pHead)); + aStrs.emplace_back(*pHead, *pHead); rMat.PutString(&aStrs[0], aStrs.size(), nCol, nOffset); } diff --git a/sc/source/core/tool/simplerangelist.cxx b/sc/source/core/tool/simplerangelist.cxx index 6cc3fdfc6cce..dbb122055c34 100644 --- a/sc/source/core/tool/simplerangelist.cxx +++ b/sc/source/core/tool/simplerangelist.cxx @@ -165,7 +165,7 @@ void ScSimpleRangeList::getRangeList(list<ScRange>& rList) const for (; itr != itrEnd; ++itr) { const Range& r = *itr; - aList.push_back(ScRange(r.mnCol1, r.mnRow1, nTab, r.mnCol2, r.mnRow2, nTab)); + aList.emplace_back(r.mnCol1, r.mnRow1, nTab, r.mnCol2, r.mnRow2, nTab); } } rList.swap(aList); diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx index e3533e297c25..15fd3ae8d029 100644 --- a/sc/source/core/tool/userlist.cxx +++ b/sc/source/core/tool/userlist.cxx @@ -71,7 +71,7 @@ void ScUserListData::InitTokens() { OUString aSub(p0, nLen); OUString aUpStr = ScGlobal::pCharClass->uppercase(aSub); - maSubStrings.push_back(SubStr(aSub, aUpStr)); + maSubStrings.emplace_back(aSub, aUpStr); } bFirst = true; } @@ -81,7 +81,7 @@ void ScUserListData::InitTokens() { OUString aSub(p0, nLen); OUString aUpStr = ScGlobal::pCharClass->uppercase(aSub); - maSubStrings.push_back(SubStr(aSub, aUpStr)); + maSubStrings.emplace_back(aSub, aUpStr); } } diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx index 7cd8190ecd3a..41a967a19ade 100644 --- a/sc/source/filter/dif/difimp.cxx +++ b/sc/source/filter/dif/difimp.cxx @@ -642,7 +642,7 @@ void DifColumn::SetNumFormat( SCROW nRow, const sal_uInt32 nNumFormat ) void DifColumn::NewEntry( const SCROW nPos, const sal_uInt32 nNumFormat ) { - maEntries.push_back(ENTRY()); + maEntries.emplace_back(); mpAkt = &maEntries.back(); mpAkt->nStart = mpAkt->nEnd = nPos; mpAkt->nNumFormat = nNumFormat; diff --git a/sc/source/filter/excel/exctools.cxx b/sc/source/filter/excel/exctools.cxx index 85f759859329..1db868817a7c 100644 --- a/sc/source/filter/excel/exctools.cxx +++ b/sc/source/filter/excel/exctools.cxx @@ -210,7 +210,7 @@ ExcScenario::ExcScenario( XclImpStream& rIn, const RootData& rR ) nR = rIn.ReaduInt16(); nC = rIn.ReaduInt16(); - aEntries.push_back(ExcScenarioCell( nC, nR )); + aEntries.emplace_back( nC, nR ); n--; } diff --git a/sc/source/filter/excel/namebuff.cxx b/sc/source/filter/excel/namebuff.cxx index 0a80cf8e6c9b..d52f48bcfcf8 100644 --- a/sc/source/filter/excel/namebuff.cxx +++ b/sc/source/filter/excel/namebuff.cxx @@ -81,7 +81,7 @@ const ScTokenArray* SharedFormulaBuffer::Find( const ScAddress& rRefPos ) const sal_Int16 ExtSheetBuffer::Add( const OUString& rFPAN, const OUString& rTN, const bool bSWB ) { - maEntries.push_back( Cont( rFPAN, rTN, bSWB ) ); + maEntries.emplace_back( rFPAN, rTN, bSWB ); // return 1-based index of EXTERNSHEET return static_cast< sal_Int16 >( maEntries.size() ); } diff --git a/sc/source/filter/excel/tokstack.cxx b/sc/source/filter/excel/tokstack.cxx index 9ffbd7c8c892..d7a32f547028 100644 --- a/sc/source/filter/excel/tokstack.cxx +++ b/sc/source/filter/excel/tokstack.cxx @@ -605,7 +605,7 @@ const TokenId TokenPool::StoreName( sal_uInt16 nIndex, sal_Int16 nSheet ) pElement[nElementAkt] = static_cast<sal_uInt16>(maRangeNames.size()); pType[nElementAkt] = T_RN; - maRangeNames.push_back(RangeName()); + maRangeNames.emplace_back(); RangeName& r = maRangeNames.back(); r.mnIndex = nIndex; r.mnSheet = nSheet; @@ -624,7 +624,7 @@ const TokenId TokenPool::StoreExtName( sal_uInt16 nFileId, const OUString& rName pElement[nElementAkt] = static_cast<sal_uInt16>(maExtNames.size()); pType[nElementAkt] = T_ExtName; - maExtNames.push_back(ExtName()); + maExtNames.emplace_back(); ExtName& r = maExtNames.back(); r.mnFileId = nFileId; r.maName = rName; @@ -643,7 +643,7 @@ const TokenId TokenPool::StoreExtRef( sal_uInt16 nFileId, const OUString& rTabNa pElement[nElementAkt] = static_cast<sal_uInt16>(maExtCellRefs.size()); pType[nElementAkt] = T_ExtRefC; - maExtCellRefs.push_back(ExtCellRef()); + maExtCellRefs.emplace_back(); ExtCellRef& r = maExtCellRefs.back(); r.mnFileId = nFileId; r.maTabName = rTabName; @@ -663,7 +663,7 @@ const TokenId TokenPool::StoreExtRef( sal_uInt16 nFileId, const OUString& rTabNa pElement[nElementAkt] = static_cast<sal_uInt16>(maExtAreaRefs.size()); pType[nElementAkt] = T_ExtRefA; - maExtAreaRefs.push_back(ExtAreaRef()); + maExtAreaRefs.emplace_back(); ExtAreaRef& r = maExtAreaRefs.back(); r.mnFileId = nFileId; r.maTabName = rTabName; diff --git a/sc/source/filter/excel/xedbdata.cxx b/sc/source/filter/excel/xedbdata.cxx index 7437ce90b525..70cc722e731b 100644 --- a/sc/source/filter/excel/xedbdata.cxx +++ b/sc/source/filter/excel/xedbdata.cxx @@ -171,7 +171,7 @@ XclExpTables::~XclExpTables() void XclExpTables::AppendTable( const ScDBData* pData, sal_Int32 nTableId ) { - maTables.push_back( Entry( pData, nTableId)); + maTables.emplace_back( pData, nTableId); } void XclExpTables::SaveTableXml( XclExpXmlStream& rStrm, const Entry& rEntry ) diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index 6fc4a8294e29..8817561d8704 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -1875,7 +1875,7 @@ void XclExpSupbookBuffer::StoreCell( sal_uInt16 nFileId, const OUString& rTabNam FindSBIndexEntry f(nSupbookId, nSheetId); if (::std::none_of(maSBIndexVec.begin(), maSBIndexVec.end(), f)) { - maSBIndexVec.push_back(XclExpSBIndex()); + maSBIndexVec.emplace_back(); XclExpSBIndex& r = maSBIndexVec.back(); r.mnSupbook = nSupbookId; r.mnSBTab = nSheetId; @@ -1939,7 +1939,7 @@ void XclExpSupbookBuffer::StoreCellRange( sal_uInt16 nFileId, const OUString& rT FindSBIndexEntry f(nSupbookId, nSheetId); if (::std::none_of(maSBIndexVec.begin(), maSBIndexVec.end(), f)) { - maSBIndexVec.push_back(XclExpSBIndex()); + maSBIndexVec.emplace_back(); XclExpSBIndex& r = maSBIndexVec.back(); r.mnSupbook = nSupbookId; r.mnSBTab = nSheetId; @@ -2042,7 +2042,7 @@ XclExpXti XclExpSupbookBuffer::GetXti( sal_uInt16 nFileId, const OUString& rTabN FindSBIndexEntry f(nSupbookId, nSheetId); if (::std::none_of(maSBIndexVec.begin(), maSBIndexVec.end(), f)) { - maSBIndexVec.push_back(XclExpSBIndex()); + maSBIndexVec.emplace_back(); XclExpSBIndex& r = maSBIndexVec.back(); r.mnSupbook = nSupbookId; r.mnSBTab = nSheetId; diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx index 00fe96fa8e37..99a2ce55c47c 100644 --- a/sc/source/filter/excel/xepivot.cxx +++ b/sc/source/filter/excel/xepivot.cxx @@ -1061,7 +1061,7 @@ void XclExpPTField::SetPropertiesFromDim( const ScDPSaveDimension& rSaveDim ) void XclExpPTField::SetDataPropertiesFromDim( const ScDPSaveDimension& rSaveDim ) { - maDataInfoVec.push_back( XclPTDataFieldInfo() ); + maDataInfoVec.emplace_back( ); XclPTDataFieldInfo& rDataInfo = maDataInfoVec.back(); rDataInfo.mnField = GetFieldIndex(); @@ -1356,7 +1356,7 @@ void XclExpPivotTable::SetDataFieldPropertiesFromDim( const ScDPSaveDimension& r // field properties pField->SetDataPropertiesFromDim( rSaveDim ); // update the data field position list - maDataFields.push_back( XclPTDataFieldPos( pField->GetFieldIndex(), pField->GetLastDataInfoIndex() ) ); + maDataFields.emplace_back( pField->GetFieldIndex(), pField->GetLastDataInfoIndex() ); } } diff --git a/sc/source/filter/excel/xepivotxml.cxx b/sc/source/filter/excel/xepivotxml.cxx index e416a2842a42..3b44b67022ef 100644 --- a/sc/source/filter/excel/xepivotxml.cxx +++ b/sc/source/filter/excel/xepivotxml.cxx @@ -647,7 +647,7 @@ void XclExpXmlPivotTables::SavePivotTableXml( XclExpXmlStream& rStrm, const ScDP aPageFields.push_back(nPos); break; case sheet::DataPilotFieldOrientation_DATA: - aDataFields.push_back(DataField(nPos, &rDim)); + aDataFields.emplace_back(nPos, &rDim); break; case sheet::DataPilotFieldOrientation_HIDDEN: default: @@ -765,7 +765,7 @@ void XclExpXmlPivotTables::SavePivotTableXml( XclExpXmlStream& rStrm, const ScDP if (it != iCacheFieldItems_end) { size_t nCachePos = it - iCacheFieldItems_begin; - aMemberSequence.push_back(std::make_pair(nCachePos, !rMember.mbVisible)); + aMemberSequence.emplace_back(nCachePos, !rMember.mbVisible); aUsedCachePositions.insert(nCachePos); } } @@ -773,7 +773,7 @@ void XclExpXmlPivotTables::SavePivotTableXml( XclExpXmlStream& rStrm, const ScDP for (size_t nItem = 0; nItem < rCacheFieldItems.size(); ++nItem) { if (aUsedCachePositions.find(nItem) == aUsedCachePositions.end()) - aMemberSequence.push_back(std::make_pair(nItem, true)); + aMemberSequence.emplace_back(nItem, true); } auto pAttList = sax_fastparser::FastSerializerHelper::createAttrList(); @@ -935,7 +935,7 @@ void XclExpXmlPivotTables::SavePivotTableXml( XclExpXmlStream& rStrm, const ScDP void XclExpXmlPivotTables::AppendTable( const ScDPObject* pTable, sal_Int32 nCacheId, sal_Int32 nPivotId ) { - maTables.push_back(Entry(pTable, nCacheId, nPivotId)); + maTables.emplace_back(pTable, nCacheId, nPivotId); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xestring.cxx b/sc/source/filter/excel/xestring.cxx index b02ec636d449..d69f6676dd67 100644 --- a/sc/source/filter/excel/xestring.cxx +++ b/sc/source/filter/excel/xestring.cxx @@ -164,7 +164,7 @@ void XclExpString::AppendFormat( sal_uInt16 nChar, sal_uInt16 nFontIdx, bool bDr OSL_ENSURE( maFormats.empty() || (maFormats.back().mnChar < nChar), "XclExpString::AppendFormat - invalid char index" ); size_t nMaxSize = static_cast< size_t >( mbIsBiff8 ? EXC_STR_MAXLEN : EXC_STR_MAXLEN_8BIT ); if( maFormats.empty() || ((maFormats.size() < nMaxSize) && (!bDropDuplicate || (maFormats.back().mnFontIdx != nFontIdx))) ) - maFormats.push_back( XclFormatRun( nChar, nFontIdx ) ); + maFormats.emplace_back( nChar, nFontIdx ); } void XclExpString::AppendTrailingFormat( sal_uInt16 nFontIdx ) diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index b0c18a16cc13..066c64ba651f 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -324,7 +324,7 @@ XclExpPaletteImpl::XclExpPaletteImpl( const XclDefaultPalette& rDefPal ) : sal_uInt16 nCount = static_cast< sal_uInt16 >( mrDefPal.GetColorCount() ); maPalette.reserve( nCount ); for( sal_uInt16 nIdx = 0; nIdx < nCount; ++nIdx ) - maPalette.push_back( XclPaletteColor( mrDefPal.GetDefColor( GetXclIndex( nIdx ) ) ) ); + maPalette.emplace_back( mrDefPal.GetDefColor( GetXclIndex( nIdx ) ) ); InsertColor( Color( COL_BLACK ), EXC_COLOR_CELLTEXT ); } @@ -1384,7 +1384,7 @@ sal_uInt16 XclExpNumFmtBuffer::Insert( sal_uInt32 nScNumFmt ) if( nSize < static_cast< size_t >( 0xFFFF - mnXclOffset ) ) { sal_uInt16 nXclNumFmt = static_cast< sal_uInt16 >( nSize + mnXclOffset ); - maFormatMap.push_back( XclExpNumFmt( nScNumFmt, nXclNumFmt, GetFormatCode( nScNumFmt ) ) ); + maFormatMap.emplace_back( nScNumFmt, nXclNumFmt, GetFormatCode( nScNumFmt ) ); return nXclNumFmt; } diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index 3d034c5d1db3..10f238fc1e92 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -884,7 +884,7 @@ Sequence< Reference< XFormattedString > > XclImpChSourceLink::CreateStringSequen rRoot.ConvertFont( aStringProp, nFontIdx ); // add string to vector of strings - aStringVec.push_back( xFmtStr ); + aStringVec.emplace_back(xFmtStr ); } } return ScfApiHelper::VectorToSequence( aStringVec ); diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index bad8d6f79fea..3a13c8d3edec 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -1044,7 +1044,7 @@ void XclImpWebQueryBuffer::ReadQsi( XclImpStream& rStrm ) { ScRange aRange; if( pRangeData->IsReference( aRange ) ) - maWQList.push_back( XclImpWebQuery( aRange ) ); + maWQList.emplace_back( aRange ); } } } diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 3b08416f6d5d..17c4f163c886 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -1305,7 +1305,7 @@ void XclImpPolygonObj::ReadCoordList( XclImpStream& rStrm ) sal_uInt16 nX, nY; nX = rStrm.ReaduInt16(); nY = rStrm.ReaduInt16(); - maCoords.push_back( Point( nX, nY ) ); + maCoords.emplace_back( nX, nY ); } } } diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx index a232c9bb8444..d045eccb4041 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -412,7 +412,7 @@ void XclImpPCField::ConvertStdGroupField( ScDPSaveData& rSaveData, const ScfStri aGroupItems.reserve( maItems.size() ); // initialize with own item names for( XclImpPCItemVec::const_iterator aIt = maItems.begin(), aEnd = maItems.end(); aIt != aEnd; ++aIt ) - aGroupItems.push_back( ScDPSaveGroupItem( (*aIt)->ConvertToText() ) ); + aGroupItems.emplace_back( (*aIt)->ConvertToText() ); // *** iterate over all base items, set their names at corresponding own items *** for( sal_uInt16 nItemIdx = 0, nItemCount = static_cast< sal_uInt16 >( maGroupOrder.size() ); nItemIdx < nItemCount; ++nItemIdx ) diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx index ed7a8ca26276..302c472f4d35 100644 --- a/sc/source/filter/excel/xistream.cxx +++ b/sc/source/filter/excel/xistream.cxx @@ -519,7 +519,7 @@ void XclImpStream::EnableDecryption( bool bEnable ) void XclImpStream::PushPosition() { - maPosStack.push_back( XclImpStreamPos() ); + maPosStack.emplace_back( ); StorePosition( maPosStack.back() ); } diff --git a/sc/source/filter/excel/xistring.cxx b/sc/source/filter/excel/xistring.cxx index 959db49e4eaf..d4866e4c3a84 100644 --- a/sc/source/filter/excel/xistring.cxx +++ b/sc/source/filter/excel/xistring.cxx @@ -96,7 +96,7 @@ void XclImpString::AppendFormat( XclFormatRunVec& rFormats, sal_uInt16 nChar, sa // #i33341# real life -- same character index may occur several times OSL_ENSURE( rFormats.empty() || (rFormats.back().mnChar <= nChar), "XclImpString::AppendFormat - wrong char order" ); if( rFormats.empty() || (rFormats.back().mnChar < nChar) ) - rFormats.push_back( XclFormatRun( nChar, nFontIdx ) ); + rFormats.emplace_back( nChar, nFontIdx ); else rFormats.back().mnFontIdx = nFontIdx; } diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index 600c1ab5d042..d29ab77e0ce5 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -560,7 +560,7 @@ const XclImpFont* XclImpFontBuffer::GetFont( sal_uInt16 nFontIndex ) const void XclImpFontBuffer::ReadFont( XclImpStream& rStrm ) { - maFontList.push_back( XclImpFont( GetRoot() ) ); + maFontList.emplace_back( GetRoot() ); XclImpFont& rFont = maFontList.back(); rFont.ReadFont( rStrm ); @@ -1964,7 +1964,7 @@ void XclImpXFRangeBuffer::SetBorderLine( const ScRange& rRange, SCTAB nScTab, Sv void XclImpXFRangeBuffer::SetHyperlink( const XclRange& rXclRange, const OUString& rUrl ) { - maHyperlinks.push_back( XclImpHyperlinkRange( rXclRange, rUrl ) ); + maHyperlinks.emplace_back( rXclRange, rUrl ); } void XclImpXFRangeBuffer::SetMerge( SCCOL nScCol1, SCROW nScRow1, SCCOL nScCol2, SCROW nScRow2 ) diff --git a/sc/source/filter/ftools/fapihelper.cxx b/sc/source/filter/ftools/fapihelper.cxx index 6e5f3dba15a1..3a4dd2b48ab5 100644 --- a/sc/source/filter/ftools/fapihelper.cxx +++ b/sc/source/filter/ftools/fapihelper.cxx @@ -282,7 +282,7 @@ ScfPropSetHelper::ScfPropSetHelper( const sal_Char* const* ppcPropNames ) : for( size_t nVecIdx = 0; *ppcPropNames; ++ppcPropNames, ++nVecIdx ) { OUString aPropName = OUString::createFromAscii( *ppcPropNames ); - aPropNameVec.push_back( IndexedOUString( aPropName, nVecIdx ) ); + aPropNameVec.emplace_back( aPropName, nVecIdx ); } // sorts the pairs, which will be sorted by first component (the property name) diff --git a/sc/source/filter/html/htmlexp2.cxx b/sc/source/filter/html/htmlexp2.cxx index 3b9179b081f4..493a4ddced41 100644 --- a/sc/source/filter/html/htmlexp2.cxx +++ b/sc/source/filter/html/htmlexp2.cxx @@ -106,8 +106,8 @@ void ScHTMLExport::FillGraphList( const SdrPage* pPage, SCTAB nTab, aSpace.Width() /= 2; aSpace.Height() /= 2; } - aGraphList.push_back( ScHTMLGraphEntry( pObject, - aR, aSize, bInCell, aSpace ) ); + aGraphList.emplace_back( pObject, + aR, aSize, bInCell, aSpace ); } pObject = aIter.Next(); } diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx index 732288b1a71c..f052286dd7e6 100644 --- a/sc/source/filter/oox/condformatbuffer.cxx +++ b/sc/source/filter/oox/condformatbuffer.cxx @@ -160,7 +160,7 @@ ColorScaleRule::ColorScaleRule( const CondFormat& rFormat ): void ColorScaleRule::importCfvo( const AttributeList& rAttribs ) { if(mnCfvo >= maColorScaleRuleEntries.size()) - maColorScaleRuleEntries.push_back(ColorScaleRuleModelEntry()); + maColorScaleRuleEntries.emplace_back(); SetCfvoData( &maColorScaleRuleEntries[mnCfvo], rAttribs ); @@ -227,7 +227,7 @@ void ColorScaleRule::importColor( const AttributeList& rAttribs ) ::Color aColor = importOOXColor(rAttribs, rThemeBuffer, rGraphicHelper); if(mnCol >= maColorScaleRuleEntries.size()) - maColorScaleRuleEntries.push_back(ColorScaleRuleModelEntry()); + maColorScaleRuleEntries.emplace_back(); maColorScaleRuleEntries[mnCol].maColor = aColor; ++mnCol; @@ -386,7 +386,7 @@ void IconSetRule::importIcon(const AttributeList& rAttribs) } ScIconSetType eIconSetType = getType(aIconSet); - mxFormatData->maCustomVector.push_back(std::pair<ScIconSetType, sal_Int32>(eIconSetType, nIndex)); + mxFormatData->maCustomVector.emplace_back(eIconSetType, nIndex); } void IconSetRule::SetData( ScIconSetFormat* pFormat, ScDocument* pDoc, const ScAddress& rPos ) diff --git a/sc/source/filter/oox/excelvbaproject.cxx b/sc/source/filter/oox/excelvbaproject.cxx index 5ecb1c6ef8a8..f119268e799d 100644 --- a/sc/source/filter/oox/excelvbaproject.cxx +++ b/sc/source/filter/oox/excelvbaproject.cxx @@ -90,7 +90,7 @@ void ExcelVbaProject::prepareImport() else { // TODO: once we have chart sheets we need a switch/case on sheet type ('SheetNNN' vs. 'ChartNNN') - aCodeNameInfos.push_back( SheetCodeNameInfo( aSheetProp, "Sheet" ) ); + aCodeNameInfos.emplace_back( aSheetProp, "Sheet" ); } } catch( Exception& ) diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx index ca99ec621dcb..52bc7189d04c 100644 --- a/sc/source/filter/oox/formulabase.cxx +++ b/sc/source/filter/oox/formulabase.cxx @@ -1697,8 +1697,8 @@ void FormulaProcessorBase::convertStringToStringList( aEntry = aEntry.copy( nStart ); } if( !aNewTokens.empty() ) - aNewTokens.push_back( ApiToken( OPCODE_SEP, Any() ) ); - aNewTokens.push_back( ApiToken( OPCODE_PUSH, Any( aEntry ) ) ); + aNewTokens.emplace_back( OPCODE_SEP, Any() ); + aNewTokens.emplace_back( OPCODE_PUSH, Any( aEntry ) ); } orTokens = ContainerHelper::vectorToSequence( aNewTokens ); } diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx index a677ce01abf5..d52f7fd6d789 100644 --- a/sc/source/filter/oox/formulabuffer.cxx +++ b/sc/source/filter/oox/formulabuffer.cxx @@ -402,15 +402,14 @@ void FormulaBuffer::createSharedFormulaMapEntry( void FormulaBuffer::setCellFormula( const ScAddress& rAddress, const OUString& rTokenStr ) { assert( rAddress.Tab() >= 0 && (size_t)rAddress.Tab() < maCellFormulas.size() ); - maCellFormulas[ rAddress.Tab() ].push_back( TokenAddressItem( rTokenStr, rAddress ) ); + maCellFormulas[ rAddress.Tab() ].emplace_back( rTokenStr, rAddress ); } void FormulaBuffer::setCellFormula( const ScAddress& rAddress, sal_Int32 nSharedId, const OUString& rCellValue, sal_Int32 nValueType ) { assert( rAddress.Tab() >= 0 && (size_t)rAddress.Tab() < maSharedFormulaIds.size() ); - maSharedFormulaIds[rAddress.Tab()].push_back( - SharedFormulaDesc(rAddress, nSharedId, rCellValue, nValueType)); + maSharedFormulaIds[rAddress.Tab()].emplace_back(rAddress, nSharedId, rCellValue, nValueType); } void FormulaBuffer::setCellArrayFormula( const ScRange& rRangeAddress, const ScAddress& rTokenAddress, const OUString& rTokenStr ) @@ -418,7 +417,7 @@ void FormulaBuffer::setCellArrayFormula( const ScRange& rRangeAddress, const ScA TokenAddressItem tokenPair( rTokenStr, rTokenAddress ); assert( rRangeAddress.aStart.Tab() >= 0 && (size_t)rRangeAddress.aStart.Tab() < maCellArrayFormulas.size() ); - maCellArrayFormulas[ rRangeAddress.aStart.Tab() ].push_back( TokenRangeAddressItem( tokenPair, rRangeAddress ) ); + maCellArrayFormulas[ rRangeAddress.aStart.Tab() ].emplace_back( tokenPair, rRangeAddress ); } void FormulaBuffer::setCellFormulaValue( diff --git a/sc/source/filter/oox/formulaparser.cxx b/sc/source/filter/oox/formulaparser.cxx index aab7e0927fbd..8ac625f58215 100644 --- a/sc/source/filter/oox/formulaparser.cxx +++ b/sc/source/filter/oox/formulaparser.cxx @@ -641,7 +641,7 @@ void FormulaParserImpl::appendSpaces( WhiteSpaceVec& orSpaces, sal_Int32 nCount, { OSL_ENSURE( nCount >= 0, "FormulaParserImpl::appendSpaces - negative count" ); if( nCount > 0 ) - orSpaces.push_back( WhiteSpace( nCount, bLineFeed ) ); + orSpaces.emplace_back( nCount, bLineFeed ); } void FormulaParserImpl::appendLeadingSpaces( sal_Int32 nCount, bool bLineFeed ) diff --git a/sc/source/filter/oox/pivottablebuffer.cxx b/sc/source/filter/oox/pivottablebuffer.cxx index eaeab3b07c38..cd1025f73abc 100644 --- a/sc/source/filter/oox/pivottablebuffer.cxx +++ b/sc/source/filter/oox/pivottablebuffer.cxx @@ -411,7 +411,7 @@ void PivotTableField::finalizeImport( const Reference< XDataPilotDescriptor >& r pCacheField->getCacheItemNames( aItems ); PivotCacheGroupItemVector aItemNames; for( ::std::vector< OUString >::iterator aIt = aItems.begin(), aEnd = aItems.end(); aIt != aEnd; ++aIt ) - aItemNames.push_back( PivotCacheGroupItem( *aIt ) ); + aItemNames.emplace_back( *aIt ); // create all nested group fields (if any) mrPivotTable.finalizeParentGroupingImport( xDPField, *pCacheField, aItemNames ); } @@ -450,7 +450,7 @@ void PivotTableField::finalizeParentGroupingImport( const Reference< XDataPilotF for( ItemModelVector::iterator aIt = maItems.begin(), aEnd = maItems.end(); aIt != aEnd; ++aIt ) { if ( aIt->mnType == XML_data && aIt->msCaption.getLength() ) - captionList.push_back( IdCaptionPair( aIt->mnCacheItem, aIt->msCaption ) ); + captionList.emplace_back( aIt->mnCacheItem, aIt->msCaption ); } if ( !captionList.empty() ) pCacheField->applyItemCaptions( captionList ); diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx index 28b48da25a77..4dba319eee72 100644 --- a/sc/source/filter/oox/sheetdatabuffer.cxx +++ b/sc/source/filter/oox/sheetdatabuffer.cxx @@ -279,7 +279,7 @@ void SheetDataBuffer::createArrayFormula( const ScRange& rRange, const ApiTokenS /* Array formulas will be inserted later in finalizeImport(). This is needed to not disturb collecting all the cells, which will be put into the sheet in large blocks to increase performance. */ - maArrayFormulas.push_back( ArrayFormula( rRange, rTokens ) ); + maArrayFormulas.emplace_back( rRange, rTokens ); } void SheetDataBuffer::createTableOperation( const ScRange& rRange, const DataTableModel& rModel ) @@ -287,7 +287,7 @@ void SheetDataBuffer::createTableOperation( const ScRange& rRange, const DataTab /* Table operations will be inserted later in finalizeImport(). This is needed to not disturb collecting all the cells, which will be put into the sheet in large blocks to increase performance. */ - maTableOperations.push_back( TableOperation( rRange, rModel ) ); + maTableOperations.emplace_back( rRange, rModel ); } void SheetDataBuffer::setRowFormat( sal_Int32 nRow, sal_Int32 nXfId, bool bCustomFormat ) @@ -313,7 +313,7 @@ void SheetDataBuffer::setRowFormat( sal_Int32 nRow, sal_Int32 nXfId, bool bCusto void SheetDataBuffer::setMergedRange( const ScRange& rRange ) { - maMergedRanges.push_back( MergedRange( rRange ) ); + maMergedRanges.emplace_back( rRange ); } typedef std::pair<sal_Int32, sal_Int32> FormatKeyPair; @@ -709,7 +709,7 @@ void SheetDataBuffer::setCellFormat( const CellModel& rModel ) /* start new merged range, if cell is not empty (#108781#), or try to expand last range with empty cell */ if( rModel.mnCellType != XML_TOKEN_INVALID ) - maCenterFillRanges.push_back( MergedRange( rModel.maCellAddr, nHorAlign ) ); + maCenterFillRanges.emplace_back( rModel.maCellAddr, nHorAlign ); else if( !maCenterFillRanges.empty() ) maCenterFillRanges.rbegin()->tryExpand( rModel.maCellAddr, nHorAlign ); } diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx index c52af23143d5..0f852206415e 100644 --- a/sc/source/filter/oox/workbookfragment.cxx +++ b/sc/source/filter/oox/workbookfragment.cxx @@ -440,7 +440,7 @@ void WorkbookFragment::finalizeImport() // insert the fragment into the map if( xFragment.is() ) { - aSheetFragments.push_back( SheetFragmentHandler( xSheetGlob, xFragment.get() ) ); + aSheetFragments.emplace_back( xSheetGlob, xFragment.get() ); aHelpers.push_back(xFragment.get()); } } diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index 9683661671cd..c24e15742e29 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -204,7 +204,7 @@ size_t ScOrcusFactory::addString(const OUString& rStr) void ScOrcusFactory::pushStringCell(const ScAddress& rPos, size_t nStrIndex) { - maStringCells.push_back(StringCellCache(rPos, nStrIndex)); + maStringCells.emplace_back(rPos, nStrIndex); } void ScOrcusFactory::incrementProgress() diff --git a/sc/source/filter/xml/pivotsource.cxx b/sc/source/filter/xml/pivotsource.cxx index 322459239320..8ae4d40b52aa 100644 --- a/sc/source/filter/xml/pivotsource.cxx +++ b/sc/source/filter/xml/pivotsource.cxx @@ -31,17 +31,17 @@ PivotTableSources::PivotTableSources() {} void PivotTableSources::appendSheetSource( ScDPObject* pObj, const ScSheetSourceDesc& rDesc ) { - maSheetSources.push_back(SheetSource(pObj, rDesc)); + maSheetSources.emplace_back(pObj, rDesc); } void PivotTableSources::appendDBSource( ScDPObject* pObj, const ScImportSourceDesc& rDesc ) { - maDBSources.push_back(DBSource(pObj, rDesc)); + maDBSources.emplace_back(pObj, rDesc); } void PivotTableSources::appendServiceSource( ScDPObject* pObj, const ScDPServiceDesc& rDesc ) { - maServiceSources.push_back(ServiceSource(pObj, rDesc)); + maServiceSources.emplace_back(pObj, rDesc); } void PivotTableSources::appendSelectedPages( ScDPObject* pObj, const SelectedPagesType& rSelected ) @@ -49,7 +49,7 @@ void PivotTableSources::appendSelectedPages( ScDPObject* pObj, const SelectedPag if (rSelected.empty()) return; - maSelectedPagesList.push_back(SelectedPages(pObj, rSelected)); + maSelectedPagesList.emplace_back(pObj, rSelected); } namespace { diff --git a/sc/source/filter/xml/sheetdata.cxx b/sc/source/filter/xml/sheetdata.cxx index 1d1cfb93487d..682d466d2a49 100644 --- a/sc/source/filter/xml/sheetdata.cxx +++ b/sc/source/filter/xml/sheetdata.cxx @@ -39,22 +39,22 @@ ScSheetSaveData::~ScSheetSaveData() void ScSheetSaveData::AddCellStyle( const OUString& rName, const ScAddress& rCellPos ) { - maCellStyles.push_back( ScCellStyleEntry( rName, rCellPos ) ); + maCellStyles.emplace_back( rName, rCellPos ); } void ScSheetSaveData::AddColumnStyle( const OUString& rName, const ScAddress& rCellPos ) { - maColumnStyles.push_back( ScCellStyleEntry( rName, rCellPos ) ); + maColumnStyles.emplace_back( rName, rCellPos ); } void ScSheetSaveData::AddRowStyle( const OUString& rName, const ScAddress& rCellPos ) { - maRowStyles.push_back( ScCellStyleEntry( rName, rCellPos ) ); + maRowStyles.emplace_back( rName, rCellPos ); } void ScSheetSaveData::AddTableStyle( const OUString& rName, const ScAddress& rCellPos ) { - maTableStyles.push_back( ScCellStyleEntry( rName, rCellPos ) ); + maTableStyles.emplace_back( rName, rCellPos ); } void ScSheetSaveData::HandleNoteStyles( const OUString& rStyleName, const OUString& rTextName, const ScAddress& rCellPos ) @@ -78,14 +78,14 @@ void ScSheetSaveData::HandleNoteStyles( const OUString& rStyleName, const OUStri void ScSheetSaveData::AddNoteContentStyle( sal_uInt16 nFamily, const OUString& rName, const ScAddress& rCellPos, const ESelection& rSelection ) { if ( nFamily == XML_STYLE_FAMILY_TEXT_PARAGRAPH ) - maNoteParaStyles.push_back( ScTextStyleEntry( rName, rCellPos, rSelection ) ); + maNoteParaStyles.emplace_back( rName, rCellPos, rSelection ); else - maNoteTextStyles.push_back( ScTextStyleEntry( rName, rCellPos, rSelection ) ); + maNoteTextStyles.emplace_back( rName, rCellPos, rSelection ); } void ScSheetSaveData::AddTextStyle( const OUString& rName, const ScAddress& rCellPos, const ESelection& rSelection ) { - maTextStyles.push_back( ScTextStyleEntry( rName, rCellPos, rSelection ) ); + maTextStyles.emplace_back( rName, rCellPos, rSelection ); } void ScSheetSaveData::BlockSheet( SCTAB nTab ) @@ -194,7 +194,7 @@ void ScSheetSaveData::StoreLoadedNamespaces( const SvXMLNamespaceMap& rNamespace if ( maInitialPrefixes.find( aIter->first ) == maInitialPrefixes.end() ) { const NameSpaceEntry& rEntry = *(aIter->second); - maLoadedNamespaces.push_back( ScLoadedNamespaceEntry( rEntry.sPrefix, rEntry.sName, rEntry.nKey ) ); + maLoadedNamespaces.emplace_back( rEntry.sPrefix, rEntry.sName, rEntry.nKey ); } ++aIter; } diff --git a/sc/source/filter/xml/xmlannoi.cxx b/sc/source/filter/xml/xmlannoi.cxx index f88643686540..42d7de994fd9 100644 --- a/sc/source/filter/xml/xmlannoi.cxx +++ b/sc/source/filter/xml/xmlannoi.cxx @@ -180,7 +180,7 @@ void ScXMLAnnotationContext::SetShape( const uno::Reference< drawing::XShape >& void ScXMLAnnotationContext::AddContentStyle( sal_uInt16 nFamily, const OUString& rName, const ESelection& rSelection ) { - mrAnnotationData.maContentStyles.push_back( ScXMLAnnotationStyleEntry( nFamily, rName, rSelection ) ); + mrAnnotationData.maContentStyles.emplace_back( nFamily, rName, rSelection ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 8c1a6442cf21..48156659941a 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -911,7 +911,7 @@ void ScXMLExport::ExportExternalRefCacheStyles() aVal <<= nNumFmt; vector<XMLPropertyState> aProps; aVal <<= aDefaultStyle; - aProps.push_back(XMLPropertyState(nEntryIndex, aVal)); + aProps.emplace_back(nEntryIndex, aVal); OUString aName; sal_Int32 nIndex; @@ -953,7 +953,7 @@ void handleFont( if (!pItem->QueryValue(aAny, MID_FONT_FAMILY_NAME)) return; - rPropStates.push_back(XMLPropertyState(nIndexFontName, aAny)); + rPropStates.emplace_back(nIndexFontName, aAny); } const SvxFieldData* toXMLPropertyStates( @@ -1002,7 +1002,7 @@ const SvxFieldData* toXMLPropertyStates( if (!static_cast<const SvxWeightItem*>(p)->QueryValue(aAny, pEntry->mnFlag)) continue; - rPropStates.push_back(XMLPropertyState(nIndex, aAny)); + rPropStates.emplace_back(nIndex, aAny); } break; case EE_CHAR_FONTHEIGHT: @@ -1012,7 +1012,7 @@ const SvxFieldData* toXMLPropertyStates( if (!static_cast<const SvxFontHeightItem*>(p)->QueryValue(aAny, pEntry->mnFlag)) continue; - rPropStates.push_back(XMLPropertyState(nIndex, aAny)); + rPropStates.emplace_back(nIndex, aAny); } break; case EE_CHAR_ITALIC: @@ -1022,7 +1022,7 @@ const SvxFieldData* toXMLPropertyStates( if (!static_cast<const SvxPostureItem*>(p)->QueryValue(aAny, pEntry->mnFlag)) continue; - rPropStates.push_back(XMLPropertyState(nIndex, aAny)); + rPropStates.emplace_back(nIndex, aAny); } break; case EE_CHAR_UNDERLINE: @@ -1050,15 +1050,15 @@ const SvxFieldData* toXMLPropertyStates( const SvxUnderlineItem* pUL = static_cast<const SvxUnderlineItem*>(p); pUL->QueryValue(aAny, MID_TL_STYLE); - rPropStates.push_back(XMLPropertyState(nIndexStyle, aAny)); - rPropStates.push_back(XMLPropertyState(nIndexType, aAny)); - rPropStates.push_back(XMLPropertyState(nIndexWidth, aAny)); + rPropStates.emplace_back(nIndexStyle, aAny); + rPropStates.emplace_back(nIndexType, aAny); + rPropStates.emplace_back(nIndexWidth, aAny); pUL->QueryValue(aAny, MID_TL_COLOR); - rPropStates.push_back(XMLPropertyState(nIndexColor, aAny)); + rPropStates.emplace_back(nIndexColor, aAny); pUL->QueryValue(aAny, MID_TL_HASCOLOR); - rPropStates.push_back(XMLPropertyState(nIndexHasColor, aAny)); + rPropStates.emplace_back(nIndexHasColor, aAny); } break; case EE_CHAR_OVERLINE: @@ -1086,15 +1086,15 @@ const SvxFieldData* toXMLPropertyStates( const SvxOverlineItem* pOL = static_cast<const SvxOverlineItem*>(p); pOL->QueryValue(aAny, MID_TL_STYLE); - rPropStates.push_back(XMLPropertyState(nIndexStyle, aAny)); - rPropStates.push_back(XMLPropertyState(nIndexType, aAny)); - rPropStates.push_back(XMLPropertyState(nIndexWidth, aAny)); + rPropStates.emplace_back(nIndexStyle, aAny); + rPropStates.emplace_back(nIndexType, aAny); + rPropStates.emplace_back(nIndexWidth, aAny); pOL->QueryValue(aAny, MID_TL_COLOR); - rPropStates.push_back(XMLPropertyState(nIndexColor, aAny)); + rPropStates.emplace_back(nIndexColor, aAny); pOL->QueryValue(aAny, MID_TL_HASCOLOR); - rPropStates.push_back(XMLPropertyState(nIndexHasColor, aAny)); + rPropStates.emplace_back(nIndexHasColor, aAny); } break; case EE_CHAR_COLOR: @@ -1107,7 +1107,7 @@ const SvxFieldData* toXMLPropertyStates( { sal_Int32 nIndexColor = ( nColor == COL_AUTO ) ? xMapper->GetEntryIndex( XML_NAMESPACE_STYLE, GetXMLToken( XML_USE_WINDOW_FONT_COLOR ), 0 ) : nIndex; - rPropStates.push_back( XMLPropertyState( nIndexColor, aAny ) ); + rPropStates.emplace_back( nIndexColor, aAny ); } } break; @@ -1116,7 +1116,7 @@ const SvxFieldData* toXMLPropertyStates( if (!static_cast<const SvxWordLineModeItem*>(p)->QueryValue(aAny, pEntry->mnFlag)) continue; - rPropStates.push_back(XMLPropertyState(nIndex, aAny)); + rPropStates.emplace_back(nIndex, aAny); } break; case EE_CHAR_STRIKEOUT: @@ -1124,7 +1124,7 @@ const SvxFieldData* toXMLPropertyStates( if (!static_cast<const SvxCrossedOutItem*>(p)->QueryValue(aAny, pEntry->mnFlag)) continue; - rPropStates.push_back(XMLPropertyState(nIndex, aAny)); + rPropStates.emplace_back(nIndex, aAny); } break; case EE_CHAR_RELIEF: @@ -1132,7 +1132,7 @@ const SvxFieldData* toXMLPropertyStates( if (!static_cast<const SvxCharReliefItem*>(p)->QueryValue(aAny, pEntry->mnFlag)) continue; - rPropStates.push_back(XMLPropertyState(nIndex, aAny)); + rPropStates.emplace_back(nIndex, aAny); } break; case EE_CHAR_OUTLINE: @@ -1140,7 +1140,7 @@ const SvxFieldData* toXMLPropertyStates( if (!static_cast<const SvxContourItem*>(p)->QueryValue(aAny, pEntry->mnFlag)) continue; - rPropStates.push_back(XMLPropertyState(nIndex, aAny)); + rPropStates.emplace_back(nIndex, aAny); } break; case EE_CHAR_SHADOW: @@ -1148,7 +1148,7 @@ const SvxFieldData* toXMLPropertyStates( if (!static_cast<const SvxShadowedItem*>(p)->QueryValue(aAny, pEntry->mnFlag)) continue; - rPropStates.push_back(XMLPropertyState(nIndex, aAny)); + rPropStates.emplace_back(nIndex, aAny); } break; case EE_CHAR_KERNING: @@ -1156,7 +1156,7 @@ const SvxFieldData* toXMLPropertyStates( if (!static_cast<const SvxKerningItem*>(p)->QueryValue(aAny, pEntry->mnFlag)) continue; - rPropStates.push_back(XMLPropertyState(nIndex, aAny)); + rPropStates.emplace_back(nIndex, aAny); } break; case EE_CHAR_PAIRKERNING: @@ -1164,7 +1164,7 @@ const SvxFieldData* toXMLPropertyStates( if (!static_cast<const SvxAutoKernItem*>(p)->QueryValue(aAny, pEntry->mnFlag)) continue; - rPropStates.push_back(XMLPropertyState(nIndex, aAny)); + rPropStates.emplace_back(nIndex, aAny); } break; case EE_CHAR_FONTWIDTH: @@ -1172,7 +1172,7 @@ const SvxFieldData* toXMLPropertyStates( if (!static_cast<const SvxCharScaleWidthItem*>(p)->QueryValue(aAny, pEntry->mnFlag)) continue; - rPropStates.push_back(XMLPropertyState(nIndex, aAny)); + rPropStates.emplace_back(nIndex, aAny); } break; case EE_CHAR_ESCAPEMENT: @@ -1188,10 +1188,10 @@ const SvxFieldData* toXMLPropertyStates( const SvxEscapementItem* pEsc = static_cast<const SvxEscapementItem*>(p); pEsc->QueryValue(aAny); - rPropStates.push_back(XMLPropertyState(nIndexEsc, aAny)); + rPropStates.emplace_back(nIndexEsc, aAny); pEsc->QueryValue(aAny, MID_ESC_HEIGHT); - rPropStates.push_back(XMLPropertyState(nIndexEscHeight, aAny)); + rPropStates.emplace_back(nIndexEscHeight, aAny); } break; @@ -1200,7 +1200,7 @@ const SvxFieldData* toXMLPropertyStates( if (!static_cast<const SvxEmphasisMarkItem*>(p)->QueryValue(aAny, pEntry->mnFlag)) continue; - rPropStates.push_back(XMLPropertyState(nIndex, aAny)); + rPropStates.emplace_back(nIndex, aAny); } break; case EE_CHAR_LANGUAGE: @@ -1236,10 +1236,10 @@ const SvxFieldData* toXMLPropertyStates( nIndexLanguage = nIndexCountry = nIndexScript = nIndexTag = -1; } assert( nIndexLanguage >= 0 && nIndexCountry >= 0 && nIndexScript >= 0 && nIndexTag >= 0); - rPropStates.push_back( XMLPropertyState( nIndexLanguage, aAny)); - rPropStates.push_back( XMLPropertyState( nIndexCountry, aAny)); - rPropStates.push_back( XMLPropertyState( nIndexScript, aAny)); - rPropStates.push_back( XMLPropertyState( nIndexTag, aAny)); + rPropStates.emplace_back( nIndexLanguage, aAny); + rPropStates.emplace_back( nIndexCountry, aAny); + rPropStates.emplace_back( nIndexScript, aAny); + rPropStates.emplace_back( nIndexTag, aAny); } break; default: diff --git a/sc/source/filter/xml/xmlfilti.cxx b/sc/source/filter/xml/xmlfilti.cxx index 9ccdc8bda4cb..42c63ec57665 100644 --- a/sc/source/filter/xml/xmlfilti.cxx +++ b/sc/source/filter/xml/xmlfilti.cxx @@ -149,7 +149,7 @@ void SAL_CALL ScXMLFilterContext::endFastElement( sal_Int32 /*nElement*/ ) void ScXMLFilterContext::OpenConnection(bool b) { - maConnStack.push_back(ConnStackItem(b)); + maConnStack.emplace_back(b); } void ScXMLFilterContext::CloseConnection() diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx index 305c7ad55ed8..42ddf57fc7c1 100644 --- a/sc/source/filter/xml/xmlstyli.cxx +++ b/sc/source/filter/xml/xmlstyli.cxx @@ -267,7 +267,7 @@ void ScXMLRowImportPropertyMapper::finished(::std::vector< XMLPropertyState >& r } else if (pHeight) { - rProperties.push_back(XMLPropertyState(maPropMapper->FindEntryIndex(CTF_SC_ROWOPTIMALHEIGHT), css::uno::Any(false))); + rProperties.emplace_back(maPropMapper->FindEntryIndex(CTF_SC_ROWOPTIMALHEIGHT), css::uno::Any(false)); } // don't access pointers to rProperties elements after push_back! } diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx index 94518d92f33a..655abcabcb18 100644 --- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx +++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx @@ -106,7 +106,7 @@ ScMyAddress ScAccessibleSpreadsheet::CalcScAddressFromRangeList(ScRangeList *pMa ScRange *p = *vi; if ( row >= p->aStart.Row() && row <= p->aEnd.Row()) { - m_vecTempCol.push_back(std::make_pair(p->aStart.Col(),p->aEnd.Col())); + m_vecTempCol.emplace_back(p->aStart.Col(),p->aEnd.Col()); } } } @@ -151,7 +151,7 @@ bool ScAccessibleSpreadsheet::CalcScRangeDifferenceMax(const ScRange *pSrc, cons { for (sal_uInt16 col = pDest->aStart.Col(); col <= pDest->aEnd.Col();++col) { - vecRet.push_back(ScMyAddress(col,row,pDest->aStart.Tab())); + vecRet.emplace_back(col,row,pDest->aStart.Tab()); } } } @@ -218,7 +218,7 @@ bool ScAccessibleSpreadsheet::CalcScRangeListDifferenceMax(ScRangeList *pSrc,ScR { for (sal_uInt16 col = pRange->aStart.Col(); col <= pRange->aEnd.Col();++col) { - vecRet.push_back(ScMyAddress(col,row,pRange->aStart.Tab())); + vecRet.emplace_back(col,row,pRange->aStart.Tab()); } } } @@ -1543,7 +1543,7 @@ void ScAccessibleSpreadsheet::NotifyRefMode() CommitChange(aEvent); m_mapFormulaSelectionSend.emplace(aFormulaAddr,xNew); m_vecFormulaLastMyAddr.clear(); - m_vecFormulaLastMyAddr.push_back(aFormulaAddr); + m_vecFormulaLastMyAddr.emplace_back(aFormulaAddr); } else { diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 2ee3e739d3dd..673c2fe834e8 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -2175,7 +2175,7 @@ void ScModule::RegisterRefWindow( sal_uInt16 nSlotId, vcl::Window *pWnd ) if( std::find( rlRefWindow.begin(), rlRefWindow.end(), pWnd ) == rlRefWindow.end() ) { - rlRefWindow.push_back( pWnd ); + rlRefWindow.emplace_back(pWnd ); } } diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index d2c16a98ebc5..cc936bdd1b97 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -1532,7 +1532,7 @@ ScTabStops::~ScTabStops() void ScTabStops::AddTabStop( vcl::Window* pWin ) { - maControls.push_back( pWin ); + maControls.emplace_back(pWin ); maControlToPos[pWin] = maControls.size() - 1; } diff --git a/sc/source/ui/dataprovider/dataprovider.cxx b/sc/source/ui/dataprovider/dataprovider.cxx index 75a3111bd475..924b3f109a30 100644 --- a/sc/source/ui/dataprovider/dataprovider.cxx +++ b/sc/source/ui/dataprovider/dataprovider.cxx @@ -268,8 +268,8 @@ std::shared_ptr<DataProvider> DataProviderFactory::getDataProvider(ScDocument* p std::vector<OUString> DataProviderFactory::getDataProviders() { std::vector<OUString> aDataProviders; - aDataProviders.push_back("org.libreoffice.calc.csv"); - aDataProviders.push_back("org.libreoffice.calc.html"); + aDataProviders.emplace_back("org.libreoffice.calc.csv"); + aDataProviders.emplace_back("org.libreoffice.calc.html"); return aDataProviders; } diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx index b5a5c4a16ee6..ecefc420bcfc 100644 --- a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx +++ b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx @@ -163,7 +163,7 @@ void ScPivotLayoutTreeListData::PushDataFieldNames(std::vector<ScDPName>& rDataF pEachItemValue->maFunctionData.mnDupCount); } - rDataFieldNames.push_back(ScDPName(rLabelData.maName, sLayoutName, rLabelData.mnDupCount)); + rDataFieldNames.emplace_back(rLabelData.maName, sLayoutName, rLabelData.mnDupCount); } } diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx index 3d68c95bdb99..9279302af01c 100644 --- a/sc/source/ui/dbgui/csvgrid.cxx +++ b/sc/source/ui/dbgui/csvgrid.cxx @@ -539,9 +539,9 @@ void ScCsvGrid::FillColumnDataSep( ScAsciiOptions& rOptions ) const { if( GetColumnType( nColIx ) != CSV_TYPE_DEFAULT ) // 1-based column index - aDataVec.push_back( ScCsvExpData( + aDataVec.emplace_back( static_cast< sal_Int32 >( nColIx + 1 ), - lcl_GetExtColumnType( GetColumnType( nColIx ) ) ) ); + lcl_GetExtColumnType( GetColumnType( nColIx ) ) ); } rOptions.SetColumnInfo( aDataVec ); } @@ -737,7 +737,7 @@ void ScCsvGrid::ImplSetTextLineSep( sal_uInt32 nLineIx = nLine - GetFirstVisLine(); while( maTexts.size() <= nLineIx ) - maTexts.push_back( std::vector<OUString>() ); + maTexts.emplace_back( ); std::vector<OUString>& rStrVec = maTexts[ nLineIx ]; rStrVec.clear(); @@ -800,7 +800,7 @@ void ScCsvGrid::ImplSetTextLineFix( sal_Int32 nLine, const OUString& rTextLine ) sal_uInt32 nLineIx = nLine - GetFirstVisLine(); while( maTexts.size() <= nLineIx ) - maTexts.push_back( std::vector<OUString>() ); + maTexts.emplace_back( ); std::vector<OUString>& rStrVec = maTexts[ nLineIx ]; rStrVec.clear(); diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx index 463d672b56f0..2fa343f09be4 100644 --- a/sc/source/ui/dbgui/dbnamdlg.cxx +++ b/sc/source/ui/dbgui/dbnamdlg.cxx @@ -531,9 +531,8 @@ IMPL_LINK_NOARG(ScDbNameDlg, RemoveBtnHdl, Button*, void) SCCOL nColStart, nColEnd; SCROW nRowStart, nRowEnd; (*itr)->GetArea( nTab, nColStart, nRowStart, nColEnd, nRowEnd ); - aRemoveList.push_back( - ScRange( ScAddress( nColStart, nRowStart, nTab ), - ScAddress( nColEnd, nRowEnd, nTab ) ) ); + aRemoveList.emplace_back( ScAddress( nColStart, nRowStart, nTab ), + ScAddress( nColEnd, nRowEnd, nTab ) ); rDBs.erase(itr); diff --git a/sc/source/ui/docshell/autostyl.cxx b/sc/source/ui/docshell/autostyl.cxx index d3fb83763b1a..bd468cb64ac5 100644 --- a/sc/source/ui/docshell/autostyl.cxx +++ b/sc/source/ui/docshell/autostyl.cxx @@ -77,7 +77,7 @@ ScAutoStyleList::~ScAutoStyleList() void ScAutoStyleList::AddInitial( const ScRange& rRange, const OUString& rStyle1, sal_uLong nTimeout, const OUString& rStyle2 ) { - aInitials.push_back( ScAutoStyleInitData( rRange, rStyle1, nTimeout, rStyle2 ) ); + aInitials.emplace_back( rRange, rStyle1, nTimeout, rStyle2 ); aInitIdle.Start(); } diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index 9c82c94dcdd0..2282f14e63f4 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -1390,7 +1390,7 @@ ScExternalRefCache::TableTypeRef ScExternalRefCache::getCacheTable(sal_uInt16 nF if( pnIndex ) *pnIndex = nIndex; TableTypeRef pTab(new Table); rDoc.maTables.push_back(pTab); - rDoc.maTableNames.push_back(TableName(aTabNameUpper, rTabName)); + rDoc.maTableNames.emplace_back(aTabNameUpper, rTabName); rDoc.maTableNameIndex.emplace(aTabNameUpper, nIndex); return pTab; } @@ -2282,7 +2282,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getDoubleRefTokensFromSr vector<ScExternalRefCache::SingleRangeData> aCacheData; aCacheData.reserve(nTabSpan+1); - aCacheData.push_back(ScExternalRefCache::SingleRangeData()); + aCacheData.emplace_back(); aCacheData.back().maTableName = ScGlobal::pCharClass->uppercase(rTabName); for (SCTAB i = 1; i < nTabSpan + 1; ++i) @@ -2292,7 +2292,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getDoubleRefTokensFromSr // source document doesn't have any table by the specified name. break; - aCacheData.push_back(ScExternalRefCache::SingleRangeData()); + aCacheData.emplace_back(); aCacheData.back().maTableName = ScGlobal::pCharClass->uppercase(aTabName); } diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx index 56b2a008b139..7ff07f2157eb 100644 --- a/sc/source/ui/miscdlgs/anyrefdg.cxx +++ b/sc/source/ui/miscdlgs/anyrefdg.cxx @@ -432,7 +432,7 @@ namespace continue; if (rVisibleWidgets.find(pChild) == rVisibleWidgets.end()) { - rWasVisibleWidgets.push_back(pChild); + rWasVisibleWidgets.emplace_back(pChild); pChild->Hide(); } else if (isContainerWindow(pChild)) @@ -501,7 +501,7 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula:: continue; // do nothing else if (pWin->IsVisible()) { - m_aHiddenWidgets.push_back(pChild); + m_aHiddenWidgets.emplace_back(pChild); pChild->Hide(); } } diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx index 58c2798a72e0..1a54c75c73f7 100644 --- a/sc/source/ui/miscdlgs/datafdlg.cxx +++ b/sc/source/ui/miscdlgs/datafdlg.cxx @@ -173,8 +173,8 @@ ScDataFormDlg::ScDataFormDlg(vcl::Window* pParent, ScTabViewShell* pTabViewShell } else { - maFixedTexts.push_back( nullptr ); - maEdits.push_back( nullptr ); + maFixedTexts.emplace_back(nullptr ); + maEdits.emplace_back(nullptr ); } if (maEdits[nIndex] != nullptr) maEdits[nIndex]->SetModifyHdl( HDL(Impl_DataModifyHdl) ); diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx index eabbfd08e823..066648d6d70e 100644 --- a/sc/source/ui/undo/undostyl.cxx +++ b/sc/source/ui/undo/undostyl.cxx @@ -227,7 +227,7 @@ ScUndoApplyPageStyle::~ScUndoApplyPageStyle() void ScUndoApplyPageStyle::AddSheetAction( SCTAB nTab, const OUString& rOldStyle ) { - maEntries.push_back( ApplyStyleEntry( nTab, rOldStyle ) ); + maEntries.emplace_back( nTab, rOldStyle ); } OUString ScUndoApplyPageStyle::GetComment() const diff --git a/sc/source/ui/unoobj/PivotTableDataProvider.cxx b/sc/source/ui/unoobj/PivotTableDataProvider.cxx index 971a46a8938c..7d5a3bfa90c7 100644 --- a/sc/source/ui/unoobj/PivotTableDataProvider.cxx +++ b/sc/source/ui/unoobj/PivotTableDataProvider.cxx @@ -315,7 +315,7 @@ void PivotTableDataProvider::collectPivotTableData() continue; if (rDataResult.Flags == 0 || rDataResult.Flags & css::sheet::DataResultFlags::HASDATA) { - aRow.push_back(ValueAndFormat(rDataResult.Flags ? rDataResult.Value : fNan, 0)); + aRow.emplace_back(rDataResult.Flags ? rDataResult.Value : fNan, 0); if (rDataResult.Flags != 0) // set as valid only if we have data { bRowEmpty = false; @@ -396,7 +396,7 @@ void PivotTableDataProvider::collectPivotTableData() { case sheet::DataPilotFieldOrientation_COLUMN: { - m_aColumnFields.push_back(chart2::data::PivotTableFieldEntry{xLevelName->getName(), nDim, nDimPos, bHasHiddenMember}); + m_aColumnFields.emplace_back(xLevelName->getName(), nDim, nDimPos, bHasHiddenMember); uno::Sequence<sheet::MemberResult> aSequence = xLevelResult->getResults(); size_t i = 0; @@ -440,7 +440,7 @@ void PivotTableDataProvider::collectPivotTableData() case sheet::DataPilotFieldOrientation_ROW: { - m_aRowFields.push_back(chart2::data::PivotTableFieldEntry{xLevelName->getName(), nDim, nDimPos, bHasHiddenMember}); + m_aRowFields.emplace_back(xLevelName->getName(), nDim, nDimPos, bHasHiddenMember); uno::Sequence<sheet::MemberResult> aSequence = xLevelResult->getResults(); @@ -498,7 +498,7 @@ void PivotTableDataProvider::collectPivotTableData() case sheet::DataPilotFieldOrientation_PAGE: { - m_aPageFields.push_back(chart2::data::PivotTableFieldEntry{xLevelName->getName(), nDim, nDimPos, bHasHiddenMember}); + m_aPageFields.emplace_back(xLevelName->getName(), nDim, nDimPos, bHasHiddenMember); // Resolve filtering OUString aFieldOutputDescription; @@ -522,7 +522,7 @@ void PivotTableDataProvider::collectPivotTableData() case sheet::DataPilotFieldOrientation_DATA: { aDataFieldNumberFormatMap[xLevelName->getName()] = nNumberFormat; - m_aDataFields.push_back(chart2::data::PivotTableFieldEntry{xLevelName->getName(), nDim, nDimPos, bHasHiddenMember}); + m_aDataFields.emplace_back(xLevelName->getName(), nDim, nDimPos, bHasHiddenMember); } break; @@ -833,7 +833,7 @@ void SAL_CALL PivotTableDataProvider::addModifyListener(const uno::Reference< ut { SolarMutexGuard aGuard; - m_aValueListeners.push_back(uno::Reference<util::XModifyListener>(aListener)); + m_aValueListeners.emplace_back(aListener); } void SAL_CALL PivotTableDataProvider::removeModifyListener(const uno::Reference<util::XModifyListener>& aListener ) diff --git a/sc/source/ui/unoobj/PivotTableDataSequence.cxx b/sc/source/ui/unoobj/PivotTableDataSequence.cxx index 23b7fd82817b..2db6dc468757 100644 --- a/sc/source/ui/unoobj/PivotTableDataSequence.cxx +++ b/sc/source/ui/unoobj/PivotTableDataSequence.cxx @@ -179,7 +179,7 @@ uno::Reference<util::XCloneable> SAL_CALL PivotTableDataSequence::createClone() void SAL_CALL PivotTableDataSequence::addModifyListener(const uno::Reference<util::XModifyListener>& aListener) { SolarMutexGuard aGuard; - m_aValueListeners.push_back(uno::Reference<util::XModifyListener>(aListener)); + m_aValueListeners.emplace_back(aListener); } void SAL_CALL PivotTableDataSequence::removeModifyListener(const uno::Reference<util::XModifyListener>& aListener) diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index d51b82663b3d..1abd589b8297 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -3376,7 +3376,7 @@ void SAL_CALL ScCellRangesBase::addModifyListener(const uno::Reference<util::XMo if ( aRanges.empty() ) throw uno::RuntimeException(); - aValueListeners.push_back( uno::Reference<util::XModifyListener>( aListener ) ); + aValueListeners.emplace_back( aListener ); if ( aValueListeners.size() == 1 ) { @@ -4407,7 +4407,7 @@ void SAL_CALL ScCellRangesObj::insertByName( const OUString& aName, const uno::A // if a name is given, also insert into list of named entries // (only possible for a single range) // name is not in m_pImpl->m_aNamedEntries (tested above) - m_pImpl->m_aNamedEntries.push_back(ScNamedEntry( aName, *rAddRanges[ 0 ] )); + m_pImpl->m_aNamedEntries.emplace_back( aName, *rAddRanges[ 0 ] ); } } } diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 3cf1ec0a7861..dc0c2dfc498e 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -1911,34 +1911,30 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum InsertTabNumber func; func = ::std::for_each(aAllTokens.begin(), aAllTokens.end(), func); func.getList(aTableNumList); - aResult.push_back( - beans::PropertyValue( "TableNumberList", -1, + aResult.emplace_back( "TableNumberList", -1, uno::makeAny( lcl_createTableNumberList( aTableNumList ) ), - beans::PropertyState_DIRECT_VALUE )); + beans::PropertyState_DIRECT_VALUE ); } // DataRowSource (calculated before) if( bRowSourceDetected ) { - aResult.push_back( - beans::PropertyValue( "DataRowSource", -1, - uno::makeAny( eRowSource ), beans::PropertyState_DIRECT_VALUE )); + aResult.emplace_back( "DataRowSource", -1, + uno::makeAny( eRowSource ), beans::PropertyState_DIRECT_VALUE ); } // HasCategories if( bRowSourceDetected ) { - aResult.push_back( - beans::PropertyValue( "HasCategories", -1, - uno::makeAny( bHasCategories ), beans::PropertyState_DIRECT_VALUE )); + aResult.emplace_back( "HasCategories", -1, + uno::makeAny( bHasCategories ), beans::PropertyState_DIRECT_VALUE ); } // FirstCellAsLabel if( bRowSourceDetected ) { - aResult.push_back( - beans::PropertyValue( "FirstCellAsLabel", -1, - uno::makeAny( bFirstCellAsLabel ), beans::PropertyState_DIRECT_VALUE )); + aResult.emplace_back( "FirstCellAsLabel", -1, + uno::makeAny( bFirstCellAsLabel ), beans::PropertyState_DIRECT_VALUE ); } // Add the left upper corner to the range if it is missing. @@ -1962,9 +1958,8 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum lcl_convertTokensToString(sRangeRep, aAllTokens, m_pDocument); // add cell range property - aResult.push_back( - beans::PropertyValue( "CellRangeRepresentation", -1, - uno::makeAny( sRangeRep ), beans::PropertyState_DIRECT_VALUE )); + aResult.emplace_back( "CellRangeRepresentation", -1, + uno::makeAny( sRangeRep ), beans::PropertyState_DIRECT_VALUE ); //Sequence Mapping bool const bSequencesReordered = true;//todo detect this above or detect this sequence mapping cheaper ... @@ -2023,10 +2018,9 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum if( bDifferentIndexes && !aSequenceMappingVector.empty() ) { - aResult.push_back( - beans::PropertyValue( "SequenceMapping", -1, + aResult.emplace_back( "SequenceMapping", -1, uno::makeAny( comphelper::containerToSequence(aSequenceMappingVector) ) - , beans::PropertyState_DIRECT_VALUE )); + , beans::PropertyState_DIRECT_VALUE ); } } @@ -2680,7 +2674,7 @@ sal_Int32 ScChart2DataSequence::FillCacheFromExternalRef(const ScTokenRef& pToke aItem.mbIsValue = false; aItem.maString = pMat->GetString(nC, nR).getString(); - m_aDataArray.push_back(Item()); + m_aDataArray.emplace_back(); ++nDataCount; } } @@ -3246,7 +3240,7 @@ void SAL_CALL ScChart2DataSequence::addModifyListener( const uno::Reference< uti ScRangeList aRanges; ScRefTokenHelper::getRangeListFromTokens(aRanges, m_aTokens, ScAddress()); - m_aValueListeners.push_back( uno::Reference<util::XModifyListener>( aListener ) ); + m_aValueListeners.emplace_back( aListener ); if ( m_aValueListeners.size() == 1 ) { diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index d2a7f81d986d..d6eb02a1eb4d 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -1267,7 +1267,7 @@ void SAL_CALL ScDataPilotTableObj::addModifyListener( const uno::Reference<util: { SolarMutexGuard aGuard; - aModifyListeners.push_back( uno::Reference<util::XModifyListener>( aListener ) ); + aModifyListeners.emplace_back( aListener ); if ( aModifyListeners.size() == 1 ) { diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx index c2a280967ae3..d3b765a8b78e 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -1872,7 +1872,7 @@ void SAL_CALL ScDatabaseRangeObj::addRefreshListener( const uno::Reference<util::XRefreshListener >& xListener ) { SolarMutexGuard aGuard; - aRefreshListeners.push_back( uno::Reference<util::XRefreshListener>( xListener )); + aRefreshListeners.emplace_back( xListener ); // hold one additional ref to keep this object alive as long as there are listeners if ( aRefreshListeners.size() == 1 ) diff --git a/sc/source/ui/unoobj/dispuno.cxx b/sc/source/ui/unoobj/dispuno.cxx index eafdb2293872..517d543cb9e6 100644 --- a/sc/source/ui/unoobj/dispuno.cxx +++ b/sc/source/ui/unoobj/dispuno.cxx @@ -270,7 +270,7 @@ void SAL_CALL ScDispatch::addStatusListener( if ( aURL.Complete == cURLDocDataSource ) { - aDataSourceListeners.push_back( uno::Reference<frame::XStatusListener>( xListener ) ); + aDataSourceListeners.emplace_back( xListener ); if (!bListeningToView) { diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx index 58d88da8aa7c..1187454cab57 100644 --- a/sc/source/ui/unoobj/fmtuno.cxx +++ b/sc/source/ui/unoobj/fmtuno.cxx @@ -234,7 +234,7 @@ ScTableConditionalFormat::~ScTableConditionalFormat() void ScTableConditionalFormat::AddEntry_Impl(const ScCondFormatEntryItem& aEntry) { ScTableConditionalEntry* pNew = new ScTableConditionalEntry(aEntry); - maEntries.push_back(pNew); + maEntries.emplace_back(pNew); } // XSheetConditionalFormat diff --git a/sc/source/ui/unoobj/listenercalls.cxx b/sc/source/ui/unoobj/listenercalls.cxx index 1164043b3977..1f7042735de3 100644 --- a/sc/source/ui/unoobj/listenercalls.cxx +++ b/sc/source/ui/unoobj/listenercalls.cxx @@ -37,7 +37,7 @@ void ScUnoListenerCalls::Add( const uno::Reference<util::XModifyListener>& rList const lang::EventObject& rEvent ) { if ( rListener.is() ) - aEntries.push_back( ScUnoListenerEntry( rListener, rEvent ) ); + aEntries.emplace_back( rListener, rEvent ); } void ScUnoListenerCalls::ExecuteAndClear() diff --git a/sc/source/ui/unoobj/unoreflist.cxx b/sc/source/ui/unoobj/unoreflist.cxx index 13d6cd06a0d6..bc0cde0277e2 100644 --- a/sc/source/ui/unoobj/unoreflist.cxx +++ b/sc/source/ui/unoobj/unoreflist.cxx @@ -30,7 +30,7 @@ ScUnoRefList::~ScUnoRefList() void ScUnoRefList::Add( sal_Int64 nId, const ScRangeList& rOldRanges ) { - aEntries.push_back( ScUnoRefEntry( nId, rOldRanges ) ); + aEntries.emplace_back( nId, rOldRanges ); } void ScUnoRefList::Undo( ScDocument* pDoc ) diff --git a/sc/source/ui/vba/vbaaxes.cxx b/sc/source/ui/vba/vbaaxes.cxx index 2083c97dda0c..babb55e034b3 100644 --- a/sc/source/ui/vba/vbaaxes.cxx +++ b/sc/source/ui/vba/vbaaxes.cxx @@ -101,18 +101,18 @@ public: bool bBool = false; uno::Reference< beans::XPropertySet > xDiagramPropertySet( pChart->xDiagramPropertySet() ); if ( ( xDiagramPropertySet->getPropertyValue("HasXAxis") >>= bBool ) && bBool ) - mCoordinates.push_back( AxesCoordinate( xlPrimary, xlCategory ) ); + mCoordinates.emplace_back( xlPrimary, xlCategory ); if ( ( xDiagramPropertySet->getPropertyValue("HasYAxis") >>= bBool ) && bBool ) - mCoordinates.push_back( AxesCoordinate( xlPrimary, xlSeriesAxis ) ); + mCoordinates.emplace_back( xlPrimary, xlSeriesAxis ); if ( pChart->is3D() ) - mCoordinates.push_back( AxesCoordinate( xlPrimary, xlValue ) ); + mCoordinates.emplace_back( xlPrimary, xlValue ); // secondary if ( ( xDiagramPropertySet->getPropertyValue("HasSecondaryXAxis") >>= bBool ) && bBool ) - mCoordinates.push_back( AxesCoordinate( xlSecondary, xlCategory ) ); + mCoordinates.emplace_back( xlSecondary, xlCategory ); if ( ( xDiagramPropertySet->getPropertyValue("HasSecondaryYAxis") >>= bBool ) && bBool ) - mCoordinates.push_back( AxesCoordinate( xlSecondary, xlSeriesAxis ) ); + mCoordinates.emplace_back( xlSecondary, xlSeriesAxis ); } } diff --git a/sc/source/ui/vba/vbaeventshelper.cxx b/sc/source/ui/vba/vbaeventshelper.cxx index 3be028a316f0..dbaf016c7978 100644 --- a/sc/source/ui/vba/vbaeventshelper.cxx +++ b/sc/source/ui/vba/vbaeventshelper.cxx @@ -660,11 +660,11 @@ bool ScVbaEventsHelper::implPrepareEvent( EventQueue& rEventQueue, case WORKBOOK_OPEN: { // execute delayed Activate event too (see above) - rEventQueue.push_back( WORKBOOK_ACTIVATE ); + rEventQueue.emplace_back(WORKBOOK_ACTIVATE ); uno::Sequence< uno::Any > aArgs( 1 ); aArgs[ 0 ] <<= mxModel->getCurrentController(); - rEventQueue.push_back( EventQueueEntry( WORKBOOK_WINDOWACTIVATE, aArgs ) ); - rEventQueue.push_back( AUTO_OPEN ); + rEventQueue.emplace_back( WORKBOOK_WINDOWACTIVATE, aArgs ); + rEventQueue.emplace_back(AUTO_OPEN ); // remember initial selection maOldSelection <<= mxModel->getCurrentSelection(); } @@ -680,7 +680,7 @@ bool ScVbaEventsHelper::implPrepareEvent( EventQueue& rEventQueue, // add workbook event associated to a sheet event bool bSheetEvent = false; if( (rInfo.maUserData >>= bSheetEvent) && bSheetEvent ) - rEventQueue.push_back( EventQueueEntry( rInfo.mnEventId + USERDEFINED_START, rArgs ) ); + rEventQueue.emplace_back( rInfo.mnEventId + USERDEFINED_START, rArgs ); } return bExecuteEvent; @@ -792,7 +792,7 @@ void ScVbaEventsHelper::implPostProcessEvent( EventQueue& rEventQueue, /* Execute Auto_Close only if not cancelled by event handler, but before UI asks user whether to cancel closing the document. */ if( !bCancel ) - rEventQueue.push_back( AUTO_CLOSE ); + rEventQueue.emplace_back(AUTO_CLOSE ); break; } } diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index 7a39865446c1..756b7cc6be6c 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -658,7 +658,7 @@ class CellsEnumeration : public CellsEnumeration_BASE for ( sal_Int32 i=0; i<nRowCount; ++i ) { for ( sal_Int32 j=0; j<nColCount; ++j ) - m_CellPositions.push_back( CellPos( i,j,nVBAIndex ) ); + m_CellPositions.emplace_back( i,j,nVBAIndex ); } } public: diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index 7d6b9fcb7858..8b6233ba0083 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -542,7 +542,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) } else { - aRanges.push_back(sc::ColRowSpan(nRow, nRow)); + aRanges.emplace_back(nRow, nRow); } pTabViewShell->SetWidthOrHeight(false, aRanges, SC_SIZE_DIRECT, HMMToTwips(nHeight)); @@ -648,7 +648,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) } else { - aRanges.push_back(sc::ColRowSpan(nColumn, nColumn)); + aRanges.emplace_back(nColumn, nColumn); } pTabViewShell->SetWidthOrHeight(true, aRanges, SC_SIZE_DIRECT, HMMToTwips(nWidth)); diff --git a/sc/source/ui/view/colrowba.cxx b/sc/source/ui/view/colrowba.cxx index 45b4aa855375..f650ffbb3e52 100644 --- a/sc/source/ui/view/colrowba.cxx +++ b/sc/source/ui/view/colrowba.cxx @@ -116,7 +116,7 @@ void ScColBar::SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewSize ) ++nEnd; if (!rMark.IsColumnMarked(nEnd)) --nEnd; - aRanges.push_back(sc::ColRowSpan(nStart,nEnd)); + aRanges.emplace_back(nStart,nEnd); nStart = nEnd+1; } else @@ -125,7 +125,7 @@ void ScColBar::SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewSize ) } else { - aRanges.push_back(sc::ColRowSpan(nPos,nPos)); + aRanges.emplace_back(nPos,nPos); } rViewData.GetView()->SetWidthOrHeight(true, aRanges, eMode, nSizeTwips); @@ -275,7 +275,7 @@ void ScRowBar::SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewSize ) ++nEnd; if (!rMark.IsRowMarked(nEnd)) --nEnd; - aRanges.push_back(sc::ColRowSpan(nStart,nEnd)); + aRanges.emplace_back(nStart,nEnd); nStart = nEnd+1; } else @@ -284,7 +284,7 @@ void ScRowBar::SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewSize ) } else { - aRanges.push_back(sc::ColRowSpan(nPos,nPos)); + aRanges.emplace_back(nPos,nPos); } rViewData.GetView()->SetWidthOrHeight(false, aRanges, eMode, nSizeTwips); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 683a9ec915ed..c885935b69ec 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -6157,24 +6157,24 @@ void ScGridWindow::UpdateDragRectOverlay() if ( meDragInsertMode == INS_CELLSDOWN ) { - aPixelRects.push_back( tools::Rectangle( aRect.Left()+1, aRect.Top()+3, aRect.Left()+1, aRect.Bottom()-2 ) ); - aPixelRects.push_back( tools::Rectangle( aRect.Right()-1, aRect.Top()+3, aRect.Right()-1, aRect.Bottom()-2 ) ); - aPixelRects.push_back( tools::Rectangle( aRect.Left()+1, aRect.Top(), aRect.Right()-1, aRect.Top()+2 ) ); - aPixelRects.push_back( tools::Rectangle( aRect.Left()+1, aRect.Bottom()-1, aRect.Right()-1, aRect.Bottom()-1 ) ); + aPixelRects.emplace_back( aRect.Left()+1, aRect.Top()+3, aRect.Left()+1, aRect.Bottom()-2 ); + aPixelRects.emplace_back( aRect.Right()-1, aRect.Top()+3, aRect.Right()-1, aRect.Bottom()-2 ); + aPixelRects.emplace_back( aRect.Left()+1, aRect.Top(), aRect.Right()-1, aRect.Top()+2 ); + aPixelRects.emplace_back( aRect.Left()+1, aRect.Bottom()-1, aRect.Right()-1, aRect.Bottom()-1 ); } else if ( meDragInsertMode == INS_CELLSRIGHT ) { - aPixelRects.push_back( tools::Rectangle( aRect.Left(), aRect.Top()+1, aRect.Left()+2, aRect.Bottom()-1 ) ); - aPixelRects.push_back( tools::Rectangle( aRect.Right()-1, aRect.Top()+1, aRect.Right()-1, aRect.Bottom()-1 ) ); - aPixelRects.push_back( tools::Rectangle( aRect.Left()+3, aRect.Top()+1, aRect.Right()-2, aRect.Top()+1 ) ); - aPixelRects.push_back( tools::Rectangle( aRect.Left()+3, aRect.Bottom()-1, aRect.Right()-2, aRect.Bottom()-1 ) ); + aPixelRects.emplace_back( aRect.Left(), aRect.Top()+1, aRect.Left()+2, aRect.Bottom()-1 ); + aPixelRects.emplace_back( aRect.Right()-1, aRect.Top()+1, aRect.Right()-1, aRect.Bottom()-1 ); + aPixelRects.emplace_back( aRect.Left()+3, aRect.Top()+1, aRect.Right()-2, aRect.Top()+1 ); + aPixelRects.emplace_back( aRect.Left()+3, aRect.Bottom()-1, aRect.Right()-2, aRect.Bottom()-1 ); } else { - aPixelRects.push_back( tools::Rectangle( aRect.Left(), aRect.Top(), aRect.Left()+2, aRect.Bottom() ) ); - aPixelRects.push_back( tools::Rectangle( aRect.Right()-2, aRect.Top(), aRect.Right(), aRect.Bottom() ) ); - aPixelRects.push_back( tools::Rectangle( aRect.Left()+3, aRect.Top(), aRect.Right()-3, aRect.Top()+2 ) ); - aPixelRects.push_back( tools::Rectangle( aRect.Left()+3, aRect.Bottom()-2, aRect.Right()-3, aRect.Bottom() ) ); + aPixelRects.emplace_back( aRect.Left(), aRect.Top(), aRect.Left()+2, aRect.Bottom() ); + aPixelRects.emplace_back( aRect.Right()-2, aRect.Top(), aRect.Right(), aRect.Bottom() ); + aPixelRects.emplace_back( aRect.Left()+3, aRect.Top(), aRect.Right()-3, aRect.Top()+2 ); + aPixelRects.emplace_back( aRect.Left()+3, aRect.Bottom()-2, aRect.Right()-3, aRect.Bottom() ); } // #i70788# get the OverlayManager safely diff --git a/sc/source/ui/view/pfuncache.cxx b/sc/source/ui/view/pfuncache.cxx index c73a1df51436..93a22a056c0e 100644 --- a/sc/source/ui/view/pfuncache.cxx +++ b/sc/source/ui/view/pfuncache.cxx @@ -118,7 +118,7 @@ void ScPrintFuncCache::InitLocations( const ScMarkData& rMark, OutputDevice* pDe ScRange aCellRange; tools::Rectangle aPixRect; if ( aLocData.GetMainCellRange( aCellRange, aPixRect ) ) - aLocations.push_back( ScPrintPageLocation( nRenderer, aCellRange, aPixRect ) ); + aLocations.emplace_back( nRenderer, aCellRange, aPixRect ); ++nRenderer; } diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 8305df3b532c..3442c54618dc 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -2521,7 +2521,7 @@ long ScPrintFunc::CountNotePages() for ( SCROW nRow = nStartRow; nRow <= nEndRow; ++nRow ) { if ( pDoc->HasNote(nCol, nRow, nPrintTab) ) - aNotePosList.push_back( ScAddress( nCol, nRow, nPrintTab ) ); + aNotePosList.emplace_back( nCol, nRow, nPrintTab ); } } } diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index ae53dd3d321a..b216b38c584e 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -2443,7 +2443,7 @@ void ScTabView::PaintRangeFinder( long nNumber ) void ScTabView::AddHighlightRange( const ScRange& rRange, const Color& rColor ) { - maHighlightRanges.push_back( ScHighlightEntry( rRange, rColor ) ); + maHighlightRanges.emplace_back( rRange, rColor ); SCTAB nTab = aViewData.GetTabNo(); if ( nTab >= rRange.aStart.Tab() && nTab <= rRange.aEnd.Tab() ) diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index fc53751f31a6..0e5dc1edbcf0 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -111,7 +111,7 @@ bool ScViewFunc::AdjustBlockHeight( bool bPaint, ScMarkData* pMarkData ) if (aMarkedRows.empty()) { SCROW nCurRow = GetViewData().GetCurY(); - aMarkedRows.push_back(sc::ColRowSpan(nCurRow, nCurRow)); + aMarkedRows.emplace_back(nCurRow, nCurRow); } double nPPTX = GetViewData().GetPPTX(); diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx index 2b545ce6d2a9..411a7979ee78 100644 --- a/sc/source/ui/view/viewfun5.cxx +++ b/sc/source/ui/view/viewfun5.cxx @@ -681,7 +681,7 @@ bool ScViewFunc::PasteLink( const uno::Reference<datatransfer::XTransferable>& r if (*p == '\0') { sal_Int32 nLen = i - nStart; - aStrs.push_back(OUString(pStart, nLen, eSysEnc)); + aStrs.emplace_back(pStart, nLen, eSysEnc); nStart = ++i; pStart = ++p; } diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 0195b22e2540..3a33dcb514d7 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1611,7 +1611,7 @@ void ScViewFunc::DeleteMulti( bool bRows ) if (aSpans.empty()) { SCCOLROW nCurPos = bRows ? GetViewData().GetCurY() : GetViewData().GetCurX(); - aSpans.push_back(sc::ColRowSpan(nCurPos, nCurPos)); + aSpans.emplace_back(nCurPos, nCurPos); } // test if allowed diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx index 9ae8dc0cf223..76dfebcbe5ab 100644 --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx @@ -565,9 +565,8 @@ void ScXMLSourceDlg::OkPressed() OUString aPath = getXPath(*mpLbTree, rEntry, aParam.maNamespaces); const ScOrcusXMLTreeParam::EntryData* pUserData = ScOrcusXMLTreeParam::getUserData(rEntry); - aParam.maCellLinks.push_back( - ScOrcusImportXMLParam::CellLink( - pUserData->maLinkedPos, OUStringToOString(aPath, RTL_TEXTENCODING_UTF8))); + aParam.maCellLinks.emplace_back( + pUserData->maLinkedPos, OUStringToOString(aPath, RTL_TEXTENCODING_UTF8)); } } |