summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorThorsten Behrens <thorsten.behrens@allotropia.de>2021-03-04 23:29:50 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2021-03-05 11:51:32 +0100
commitaecdb5425538130ff4b82d56fa910bffcd9c3b81 (patch)
treee9a51f36470b7df4f4c3ea1b5aa57f36e398c84c /writerfilter
parentd6886c340d1c940a4b3ab7e7ca499fff63183845 (diff)
emplace_back: use perfect forwarding if possible
When using that new-ish method, try giving the compiler a chance to construct in-place. Left out harder cases using initializer lists, and might have missed slightly less obvious places. Change-Id: Ifcc3a6d4599474457e37dd17a35c41fc73e7a17e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111980 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdispatchvalue.cxx5
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx9
2 files changed, 6 insertions, 8 deletions
diff --git a/writerfilter/source/rtftok/rtfdispatchvalue.cxx b/writerfilter/source/rtftok/rtfdispatchvalue.cxx
index cca01ebf4323..f398326a7344 100644
--- a/writerfilter/source/rtftok/rtfdispatchvalue.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchvalue.cxx
@@ -273,7 +273,7 @@ bool RTFDocumentImpl::dispatchParagraphSprmValue(RTFKeyword nKeyword, int nParam
{
while (m_aTableBufferStack.size() < sal::static_int_cast<std::size_t>(nParam))
{
- m_aTableBufferStack.emplace_back(RTFBuffer_t());
+ m_aTableBufferStack.emplace_back();
}
// Invalid tables may omit INTBL after ITAP
dispatchFlag(RTF_INTBL); // sets newly pushed buffer as current
@@ -1637,8 +1637,7 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
if (rDrawingObject.getPolyLinePoints().empty())
dispatchValue(RTF_DPPOLYCOUNT, 2);
- rDrawingObject.getPolyLinePoints().emplace_back(
- awt::Point(convertTwipToMm100(nParam), 0));
+ rDrawingObject.getPolyLinePoints().emplace_back(convertTwipToMm100(nParam), 0);
}
break;
case RTF_DPPTY:
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 2eb09c13d4ec..8745ba050afb 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1483,8 +1483,7 @@ void RTFDocumentImpl::text(OUString& rString)
if (m_aStates.top().getTableCellSprms().find(NS_ooxml::LN_CT_TcPrBase_vAlign)
&& m_nTopLevelCells == 0)
{
- m_aTableBufferStack.back().emplace_back(
- Buf_t(BUFFER_UTEXT, new RTFValue(rString), nullptr));
+ m_aTableBufferStack.back().emplace_back(BUFFER_UTEXT, new RTFValue(rString), nullptr);
return;
}
@@ -3673,9 +3672,9 @@ void RTFDocumentImpl::resetFrame() { m_aStates.top().getFrame() = RTFFrame(&m_aS
void RTFDocumentImpl::bufferProperties(RTFBuffer_t& rBuffer, const RTFValue::Pointer_t& pValue,
const tools::SvRef<TableRowBuffer>& pTableProperties)
{
- rBuffer.emplace_back(
- Buf_t(BUFFER_SETSTYLE, new RTFValue(m_aStates.top().getCurrentStyleIndex()), nullptr));
- rBuffer.emplace_back(Buf_t(BUFFER_PROPS, pValue, pTableProperties));
+ rBuffer.emplace_back(BUFFER_SETSTYLE, new RTFValue(m_aStates.top().getCurrentStyleIndex()),
+ nullptr);
+ rBuffer.emplace_back(BUFFER_PROPS, pValue, pTableProperties);
}
RTFShape::RTFShape() = default;