diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-11 08:54:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-11 09:42:55 +0200 |
commit | 9c5c905680f7cb58eb3d0fbf25725a50c17896da (patch) | |
tree | d15a5bade5d44301a6292649a23ff65e219a8adb /editeng | |
parent | ba7492ebe6f943976fc41274672ec41c035b4fbb (diff) |
clang-tidy modernize-use-emplace in editeng..framework
Change-Id: I7739c4f77c856d34f8484754244df13d8fef840e
Reviewed-on: https://gerrit.libreoffice.org/42151
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editobj.cxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/edtspell.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 8 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit4.cxx | 4 | ||||
-rw-r--r-- | editeng/source/uno/unotext2.cxx | 6 |
7 files changed, 14 insertions, 14 deletions
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index a20217749d46..549d8cee1992 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -924,7 +924,7 @@ void EditTextObjectImpl::GetAllSections( std::vector<editeng::Section>& rAttrs ) if (rBorders.size() == 1 && rBorders[0] == 0) { // Empty paragraph. Push an empty section. - aAttrs.push_back(editeng::Section(nPara, 0, 0)); + aAttrs.emplace_back(nPara, 0, 0); continue; } @@ -934,7 +934,7 @@ void EditTextObjectImpl::GetAllSections( std::vector<editeng::Section>& rAttrs ) for (++itBorder; itBorder != itBorderEnd; ++itBorder, nPrev = nCur) { nCur = *itBorder; - aAttrs.push_back(editeng::Section(nPara, nPrev, nCur)); + aAttrs.emplace_back(nPara, nPrev, nCur); } } diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx index c2810f49ed07..47603ca1a039 100644 --- a/editeng/source/editeng/edtspell.cxx +++ b/editeng/source/editeng/edtspell.cxx @@ -428,7 +428,7 @@ void WrongList::InsertWrong( size_t nStart, size_t nEnd ) if (nPos != maRanges.end()) maRanges.insert(nPos, editeng::MisspellRange(nStart, nEnd)); else - maRanges.push_back(editeng::MisspellRange(nStart, nEnd)); + maRanges.emplace_back(nStart, nEnd); SAL_WARN_IF(DbgIsBuggy(), "editeng", "InsertWrong: WrongList broken!"); } diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index f0f80b4f700d..aaf24df25f18 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -451,7 +451,7 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, vcl::Region* pRegion, if (bMm100ToTwip) rRectangle = OutputDevice::LogicToLogic(rRectangle, MapUnit::Map100thMM, MapUnit::MapTwip); rRectangle.Move(aOrigin.getX(), aOrigin.getY()); - v.push_back(rRectangle.toString().getStr()); + v.emplace_back(rRectangle.toString().getStr()); } sRectangle = comphelper::string::join("; ", v); } diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index adf436e894b7..1e020d6d5ac3 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -1672,7 +1672,7 @@ void ImpEditEngine::InitScriptTypes( sal_Int32 nPara ) sal_Int32 nPos = 0; short nScriptType = _xBI->getScriptType( aText, nPos ); - rTypes.push_back( ScriptTypePosInfo( nScriptType, nPos, nTextLen ) ); + rTypes.emplace_back( nScriptType, nPos, nTextLen ); nPos = _xBI->endOfScript( aText, nPos, nScriptType ); while ( ( nPos != (-1) ) && ( nPos < nTextLen ) ) { @@ -1699,7 +1699,7 @@ void ImpEditEngine::InitScriptTypes( sal_Int32 nPara ) break; } } - rTypes.push_back( ScriptTypePosInfo( nScriptType, nPos, nTextLen ) ); + rTypes.emplace_back( nScriptType, nPos, nTextLen ); } nPos = nEndPos; @@ -1950,7 +1950,7 @@ void ImpEditEngine::InitWritingDirections( sal_Int32 nPara ) for (int32_t nIdx = 0; nIdx < nCount; ++nIdx) { ubidi_getLogicalRun( pBidi, nStart, &nEnd, &nCurrDir ); - rInfos.push_back( WritingDirectionInfo( nCurrDir, nStart, nEnd ) ); + rInfos.emplace_back( nCurrDir, nStart, nEnd ); nStart = nEnd; } } @@ -1960,7 +1960,7 @@ void ImpEditEngine::InitWritingDirections( sal_Int32 nPara ) // No infos mean no CTL and default dir is L2R... if ( rInfos.empty() ) - rInfos.push_back( WritingDirectionInfo( 0, 0, pParaPortion->GetNode()->Len() ) ); + rInfos.emplace_back( 0, 0, pParaPortion->GetNode()->Len() ); } diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 4699ce520fc9..121428166c91 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -3380,7 +3380,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po } // add to vector - aWrongSpellVector.push_back(EEngineData::WrongSpellClass(nStart, nEnd)); + aWrongSpellVector.emplace_back(nStart, nEnd); // goto next index nStart = nEnd + 1; diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 926949c77a65..2bade0c2e8a9 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -386,7 +386,7 @@ ErrCode ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) // Write out ColorList ... SvxColorList aColorList; // COL_AUTO should be the default color, always put it first - aColorList.push_back(COL_AUTO); + aColorList.emplace_back(COL_AUTO); SvxColorItem const& rDefault(static_cast<SvxColorItem const&>( aEditDoc.GetItemPool().GetDefaultItem(EE_CHAR_COLOR))); if (rDefault.GetValue() != COL_AUTO) // is the default always AUTO? @@ -1376,7 +1376,7 @@ void ImpEditEngine::GetAllMisspellRanges( std::vector<editeng::MisspellRanges>& if (!pWrongList) continue; - aRanges.push_back(editeng::MisspellRanges(i, pWrongList->GetRanges())); + aRanges.emplace_back(i, pWrongList->GetRanges()); } aRanges.swap(rRanges); diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx index 6f16b855e751..e647433ebf9c 100644 --- a/editeng/source/uno/unotext2.cxx +++ b/editeng/source/uno/unotext2.cxx @@ -69,7 +69,7 @@ SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( const SvxUnoTextBase if( aIterSel.IsEqual( aCurrentParaSel ) ) { pContent = pIterContent; - maContents.push_back( pContent ); + maContents.emplace_back(pContent ); } } } @@ -77,7 +77,7 @@ SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( const SvxUnoTextBase { pContent = new SvxUnoTextContent( mrText, currentPara ); pContent->SetSelection( aCurrentParaSel ); - maContents.push_back( pContent ); + maContents.emplace_back(pContent ); } } } @@ -416,7 +416,7 @@ SvxUnoTextRangeEnumeration::SvxUnoTextRangeEnumeration( const SvxUnoTextBase& rT pRange = new SvxUnoTextRange( mrParentText, true ); pRange->SetSelection( aSel ); } - maPortions.push_back( pRange ); + maPortions.emplace_back(pRange ); } } } |