summaryrefslogtreecommitdiffstats
path: root/writerfilter
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2018-06-30 20:34:46 +0200
committerJochen Nitschke <j.nitschke+logerrit@ok.de>2018-07-04 19:09:45 +0200
commit99d2c655012af86941f2cdc46fc555bcc27c8eba (patch)
treeecfa18ba922375d318a3556eca127290db3608bd /writerfilter
parentm_nHeaderLength is always 0 (diff)
downloadcore-99d2c655012af86941f2cdc46fc555bcc27c8eba.tar.gz
core-99d2c655012af86941f2cdc46fc555bcc27c8eba.zip
cppcheck: variableScope
Change-Id: I9a01758812e5611c313a41225ec8e04b86e3bdf3 Reviewed-on: https://gerrit.libreoffice.org/56769 Tested-by: Jenkins Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 8445b5c9a292..fca227d9a702 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -475,8 +475,6 @@ RTFDocumentImpl::getProperties(RTFSprms& rAttributes, RTFSprms const& rSprms, Id
auto it = m_aStyleTableEntries.find(nStyle);
if (it != m_aStyleTableEntries.end())
{
- RTFReferenceProperties& rProps = *static_cast<RTFReferenceProperties*>(it->second.get());
-
// cloneAndDeduplicate() wants to know about only a single "style", so
// let's merge paragraph and character style properties here.
auto itChar = m_aStyleTableEntries.end();
@@ -490,15 +488,21 @@ RTFDocumentImpl::getProperties(RTFSprms& rAttributes, RTFSprms const& rSprms, Id
RTFSprms aStyleAttributes;
// Ensure the paragraph style is a flat list.
if (!nStyleType || nStyleType == NS_ooxml::LN_Value_ST_StyleType_paragraph)
+ {
+ RTFReferenceProperties& rProps
+ = *static_cast<RTFReferenceProperties*>(it->second.get());
lcl_copyFlatten(rProps, aStyleAttributes, aStyleSprms);
+ }
if (itChar != m_aStyleTableEntries.end())
{
// Found active character style, then update aStyleSprms/Attributes.
- RTFReferenceProperties& rCharProps
- = *static_cast<RTFReferenceProperties*>(itChar->second.get());
if (!nStyleType || nStyleType == NS_ooxml::LN_Value_ST_StyleType_character)
+ {
+ RTFReferenceProperties& rCharProps
+ = *static_cast<RTFReferenceProperties*>(itChar->second.get());
lcl_copyFlatten(rCharProps, aStyleAttributes, aStyleSprms);
+ }
}
// Get rid of direct formatting what is already in the style.