diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-10 20:47:32 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-11 11:20:43 +0200 |
commit | 2d582244680e7f6dec6e4a466e276f93ccb01dc9 (patch) | |
tree | b0e880ddfb3ce1ea2f47151b648e7fbb55132f08 /oox | |
parent | 74012c48d99634a7556a86f77e9522024f2afdb2 (diff) |
loplugin:flatten
Change-Id: I6560756eb63856a22b43e3e65a7b7843cd2d5376
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100447
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/diagram/diagramlayoutatoms.cxx | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx index e4980991795a..f81aa774402b 100644 --- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx +++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx @@ -456,26 +456,26 @@ namespace void ApplyConstraintToLayout(const Constraint& rConstraint, LayoutPropertyMap& rProperties) { const LayoutPropertyMap::const_iterator aRef = rProperties.find(rConstraint.msRefForName); - if (aRef != rProperties.end()) + if (aRef == rProperties.end()) + return; + + const LayoutProperty::const_iterator aRefType = aRef->second.find(rConstraint.mnRefType); + if (aRefType != aRef->second.end()) + rProperties[rConstraint.msForName][rConstraint.mnType] + = aRefType->second * rConstraint.mfFactor; + else { - const LayoutProperty::const_iterator aRefType = aRef->second.find(rConstraint.mnRefType); - if (aRefType != aRef->second.end()) - rProperties[rConstraint.msForName][rConstraint.mnType] - = aRefType->second * rConstraint.mfFactor; + // Values are never in EMU, while oox::drawingml::Shape position and size are always in + // EMU. + double fUnitFactor = 0; + if (isFontUnit(rConstraint.mnRefType)) + // Points -> EMU. + fUnitFactor = EMU_PER_PT; else - { - // Values are never in EMU, while oox::drawingml::Shape position and size are always in - // EMU. - double fUnitFactor = 0; - if (isFontUnit(rConstraint.mnRefType)) - // Points -> EMU. - fUnitFactor = EMU_PER_PT; - else - // Millimeters -> EMU. - fUnitFactor = EMU_PER_HMM * 100; - rProperties[rConstraint.msForName][rConstraint.mnType] - = rConstraint.mfValue * fUnitFactor; - } + // Millimeters -> EMU. + fUnitFactor = EMU_PER_HMM * 100; + rProperties[rConstraint.msForName][rConstraint.mnType] + = rConstraint.mfValue * fUnitFactor; } } } |