From b0de7bc428aaf914a836da3c33b123e4195e603e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 31 Aug 2017 12:05:39 +0200 Subject: clang-tidy modernize-use-emplace in various Change-Id: Id1bbd3f380c17beeaab11f7140d4df1304c3d0d8 Reviewed-on: https://gerrit.libreoffice.org/41750 Tested-by: Jenkins Reviewed-by: Noel Grandin --- writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 4 ++-- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 10 +++++----- writerfilter/source/dmapper/NumberingManager.cxx | 12 ++++-------- writerfilter/source/dmapper/StyleSheetTable.cxx | 2 +- 4 files changed, 12 insertions(+), 16 deletions(-) (limited to 'writerfilter') diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index a00548c84b56..98faa97b635d 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -1152,7 +1152,7 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel, bool bTab sal_Int32 nTableWidth = 0; m_aTableProperties->getValue(TablePropertyMap::TABLE_WIDTH, nTableWidth); if (m_rDMapper_Impl.GetSectionContext() && nestedTableLevel <= 1 && !m_rDMapper_Impl.IsInHeaderFooter()) - m_rDMapper_Impl.m_aPendingFloatingTables.push_back(FloatingTableInfo(xStart, xEnd, comphelper::containerToSequence(aFrameProperties), nTableWidth)); + m_rDMapper_Impl.m_aPendingFloatingTables.emplace_back(xStart, xEnd, comphelper::containerToSequence(aFrameProperties), nTableWidth); else { // m_xText points to the body text, get the current xText from m_rDMapper_Impl, in case e.g. we would be in a header. @@ -1183,7 +1183,7 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel, bool bTab void DomainMapperTableHandler::startRow(const TablePropertyMapPtr& pProps) { m_aRowProperties.push_back( pProps ); - m_aCellProperties.push_back( PropertyMapVector1() ); + m_aCellProperties.emplace_back( ); #ifdef DEBUG_WRITERFILTER TagLogger::getInstance().startElement("table.row"); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 2cd7f7fff6c2..1b777821b8b3 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -600,7 +600,7 @@ void DomainMapper_Impl::InitTabStopFromStyle( const uno::Sequence< style::TabSto OSL_ENSURE(m_aCurrentTabStops.empty(), "tab stops already initialized"); for( sal_Int32 nTab = 0; nTab < rInitTabStops.getLength(); ++nTab) { - m_aCurrentTabStops.push_back( DeletableTabStop(rInitTabStops[nTab]) ); + m_aCurrentTabStops.emplace_back(rInitTabStops[nTab] ); } } @@ -5227,13 +5227,13 @@ void DomainMapper_Impl::ApplySettingsTable() std::vector aViewProps; if (m_pSettingsTable->GetZoomFactor()) { - aViewProps.push_back(beans::PropertyValue("ZoomFactor", -1, uno::makeAny(m_pSettingsTable->GetZoomFactor()), beans::PropertyState_DIRECT_VALUE)); - aViewProps.push_back(beans::PropertyValue("VisibleBottom", -1, uno::makeAny(sal_Int32(0)), beans::PropertyState_DIRECT_VALUE)); - aViewProps.push_back(beans::PropertyValue("ZoomType", -1, uno::makeAny(sal_Int16(0)), beans::PropertyState_DIRECT_VALUE)); + aViewProps.emplace_back("ZoomFactor", -1, uno::makeAny(m_pSettingsTable->GetZoomFactor()), beans::PropertyState_DIRECT_VALUE); + aViewProps.emplace_back("VisibleBottom", -1, uno::makeAny(sal_Int32(0)), beans::PropertyState_DIRECT_VALUE); + aViewProps.emplace_back("ZoomType", -1, uno::makeAny(sal_Int16(0)), beans::PropertyState_DIRECT_VALUE); } if (m_pSettingsTable->GetView()) { - aViewProps.push_back(beans::PropertyValue("ShowOnlineLayout", -1, uno::makeAny(m_pSettingsTable->GetView() == NS_ooxml::LN_Value_doc_ST_View_web), beans::PropertyState_DIRECT_VALUE)); + aViewProps.emplace_back("ShowOnlineLayout", -1, uno::makeAny(m_pSettingsTable->GetView() == NS_ooxml::LN_Value_doc_ST_View_web), beans::PropertyState_DIRECT_VALUE); } uno::Reference xBox = document::IndexedPropertyValues::create(m_xComponentContext); xBox->insertByIndex(sal_Int32(0), uno::makeAny(comphelper::containerToSequence(aViewProps))); diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index 47f5dae1999b..5da02b0004d4 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -217,11 +217,11 @@ uno::Sequence< beans::PropertyValue > ListLevel::GetCharStyleProperties( ) beans::PropertyValue* aGrabIter = vGrabVals.begin(); for(; aGrabIter!=vGrabVals.end(); ++aGrabIter) { if(!IgnoreForCharStyle(aGrabIter->Name)) - rProperties.push_back(beans::PropertyValue(aGrabIter->Name, 0, aGrabIter->Value, beans::PropertyState_DIRECT_VALUE)); + rProperties.emplace_back(aGrabIter->Name, 0, aGrabIter->Value, beans::PropertyState_DIRECT_VALUE); } } else - rProperties.push_back(beans::PropertyValue(aValIter->Name, 0, aValIter->Value, beans::PropertyState_DIRECT_VALUE)); + rProperties.emplace_back(aValIter->Name, 0, aValIter->Value, beans::PropertyState_DIRECT_VALUE); } return comphelper::containerToSequence(rProperties); @@ -303,16 +303,12 @@ uno::Sequence< beans::PropertyValue > ListLevel::GetLevelProperties( ) for(PropertyIds const & rReadId : aReadIds) { boost::optional aProp = getProperty(rReadId); if (aProp) - aNumberingProperties.push_back( - beans::PropertyValue( getPropertyName(aProp->first), 0, aProp->second, beans::PropertyState_DIRECT_VALUE ) - ); + aNumberingProperties.emplace_back( getPropertyName(aProp->first), 0, aProp->second, beans::PropertyState_DIRECT_VALUE ); } boost::optional aPropFont = getProperty(PROP_CHAR_FONT_NAME); if(aPropFont && !isOutlineNumbering()) - aNumberingProperties.push_back( - beans::PropertyValue( getPropertyName(PROP_BULLET_FONT_NAME), 0, aPropFont->second, beans::PropertyState_DIRECT_VALUE ) - ); + aNumberingProperties.emplace_back( getPropertyName(PROP_BULLET_FONT_NAME), 0, aPropFont->second, beans::PropertyState_DIRECT_VALUE ); return comphelper::containerToSequence(aNumberingProperties); } diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index cc63585dc9dc..9e5d80735c47 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -1591,7 +1591,7 @@ OUString StyleSheetTable::getOrCreateCharStyle( PropertyValueVector_t& rCharProp ++aCharPropIter; } xCharStyles->insertByName( sListLabel, uno::makeAny( xStyle) ); - m_pImpl->m_aListCharStylePropertyVector.push_back( ListCharStylePropertyMap_t( sListLabel, rCharProperties )); + m_pImpl->m_aListCharStylePropertyVector.emplace_back( sListLabel, rCharProperties ); } catch( const uno::Exception& ) { -- cgit