diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-13 14:56:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-14 08:28:31 +0200 |
commit | b0b0aef18fff981fa1f4a1539c150260cc526595 (patch) | |
tree | 5ca719fbb17aa857d132f2d97becfa0ac95b34c2 /sw | |
parent | a4fb52ac0f48b10b72be330fe49d99a9a2471751 (diff) |
clang-tidy modernize-use-emplace in sw
Change-Id: I92fd035824f247dc61edfb18c54b960a7733fdf7
Reviewed-on: https://gerrit.libreoffice.org/42244
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
59 files changed, 165 insertions, 168 deletions
diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx index 60b5c0bd9011..d7413f33a68a 100644 --- a/sw/qa/extras/mailmerge/mailmerge.cxx +++ b/sw/qa/extras/mailmerge/mailmerge.cxx @@ -147,36 +147,36 @@ public: mMMargs.reserve( 15 ); - mMMargs.push_back( beans::NamedValue( UNO_NAME_OUTPUT_TYPE, uno::Any( file ? text::MailMergeType::FILE : text::MailMergeType::SHELL ) ) ); - mMMargs.push_back( beans::NamedValue( UNO_NAME_DOCUMENT_URL, uno::Any( - ( OUString( m_directories.getURLFromSrc(mpTestDocumentPath) + OUString::createFromAscii(filename)) ) ) ) ); - mMMargs.push_back( beans::NamedValue( UNO_NAME_DATA_SOURCE_NAME, uno::Any( aDBName ) ) ); - mMMargs.push_back( beans::NamedValue( UNO_NAME_OUTPUT_URL, uno::Any( aWorkDir ) ) ); + mMMargs.emplace_back( UNO_NAME_OUTPUT_TYPE, uno::Any( file ? text::MailMergeType::FILE : text::MailMergeType::SHELL ) ); + mMMargs.emplace_back( UNO_NAME_DOCUMENT_URL, uno::Any( + ( OUString( m_directories.getURLFromSrc(mpTestDocumentPath) + OUString::createFromAscii(filename)) ) ) ); + mMMargs.emplace_back( UNO_NAME_DATA_SOURCE_NAME, uno::Any( aDBName ) ); + mMMargs.emplace_back( UNO_NAME_OUTPUT_URL, uno::Any( aWorkDir ) ); if (file) - mMMargs.push_back( beans::NamedValue( UNO_NAME_FILE_NAME_PREFIX, uno::Any( aPrefix )) ); + mMMargs.emplace_back( UNO_NAME_FILE_NAME_PREFIX, uno::Any( aPrefix ) ); if (bPrefixIsColumn) - mMMargs.push_back( beans::NamedValue( UNO_NAME_FILE_NAME_FROM_COLUMN, uno::Any( true ) ) ); + mMMargs.emplace_back( UNO_NAME_FILE_NAME_FROM_COLUMN, uno::Any( true ) ); if (tablename) { - mMMargs.push_back( beans::NamedValue( UNO_NAME_DAD_COMMAND_TYPE, uno::Any( sdb::CommandType::TABLE ) ) ); - mMMargs.push_back( beans::NamedValue( UNO_NAME_DAD_COMMAND, uno::Any( OUString::createFromAscii(tablename) ) ) ); + mMMargs.emplace_back( UNO_NAME_DAD_COMMAND_TYPE, uno::Any( sdb::CommandType::TABLE ) ); + mMMargs.emplace_back( UNO_NAME_DAD_COMMAND, uno::Any( OUString::createFromAscii(tablename) ) ); } if (nDataSets > 0) { mxCurResultSet = getXResultFromDataset( tablename, aDBName ); uno::Reference< sdbcx::XRowLocate > xCurRowLocate( mxCurResultSet, uno::UNO_QUERY ); - mMMargs.push_back( beans::NamedValue( UNO_NAME_RESULT_SET, uno::Any( mxCurResultSet ) ) ); + mMMargs.emplace_back( UNO_NAME_RESULT_SET, uno::Any( mxCurResultSet ) ); std::vector< uno::Any > vResult; vResult.reserve( nDataSets ); sal_Int32 i; for (i = 0, mxCurResultSet->first(); i < nDataSets; i++, mxCurResultSet->next()) { - vResult.push_back( uno::Any( xCurRowLocate->getBookmark() ) ); + vResult.emplace_back( xCurRowLocate->getBookmark() ); } - mMMargs.push_back( beans::NamedValue( UNO_NAME_SELECTION, uno::Any( comphelper::containerToSequence(vResult) ) ) ); + mMMargs.emplace_back( UNO_NAME_SELECTION, uno::Any( comphelper::containerToSequence(vResult) ) ); } } @@ -652,7 +652,7 @@ DECLARE_FILE_MAILMERGE_TEST(testTdf102010, "empty.odt", "10-testing-addresses.od ++aNamedValueIter; } } - mMMargs.push_back( beans::NamedValue( UNO_NAME_SAVE_AS_SINGLE_FILE, uno::Any( true ) ) ); + mMMargs.emplace_back( UNO_NAME_SAVE_AS_SINGLE_FILE, uno::Any( true ) ); // Generate correct mail merge result filename executeMailMerge(); diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index b83881d0d1da..b7eb3393fc61 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -238,7 +238,7 @@ void SwTiledRenderingTest::callbackImpl(int nType, const char* pPayload) boost::property_tree::read_json(aStream, aTree); for (boost::property_tree::ptree::value_type& rValue : aTree.get_child("searchResultSelection")) { - m_aSearchResultSelection.push_back(rValue.second.get<std::string>("rectangles").c_str()); + m_aSearchResultSelection.emplace_back(rValue.second.get<std::string>("rectangles").c_str()); m_aSearchResultPart.push_back(std::atoi(rValue.second.get<std::string>("part").c_str())); } } diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index c3ef16b82558..4e3a437d104c 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -3908,29 +3908,29 @@ class PortionHandler : public SwPortionHandler virtual void Text(sal_Int32 nLength, sal_uInt16 nType, sal_Int32 /*nHeight*/, sal_Int32 /*nWidth*/) override { - mPortionItems.push_back(PortionItem("text", nLength, nType)); + mPortionItems.emplace_back("text", nLength, nType); } virtual void Special(sal_Int32 nLength, const OUString & /*rText*/, sal_uInt16 nType, sal_Int32 /*nHeight*/, sal_Int32 /*nWidth*/, const SwFont* /*pFont*/) override { - mPortionItems.push_back(PortionItem("special", nLength, nType)); + mPortionItems.emplace_back("special", nLength, nType); } virtual void LineBreak(sal_Int32 /*nWidth*/) override { - mPortionItems.push_back(PortionItem("line_break")); + mPortionItems.emplace_back("line_break"); } virtual void Skip(sal_Int32 nLength) override { - mPortionItems.push_back(PortionItem("skip", nLength)); + mPortionItems.emplace_back("skip", nLength); } virtual void Finish() override { - mPortionItems.push_back(PortionItem("finish")); + mPortionItems.emplace_back("finish"); } }; diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx index 37085ae95b69..699114cf30c9 100644 --- a/sw/source/core/access/accportions.cxx +++ b/sw/source/core/access/accportions.cxx @@ -162,7 +162,7 @@ void SwAccessiblePortionData::Special( sDisplay = rText; sal_Int32 nStart=m_aBuffer.getLength(); sal_Int32 nEnd=nStart + rText.getLength(); - m_vecPairPos.push_back(std::make_pair(nStart,nEnd)); + m_vecPairPos.emplace_back(nStart,nEnd); break; } break; diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx index 7baa336775d8..9b37eed98294 100644 --- a/sw/source/core/access/acctable.cxx +++ b/sw/source/core/access/acctable.cxx @@ -1734,11 +1734,11 @@ void SwAccessibleTable::AddSelectionCell( uno::Reference<XAccessible> const xTmp(pAccCell); if (bAddOrRemove) { - m_vecCellAdd.push_back(std::make_pair(pAccCell, xTmp)); + m_vecCellAdd.emplace_back(pAccCell, xTmp); } else { - m_vecCellRemove.push_back(std::make_pair(pAccCell, xTmp)); + m_vecCellRemove.emplace_back(pAccCell, xTmp); } } diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 937047665e4b..c23a92912bfa 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -340,9 +340,9 @@ void SwSelPaintRects::Show(std::vector<OString>* pSelectionRectangles) const SwRect aNextRect((*this)[a]); const tools::Rectangle aPntRect(aNextRect.SVRect()); - aNewRanges.push_back(basegfx::B2DRange( + aNewRanges.emplace_back( aPntRect.Left(), aPntRect.Top(), - aPntRect.Right() + 1, aPntRect.Bottom() + 1)); + aPntRect.Right() + 1, aPntRect.Bottom() + 1); } if (m_pCursorOverlay) @@ -453,9 +453,9 @@ void SwSelPaintRects::HighlightInputField() { const tools::Rectangle aPntRect(rNextRect.SVRect()); - aInputFieldRanges.push_back(basegfx::B2DRange( + aInputFieldRanges.emplace_back( aPntRect.Left(), aPntRect.Top(), - aPntRect.Right() + 1, aPntRect.Bottom() + 1)); + aPntRect.Right() + 1, aPntRect.Bottom() + 1); } } } diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 45d192443d66..ff1e4586d0df 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -715,7 +715,7 @@ namespace } // save the current redline - rArr.push_back(SaveRedline( pCurrent, *pStart )); + rArr.emplace_back( pCurrent, *pStart ); } } @@ -771,7 +771,7 @@ namespace pTmpPos->nContent.Assign( pTmpPos->nNode.GetNode().GetContentNode(), 0 ); - rArr.push_back(SaveRedline(pNewRedl, rRg.aStart)); + rArr.emplace_back(pNewRedl, rRg.aStart); pTmpPos = pTmp->End(); pTmpPos->nNode = rRg.aEnd; @@ -793,7 +793,7 @@ namespace ( pREnd->nNode == rRg.aEnd && !pREnd->nContent.GetIndex()) ) { // move everything - rArr.push_back(SaveRedline( pTmp, rRg.aStart )); + rArr.emplace_back( pTmp, rRg.aStart ); } else { @@ -804,7 +804,7 @@ namespace pTmpPos->nContent.Assign( pTmpPos->nNode.GetNode().GetContentNode(), 0 ); - rArr.push_back(SaveRedline( pNewRedl, rRg.aStart )); + rArr.emplace_back( pNewRedl, rRg.aStart ); pTmpPos = pTmp->Start(); pTmpPos->nNode = rRg.aEnd; diff --git a/sw/source/core/doc/SwStyleNameMapper.cxx b/sw/source/core/doc/SwStyleNameMapper.cxx index 53ee718715d0..9b71bdd514b2 100644 --- a/sw/source/core/doc/SwStyleNameMapper.cxx +++ b/sw/source/core/doc/SwStyleNameMapper.cxx @@ -432,49 +432,49 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag case SwGetPoolIdFromName::TxtColl: { pHashPointer = bProgName ? &s_pParaProgMap : &s_pParaUIMap; - vIndexes.push_back( std::make_tuple(RES_POOLCOLL_TEXT_BEGIN, RES_POOLCOLL_TEXT_END, bProgName ? &GetTextProgNameArray : &GetTextUINameArray) ); - vIndexes.push_back( std::make_tuple(RES_POOLCOLL_LISTS_BEGIN, RES_POOLCOLL_LISTS_END, bProgName ? &GetListsProgNameArray : &GetListsUINameArray) ); - vIndexes.push_back( std::make_tuple(RES_POOLCOLL_EXTRA_BEGIN, RES_POOLCOLL_EXTRA_END, bProgName ? &GetExtraProgNameArray : &GetExtraUINameArray) ); - vIndexes.push_back( std::make_tuple(RES_POOLCOLL_REGISTER_BEGIN, RES_POOLCOLL_REGISTER_END, bProgName ? &GetRegisterProgNameArray : &GetRegisterUINameArray) ); - vIndexes.push_back( std::make_tuple(RES_POOLCOLL_DOC_BEGIN, RES_POOLCOLL_DOC_END, bProgName ? &GetDocProgNameArray : &GetDocUINameArray) ); - vIndexes.push_back( std::make_tuple(RES_POOLCOLL_HTML_BEGIN, RES_POOLCOLL_HTML_END, bProgName ? &GetHTMLProgNameArray : &GetHTMLUINameArray) ); + vIndexes.emplace_back(RES_POOLCOLL_TEXT_BEGIN, RES_POOLCOLL_TEXT_END, bProgName ? &GetTextProgNameArray : &GetTextUINameArray ); + vIndexes.emplace_back(RES_POOLCOLL_LISTS_BEGIN, RES_POOLCOLL_LISTS_END, bProgName ? &GetListsProgNameArray : &GetListsUINameArray ); + vIndexes.emplace_back(RES_POOLCOLL_EXTRA_BEGIN, RES_POOLCOLL_EXTRA_END, bProgName ? &GetExtraProgNameArray : &GetExtraUINameArray ); + vIndexes.emplace_back(RES_POOLCOLL_REGISTER_BEGIN, RES_POOLCOLL_REGISTER_END, bProgName ? &GetRegisterProgNameArray : &GetRegisterUINameArray ); + vIndexes.emplace_back(RES_POOLCOLL_DOC_BEGIN, RES_POOLCOLL_DOC_END, bProgName ? &GetDocProgNameArray : &GetDocUINameArray ); + vIndexes.emplace_back(RES_POOLCOLL_HTML_BEGIN, RES_POOLCOLL_HTML_END, bProgName ? &GetHTMLProgNameArray : &GetHTMLUINameArray ); } break; case SwGetPoolIdFromName::ChrFmt: { pHashPointer = bProgName ? &s_pCharProgMap : &s_pCharUIMap; - vIndexes.push_back( std::make_tuple(RES_POOLCHR_NORMAL_BEGIN, RES_POOLCHR_NORMAL_END, bProgName ? &GetChrFormatProgNameArray : &GetChrFormatUINameArray) ); - vIndexes.push_back( std::make_tuple(RES_POOLCHR_HTML_BEGIN, RES_POOLCHR_HTML_END, bProgName ? &GetHTMLChrFormatProgNameArray : &GetHTMLChrFormatUINameArray) ); + vIndexes.emplace_back(RES_POOLCHR_NORMAL_BEGIN, RES_POOLCHR_NORMAL_END, bProgName ? &GetChrFormatProgNameArray : &GetChrFormatUINameArray ); + vIndexes.emplace_back(RES_POOLCHR_HTML_BEGIN, RES_POOLCHR_HTML_END, bProgName ? &GetHTMLChrFormatProgNameArray : &GetHTMLChrFormatUINameArray ); } break; case SwGetPoolIdFromName::FrmFmt: { pHashPointer = bProgName ? &s_pFrameProgMap : &s_pFrameUIMap; - vIndexes.push_back( std::make_tuple(RES_POOLFRM_BEGIN, RES_POOLFRM_END, bProgName ? &GetFrameFormatProgNameArray : &GetFrameFormatUINameArray) ); + vIndexes.emplace_back(RES_POOLFRM_BEGIN, RES_POOLFRM_END, bProgName ? &GetFrameFormatProgNameArray : &GetFrameFormatUINameArray ); } break; case SwGetPoolIdFromName::PageDesc: { pHashPointer = bProgName ? &s_pPageProgMap : &s_pPageUIMap; - vIndexes.push_back( std::make_tuple(RES_POOLPAGE_BEGIN, RES_POOLPAGE_END, bProgName ? &GetPageDescProgNameArray : &GetPageDescUINameArray) ); + vIndexes.emplace_back(RES_POOLPAGE_BEGIN, RES_POOLPAGE_END, bProgName ? &GetPageDescProgNameArray : &GetPageDescUINameArray ); } break; case SwGetPoolIdFromName::NumRule: { pHashPointer = bProgName ? &s_pNumRuleProgMap : &s_pNumRuleUIMap; - vIndexes.push_back( std::make_tuple(RES_POOLNUMRULE_BEGIN, RES_POOLNUMRULE_END, bProgName ? &GetNumRuleProgNameArray : &GetNumRuleUINameArray) ); + vIndexes.emplace_back(RES_POOLNUMRULE_BEGIN, RES_POOLNUMRULE_END, bProgName ? &GetNumRuleProgNameArray : &GetNumRuleUINameArray ); } break; case SwGetPoolIdFromName::TabStyle: { pHashPointer = bProgName ? &s_pTableStyleProgMap : &s_pTableStyleUIMap; - vIndexes.push_back( std::make_tuple(RES_POOLTABSTYLE_BEGIN, RES_POOLTABSTYLE_END, bProgName ? &GetTableStyleProgNameArray : &GetTableStyleUINameArray) ); + vIndexes.emplace_back(RES_POOLTABSTYLE_BEGIN, RES_POOLTABSTYLE_END, bProgName ? &GetTableStyleProgNameArray : &GetTableStyleUINameArray ); } break; case SwGetPoolIdFromName::CellStyle: { pHashPointer = bProgName ? &s_pCellStyleProgMap : &s_pCellStyleUIMap; - vIndexes.push_back( std::make_tuple(RES_POOLCELLSTYLE_BEGIN, RES_POOLCELLSTYLE_END, bProgName ? &GetCellStyleProgNameArray : &GetCellStyleUINameArray) ); + vIndexes.emplace_back(RES_POOLCELLSTYLE_BEGIN, RES_POOLCELLSTYLE_END, bProgName ? &GetCellStyleProgNameArray : &GetCellStyleUINameArray ); } break; default: diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx index 27addb54bed4..32afddc0769a 100644 --- a/sw/source/core/doc/acmplwrd.cxx +++ b/sw/source/core/doc/acmplwrd.cxx @@ -161,7 +161,7 @@ void SwAutoCompleteWord_Impl::AddDocument(SwDoc& rDoc) if(&aIt->GetDoc() == &rDoc) return; } - aClientVector.push_back(SwAutoCompleteClient(rAutoCompleteWord, rDoc)); + aClientVector.emplace_back(rAutoCompleteWord, rDoc); } void SwAutoCompleteWord_Impl::RemoveDocument(const SwDoc& rDoc) diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index c159ed9eacd7..a8216e67b53a 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1038,7 +1038,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting( pStPage = pNxtPage; } - rPagePairs.push_back( std::pair< sal_Int32, sal_Int32 >(nFirst, nSecond) ); + rPagePairs.emplace_back(nFirst, nSecond ); nSPg = nSPg + nStep; nEPg = nEPg - nStep; diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 3dec191cc6c8..85554d3baee2 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -761,7 +761,7 @@ namespace sw { namespace mark { pSaveBkmk->push_back( SaveBookmark( *pMark, rStt, pSttIdx ) ); } - vMarksToDelete.push_back(ppMark); + vMarksToDelete.emplace_back(ppMark); } else { diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index 1acbe7a9f306..819ebbdb4cbe 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -1773,8 +1773,8 @@ namespace { Comparators aComparisons; //compare main text - aComparisons.push_back(CompareDataPtrPair(CompareDataPtr(new CompareMainText(rSrcDoc)), - CompareDataPtr(new CompareMainText(rDestDoc)))); + aComparisons.emplace_back(CompareDataPtr(new CompareMainText(rSrcDoc)), + CompareDataPtr(new CompareMainText(rDestDoc))); //if we have the same number of frames then try to compare within them const SwFrameFormats *pSrcFrameFormats = rSrcDoc.GetSpzFrameFormats(); @@ -1797,8 +1797,8 @@ namespace continue; if (!pSrcNode || !pDestNode) break; - aComparisons.push_back(CompareDataPtrPair(CompareDataPtr(new CompareFrameFormatText(rSrcDoc, *pSrcIdx)), - CompareDataPtr(new CompareFrameFormatText(rDestDoc, *pDestIdx)))); + aComparisons.emplace_back(CompareDataPtr(new CompareFrameFormatText(rSrcDoc, *pSrcIdx)), + CompareDataPtr(new CompareFrameFormatText(rDestDoc, *pDestIdx))); } } return aComparisons; @@ -2093,7 +2093,7 @@ long SwDoc::MergeDoc( const SwDoc& rDoc ) // Found the position. // Then we also have to insert the redline to the line in the DestDoc. - vRedlines.push_back(SaveMergeRedline(*pDstNd, *pRedl)); + vRedlines.emplace_back(*pDstNd, *pRedl); } } diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index 6f518258b588..037e420620df 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -346,7 +346,7 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView ) // #i36010# - set layout direction of the position pFormat->SetPositionLayoutDir( text::PositionLayoutDir::PositionInLayoutDirOfAnchor ); - pFormatsAndObjs[i].push_back( std::pair< SwDrawFrameFormat*, SdrObject* >( pFormat, pSubObj ) ); + pFormatsAndObjs[i].emplace_back( pFormat, pSubObj ); if( bUndo ) pUndo->AddObj( static_cast<sal_uInt16>(i2), pFormat ); diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index fa9eb822b10e..dcbc666ccfde 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -501,7 +501,7 @@ void SwDoc::GetAllDBNames( std::vector<OUString>& rAllDBNames ) const SwDSParams_t& rArr = pMgr->GetDSParamArray(); for (const auto& pParam : rArr) { - rAllDBNames.push_back(pParam->sDataSource + OUStringLiteral1(DB_DELIM) + pParam->sCommand); + rAllDBNames.emplace_back(pParam->sDataSource + OUStringLiteral1(DB_DELIM) + pParam->sCommand); } #endif } @@ -529,7 +529,7 @@ std::vector<OUString>& SwDoc::FindUsedDBs( const std::vector<OUString>& rAllDBNa const sal_Int32 nEndPos = sFormula.indexOf('.', nPos); if( nEndPos>=0 ) { - rUsedDBNames.push_back(sItem + OUStringLiteral1(DB_DELIM) + sFormula.copy( nPos, nEndPos - nPos )); + rUsedDBNames.emplace_back(sItem + OUStringLiteral1(DB_DELIM) + sFormula.copy( nPos, nEndPos - nPos )); } } } diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx index 86a348f34612..d479b1ea6b1e 100644 --- a/sw/source/core/doc/tblafmt.cxx +++ b/sw/source/core/doc/tblafmt.cxx @@ -1448,7 +1448,7 @@ SwCellStyleDescriptor SwCellStyleTable::operator[](size_t i) const void SwCellStyleTable::AddBoxFormat(const SwBoxAutoFormat& rBoxFormat, const OUString& sName) { - m_aCellStyles.push_back(std::make_pair(sName, new SwBoxAutoFormat(rBoxFormat))); + m_aCellStyles.emplace_back(sName, new SwBoxAutoFormat(rBoxFormat)); } void SwCellStyleTable::RemoveBoxFormat(const OUString& sName) diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx index 737c8cd9abaa..d55a529881ce 100644 --- a/sw/source/core/docnode/ndcopy.cxx +++ b/sw/source/core/docnode/ndcopy.cxx @@ -169,7 +169,7 @@ static void lcl_CopyTableBox( SwTableBox* pBox, CopyTable* pCT ) } } - pCT->m_rMapArr.push_back(MapTableFrameFormat(pBox->GetFrameFormat(), pBoxFormat)); + pCT->m_rMapArr.emplace_back(pBox->GetFrameFormat(), pBoxFormat); } sal_uInt16 nLines = pBox->GetTabLines().size(); @@ -212,7 +212,7 @@ static void lcl_CopyTableLine( const SwTableLine* pLine, CopyTable* pCT ) { pLineFormat = pCT->m_pDoc->MakeTableLineFormat(); pLineFormat->CopyAttrs( *pLine->GetFrameFormat() ); - pCT->m_rMapArr.push_back(MapTableFrameFormat(pLine->GetFrameFormat(), pLineFormat)); + pCT->m_rMapArr.emplace_back(pLine->GetFrameFormat(), pLineFormat); } SwTableLine* pNewLine = new SwTableLine(pLineFormat, pLine->GetTabBoxes().size(), pCT->m_pInsBox); diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx index 5e01ee4008a7..aad47d7f8b22 100644 --- a/sw/source/core/edit/edattr.cxx +++ b/sw/source/core/edit/edattr.cxx @@ -315,7 +315,7 @@ std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >> SwEditShell { pNewPaM = new SwPaM(*pNd, nStt, *pNd, nEnd); pItem = pTextNd->GetSwAttrSet().GetItem( nWhich ); - vItem.push_back( std::make_pair( pItem, std::unique_ptr<SwPaM>(pNewPaM) ) ); + vItem.emplace_back( pItem, std::unique_ptr<SwPaM>(pNewPaM) ); } if( !pTextNd->HasHints() ) @@ -360,7 +360,7 @@ std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >> SwEditShell else nStop = *pAttrEnd; pNewPaM = new SwPaM(*pNd, nStart, *pNd, nStop); - vItem.push_back( std::make_pair( pItem, std::unique_ptr<SwPaM>(pNewPaM) ) ); + vItem.emplace_back( pItem, std::unique_ptr<SwPaM>(pNewPaM) ); break; } pItem = aItemIter.NextItem(); @@ -370,7 +370,7 @@ std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >> SwEditShell { pNewPaM = new SwPaM(*pNd, nStt, *pNd, nEnd); pItem = pAutoSet->GetPool()->GetPoolDefaultItem( nWhich ); - vItem.push_back( std::make_pair( pItem, std::unique_ptr<SwPaM>(pNewPaM)) ); + vItem.emplace_back( pItem, std::unique_ptr<SwPaM>(pNewPaM) ); } } } diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 91ff4641b0d3..cb3cf89d0088 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -685,7 +685,7 @@ void SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr ) if( !sText.isEmpty() ) { - rArr.push_back(SwGetINetAttr(sText, rAttr)); + rArr.emplace_back(sText, rAttr); } } } diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index b81f04a952c2..0d8ffeba54c6 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -542,8 +542,7 @@ bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd ) rUnion.Top() <= nFrameBottom && nFrameBottom <= nUnionBottom+ nYFuzzy ) - aCellFrames.push_back( - Sort_CellFrame( *static_cast<const SwCellFrame*>(pCell)) ); + aCellFrames.emplace_back( *static_cast<const SwCellFrame*>(pCell) ); else { bValidChartSel = false; @@ -1918,7 +1917,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrame *pStart, if( aRectFnSet.GetWidth(aUnion) ) { - rUnions.push_back(SwSelUnion(aUnion, const_cast<SwTabFrame*>(pTable))); + rUnions.emplace_back(aUnion, const_cast<SwTabFrame*>(pTable)); } pTable = pTable->GetFollow(); diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index b10b65320bd9..9dfe0f870a2f 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -813,7 +813,7 @@ SwFormatCol::SwFormatCol( const SwFormatCol& rCpy ) m_aColumns.reserve(rCpy.GetNumCols()); for ( sal_uInt16 i = 0; i < rCpy.GetNumCols(); ++i ) { - m_aColumns.push_back( SwColumn(rCpy.GetColumns()[i]) ); + m_aColumns.emplace_back(rCpy.GetColumns()[i] ); } } @@ -834,7 +834,7 @@ SwFormatCol& SwFormatCol::operator=( const SwFormatCol& rCpy ) m_aColumns.clear(); for ( sal_uInt16 i = 0; i < rCpy.GetNumCols(); ++i ) { - m_aColumns.push_back( SwColumn(rCpy.GetColumns()[i]) ); + m_aColumns.emplace_back(rCpy.GetColumns()[i] ); } return *this; } @@ -939,7 +939,7 @@ void SwFormatCol::Init( sal_uInt16 nNumCols, sal_uInt16 nGutterWidth, sal_uInt16 m_aColumns.clear(); for ( sal_uInt16 i = 0; i < nNumCols; ++i ) { - m_aColumns.push_back( SwColumn() ); + m_aColumns.emplace_back( ); } m_bOrtho = true; m_nWidth = USHRT_MAX; diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx index 39cfc157aae7..21ab1ba8729e 100644 --- a/sw/source/core/layout/laycache.cxx +++ b/sw/source/core/layout/laycache.cxx @@ -132,7 +132,7 @@ bool SwLayCacheImpl::Read( SvStream& rStream ) sal_uInt16 nPgNum(0); aIo.GetStream().ReadUInt16( nPgNum ).ReadUInt32( nIndex ) .ReadInt32( nX ).ReadInt32( nY ).ReadInt32( nW ).ReadInt32( nH ); - m_FlyCache.push_back(SwFlyCache( nPgNum, nIndex, nX, nY, nW, nH )); + m_FlyCache.emplace_back( nPgNum, nIndex, nX, nY, nW, nH ); aIo.CloseRec(); break; } @@ -1045,7 +1045,7 @@ bool SwLayCacheIoImpl::OpenRec( sal_uInt8 cType ) sal_uInt32 nPos = pStream->Tell(); if( bWriteMode ) { - aRecords.push_back( RecTypeSize(cType, nPos) ); + aRecords.emplace_back(cType, nPos ); pStream->WriteUInt32( 0 ); } else @@ -1058,14 +1058,14 @@ bool SwLayCacheIoImpl::OpenRec( sal_uInt8 cType ) { OSL_ENSURE( nVal, "OpenRec: Record-Header is 0" ); OSL_ENSURE( cRecTyp == cType, "OpenRec: Wrong Record Type" ); - aRecords.push_back( RecTypeSize(0, pStream->Tell()) ); + aRecords.emplace_back(0, pStream->Tell() ); bRes = false; bError = true; } else { sal_uInt32 nSize = nVal >> 8; - aRecords.push_back( RecTypeSize(cRecTyp, nPos+nSize) ); + aRecords.emplace_back(cRecTyp, nPos+nSize ); } } return bRes; diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index fc1aed273e67..13813ccef2b4 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -742,7 +742,7 @@ void SwLineRects::AddLineRect( const SwRect &rRect, const Color *pCol, const Svx return; } } - aLineRects.push_back( SwLineRect( rRect, pCol, nStyle, pTab, nSCol ) ); + aLineRects.emplace_back( rRect, pCol, nStyle, pTab, nSCol ); } void SwLineRects::ConnectEdges( OutputDevice const *pOut, SwPaintProperties const & properties ) @@ -847,9 +847,9 @@ void SwLineRects::ConnectEdges( OutputDevice const *pOut, SwPaintProperties cons aIns.Bottom( pLA->Bottom() ); if ( !rL1.IsInside( aIns ) ) continue; - aLineRects.push_back( SwLineRect( aIns, &rL1.GetColor(), + aLineRects.emplace_back( aIns, &rL1.GetColor(), SvxBorderLineStyle::SOLID, - rL1.GetTab(), SubColFlags::Tab ) ); + rL1.GetTab(), SubColFlags::Tab ); if ( isFull() ) { --i; @@ -888,9 +888,9 @@ void SwLineRects::ConnectEdges( OutputDevice const *pOut, SwPaintProperties cons aIns.Right( pLA->Right() ); if ( !rL1.IsInside( aIns ) ) continue; - aLineRects.push_back( SwLineRect( aIns, &rL1.GetColor(), + aLineRects.emplace_back( aIns, &rL1.GetColor(), SvxBorderLineStyle::SOLID, - rL1.GetTab(), SubColFlags::Tab ) ); + rL1.GetTab(), SubColFlags::Tab ); if ( isFull() ) { --i; @@ -965,16 +965,16 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects, S { SwRect aNewSubsRect( aSubsLineRect ); aNewSubsRect.Bottom( nTmp ); - aLineRects.push_back( SwLineRect( aNewSubsRect, nullptr, aSubsLineRect.GetStyle(), nullptr, - aSubsLineRect.GetSubColor() ) ); + aLineRects.emplace_back( aNewSubsRect, nullptr, aSubsLineRect.GetStyle(), nullptr, + aSubsLineRect.GetSubColor() ); } nTmp = rLine.Bottom()+properties.nSPixelSzH+1; if ( aSubsLineRect.Bottom() > nTmp ) { SwRect aNewSubsRect( aSubsLineRect ); aNewSubsRect.Top( nTmp ); - aLineRects.push_back( SwLineRect( aNewSubsRect, nullptr, aSubsLineRect.GetStyle(), nullptr, - aSubsLineRect.GetSubColor() ) ); + aLineRects.emplace_back( aNewSubsRect, nullptr, aSubsLineRect.GetStyle(), nullptr, + aSubsLineRect.GetSubColor() ); } aLineRects.erase(aLineRects.begin() + i); --i; @@ -991,16 +991,16 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects, S { SwRect aNewSubsRect( aSubsLineRect ); aNewSubsRect.Right( nTmp ); - aLineRects.push_back( SwLineRect( aNewSubsRect, nullptr, aSubsLineRect.GetStyle(), nullptr, - aSubsLineRect.GetSubColor() ) ); + aLineRects.emplace_back( aNewSubsRect, nullptr, aSubsLineRect.GetStyle(), nullptr, + aSubsLineRect.GetSubColor() ); } nTmp = rLine.Right()+properties.nSPixelSzW+1; if ( aSubsLineRect.Right() > nTmp ) { SwRect aNewSubsRect( aSubsLineRect ); aNewSubsRect.Left( nTmp ); - aLineRects.push_back( SwLineRect( aNewSubsRect, nullptr, aSubsLineRect.GetStyle(), nullptr, - aSubsLineRect.GetSubColor() ) ); + aLineRects.emplace_back( aNewSubsRect, nullptr, aSubsLineRect.GetStyle(), nullptr, + aSubsLineRect.GetSubColor() ); } aLineRects.erase(aLineRects.begin() + i); --i; diff --git a/sw/source/core/text/noteurl.cxx b/sw/source/core/text/noteurl.cxx index a8c723cdd742..88458513dd0d 100644 --- a/sw/source/core/text/noteurl.cxx +++ b/sw/source/core/text/noteurl.cxx @@ -35,7 +35,7 @@ void SwNoteURL::InsertURLNote( const OUString& rURL, const OUString& rTarget, if (rRect == m_List[i].GetRect()) return; - m_List.push_back(SwURLNote(rURL, rTarget, rRect)); + m_List.emplace_back(rURL, rTarget, rRect); } void SwNoteURL::FillImageMap( ImageMap *pMap, const Point &rPos, diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 99069d1e1f77..3573398d42bf 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -865,7 +865,7 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& rNode, bool bRTL ) if ( nScript != nNextScript ) { - aScriptChanges.push_back( ScriptChangeInfo(nEnd, nScript) ); + aScriptChanges.emplace_back(nEnd, nScript ); nCnt++; nScript = nNextScript; } @@ -911,16 +911,16 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& rNode, bool bRTL ) if (nType == U_NON_SPACING_MARK || nType == U_ENCLOSING_MARK || nType == U_COMBINING_SPACING_MARK ) { - aScriptChanges.push_back( ScriptChangeInfo(nChg-1, nScript) ); + aScriptChanges.emplace_back(nChg-1, nScript ); } else { - aScriptChanges.push_back( ScriptChangeInfo(nChg, nScript) ); + aScriptChanges.emplace_back(nChg, nScript ); } } else { - aScriptChanges.push_back( ScriptChangeInfo(nChg, nScript) ); + aScriptChanges.emplace_back(nChg, nScript ); } ++nCnt; @@ -969,7 +969,7 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& rNode, bool bRTL ) if ( CharCompressType::PunctuationAndKana == aCompEnum || ePrevState != KANA ) { - aCompressionChanges.push_back( CompressionChangeInfo(nPrevChg, nLastCompression - nPrevChg, ePrevState) ); + aCompressionChanges.emplace_back(nPrevChg, nLastCompression - nPrevChg, ePrevState ); } } @@ -987,7 +987,7 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& rNode, bool bRTL ) if ( CharCompressType::PunctuationAndKana == aCompEnum || ePrevState != KANA ) { - aCompressionChanges.push_back( CompressionChangeInfo(nPrevChg, nLastCompression - nPrevChg, ePrevState) ); + aCompressionChanges.emplace_back(nPrevChg, nLastCompression - nPrevChg, ePrevState ); } } } @@ -1278,7 +1278,7 @@ void SwScriptInfo::UpdateBidiInfo( const OUString& rText ) for ( int nIdx = 0; nIdx < nCount; ++nIdx ) { ubidi_getLogicalRun( pBidi, nStart, &nEnd, &nCurrDir ); - aDirectionChanges.push_back( DirectionChangeInfo(nEnd, nCurrDir) ); + aDirectionChanges.emplace_back(nEnd, nCurrDir ); nStart = nEnd; } diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx index 844dce1e936a..ed4716579063 100644 --- a/sw/source/core/tox/tox.cxx +++ b/sw/source/core/tox/tox.cxx @@ -335,11 +335,11 @@ SwForm::SwForm( TOXTypes eTyp ) // #i21237# if (TOX_CONTENT == m_eType) { - aTokens.push_back(SwFormToken(TOKEN_ENTRY_NO)); - aTokens.push_back(SwFormToken(TOKEN_ENTRY_TEXT)); + aTokens.emplace_back(TOKEN_ENTRY_NO); + aTokens.emplace_back(TOKEN_ENTRY_TEXT); } else - aTokens.push_back(SwFormToken(TOKEN_ENTRY)); + aTokens.emplace_back(TOKEN_ENTRY); if (TOX_AUTHORITIES != m_eType) { @@ -351,11 +351,11 @@ SwForm::SwForm( TOXTypes eTyp ) // #i21237# aToken.eTabAlign = SvxTabAdjust::End; aTokens.push_back(aToken); - aTokens.push_back(SwFormToken(TOKEN_PAGE_NUMS)); + aTokens.emplace_back(TOKEN_PAGE_NUMS); } if (TOX_CONTENT == m_eType || TOX_ILLUSTRATIONS == m_eType) - aTokens.push_back(SwFormToken(TOKEN_LINK_END)); + aTokens.emplace_back(TOKEN_LINK_END); SetTemplate(0, SwResId(*pPoolId++)); diff --git a/sw/source/core/txtnode/modeltoviewhelper.cxx b/sw/source/core/txtnode/modeltoviewhelper.cxx index 496d92a54c1a..d6fe28b621c2 100644 --- a/sw/source/core/txtnode/modeltoviewhelper.cxx +++ b/sw/source/core/txtnode/modeltoviewhelper.cxx @@ -110,17 +110,17 @@ ModelToViewHelper::ModelToViewHelper(const SwTextNode &rNode, ExpandMode eMode) const sal_Int32 nShownLen = nShownEnd - nShownStart; if (nShownLen) - aBlocks.push_back(block(nShownStart, nShownLen, true)); + aBlocks.emplace_back(nShownStart, nShownLen, true); if (nHiddenLen) - aBlocks.push_back(block(nHiddenStart, nHiddenLen, false)); + aBlocks.emplace_back(nHiddenStart, nHiddenLen, false); nShownStart = nHiddenEnd; } sal_Int32 nTrailingShownLen = rNodeText.getLength() - nShownStart; if (nTrailingShownLen) - aBlocks.push_back(block(nShownStart, nTrailingShownLen, true)); + aBlocks.emplace_back(nShownStart, nTrailingShownLen, true); if (eMode & ExpandMode::ExpandFields || eMode & ExpandMode::ExpandFootnote) { @@ -217,7 +217,7 @@ ModelToViewHelper::ModelToViewHelper(const SwTextNode &rNode, ExpandMode eMode) { sal_Int32 const modelBlockPos(nBlockEnd); sal_Int32 const viewBlockPos(nBlockStart + nOffset); - m_aMap.push_back(ConversionMapEntry(modelBlockPos, viewBlockPos, false)); + m_aMap.emplace_back(modelBlockPos, viewBlockPos, false); m_aRetText = m_aRetText.replaceAt(nOffset + nBlockStart, nBlockLen, OUString()); nOffset -= nBlockLen; @@ -228,7 +228,7 @@ ModelToViewHelper::ModelToViewHelper(const SwTextNode &rNode, ExpandMode eMode) { sal_Int32 const modelFieldPos(j->m_nFieldPos); sal_Int32 const viewFieldPos(j->m_nFieldPos + nOffset); - m_aMap.push_back( ConversionMapEntry(modelFieldPos, viewFieldPos, true) ); + m_aMap.emplace_back(modelFieldPos, viewFieldPos, true ); m_aRetText = m_aRetText.replaceAt(viewFieldPos, 1, j->m_sExpand); nOffset += j->m_sExpand.getLength() - 1; @@ -248,7 +248,7 @@ ModelToViewHelper::ModelToViewHelper(const SwTextNode &rNode, ExpandMode eMode) sal_Int32 const modelEndBlock(nBlockEnd); sal_Int32 const viewFieldPos(nBlockEnd + nOffset); - m_aMap.push_back(ConversionMapEntry(modelEndBlock, viewFieldPos, true)); + m_aMap.emplace_back(modelEndBlock, viewFieldPos, true); } } } diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index c59c5419b976..3b80b0ca76fa 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -1212,7 +1212,7 @@ bool SwTextNode::Convert( SwConversionArgs &rArgs ) if (!bIsAsianScript && rArgs.bAllowImplicitChangesForNotConvertibleText) { // Store for later use - aImplicitChanges.push_back(ImplicitChangesRange(nBegin, nBegin+nLen)); + aImplicitChanges.emplace_back(nBegin, nBegin+nLen); } nBegin = nChPos; // start of next language portion } diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx index 683c29b22645..f516c50eba6a 100644 --- a/sw/source/core/undo/undraw.cxx +++ b/sw/source/core/undo/undraw.cxx @@ -478,8 +478,7 @@ SwUndoDrawUnGroupConnectToLayout::RedoImpl(::sw::UndoRedoContext &) void SwUndoDrawUnGroupConnectToLayout::AddFormatAndObj( SwDrawFrameFormat* pDrawFrameFormat, SdrObject* pDrawObject ) { - aDrawFormatsAndObjs.push_back( - std::pair< SwDrawFrameFormat*, SdrObject* >( pDrawFrameFormat, pDrawObject ) ); + aDrawFormatsAndObjs.emplace_back( pDrawFrameFormat, pDrawObject ); } SwUndoDrawDelete::SwUndoDrawDelete( sal_uInt16 nCnt, const SwDoc* pDoc ) diff --git a/sw/source/core/undo/unnum.cxx b/sw/source/core/undo/unnum.cxx index c33c9997bf1e..cf1fbfa0e8fc 100644 --- a/sw/source/core/undo/unnum.cxx +++ b/sw/source/core/undo/unnum.cxx @@ -208,7 +208,7 @@ void SwUndoDelNum::AddNode( const SwTextNode& rNd ) { if( rNd.GetNumRule() ) { - aNodes.push_back( NodeLevel( rNd.GetIndex(), rNd.GetActualListLevel() ) ); + aNodes.emplace_back( rNd.GetIndex(), rNd.GetActualListLevel() ); } } diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 3da877ae390a..352f31ea1dbd 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -1749,7 +1749,7 @@ void SwUndoTableNdsChg::UndoImpl(::sw::UndoRedoContext & rContext) } else { - aDelNodes.push_back(std::make_pair(pBox, nIdx)); + aDelNodes.emplace_back(pBox, nIdx); } } } @@ -1766,7 +1766,7 @@ void SwUndoTableNdsChg::UndoImpl(::sw::UndoRedoContext & rContext) if (pPCD) pPCD->DeleteBox( &pTableNd->GetTable(), *pBox ); aDelBoxes.insert(pBox); - aDelNodes.push_back(std::make_pair(pBox, nIdx)); + aDelNodes.emplace_back(pBox, nIdx); } } diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index e9bb0f4ab4ff..d40ec5bf5135 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -534,7 +534,7 @@ lcl_InsertRubyPortion( { SwXTextPortion* pPortion = new SwXTextPortion(pUnoCursor, static_txtattr_cast<const SwTextRuby&>(rAttr), xParent, bEnd); - rPortions.push_back(pPortion); + rPortions.emplace_back(pPortion); pPortion->SetCollapsed(rAttr.End() == nullptr); } @@ -616,7 +616,7 @@ static void lcl_ExportBookmark( { pPortion = new SwXTextPortion(pUnoCursor, xParent, PORTION_BOOKMARK_START); - rPortions.push_back(pPortion); + rPortions.emplace_back(pPortion); pPortion->SetBookmark(pPtr->xBookmark); pPortion->SetCollapsed( BkmType::StartEnd == pPtr->nBkmType ); @@ -625,7 +625,7 @@ static void lcl_ExportBookmark( { pPortion = new SwXTextPortion(pUnoCursor, xParent, PORTION_BOOKMARK_END); - rPortions.push_back(pPortion); + rPortions.emplace_back(pPortion); pPortion->SetBookmark(pPtr->xBookmark); } aIter = rBkmArr.erase(aIter); @@ -1155,7 +1155,7 @@ static void lcl_ExportAnnotationStarts( SwXTextPortion* pPortion = new SwXTextPortion( pUnoCursor, xParent, PORTION_ANNOTATION ); pPortion->SetTextField( pPtr->mxAnnotationField ); - rPortions.push_back(pPortion); + rPortions.emplace_back(pPortion); aIter = rAnnotationStartArr.erase(aIter); } @@ -1184,7 +1184,7 @@ static sal_Int32 lcl_ExportFrames( { SwXTextPortion* pPortion = new SwXTextPortion(i_pUnoCursor, i_xParent, *static_cast<SwFrameFormat*>( const_cast<SwModify*>( pFrame ) ) ); - rPortions.push_back(pPortion); + rPortions.emplace_back(pPortion); } i_rFrames.pop_front(); } diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 1c3893e89f6a..db3005f88d15 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1490,8 +1490,8 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetPropertiesForNumFormat { uno::Any any; pOrient->QueryValue(any); - aPropertyValues.push_back(PropertyValue( - UNO_NAME_VERT_ORIENT, -1, any, PropertyState_DIRECT_VALUE)); + aPropertyValues.emplace_back( + UNO_NAME_VERT_ORIENT, -1, any, PropertyState_DIRECT_VALUE); } } } diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index c08e5f5840d3..360cccc531ca 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -1813,7 +1813,7 @@ void SwTableProperties_Impl::AddItemToSet(SfxItemSet& rSet, std::function<Tpooli const uno::Any* pAny = nullptr; GetProperty(nWhich, nMember, pAny); if(pAny) - vMemberAndAny.push_back(std::make_pair(nMember, pAny)); + vMemberAndAny.emplace_back(nMember, pAny); } if(!vMemberAndAny.empty()) { @@ -3272,7 +3272,7 @@ std::vector< uno::Reference< table::XCell > > SwXCellRange::GetCells() vResult.reserve(static_cast<size_t>(nRowCount)*static_cast<size_t>(nColCount)); for(sal_Int32 nRow = 0; nRow < nRowCount; ++nRow) for(sal_Int32 nCol = 0; nCol < nColCount; ++nCol) - vResult.push_back(uno::Reference< table::XCell >(lcl_CreateXCell(pFormat, m_pImpl->m_RangeDescriptor.nLeft + nCol, m_pImpl->m_RangeDescriptor.nTop + nRow))); + vResult.emplace_back(lcl_CreateXCell(pFormat, m_pImpl->m_RangeDescriptor.nLeft + nCol, m_pImpl->m_RangeDescriptor.nTop + nRow)); return vResult; } diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 0040ecb792c2..ab240ba3cdf2 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -2020,7 +2020,7 @@ lcl_ApplyCellProperties( } } // add the new group of merged cells - rMergedCells.push_back(VerticallyMergedCell(xCellPS, nLeftPos)); + rMergedCells.emplace_back(xCellPS, nLeftPos); } else { diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 796cf7d56763..d4c9218c5ecc 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -5158,7 +5158,7 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const ww8::Frame &rFrame, const P if( !bDuplicate ) { m_bPostponedProcessingFly = true ; - m_aFramesOfParagraph.push_back(ww8::Frame(rFrame)); + m_aFramesOfParagraph.emplace_back(rFrame); } } break; @@ -5179,7 +5179,7 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const ww8::Frame &rFrame, const P { const SdrObject* pObject = rFrame.GetFrameFormat().FindRealSdrObject(); if(ExportAsActiveXControl(pObject)) - m_aPostponedActiveXControls.push_back(PostponedDrawing(pObject, &(rFrame.GetFrameFormat()))); + m_aPostponedActiveXControls.emplace_back(pObject, &(rFrame.GetFrameFormat())); else m_aPostponedFormControls.push_back(pObject); m_bPostponedProcessingFly = true ; @@ -6844,7 +6844,7 @@ void DocxAttributeOutput::PostitField( const SwField* pField ) else // Otherwise get a new one. nId = m_nNextAnnotationMarkId++; - m_postitFields.push_back(std::make_pair(pPostItField, nId)); + m_postitFields.emplace_back(pPostItField, nId); } void DocxAttributeOutput::WritePostitFieldReference() diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index 6258e0ee34b3..bf841d6d977a 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -116,7 +116,7 @@ namespace // so set a dummy position and fix it in UpdateFramePositions SwPosition const dummy(SwNodeIndex( const_cast<SwNodes&>(pAnchor->nNode.GetNodes()))); - aRet.push_back(ww8::Frame(rEntry, dummy)); + aRet.emplace_back(rEntry, dummy); } else { @@ -127,7 +127,7 @@ namespace aPos.nContent.Assign(pTextNd, 0); } - aRet.push_back(ww8::Frame(rEntry, aPos)); + aRet.emplace_back(rEntry, aPos); } } return aRet; diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx index 06f9b870977a..f9dedf2c25cb 100644 --- a/sw/source/filter/ww8/writerwordglue.cxx +++ b/sw/source/filter/ww8/writerwordglue.cxx @@ -543,8 +543,8 @@ namespace sw if (rText.isEmpty()) { - aRunChanges.push_back(CharRunEntry(0, nScript, eChrSet, - bParaIsRTL)); + aRunChanges.emplace_back(0, nScript, eChrSet, + bParaIsRTL); return aRunChanges; } @@ -585,7 +585,7 @@ namespace sw The value for UBIDI_DEFAULT_LTR is even and the one for UBIDI_DEFAULT_RTL is odd */ - aDirChanges.push_back(DirEntry(nEnd, nCurrDir & 0x1)); + aDirChanges.emplace_back(nEnd, nCurrDir & 0x1); nStart = nEnd; } ubidi_close(pBidi); @@ -601,7 +601,7 @@ namespace sw if (nEnd2 < 0) break; nPos = nEnd2; - aScripts.push_back(ScriptEntry(nPos, nScript)); + aScripts.emplace_back(nPos, nScript); nScript = g_pBreakIt->GetBreakIter()->getScriptType(rText, nPos); } @@ -634,8 +634,7 @@ namespace sw nScript = aScriptIter->second; } - aRunChanges.push_back( - CharRunEntry(nMinPos, nScript, eChrSet, bCharIsRTL)); + aRunChanges.emplace_back(nMinPos, nScript, eChrSet, bCharIsRTL); if (aBiDiIter != aBiDiEnd) { diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index bd21641eb1c6..c9c5fc11653a 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -320,7 +320,7 @@ void MSWordStyles::BuildStyleIds() { std::unordered_set<OString, OStringHash> aUsed; - m_aStyleIds.push_back("Normal"); + m_aStyleIds.emplace_back("Normal"); aUsed.insert("normal"); for (sal_uInt16 n = 1; n < m_nUsedSlots; ++n) @@ -365,7 +365,7 @@ void MSWordStyles::BuildStyleIds() ++nFree; aUsed.insert(aLower + OString::number(nFree)); - m_aStyleIds.push_back(aStyleId + OString::number(nFree)); + m_aStyleIds.emplace_back(aStyleId + OString::number(nFree)); } } } @@ -1088,7 +1088,7 @@ void MSWordSections::AppendSection( const SwPageDesc* pPd, if (HeaderFooterWritten()) { return; // #i117955# prevent new sections in endnotes } - aSects.push_back( WW8_SepInfo( pPd, pSectionFormat, nLnNumRestartNo, boost::none, nullptr, bIsFirstParagraph ) ); + aSects.emplace_back( pPd, pSectionFormat, nLnNumRestartNo, boost::none, nullptr, bIsFirstParagraph ); NeedsDocumentProtected( aSects.back() ); } @@ -2165,12 +2165,12 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, for ( sal_uInt16 i = 0; i < nLen; ++i ) { const WW8_Annotation& rAtn = *static_cast<const WW8_Annotation*>(aContent[i]); - aStrArr.push_back(std::pair<OUString,OUString>(rAtn.msOwner,rAtn.m_sInitials)); + aStrArr.emplace_back(rAtn.msOwner,rAtn.m_sInitials); // record start and end positions for ranges if( rAtn.m_nRangeStart != rAtn.m_nRangeEnd ) { - aRangeStartPos.push_back(std::make_pair(rAtn.m_nRangeStart, nIdx)); - aRangeEndPos.push_back(std::make_pair(rAtn.m_nRangeEnd, nIdx)); + aRangeStartPos.emplace_back(rAtn.m_nRangeStart, nIdx); + aRangeEndPos.emplace_back(rAtn.m_nRangeEnd, nIdx); ++nIdx; } } diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx index c7657440a3a2..0528253b558b 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -491,7 +491,7 @@ void SwWW8WrGrf::Insert(const ww8::Frame &rFly) const Size aSize( rFly.GetLayoutSize() ); const sal_uInt16 nWidth = static_cast< sal_uInt16 >(aSize.Width()); const sal_uInt16 nHeight = static_cast< sal_uInt16 >(aSize.Height()); - maDetails.push_back(GraphicDetails(rFly, nWidth, nHeight)); + maDetails.emplace_back(rFly, nWidth, nHeight); } void SwWW8WrGrf::WritePICFHeader(SvStream& rStrm, const ww8::Frame &rFly, diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index d8ccf427accc..362fbfc9d069 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -661,7 +661,7 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(WW8_CP nStartCp, WW8_CP nEndCp, } m_xCtrlStck->DeleteAndDestroy(nI-1); } - aChunks.push_back(Chunk(nStart, sURL)); + aChunks.emplace_back(nStart, sURL); } } else diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 196e8c7fcad8..a68b9a640dd6 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -6111,7 +6111,7 @@ void SwWW8ImplReader::GetSmartTagInfo(SwFltRDFMark& rMark) if (rProperty.m_nValue < m_pSmartTagData->m_aPropBagStore.m_aStringTable.size()) aValue = m_pSmartTagData->m_aPropBagStore.m_aStringTable[rProperty.m_nValue]; if (!aKey.isEmpty() && !aValue.isEmpty()) - aAttributes.push_back(std::make_pair(aKey, aValue)); + aAttributes.emplace_back(aKey, aValue); } rMark.SetAttributes(aAttributes); } diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index b822b40547a4..85ec71a4701f 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -3445,7 +3445,7 @@ void WW8TabDesc::SetNumRuleName( const OUString& rName ) { sal_uInt16 nCol = GetLogicalWWCol(); for (sal_uInt16 nSize = static_cast< sal_uInt16 >(m_aNumRuleNames.size()); nSize <= nCol; ++nSize) - m_aNumRuleNames.push_back(OUString()); + m_aNumRuleNames.emplace_back(); m_aNumRuleNames[nCol] = rName; } @@ -4447,7 +4447,7 @@ void WW8RStyle::ImportOldFormatStyles() nByteCount += nRemainder; } else - aConvertedChpx.push_back( std::vector<sal_uInt8>() ); + aConvertedChpx.emplace_back( ); ++stcp; } diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 36d700d715c1..0acc43804034 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -863,7 +863,7 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes) bool bCodeNest = aF.bCodeNest; if ( aF.nId == 6 ) bCodeNest = false; // We can handle them and lose the inner data - m_aFieldStack.push_back(WW8FieldEntry(*m_pPaM->GetPoint(), aF.nId)); + m_aFieldStack.emplace_back(*m_pPaM->GetPoint(), aF.nId); if (bNested) return 0; diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index b2e1b62dab96..9c6f46752004 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -2599,7 +2599,7 @@ WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(const WW8Fib& rFib, SvStream* pSt, } //one more FC than grrpl entries - maEntries.push_back(Entry(Get_Long(pStart))); + maEntries.emplace_back(Get_Long(pStart)); //we expect them sorted, but it appears possible for them to arrive unsorted std::sort(maEntries.begin(), maEntries.end()); @@ -2755,7 +2755,7 @@ void WW8PLCFx_Fc_FKP::WW8Fkp::HasSprm(sal_uInt16 nId, { sal_uInt16 nFixedLen = maSprmParser.DistanceToData(nId); sal_uInt16 nL = maSprmParser.GetSprmSize(nId, aIter.GetSprms(), aIter.GetRemLen()); - rResult.push_back(SprmResult(aIter.GetAktParams(), nL - nFixedLen)); + rResult.emplace_back(aIter.GetAktParams(), nL - nFixedLen); } aIter.advance(); }; @@ -3088,7 +3088,7 @@ bool WW8PLCFx_Fc_FKP::HasSprm(sal_uInt16 nId, std::vector<SprmResult> &rResult) { sal_uInt16 nFixedLen = rSprmParser.DistanceToData(nId); sal_uInt16 nL = rSprmParser.GetSprmSize(nId, aIter.GetSprms(), aIter.GetRemLen()); - rResult.push_back(SprmResult(aIter.GetAktParams(), nL - nFixedLen)); + rResult.emplace_back(aIter.GetAktParams(), nL - nFixedLen); } aIter.advance(); }; @@ -3921,7 +3921,7 @@ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, sal_uInt32 nStart, sal_Int32 nLen rArray.push_back(OStringToOUString(aTmp, eCS)); } else - rArray.push_back(OUString()); + rArray.emplace_back(); // Skip the extra data (for bVer67 versions this must come from // external knowledge) diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index 0e2758b6b0fd..d340e9eecc6b 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -413,7 +413,7 @@ sal_Int32 SwXMLExport::GetDocumentSpecificSettings( std::list< SettingsGroup >& if ( xXForms.is() ) { getXFormsSettings( xXForms, aXFormsSettings ); - _out_rSettings.push_back( SettingsGroup( XML_XFORM_MODEL_SETTINGS, aXFormsSettings ) ); + _out_rSettings.emplace_back( XML_XFORM_MODEL_SETTINGS, aXFormsSettings ); } return aXFormsSettings.getLength() + SvXMLExport::GetDocumentSpecificSettings( _out_rSettings ); diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index aa6c634820d7..2a78d10e814d 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -1452,7 +1452,7 @@ void SwXMLTableContext::InsertColumn( sal_Int32 nWidth2, bool bRelWidth2, nWidth2 = MINLAY; else if( nWidth2 > USHRT_MAX ) nWidth2 = USHRT_MAX; - m_aColumnWidths.push_back( ColumnWidthInfo(nWidth2, bRelWidth2) ); + m_aColumnWidths.emplace_back(nWidth2, bRelWidth2 ); if( (pDfltCellStyleName && !pDfltCellStyleName->isEmpty()) || m_pColumnDefaultCellStyleNames ) { @@ -1558,7 +1558,7 @@ void SwXMLTableContext::InsertCell( const OUString& rStyleName, { for( sal_uInt32 i=GetColumnCount(); i<nColsReq; ++i ) { - m_aColumnWidths.push_back( ColumnWidthInfo(MINLAY, true) ); + m_aColumnWidths.emplace_back(MINLAY, true ); } // adjust columns in *all* rows, if columns must be inserted for (size_t i = 0; i < m_pRows->size(); ++i) diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index 9b9cc1254851..876f0ca98202 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -445,7 +445,7 @@ void SwDropCapsPict::CheckScript() for(;;) { nChg = xBreak->endOfScript( maText, nChg, nScript ); - maScriptChanges.push_back( ScriptInfo(nScript, nChg) ); + maScriptChanges.emplace_back(nScript, nChg ); if( nChg >= maText.getLength() || nChg < 0 ) break; nScript = xBreak->getScriptType( maText, nChg ); diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 0cf1e58a0e63..42e364be0f54 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -2939,7 +2939,7 @@ Control* SwTokenWindow::InsertItem(const OUString& rText, const SwFormToken& VclPtr<SwTOXEdit> pEdit = VclPtr<SwTOXEdit>::Create(m_pCtrlParentWin, this, rToken); pEdit->SetPosPixel(aControlPos); - m_aControlList.push_back(pEdit); + m_aControlList.emplace_back(pEdit); pEdit->SetText(rText); sal_uInt32 nIndex = GetControlIndex( TOKEN_TEXT ); @@ -2968,7 +2968,7 @@ Control* SwTokenWindow::InsertItem(const OUString& rText, const SwFormToken& VclPtr<SwTOXButton> pButton = VclPtr<SwTOXButton>::Create(m_pCtrlParentWin, this, rToken); pButton->SetPosPixel(aControlPos); - m_aControlList.push_back(pButton); + m_aControlList.emplace_back(pButton); Size aEditSize(aControlSize); aEditSize.Width() = pButton->GetTextWidth(rText) + 5; diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx index 2680d6f3bf5d..e14f620647f1 100644 --- a/sw/source/ui/misc/bookmark.cxx +++ b/sw/source/ui/misc/bookmark.cxx @@ -280,7 +280,7 @@ void SwInsertBookmarkDlg::PopulateTable() if (IDocumentMarkAccess::MarkType::BOOKMARK == IDocumentMarkAccess::GetType(**ppBookmark)) { m_pBookmarksBox->InsertBookmark(ppBookmark->get()); - aTableBookmarks.push_back(std::make_pair(ppBookmark->get(), ppBookmark->get()->GetName())); + aTableBookmarks.emplace_back(ppBookmark->get(), ppBookmark->get()->GetName()); } } m_nLastBookmarksCount = pMarkAccess->getBookmarksCount(); diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx index a3db641950c8..ab0dd1b8dae0 100644 --- a/sw/source/ui/misc/glosbib.cxx +++ b/sw/source/ui/misc/glosbib.cxx @@ -271,7 +271,7 @@ IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton, void ) } if(bDelete) { - m_RemovedArr.push_back(pUserData->sGroupName + "\t" + pUserData->sGroupTitle); + m_RemovedArr.emplace_back(pUserData->sGroupName + "\t" + pUserData->sGroupTitle); } delete pUserData; m_pGroupTLB->GetModel()->Remove(pEntry); diff --git a/sw/source/ui/vba/vbaeventshelper.cxx b/sw/source/ui/vba/vbaeventshelper.cxx index 3520cb38ccc3..2b2d03e47aed 100644 --- a/sw/source/ui/vba/vbaeventshelper.cxx +++ b/sw/source/ui/vba/vbaeventshelper.cxx @@ -50,13 +50,13 @@ bool SwVbaEventsHelper::implPrepareEvent( EventQueue& rEventQueue, switch( rInfo.mnEventId ) { case DOCUMENT_NEW: - rEventQueue.push_back( AUTO_NEW ); + rEventQueue.emplace_back(AUTO_NEW ); break; case DOCUMENT_OPEN: - rEventQueue.push_back( AUTO_OPEN ); + rEventQueue.emplace_back(AUTO_OPEN ); break; case DOCUMENT_CLOSE: - rEventQueue.push_back( AUTO_CLOSE ); + rEventQueue.emplace_back(AUTO_CLOSE ); break; } return true; diff --git a/sw/source/uibase/config/StoredChapterNumbering.cxx b/sw/source/uibase/config/StoredChapterNumbering.cxx index 0a129288517f..92e94e8ef4a0 100644 --- a/sw/source/uibase/config/StoredChapterNumbering.cxx +++ b/sw/source/uibase/config/StoredChapterNumbering.cxx @@ -356,7 +356,7 @@ public: SvxXMLListStyleContext *const pContext( new SvxXMLListStyleContext(GetImport(), nPrefix, rLocalName, xAttrList, true)); - m_Contexts.push_back(pContext); + m_Contexts.emplace_back(pContext); return pContext; } } diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index 3737f9e0432c..3de0f42ac26b 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -524,7 +524,7 @@ bool SwDBManager::Merge( const SwMergeDescriptor& rMergeDesc ) { // with database fields without DB-Name, use DB-Name from Doc std::vector<OUString> aDBNames; - aDBNames.push_back(OUString()); + aDBNames.emplace_back(); SwDBData aInsertData = pWorkShell->GetDBData(); OUString sDBName = aInsertData.sDataSource + OUStringLiteral1(DB_DELIM) + aInsertData.sCommand diff --git a/sw/source/uibase/dbui/mmconfigitem.cxx b/sw/source/uibase/dbui/mmconfigitem.cxx index f01d6e6bbe4b..0dbc3a088543 100644 --- a/sw/source/uibase/dbui/mmconfigitem.cxx +++ b/sw/source/uibase/dbui/mmconfigitem.cxx @@ -207,7 +207,7 @@ SwMailMergeConfigItem_Impl::SwMailMergeConfigItem_Impl() : { for (size_t i = 0; i < SAL_N_ELEMENTS(SA_ADDRESS_HEADER); ++i) { - m_AddressHeaderSA.push_back(std::make_pair(SwResId(SA_ADDRESS_HEADER[i].first), SA_ADDRESS_HEADER[i].second)); + m_AddressHeaderSA.emplace_back(SwResId(SA_ADDRESS_HEADER[i].first), SA_ADDRESS_HEADER[i].second); } const Sequence<OUString>& rNames = GetPropertyNames(); diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx index d6f5c7f7a369..9487080fab41 100644 --- a/sw/source/uibase/dochdl/gloshdl.cxx +++ b/sw/source/uibase/dochdl/gloshdl.cxx @@ -416,7 +416,7 @@ bool SwGlossaryHdl::Expand( const OUString& rShortName, const OUString sShortName(pGlossaryList->GetBlockShortName(i, j)); if( rSCmp.isEqual( rShortName, sShortName )) { - aFoundArr.push_back(TextBlockInfo_Impl(sTitle, sLongName, sGroupName)); + aFoundArr.emplace_back(sTitle, sLongName, sGroupName); } } } diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index 82ac1ea8c676..a225edf5688d 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -801,9 +801,9 @@ void SwAnnotationWin::SetPosAndSize() for(SwRect & rNextRect : *pRects) { const tools::Rectangle aPntRect(rNextRect.SVRect()); - maAnnotationTextRanges.push_back(basegfx::B2DRange( + maAnnotationTextRanges.emplace_back( aPntRect.Left(), aPntRect.Top(), - aPntRect.Right() + 1, aPntRect.Bottom() + 1)); + aPntRect.Right() + 1, aPntRect.Bottom() + 1); } } } diff --git a/sw/source/uibase/misc/glosdoc.cxx b/sw/source/uibase/misc/glosdoc.cxx index 53ea0b2e932a..986f81bbe1fb 100644 --- a/sw/source/uibase/misc/glosdoc.cxx +++ b/sw/source/uibase/misc/glosdoc.cxx @@ -327,7 +327,7 @@ std::vector<OUString> & SwGlossaries::GetNameList() if (m_GlosArr.empty()) { // the standard block is inside of the path's first part - m_GlosArr.push_back( SwGlossaries::GetDefName() + OUStringLiteral1(GLOS_DELIM) + "0" ); + m_GlosArr.emplace_back(SwGlossaries::GetDefName() + OUStringLiteral1(GLOS_DELIM) + "0" ); } } return m_GlosArr; @@ -598,7 +598,7 @@ Reference< text::XAutoTextGroup > SwGlossaries::GetAutoTextGroup( const OUString { xGroup = new SwXAutoTextGroup( sCompleteGroupName, this ); // cache it - m_aGlossaryGroups.push_back( css::uno::WeakReference< css::text::XAutoTextGroup >( xGroup ) ); + m_aGlossaryGroups.emplace_back( xGroup ); } return xGroup; @@ -655,7 +655,7 @@ Reference< text::XAutoTextEntry > SwGlossaries::GetAutoTextEntry( { xReturn = new SwXAutoTextEntry( this, rGroupName, rEntryName ); // cache it - m_aGlossaryEntries.push_back( css::uno::WeakReference< css::text::XAutoTextEntry >( xReturn ) ); + m_aGlossaryEntries.emplace_back( xReturn ); } return xReturn; diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx index e183e2c99e6b..00ea92dad174 100644 --- a/sw/source/uibase/shells/txtattr.cxx +++ b/sw/source/uibase/shells/txtattr.cxx @@ -258,7 +258,7 @@ void SwTextShell::ExecCharAttrArgs(SfxRequest &rReq) { // must create new one, otherwise document is without pam SwPaM* pPaM = rWrtSh.GetCursor(); - vItems.push_back( std::make_pair( pSize, o3tl::make_unique<SwPaM>( *(pPaM->GetMark()), *(pPaM->GetPoint())) ) ); + vItems.emplace_back( pSize, o3tl::make_unique<SwPaM>( *(pPaM->GetMark()), *(pPaM->GetPoint())) ); } else vItems = rWrtSh.GetItemWithPaM( RES_CHRATR_FONTSIZE ); diff --git a/sw/source/uibase/uiview/uivwimp.cxx b/sw/source/uibase/uiview/uivwimp.cxx index 939dbc01513b..c4cce14d2291 100644 --- a/sw/source/uibase/uiview/uivwimp.cxx +++ b/sw/source/uibase/uiview/uivwimp.cxx @@ -236,7 +236,7 @@ void SwView_Impl::AddTransferable(SwTransferable& rTransferable) ++it; } - mxTransferables.push_back(uno::WeakReference<lang::XUnoTunnel>(uno::Reference<lang::XUnoTunnel>(&rTransferable))); + mxTransferables.emplace_back(uno::Reference<lang::XUnoTunnel>(&rTransferable)); } rTransferable.m_refCount--; } |