diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-06 09:00:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-06 10:27:49 +0200 |
commit | 5633b217a6b5f6e1bb673d468fa8cb7ac66ceb54 (patch) | |
tree | 37ab8cb1fb3a9d1afebbb64cf92911b65274fe10 /xmloff/source/style/prstylei.cxx | |
parent | 04336ca32ea08f0c0c78125ea3b07689ee51acf2 (diff) |
loplugin:flatten in xmloff/style
Change-Id: I8a9f939e799f8aeb119a56e33d5291177135b3ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100196
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/style/prstylei.cxx')
-rw-r--r-- | xmloff/source/style/prstylei.cxx | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx index 708ae6675e57..931be4fce799 100644 --- a/xmloff/source/style/prstylei.cxx +++ b/xmloff/source/style/prstylei.cxx @@ -577,24 +577,24 @@ bool XMLPropStyleContext::doNewDrawingLayerFillStyleDefinitionsExist( void XMLPropStyleContext::deactivateOldFillStyleDefinitions( const OldFillStyleDefinitionSet& rHashSetOfTags) { - if(!rHashSetOfTags.empty() && !maProperties.empty()) - { - const rtl::Reference< XMLPropertySetMapper >& rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper(); + if(rHashSetOfTags.empty() || maProperties.empty()) + return; - if(rMapper.is()) + const rtl::Reference< XMLPropertySetMapper >& rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper(); + + if(!rMapper.is()) + return; + + for(auto& a : maProperties) + { + if(a.mnIndex != -1) { - for(auto& a : maProperties) - { - if(a.mnIndex != -1) - { - const OUString& rPropName = rMapper->GetEntryAPIName(a.mnIndex); + const OUString& rPropName = rMapper->GetEntryAPIName(a.mnIndex); - if(rHashSetOfTags.find(rPropName) != rHashSetOfTags.end()) - { - // mark entry as inactive - a.mnIndex = -1; - } - } + if(rHashSetOfTags.find(rPropName) != rHashSetOfTags.end()) + { + // mark entry as inactive + a.mnIndex = -1; } } } @@ -602,46 +602,46 @@ void XMLPropStyleContext::deactivateOldFillStyleDefinitions( void XMLPropStyleContext::translateNameBasedDrawingLayerFillStyleDefinitionsToStyleDisplayNames() { - if(!maProperties.empty()) - { - const rtl::Reference< XMLPropertySetMapper >& rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper(); + if(maProperties.empty()) + return; - if(rMapper.is()) + const rtl::Reference< XMLPropertySetMapper >& rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper(); + + if(!rMapper.is()) + return; + + static OUString s_FillGradientName("FillGradientName"); + static OUString s_FillHatchName("FillHatchName"); + static OUString s_FillBitmapName("FillBitmapName"); + static OUString s_FillTransparenceGradientName("FillTransparenceGradientName"); + + for(auto& a : maProperties) + { + if(a.mnIndex != -1) { - static OUString s_FillGradientName("FillGradientName"); - static OUString s_FillHatchName("FillHatchName"); - static OUString s_FillBitmapName("FillBitmapName"); - static OUString s_FillTransparenceGradientName("FillTransparenceGradientName"); + const OUString& rPropName = rMapper->GetEntryAPIName(a.mnIndex); + XmlStyleFamily aStyleFamily(XmlStyleFamily::DATA_STYLE); - for(auto& a : maProperties) + if(rPropName == s_FillGradientName || rPropName == s_FillTransparenceGradientName) { - if(a.mnIndex != -1) - { - const OUString& rPropName = rMapper->GetEntryAPIName(a.mnIndex); - XmlStyleFamily aStyleFamily(XmlStyleFamily::DATA_STYLE); - - if(rPropName == s_FillGradientName || rPropName == s_FillTransparenceGradientName) - { - aStyleFamily = XmlStyleFamily::SD_GRADIENT_ID; - } - else if(rPropName == s_FillHatchName) - { - aStyleFamily = XmlStyleFamily::SD_HATCH_ID; - } - else if(rPropName == s_FillBitmapName) - { - aStyleFamily = XmlStyleFamily::SD_FILL_IMAGE_ID; - } + aStyleFamily = XmlStyleFamily::SD_GRADIENT_ID; + } + else if(rPropName == s_FillHatchName) + { + aStyleFamily = XmlStyleFamily::SD_HATCH_ID; + } + else if(rPropName == s_FillBitmapName) + { + aStyleFamily = XmlStyleFamily::SD_FILL_IMAGE_ID; + } - if(aStyleFamily != XmlStyleFamily::DATA_STYLE) - { - OUString sStyleName; + if(aStyleFamily != XmlStyleFamily::DATA_STYLE) + { + OUString sStyleName; - a.maValue >>= sStyleName; - sStyleName = GetImport().GetStyleDisplayName( aStyleFamily, sStyleName ); - a.maValue <<= sStyleName; - } - } + a.maValue >>= sStyleName; + sStyleName = GetImport().GetStyleDisplayName( aStyleFamily, sStyleName ); + a.maValue <<= sStyleName; } } } |