diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-05-28 22:15:27 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-05-29 08:57:17 +0200 |
commit | 42f0286c0ec68dde36cf3cef15f8a6e2e7ec1830 (patch) | |
tree | 7b8666e9196d04976121b85ab9ae9f407c8a3dbe /writerfilter/source/rtftok/rtfdocumentimpl.cxx | |
parent | e17224e2aa0e53b1e5518ce3c2a2baa174aad265 (diff) |
writerfilter: various small cleanups
Some parameters were passed by value for no reason, it's always a good
idea to declare a variable at the point where we can also initialize it,
etc.
Change-Id: Ia07bbef7826132fa0326445b89fcaf48dd38b11b
Reviewed-on: https://gerrit.libreoffice.org/73125
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'writerfilter/source/rtftok/rtfdocumentimpl.cxx')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index c2c139744ccb..b6d8290283cc 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -846,7 +846,8 @@ void RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference<drawing::XS if (!m_pBinaryData.get()) { pStream = &aStream; - int b = 0, count = 2; + int b = 0; + int count = 2; // Feed the destination text to a stream. OString aStr = OUStringToOString(m_aStates.top().getDestinationText().makeStringAndClear(), @@ -1019,11 +1020,10 @@ void RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference<drawing::XS auto pGraphicValue = new RTFValue(aGraphicAttributes, aGraphicSprms); // extent sprm RTFSprms aExtentAttributes; - int nXExt, nYExt; - nXExt = (m_aStates.top().getPicture().nGoalWidth ? m_aStates.top().getPicture().nGoalWidth - : m_aStates.top().getPicture().nWidth); - nYExt = (m_aStates.top().getPicture().nGoalHeight ? m_aStates.top().getPicture().nGoalHeight - : m_aStates.top().getPicture().nHeight); + int nXExt = (m_aStates.top().getPicture().nGoalWidth ? m_aStates.top().getPicture().nGoalWidth + : m_aStates.top().getPicture().nWidth); + int nYExt = (m_aStates.top().getPicture().nGoalHeight ? m_aStates.top().getPicture().nGoalHeight + : m_aStates.top().getPicture().nHeight); if (m_aStates.top().getPicture().nScaleX != 100) nXExt = (static_cast<long>(m_aStates.top().getPicture().nScaleX) * (nXExt @@ -2477,7 +2477,8 @@ RTFError RTFDocumentImpl::popState() aState.getCurrentEncoding()); // decode hex dump OStringBuffer aBuf; - int b = 0, count = 2; + int b = 0; + int count = 2; for (int i = 0; i < aStr.getLength(); ++i) { char ch = aStr[i]; @@ -2745,8 +2746,8 @@ RTFError RTFDocumentImpl::popState() if (m_aStates.top().getDrawingObject().getShape().is()) { RTFDrawingObject& rDrawing = m_aStates.top().getDrawingObject(); - uno::Reference<drawing::XShape> xShape(rDrawing.getShape()); - uno::Reference<beans::XPropertySet> xPropertySet(rDrawing.getPropertySet()); + const uno::Reference<drawing::XShape>& xShape(rDrawing.getShape()); + const uno::Reference<beans::XPropertySet>& xPropertySet(rDrawing.getPropertySet()); uno::Reference<lang::XServiceInfo> xServiceInfo(xShape, uno::UNO_QUERY); bool bTextFrame = xServiceInfo->supportsService("com.sun.star.text.TextFrame"); |