diff options
Diffstat (limited to 'sc/source/ui')
35 files changed, 90 insertions, 98 deletions
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)); } } |