Kaydet (Commit) 48b200a0 authored tarafından Noel Grandin's avatar Noel Grandin

clang-tidy modernize-use-emplace in svgio..svtools

Change-Id: I4f3b0762e197d5397e723aba1dc43e3c857be145
Reviewed-on: https://gerrit.libreoffice.org/42193Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 65b756f6
......@@ -350,7 +350,7 @@ namespace svgio
{
// if it is a Css style, allow reading text between the start and end tag (see
// SvgDocHdl::characters for details)
maCssContents.push_back(OUString());
maCssContents.emplace_back();
}
break;
}
......
......@@ -289,11 +289,10 @@ namespace svgio
fOffset = 1.0;
}
aVector.push_back(
drawinglayer::primitive2d::SvgGradientEntry(
aVector.emplace_back(
fOffset,
pStyle->getStopColor(),
pStyle->getStopOpacity().solve(*this)));
pStyle->getStopOpacity().solve(*this));
}
else
{
......
......@@ -56,7 +56,7 @@ namespace svt
_rHistory.end());
// then push_back the picker
_rHistory.push_back( css::uno::WeakReference< XInterface >( _rxPicker ) );
_rHistory.emplace_back( _rxPicker );
}
}
......
......@@ -49,7 +49,7 @@ namespace svl {
IndexedStyleSheets::IndexedStyleSheets()
{
for (size_t i = 0; i < NUMBER_OF_FAMILIES; i++) {
mStyleSheetPositionsByFamily.push_back(std::vector<unsigned>());
mStyleSheetPositionsByFamily.emplace_back();
}
;}
......@@ -69,7 +69,7 @@ IndexedStyleSheets::Reindex()
mPositionsByName.clear();
mStyleSheetPositionsByFamily.clear();
for (size_t i = 0; i < NUMBER_OF_FAMILIES; i++) {
mStyleSheetPositionsByFamily.push_back(std::vector<unsigned>());
mStyleSheetPositionsByFamily.emplace_back();
}
unsigned i = 0;
......
......@@ -157,7 +157,7 @@ PropertyEntryVector_t SfxItemPropertyMap::getPropertyEntries() const
while( aIt != m_pImpl->end() )
{
const SfxItemPropertySimpleEntry* pEntry = &(*aIt).second;
aRet.push_back( SfxItemPropertyNamedEntry( (*aIt).first, * pEntry ) );
aRet.emplace_back( (*aIt).first, * pEntry );
++aIt;
}
return aRet;
......
......@@ -34,7 +34,7 @@ void SvCommandList::Append
const OUString & rArg /* The command's argument */
)
{
aCommandList.push_back( SvCommand( rCommand, rArg ) );
aCommandList.emplace_back( rCommand, rArg );
}
void SvCommandList::FillFromSequence( const css::uno::Sequence < css::beans::PropertyValue >& aCommandSequence )
......
......@@ -214,7 +214,7 @@ PassMap StorageItem::getInfo()
PassMap::iterator aIter = aResult.find( aUrl );
if( aIter != aResult.end() )
aIter->second.push_back( NamePassRecord( aName, aEPasswd ) );
aIter->second.emplace_back( aName, aEPasswd );
else
{
NamePassRecord aNewRecord( aName, aEPasswd );
......
......@@ -356,12 +356,12 @@ namespace svl { namespace undo { namespace impl
*/
void scheduleNotification( UndoListenerVoidMethod i_notificationMethod )
{
m_notifiers.push_back( NotifyUndoListener( i_notificationMethod ) );
m_notifiers.emplace_back( i_notificationMethod );
}
void scheduleNotification( UndoListenerStringMethod i_notificationMethod, const OUString& i_actionComment )
{
m_notifiers.push_back( NotifyUndoListener( i_notificationMethod, i_actionComment ) );
m_notifiers.emplace_back( i_notificationMethod, i_actionComment );
}
private:
......
......@@ -146,7 +146,7 @@ void FilterMatch::createWildCardFilterList(const OUString& _rFilterList,::std::v
sToken = _rFilterList.getToken( 0, ';', nIndex );
if ( !sToken.isEmpty() )
{
_rFilters.push_back( WildCard( sToken.toAsciiUpperCase() ) );
_rFilters.emplace_back( sToken.toAsciiUpperCase() );
}
}
while ( nIndex >= 0 );
......@@ -154,7 +154,7 @@ void FilterMatch::createWildCardFilterList(const OUString& _rFilterList,::std::v
else
{
// no filter is given -> match all
_rFilters.push_back( WildCard("*") );
_rFilters.emplace_back("*" );
}
}
......
......@@ -24,18 +24,18 @@
// implementation of the collator-algorithm-name translation
CollatorResource::CollatorResource()
{
m_aData.push_back(CollatorResourceData("alphanumeric", SvtResId(STR_SVT_COLLATE_ALPHANUMERIC)));
m_aData.push_back(CollatorResourceData("charset", SvtResId(STR_SVT_COLLATE_CHARSET)));
m_aData.push_back(CollatorResourceData("dict", SvtResId(STR_SVT_COLLATE_DICTIONARY)));
m_aData.push_back(CollatorResourceData("normal", SvtResId(STR_SVT_COLLATE_NORMAL)));
m_aData.push_back(CollatorResourceData("pinyin", SvtResId(STR_SVT_COLLATE_PINYIN)));
m_aData.push_back(CollatorResourceData("radical", SvtResId(STR_SVT_COLLATE_RADICAL)));
m_aData.push_back(CollatorResourceData("stroke", SvtResId(STR_SVT_COLLATE_STROKE)));
m_aData.push_back(CollatorResourceData("unicode", SvtResId(STR_SVT_COLLATE_UNICODE)));
m_aData.push_back(CollatorResourceData("zhuyin", SvtResId(STR_SVT_COLLATE_ZHUYIN)));
m_aData.push_back(CollatorResourceData("phonebook", SvtResId(STR_SVT_COLLATE_PHONEBOOK)));
m_aData.push_back(CollatorResourceData("phonetic (alphanumeric first)", SvtResId(STR_SVT_COLLATE_PHONETIC_F)));
m_aData.push_back(CollatorResourceData("phonetic (alphanumeric last)", SvtResId(STR_SVT_COLLATE_PHONETIC_L)));
m_aData.emplace_back("alphanumeric", SvtResId(STR_SVT_COLLATE_ALPHANUMERIC));
m_aData.emplace_back("charset", SvtResId(STR_SVT_COLLATE_CHARSET));
m_aData.emplace_back("dict", SvtResId(STR_SVT_COLLATE_DICTIONARY));
m_aData.emplace_back("normal", SvtResId(STR_SVT_COLLATE_NORMAL));
m_aData.emplace_back("pinyin", SvtResId(STR_SVT_COLLATE_PINYIN));
m_aData.emplace_back("radical", SvtResId(STR_SVT_COLLATE_RADICAL));
m_aData.emplace_back("stroke", SvtResId(STR_SVT_COLLATE_STROKE));
m_aData.emplace_back("unicode", SvtResId(STR_SVT_COLLATE_UNICODE));
m_aData.emplace_back("zhuyin", SvtResId(STR_SVT_COLLATE_ZHUYIN));
m_aData.emplace_back("phonebook", SvtResId(STR_SVT_COLLATE_PHONEBOOK));
m_aData.emplace_back("phonetic (alphanumeric first)", SvtResId(STR_SVT_COLLATE_PHONETIC_F));
m_aData.emplace_back("phonetic (alphanumeric last)", SvtResId(STR_SVT_COLLATE_PHONETIC_L));
}
const OUString&
......
......@@ -25,16 +25,16 @@
// implementation of the indexentry-algorithm-name translation
IndexEntryResource::IndexEntryResource()
{
m_aData.push_back(IndexEntryResourceData("alphanumeric", SvtResId(STR_SVT_INDEXENTRY_ALPHANUMERIC)));
m_aData.push_back(IndexEntryResourceData("dict", SvtResId(STR_SVT_INDEXENTRY_DICTIONARY)));
m_aData.push_back(IndexEntryResourceData("pinyin", SvtResId(STR_SVT_INDEXENTRY_PINYIN)));
m_aData.push_back(IndexEntryResourceData("radical", SvtResId(STR_SVT_INDEXENTRY_RADICAL)));
m_aData.push_back(IndexEntryResourceData("stroke", SvtResId(STR_SVT_INDEXENTRY_STROKE)));
m_aData.push_back(IndexEntryResourceData("zhuyin", SvtResId(STR_SVT_INDEXENTRY_ZHUYIN)));
m_aData.push_back(IndexEntryResourceData("phonetic (alphanumeric first) (grouped by syllable)", SvtResId(STR_SVT_INDEXENTRY_PHONETIC_FS)));
m_aData.push_back(IndexEntryResourceData("phonetic (alphanumeric first) (grouped by consonant)", SvtResId(STR_SVT_INDEXENTRY_PHONETIC_FC)));
m_aData.push_back(IndexEntryResourceData("phonetic (alphanumeric last) (grouped by syllable)", SvtResId(STR_SVT_INDEXENTRY_PHONETIC_LS)));
m_aData.push_back(IndexEntryResourceData("phonetic (alphanumeric last) (grouped by consonant)", SvtResId(STR_SVT_INDEXENTRY_PHONETIC_LC)));
m_aData.emplace_back("alphanumeric", SvtResId(STR_SVT_INDEXENTRY_ALPHANUMERIC));
m_aData.emplace_back("dict", SvtResId(STR_SVT_INDEXENTRY_DICTIONARY));
m_aData.emplace_back("pinyin", SvtResId(STR_SVT_INDEXENTRY_PINYIN));
m_aData.emplace_back("radical", SvtResId(STR_SVT_INDEXENTRY_RADICAL));
m_aData.emplace_back("stroke", SvtResId(STR_SVT_INDEXENTRY_STROKE));
m_aData.emplace_back("zhuyin", SvtResId(STR_SVT_INDEXENTRY_ZHUYIN));
m_aData.emplace_back("phonetic (alphanumeric first) (grouped by syllable)", SvtResId(STR_SVT_INDEXENTRY_PHONETIC_FS));
m_aData.emplace_back("phonetic (alphanumeric first) (grouped by consonant)", SvtResId(STR_SVT_INDEXENTRY_PHONETIC_FC));
m_aData.emplace_back("phonetic (alphanumeric last) (grouped by syllable)", SvtResId(STR_SVT_INDEXENTRY_PHONETIC_LS));
m_aData.emplace_back("phonetic (alphanumeric last) (grouped by consonant)", SvtResId(STR_SVT_INDEXENTRY_PHONETIC_LC));
}
const OUString& IndexEntryResource::GetTranslation(const OUString &r_Algorithm)
......
......@@ -583,7 +583,7 @@ void AssignmentPersistentData::ImplCommit()
// force a even number of known fields
m_pImpl->bOddFieldNumber = (m_pImpl->aFieldLabels.size() % 2) != 0;
if (m_pImpl->bOddFieldNumber)
m_pImpl->aFieldLabels.push_back( OUString() );
m_pImpl->aFieldLabels.emplace_back( );
// limit the scrollbar range accordingly
sal_Int32 nOverallFieldPairs = m_pImpl->aFieldLabels.size() / 2;
......
......@@ -163,7 +163,7 @@ void SvObjectServerList::FillInsertObjects()
{
if( !Get( aClassName ) )
// not entered yet
aObjectServerList.push_back( SvObjectServer( aClassName, aUIName ) );
aObjectServerList.emplace_back( aClassName, aUIName );
}
}
}
......
......@@ -94,7 +94,7 @@ namespace svt
void DialogController::addDependentWindow( vcl::Window& _rWindow )
{
m_pImpl->aConcernedWindows.push_back( &_rWindow );
m_pImpl->aConcernedWindows.emplace_back(&_rWindow );
VclWindowEvent aEvent( &_rWindow, VclEventId::NONE, nullptr );
impl_update( aEvent, _rWindow );
......
......@@ -51,7 +51,7 @@ public:
LanguageType GetTypeAtIndex( sal_uInt32 nIndex ) const;
sal_uInt32 AddItem(const OUString& rLanguage, const LanguageType eType)
{
m_aStrings.push_back(std::make_pair(rLanguage, eType));
m_aStrings.emplace_back(rLanguage, eType);
return m_aStrings.size();
}
LanguageType GetValue(sal_uInt32 nIndex) const
......@@ -154,7 +154,7 @@ SvtLanguageTableImpl::SvtLanguageTableImpl()
{
for (size_t i = 0; i < SAL_N_ELEMENTS(STR_ARR_SVT_LANGUAGE_TABLE); ++i)
{
m_aStrings.push_back(std::make_pair(SvtResId(STR_ARR_SVT_LANGUAGE_TABLE[i].first), STR_ARR_SVT_LANGUAGE_TABLE[i].second));
m_aStrings.emplace_back(SvtResId(STR_ARR_SVT_LANGUAGE_TABLE[i].first), STR_ARR_SVT_LANGUAGE_TABLE[i].second);
}
auto xNA = officecfg::VCL::ExtraLanguages::get();
......
......@@ -1523,7 +1523,7 @@ const HTMLOptions& HTMLParser::GetOptions( HtmlOptionId const *pNoConvertToken )
}
// Token is known and can be saved
maOptions.push_back(HTMLOption(nToken, sName, aValue));
maOptions.emplace_back(nToken, sName, aValue);
}
else
......
......@@ -772,7 +772,7 @@ namespace svt { namespace table
if ( flexibility > 0 )
++flexibleColumnCount;
effectiveColumnLimits.push_back( ::std::pair< long, long >( effectiveMin, effectiveMax ) );
effectiveColumnLimits.emplace_back( effectiveMin, effectiveMax );
accumulatedMinWidth += effectiveMin;
accumulatedMaxWidth += effectiveMax;
}
......@@ -1028,7 +1028,7 @@ namespace svt { namespace table
{
const long columnStart = accumulatedWidthPixel;
const long columnEnd = columnStart + newWidthsPixel[col];
m_aColumnWidths.push_back( MutableColumnMetrics( columnStart, columnEnd ) );
m_aColumnWidths.emplace_back( columnStart, columnEnd );
accumulatedWidthPixel = columnEnd;
// and don't forget to forward this to the column models
......
......@@ -613,7 +613,7 @@ Reference< XEnumeration > SAL_CALL TreeControlPeer::createSelectionEnumeration()
UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.FirstSelected() );
while( pEntry && nSelectionCount )
{
aSelection.push_back( Any( pEntry->mxNode ) );
aSelection.emplace_back( pEntry->mxNode );
pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.NextSelected( pEntry ) );
--nSelectionCount;
}
......
......@@ -579,7 +579,7 @@ void SAL_CALL SvUnoImageMap::insertByIndex( sal_Int32 nIndex, const Any& Element
throw IndexOutOfBoundsException();
if( nIndex == nCount )
maObjectList.push_back( pObject );
maObjectList.emplace_back(pObject );
else
{
auto aIter = maObjectList.begin();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment