diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-07 10:14:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-07 13:11:35 +0200 |
commit | e41106332982faef3c8b343b96904eeaa9ff6f60 (patch) | |
tree | 4c468229353f295eaeca6e1970e414159da9d608 /linguistic/source/lngprophelp.cxx | |
parent | 6a2d03e7c796ad90c4d9d134ad1a91d527953c66 (diff) |
loplugin:flatten in linguistic
Change-Id: I5dc83e3f3697ccd6a482c799af267587a77563c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91799
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'linguistic/source/lngprophelp.cxx')
-rw-r--r-- | linguistic/source/lngprophelp.cxx | 164 |
1 files changed, 82 insertions, 82 deletions
diff --git a/linguistic/source/lngprophelp.cxx b/linguistic/source/lngprophelp.cxx index ba3fbd52e7af..1c066e7eba34 100644 --- a/linguistic/source/lngprophelp.cxx +++ b/linguistic/source/lngprophelp.cxx @@ -108,29 +108,29 @@ void PropertyChgHelper::SetDefaultValues() void PropertyChgHelper::GetCurrentValues() { const auto& rPropNames = GetPropNames(); - if (GetPropSet().is() && rPropNames.hasElements()) + if (!(GetPropSet().is() && rPropNames.hasElements())) + return; + + for (const OUString& rPropName : rPropNames) { - for (const OUString& rPropName : rPropNames) - { - bool *pbVal = nullptr, - *pbResVal = nullptr; + bool *pbVal = nullptr, + *pbResVal = nullptr; - if ( rPropName == UPN_IS_IGNORE_CONTROL_CHARACTERS ) - { - pbVal = &bIsIgnoreControlCharacters; - pbResVal = &bResIsIgnoreControlCharacters; - } - else if ( rPropName == UPN_IS_USE_DICTIONARY_LIST ) - { - pbVal = &bIsUseDictionaryList; - pbResVal = &bResIsUseDictionaryList; - } + if ( rPropName == UPN_IS_IGNORE_CONTROL_CHARACTERS ) + { + pbVal = &bIsIgnoreControlCharacters; + pbResVal = &bResIsIgnoreControlCharacters; + } + else if ( rPropName == UPN_IS_USE_DICTIONARY_LIST ) + { + pbVal = &bIsUseDictionaryList; + pbResVal = &bResIsUseDictionaryList; + } - if (pbVal && pbResVal) - { - GetPropSet()->getPropertyValue( rPropName ) >>= *pbVal; - *pbResVal = *pbVal; - } + if (pbVal && pbResVal) + { + GetPropSet()->getPropertyValue( rPropName ) >>= *pbVal; + *pbResVal = *pbVal; } } } @@ -358,34 +358,34 @@ void PropertyHelper_Spell::GetCurrentValues() PropertyChgHelper::GetCurrentValues(); const auto& rPropNames = GetPropNames(); - if (GetPropSet().is() && rPropNames.hasElements()) + if (!(GetPropSet().is() && rPropNames.hasElements())) + return; + + for (const OUString& rPropName : rPropNames) { - for (const OUString& rPropName : rPropNames) - { - bool *pbVal = nullptr, - *pbResVal = nullptr; + bool *pbVal = nullptr, + *pbResVal = nullptr; - if ( rPropName == UPN_IS_SPELL_UPPER_CASE ) - { - pbVal = &bIsSpellUpperCase; - pbResVal = &bResIsSpellUpperCase; - } - else if ( rPropName == UPN_IS_SPELL_WITH_DIGITS ) - { - pbVal = &bIsSpellWithDigits; - pbResVal = &bResIsSpellWithDigits; - } - else if ( rPropName == UPN_IS_SPELL_CAPITALIZATION ) - { - pbVal = &bIsSpellCapitalization; - pbResVal = &bResIsSpellCapitalization; - } + if ( rPropName == UPN_IS_SPELL_UPPER_CASE ) + { + pbVal = &bIsSpellUpperCase; + pbResVal = &bResIsSpellUpperCase; + } + else if ( rPropName == UPN_IS_SPELL_WITH_DIGITS ) + { + pbVal = &bIsSpellWithDigits; + pbResVal = &bResIsSpellWithDigits; + } + else if ( rPropName == UPN_IS_SPELL_CAPITALIZATION ) + { + pbVal = &bIsSpellCapitalization; + pbResVal = &bResIsSpellCapitalization; + } - if (pbVal && pbResVal) - { - GetPropSet()->getPropertyValue( rPropName ) >>= *pbVal; - *pbResVal = *pbVal; - } + if (pbVal && pbResVal) + { + GetPropSet()->getPropertyValue( rPropName ) >>= *pbVal; + *pbResVal = *pbVal; } } } @@ -531,46 +531,46 @@ void PropertyHelper_Hyphen::GetCurrentValues() PropertyChgHelper::GetCurrentValues(); const auto& rPropNames = GetPropNames(); - if (GetPropSet().is() && rPropNames.hasElements()) + if (!(GetPropSet().is() && rPropNames.hasElements())) + return; + + for (const OUString& rPropName : rPropNames) { - for (const OUString& rPropName : rPropNames) - { - sal_Int16 *pnVal = nullptr, - *pnResVal = nullptr; - bool *pbVal = nullptr; - bool *pbResVal = nullptr; + sal_Int16 *pnVal = nullptr, + *pnResVal = nullptr; + bool *pbVal = nullptr; + bool *pbResVal = nullptr; - if ( rPropName == UPN_HYPH_MIN_LEADING ) - { - pnVal = &nHyphMinLeading; - pnResVal = &nResHyphMinLeading; - } - else if ( rPropName == UPN_HYPH_MIN_TRAILING ) - { - pnVal = &nHyphMinTrailing; - pnResVal = &nResHyphMinTrailing; - } - else if ( rPropName == UPN_HYPH_MIN_WORD_LENGTH ) - { - pnVal = &nHyphMinWordLength; - pnResVal = &nResHyphMinWordLength; - } - else if ( rPropName == UPN_HYPH_NO_CAPS ) - { - pbVal = &bNoHyphenateCaps; - pbResVal = &bResNoHyphenateCaps; - } + if ( rPropName == UPN_HYPH_MIN_LEADING ) + { + pnVal = &nHyphMinLeading; + pnResVal = &nResHyphMinLeading; + } + else if ( rPropName == UPN_HYPH_MIN_TRAILING ) + { + pnVal = &nHyphMinTrailing; + pnResVal = &nResHyphMinTrailing; + } + else if ( rPropName == UPN_HYPH_MIN_WORD_LENGTH ) + { + pnVal = &nHyphMinWordLength; + pnResVal = &nResHyphMinWordLength; + } + else if ( rPropName == UPN_HYPH_NO_CAPS ) + { + pbVal = &bNoHyphenateCaps; + pbResVal = &bResNoHyphenateCaps; + } - if (pnVal && pnResVal) - { - GetPropSet()->getPropertyValue( rPropName ) >>= *pnVal; - *pnResVal = *pnVal; - } - else if (pbVal && pbResVal) - { - GetPropSet()->getPropertyValue( rPropName ) >>= *pbVal; - *pbResVal = *pbVal; - } + if (pnVal && pnResVal) + { + GetPropSet()->getPropertyValue( rPropName ) >>= *pnVal; + *pnResVal = *pnVal; + } + else if (pbVal && pbResVal) + { + GetPropSet()->getPropertyValue( rPropName ) >>= *pbVal; + *pbResVal = *pbVal; } } } |