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

clang-tidy modernize-use-emplace in various

Change-Id: Id1bbd3f380c17beeaab11f7140d4df1304c3d0d8
Reviewed-on: https://gerrit.libreoffice.org/41750Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 5d5ac2fd
......@@ -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");
......
......@@ -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<beans::PropertyValue> 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<container::XIndexContainer> xBox = document::IndexedPropertyValues::create(m_xComponentContext);
xBox->insertByIndex(sal_Int32(0), uno::makeAny(comphelper::containerToSequence(aViewProps)));
......
......@@ -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<PropertyMap::Property> 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<PropertyMap::Property> 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);
}
......
......@@ -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& )
{
......
......@@ -232,8 +232,8 @@ void OLEStorageImpl::traverse(const tools::SvRef<SotStorage> &rStorage, const rt
// librevenge::RVNGOLEStream ignores the first character when is a control code, so ...
if (!rvngName.isEmpty() && rvngName.toChar()<32)
rvngName=rvngName.copy(1);
maStreams.push_back(OLEStreamData(rtl::OUStringToOString(concatPath(rPath, baseName), RTL_TEXTENCODING_UTF8),
rtl::OUStringToOString(concatPath(rPath, rvngName), RTL_TEXTENCODING_UTF8)));
maStreams.emplace_back(rtl::OUStringToOString(concatPath(rPath, baseName), RTL_TEXTENCODING_UTF8),
rtl::OUStringToOString(concatPath(rPath, rvngName), RTL_TEXTENCODING_UTF8));
maNameMap[concatPath(rPath, rvngName)] = maStreams.size() - 1;
}
else if (aIt->IsStorage())
......@@ -379,7 +379,7 @@ void ZipStorageImpl::traverse(const Reference<container::XNameAccess> &rxContain
{
if (!lNames[n].endsWith("/")) // skip dirs
{
maStreams.push_back(ZipStreamData(rtl::OUStringToOString(lNames[n], RTL_TEXTENCODING_UTF8)));
maStreams.emplace_back(rtl::OUStringToOString(lNames[n], RTL_TEXTENCODING_UTF8));
maNameMap[lNames[n]] = maStreams.size() - 1;
}
}
......
......@@ -621,7 +621,7 @@ void KeywordInfo::KeywordElement::init( Databases const *pDatabases,helpdatafile
else
{
id.push_back( ids.copy( k, idx-k ) );
anchor.push_back( OUString() );
anchor.emplace_back( );
}
}
......@@ -768,10 +768,10 @@ KeywordInfo* Databases::getKeyword( const OUString& Database,
if( !bBelongsToDatabase )
continue;
aVector.push_back( KeywordInfo::KeywordElement( this,
aVector.emplace_back( this,
pHdf,
keyword,
doclist ) );
doclist );
}
aHdf.stopIteration();
......
......@@ -86,8 +86,8 @@ XmlReader::XmlReader(OUString const & fileUrl)
throw css::uno::RuntimeException(
"cannot mmap " + fileUrl_ + " (" + OUString::number(e) + ")" );
}
namespaceIris_.push_back(Span("http://www.w3.org/XML/1998/namespace"));
namespaces_.push_back(NamespaceData(Span("xml"), NAMESPACE_XML));
namespaceIris_.emplace_back("http://www.w3.org/XML/1998/namespace");
namespaces_.emplace_back(Span("xml"), NAMESPACE_XML);
pos_ = static_cast< char * >(fileAddress_);
end_ = pos_ + fileSize_;
state_ = State::Content;
......@@ -120,7 +120,7 @@ int XmlReader::registerNamespaceIri(Span const & iri) {
// those files during migration would fail without this hack that can be
// removed once migration is no longer relevant (see
// configmgr::Components::parseModificationLayer):
namespaces_.push_back(NamespaceData(Span("xsi"), id));
namespaces_.emplace_back(Span("xsi"), id);
}
return id;
}
......@@ -646,15 +646,13 @@ XmlReader::Result XmlReader::handleStartTag(int * nsId, Span * localName) {
Span(attrNameBegin, attrNameColon - attrNameBegin).equals(
"xmlns"))
{
namespaces_.push_back(
NamespaceData(
namespaces_.emplace_back(
Span(attrNameColon + 1, attrNameEnd - (attrNameColon + 1)),
scanNamespaceIri(valueBegin, valueEnd)));
scanNamespaceIri(valueBegin, valueEnd));
} else {
attributes_.push_back(
AttributeData(
attributes_.emplace_back(
attrNameBegin, attrNameEnd, attrNameColon, valueBegin,
valueEnd));
valueEnd);
}
}
if (!hasDefaultNs && !elements_.empty()) {
......
......@@ -66,7 +66,7 @@ namespace xmlscript
void EventElement::endElement()
{
static_cast< ControlElement * >( m_xParent.get() )->_events.push_back( this );
static_cast< ControlElement * >( m_xParent.get() )->_events.emplace_back(this );
}
ControlElement::ControlElement(
......
......@@ -262,7 +262,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString)
if (!bInValue)
{
OSL_ASSERT(!sType.isEmpty());
retVal.push_back(make_pair(sType, sbufValue.makeStringAndClear()));
retVal.emplace_back(sType, sbufValue.makeStringAndClear());
sType.clear();
//The next char is the start of the new type
nTypeNameStart = i + 1;
......@@ -288,7 +288,7 @@ vector< pair< OUString, OUString> > parseDN(const OUString& rRawString)
if (!sbufValue.isEmpty())
{
OSL_ASSERT(!sType.isEmpty());
retVal.push_back(make_pair(sType, sbufValue.makeStringAndClear()));
retVal.emplace_back(sType, sbufValue.makeStringAndClear());
}
return retVal;
}
......
......@@ -432,9 +432,9 @@ void XMLSignatureHelper::EnsureSignaturesRelation(const css::uno::Reference<css:
{
// No, and have to add one.
std::vector<beans::StringPair> aRelation;
aRelation.push_back(beans::StringPair("Id", "rId" + OUString::number(++nCount)));
aRelation.push_back(beans::StringPair("Type", OOXML_SIGNATURE_ORIGIN));
aRelation.push_back(beans::StringPair("Target", "_xmlsignatures/origin.sigs"));
aRelation.emplace_back("Id", "rId" + OUString::number(++nCount));
aRelation.emplace_back("Type", OOXML_SIGNATURE_ORIGIN);
aRelation.emplace_back("Target", "_xmlsignatures/origin.sigs");
aRelationsInfo.push_back(comphelper::containerToSequence(aRelation));
}
else if (bHaveRelation && !bAdd)
......@@ -479,9 +479,9 @@ void XMLSignatureHelper::ExportSignatureRelations(const css::uno::Reference<css:
for (int i = 0; i < nSignatureCount; ++i)
{
std::vector<beans::StringPair> aRelation;
aRelation.push_back(beans::StringPair("Id", "rId" + OUString::number(i + 1)));
aRelation.push_back(beans::StringPair("Type", OOXML_SIGNATURE_SIGNATURE));
aRelation.push_back(beans::StringPair("Target", "sig" + OUString::number(i + 1) + ".xml"));
aRelation.emplace_back("Id", "rId" + OUString::number(i + 1));
aRelation.emplace_back("Type", OOXML_SIGNATURE_SIGNATURE);
aRelation.emplace_back("Target", "sig" + OUString::number(i + 1) + ".xml");
aRelations.push_back(comphelper::containerToSequence(aRelation));
}
comphelper::OFOPXMLHelper::WriteRelationsInfoSequence(xRelStream, comphelper::containerToSequence(aRelations), mxCtx);
......@@ -508,14 +508,14 @@ void XMLSignatureHelper::ExportSignatureContentTypes(const css::uno::Reference<c
return rPair.First == "rels";
});
if (it == rDefaults.end())
aDefaults.push_back(beans::StringPair("rels", "application/vnd.openxmlformats-package.relationships+xml"));
aDefaults.emplace_back("rels", "application/vnd.openxmlformats-package.relationships+xml");
it = std::find_if(rDefaults.begin(), rDefaults.end(), [](const beans::StringPair& rPair)
{
return rPair.First == "sigs";
});
if (it == rDefaults.end())
aDefaults.push_back(beans::StringPair("sigs", "application/vnd.openxmlformats-package.digital-signature-origin"));
aDefaults.emplace_back("sigs", "application/vnd.openxmlformats-package.digital-signature-origin");
rDefaults = comphelper::containerToSequence(aDefaults);
// Remove existing signature overrides.
......@@ -528,7 +528,7 @@ void XMLSignatureHelper::ExportSignatureContentTypes(const css::uno::Reference<c
// Add our signature overrides.
for (int i = 1; i <= nSignatureCount; ++i)
aOverrides.push_back(beans::StringPair("/_xmlsignatures/sig" + OUString::number(i) + ".xml", "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml"));
aOverrides.emplace_back("/_xmlsignatures/sig" + OUString::number(i) + ".xml", "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml");
rOverrides = comphelper::containerToSequence(aOverrides);
uno::Reference<io::XOutputStream> xOutputStream = xStream->getOutputStream();
......
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