diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-06 12:58:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-06 14:20:20 +0200 |
commit | 8f719de217b1079bd985b3bc63bbfa97069483bc (patch) | |
tree | cb15a422b7df468d913cb0815d628f7c0bc4fd9b /svx/source/smarttags | |
parent | bfc298d02ca6275588d5897d97ced9498a3e91aa (diff) |
loplugin:flatten in svx
Change-Id: I31f33a5f693d5fdb8282181c5bd7f31971efe784
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100236
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/smarttags')
-rw-r--r-- | svx/source/smarttags/SmartTagMgr.cxx | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/svx/source/smarttags/SmartTagMgr.cxx b/svx/source/smarttags/SmartTagMgr.cxx index a81bce9609c3..8d82643c82aa 100644 --- a/svx/source/smarttags/SmartTagMgr.cxx +++ b/svx/source/smarttags/SmartTagMgr.cxx @@ -202,49 +202,49 @@ bool SmartTagMgr::IsSmartTagTypeEnabled( const OUString& rSmartTagType ) const void SmartTagMgr::WriteConfiguration( const bool* pIsLabelTextWithSmartTags, const std::vector< OUString >* pDisabledTypes ) const { - if ( mxConfigurationSettings.is() ) + if ( !mxConfigurationSettings.is() ) + return; + + bool bCommit = false; + + if ( pIsLabelTextWithSmartTags ) { - bool bCommit = false; + const Any aEnabled = makeAny( *pIsLabelTextWithSmartTags ); - if ( pIsLabelTextWithSmartTags ) + try { - const Any aEnabled = makeAny( *pIsLabelTextWithSmartTags ); - - try - { - mxConfigurationSettings->setPropertyValue( "RecognizeSmartTags", aEnabled ); - bCommit = true; - } - catch ( css::uno::Exception& ) - { - } + mxConfigurationSettings->setPropertyValue( "RecognizeSmartTags", aEnabled ); + bCommit = true; } - - if ( pDisabledTypes ) + catch ( css::uno::Exception& ) { - Sequence< OUString > aTypes = comphelper::containerToSequence(*pDisabledTypes); + } + } - const Any aNewTypes = makeAny( aTypes ); + if ( pDisabledTypes ) + { + Sequence< OUString > aTypes = comphelper::containerToSequence(*pDisabledTypes); - try - { - mxConfigurationSettings->setPropertyValue( "ExcludedSmartTagTypes", aNewTypes ); - bCommit = true; - } - catch ( css::uno::Exception& ) - { - } + const Any aNewTypes = makeAny( aTypes ); + + try + { + mxConfigurationSettings->setPropertyValue( "ExcludedSmartTagTypes", aNewTypes ); + bCommit = true; } + catch ( css::uno::Exception& ) + { + } + } - if ( bCommit ) + if ( bCommit ) + { + try + { + Reference< util::XChangesBatch >( mxConfigurationSettings, UNO_QUERY_THROW )->commitChanges(); + } + catch ( css::uno::Exception& ) { - try - { - Reference< util::XChangesBatch >( mxConfigurationSettings, UNO_QUERY_THROW )->commitChanges(); - } - catch ( css::uno::Exception& ) - { - } } } } @@ -415,28 +415,28 @@ void SmartTagMgr::PrepareConfiguration( const OUString& rConfigurationGroupName void SmartTagMgr::ReadConfiguration( bool bExcludedTypes, bool bRecognize ) { - if ( mxConfigurationSettings.is() ) + if ( !mxConfigurationSettings.is() ) + return; + + if ( bExcludedTypes ) { - if ( bExcludedTypes ) - { - maDisabledSmartTagTypes.clear(); + maDisabledSmartTagTypes.clear(); - Any aAny = mxConfigurationSettings->getPropertyValue( "ExcludedSmartTagTypes" ); - Sequence< OUString > aValues; - aAny >>= aValues; + Any aAny = mxConfigurationSettings->getPropertyValue( "ExcludedSmartTagTypes" ); + Sequence< OUString > aValues; + aAny >>= aValues; - for ( const auto& rValue : std::as_const(aValues) ) - maDisabledSmartTagTypes.insert( rValue ); - } + for ( const auto& rValue : std::as_const(aValues) ) + maDisabledSmartTagTypes.insert( rValue ); + } - if ( bRecognize ) - { - Any aAny = mxConfigurationSettings->getPropertyValue( "RecognizeSmartTags" ); - bool bValue = true; - aAny >>= bValue; + if ( bRecognize ) + { + Any aAny = mxConfigurationSettings->getPropertyValue( "RecognizeSmartTags" ); + bool bValue = true; + aAny >>= bValue; - mbLabelTextWithSmartTags = bValue; - } + mbLabelTextWithSmartTags = bValue; } } |