Use emplace_back instead of push_back (writerfilter)

Change-Id: Ic09353c1c99265c789edb745044b0afe7dffbee6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161404
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
This commit is contained in:
Julien Nabet
2023-12-29 16:06:09 +01:00
parent 7982d59c98
commit d727f58d73
3 changed files with 17 additions and 17 deletions
+2 -2
View File
@@ -2958,12 +2958,12 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
if (m_pImpl->m_pSdtHelper->getDropDownDisplayTexts().size() != nDropDownDisplayTexts + 1)
{
// w:displayText="..." is optional, add empty value if it was not provided.
m_pImpl->m_pSdtHelper->getDropDownDisplayTexts().push_back(OUString());
m_pImpl->m_pSdtHelper->getDropDownDisplayTexts().emplace_back();
}
if (m_pImpl->m_pSdtHelper->getDropDownItems().size() != nDropDownItems + 1)
{
// w:value="..." is optional, add empty value if it was not provided.
m_pImpl->m_pSdtHelper->getDropDownItems().push_back(OUString());
m_pImpl->m_pSdtHelper->getDropDownItems().emplace_back();
}
}
break;
@@ -4108,9 +4108,9 @@ void DomainMapper_Impl::CreateRedline(uno::Reference<text::XTextRange> const& xR
if (eType != StoredRedlines::NONE)
{
m_aStoredRedlines[eType].push_back( uno::Any(xRange) );
m_aStoredRedlines[eType].push_back( uno::Any(sType) );
m_aStoredRedlines[eType].push_back( uno::Any(aRedlineProperties) );
m_aStoredRedlines[eType].emplace_back(xRange);
m_aStoredRedlines[eType].emplace_back(sType);
m_aStoredRedlines[eType].emplace_back(aRedlineProperties);
}
}
catch( const uno::Exception & )
+12 -12
View File
@@ -1348,7 +1348,7 @@ void RTFDocumentImpl::singleChar(sal_uInt8 nValue, bool bRunProps)
}
else
{
pCurrentBuffer->push_back(Buf_t(BUFFER_STARTRUN, nullptr, nullptr));
pCurrentBuffer->emplace_back(BUFFER_STARTRUN, nullptr, nullptr);
}
// Should we send run properties?
@@ -1363,8 +1363,8 @@ void RTFDocumentImpl::singleChar(sal_uInt8 nValue, bool bRunProps)
else
{
auto pValue = new RTFValue(*sValue);
pCurrentBuffer->push_back(Buf_t(BUFFER_TEXT, pValue, nullptr));
pCurrentBuffer->push_back(Buf_t(BUFFER_ENDRUN, nullptr, nullptr));
pCurrentBuffer->emplace_back(BUFFER_TEXT, pValue, nullptr);
pCurrentBuffer->emplace_back(BUFFER_ENDRUN, nullptr, nullptr);
}
}
@@ -1604,7 +1604,7 @@ void RTFDocumentImpl::text(OUString& rString)
else if (pCurrentBuffer)
{
RTFValue::Pointer_t pValue;
pCurrentBuffer->push_back(Buf_t(BUFFER_STARTRUN, pValue, nullptr));
pCurrentBuffer->emplace_back(BUFFER_STARTRUN, pValue, nullptr);
}
if (m_aStates.top().getDestination() == Destination::NORMAL
@@ -1617,7 +1617,7 @@ void RTFDocumentImpl::text(OUString& rString)
else
{
auto pValue = new RTFValue(rString);
pCurrentBuffer->push_back(Buf_t(BUFFER_UTEXT, pValue, nullptr));
pCurrentBuffer->emplace_back(BUFFER_UTEXT, pValue, nullptr);
}
m_bNeedCr = true;
@@ -1627,7 +1627,7 @@ void RTFDocumentImpl::text(OUString& rString)
else if (pCurrentBuffer)
{
RTFValue::Pointer_t pValue;
pCurrentBuffer->push_back(Buf_t(BUFFER_ENDRUN, pValue, nullptr));
pCurrentBuffer->emplace_back(BUFFER_ENDRUN, pValue, nullptr);
}
}
@@ -2498,8 +2498,8 @@ RTFError RTFDocumentImpl::beforePopState(RTFParserState& rState)
// Also buffer the RTFPicture of the state stack as it contains
// the shape size.
auto pPictureValue = new RTFValue(m_aStates.top().getPicture());
m_aStates.top().getCurrentBuffer()->push_back(
Buf_t(BUFFER_PICTURE, pPictureValue, nullptr));
m_aStates.top().getCurrentBuffer()->emplace_back(BUFFER_PICTURE, pPictureValue,
nullptr);
auto pValue = new RTFValue(m_aStates.top().getShape());
// Buffer wrap type.
@@ -2513,8 +2513,8 @@ RTFError RTFDocumentImpl::beforePopState(RTFParserState& rState)
}
}
m_aStates.top().getCurrentBuffer()->push_back(
Buf_t(BUFFER_RESOLVESHAPE, pValue, nullptr));
m_aStates.top().getCurrentBuffer()->emplace_back(BUFFER_RESOLVESHAPE, pValue,
nullptr);
}
}
else if (rState.getInShapeGroup() && !rState.getInShape())
@@ -3575,8 +3575,8 @@ void RTFDocumentImpl::afterPopState(RTFParserState& rState)
if (!m_aStates.top().getCurrentBuffer())
m_pSdrImport->close();
else
m_aStates.top().getCurrentBuffer()->push_back(
Buf_t(BUFFER_ENDSHAPE, nullptr, nullptr));
m_aStates.top().getCurrentBuffer()->emplace_back(BUFFER_ENDSHAPE, nullptr,
nullptr);
}
// It's allowed to declare these inside the shape text, and they