diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-19 13:10:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-19 14:38:35 +0200 |
commit | 8fced917aa1af58216cbde56720f2f473eed86d9 (patch) | |
tree | 755d0dfba1fe4a5c34860d0d1ea4c6ce01525405 /cui/source | |
parent | f0110f798cee31ff87651dc2377eacef2ab8a8b7 (diff) |
clang-tidy readability-simplify-boolean-expr in accessibility..cui
Change-Id: Iae27da322c6ede592e6b268fb2210d3525ed22cc
Reviewed-on: https://gerrit.libreoffice.org/36677
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/customize/cfg.cxx | 35 | ||||
-rw-r--r-- | cui/source/customize/cfgutil.cxx | 5 | ||||
-rw-r--r-- | cui/source/options/optdict.cxx | 2 | ||||
-rw-r--r-- | cui/source/options/personalization.cxx | 4 | ||||
-rw-r--r-- | cui/source/tabpages/numfmt.cxx | 5 |
5 files changed, 10 insertions, 41 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index c8410db79857..6ac6fbbe8bf8 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -401,11 +401,7 @@ void RemoveEntry( SvxEntries* pEntries, SvxConfigEntry* pChildEntry ) bool SvxConfigPage::CanConfig( const OUString& aModuleId ) { - if ( aModuleId == "com.sun.star.script.BasicIDE" || aModuleId == "com.sun.star.frame.Bibliography" ) - { - return false; - } - return true; + return !(aModuleId == "com.sun.star.script.BasicIDE" || aModuleId == "com.sun.star.frame.Bibliography"); } OUString GetModuleName( const OUString& aModuleId ) @@ -3095,29 +3091,17 @@ SvxConfigEntry::~SvxConfigEntry() bool SvxConfigEntry::IsMovable() { - if ( IsPopup() && !IsMain() ) - { - return false; - } - return true; + return !IsPopup() || IsMain(); } bool SvxConfigEntry::IsDeletable() { - if ( IsMain() && !IsUserDefined() ) - { - return false; - } - return true; + return !IsMain() || IsUserDefined(); } bool SvxConfigEntry::IsRenamable() { - if ( IsMain() && !IsUserDefined() ) - { - return false; - } - return true; + return !IsMain() || IsUserDefined(); } SvxToolbarConfigPage::SvxToolbarConfigPage(vcl::Window *pParent, const SfxItemSet& rSet) @@ -4067,10 +4051,7 @@ ToolbarSaveInData::HasURL( const OUString& rURL ) if ( pEntry->GetCommand().equals( rURL ) ) { - if ( pEntry->IsParentData() ) - return false; - else - return true; + return !pEntry->IsParentData(); } ++iter; @@ -4081,11 +4062,7 @@ ToolbarSaveInData::HasURL( const OUString& rURL ) bool ToolbarSaveInData::HasSettings() { // return true if there is at least one toolbar entry - if ( GetEntries()->size() > 0 ) - { - return true; - } - return false; + return GetEntries()->size() > 0; } void ToolbarSaveInData::Reset() diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index 0579880c3bba..8e47238ca3ee 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -119,10 +119,7 @@ bool SfxStylesInfo_Impl::parseStyleCommand(SfxStyleInfo_Impl& aStyle) else if (sArg.startsWith(CMDURL_FPART_ONLY)) aStyle.sFamily = sArg.copy(LEN_FPART, sArg.getLength()-LEN_FPART); - if (!(aStyle.sFamily.isEmpty() || aStyle.sStyle.isEmpty())) - return true; - - return false; + return !(aStyle.sFamily.isEmpty() || aStyle.sStyle.isEmpty()); } void SfxStylesInfo_Impl::getLabel4Style(SfxStyleInfo_Impl& aStyle) diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx index 948cc2529606..a8541b98f1d5 100644 --- a/cui/source/options/optdict.cxx +++ b/cui/source/options/optdict.cxx @@ -567,7 +567,7 @@ IMPL_LINK(SvxEditDictionaryDialog, SelectHdl, SvTreeListBox*, pBox, void) // entries in the list box should exactly correspond to those from the // dictionary. Thus: pNewReplacePB->Enable(false); - pDeletePB->Enable( true && !IsDicReadonly_Impl() ); + pDeletePB->Enable( !IsDicReadonly_Impl() ); } }; diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx index 7fa466f10ae8..13087f5e352a 100644 --- a/cui/source/options/personalization.cxx +++ b/cui/source/options/personalization.cxx @@ -585,9 +585,7 @@ static bool parsePersonaInfo( const OString &rBuffer, OUString *pHeaderURL, OUSt return false; *pName = searchValue( rBuffer, persona, ""name":"" ); - if ( pName->isEmpty() ) - return false; - return true; + return !pName->isEmpty(); } SearchAndParseThread::SearchAndParseThread( SelectPersonaDialog* pDialog, diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx index d28fdbff8267..73be739ebdfc 100644 --- a/cui/source/tabpages/numfmt.cxx +++ b/cui/source/tabpages/numfmt.cxx @@ -959,10 +959,7 @@ void SvxNumberFormatTabPage::UpdateOptions_Impl( bool bCheckCatChange /*= sal_Fa case CAT_SCIENTIFIC: // bThousand is for Engineering notation { sal_uInt16 nIntDigits = pNumFmtShell->GetFormatIntegerDigits(theFormat); - if ( (nIntDigits > 0) && (nIntDigits % 3 == 0) ) - bThousand = true; - else - bThousand = false; + bThousand = (nIntDigits > 0) && (nIntDigits % 3 == 0); m_pBtnEngineering->Enable(); m_pBtnEngineering->Check( bThousand ); } |