summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-04-24 09:24:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-04-24 11:31:02 +0200
commit63df0796f5ec500f3b6fb34510d4bc79c009e76d (patch)
tree1abacb83b15612c8ef712c89eb3dc15f28bc41c4
parent1c8f03b48a02a56bc4eb364d8a4e9bd4715a530a (diff)
clang-tidy readability-simplify-boolean-expr in oox..sal
Change-Id: I1e14e5b15d2dd9e35477f8189cbecf0b443b9381 Reviewed-on: https://gerrit.libreoffice.org/36875 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--oox/source/export/vmlexport.cxx5
-rw-r--r--opencl/source/openclconfig.cxx8
-rw-r--r--opencl/source/openclwrapper.cxx4
-rw-r--r--sal/osl/unx/profile.cxx10
-rw-r--r--sal/qa/OStringBuffer/rtl_OStringBuffer.cxx12
-rw-r--r--sal/qa/osl/file/osl_File.cxx5
6 files changed, 8 insertions, 36 deletions
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index aa814c460f51..ef400be64f7c 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -199,10 +199,7 @@ bool VMLExport::IsWaterMarkShape(const OUString& rStr)
{
if (rStr.isEmpty() ) return false;
- if (rStr.match("PowerPlusWaterMarkObject") || rStr.match("WordPictureWatermark"))
- return true;
- else
- return false;
+ return rStr.match("PowerPlusWaterMarkObject") || rStr.match("WordPictureWatermark");
}
static void impl_AddArrowHead( sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue )
diff --git a/opencl/source/openclconfig.cxx b/opencl/source/openclconfig.cxx
index eaa0bba5e06c..b81ffed22937 100644
--- a/opencl/source/openclconfig.cxx
+++ b/opencl/source/openclconfig.cxx
@@ -38,8 +38,7 @@ bool OpenCLConfig::operator== (const OpenCLConfig& r) const
{
return (mbUseOpenCL == r.mbUseOpenCL &&
maBlackList == r.maBlackList &&
- maWhiteList == r.maWhiteList &&
- true);
+ maWhiteList == r.maWhiteList);
}
bool OpenCLConfig::operator!= (const OpenCLConfig& r) const
@@ -122,10 +121,7 @@ bool match(const OUString& rPattern, const OUString& rInput)
icu::UnicodeString sIcuInput(reinterpret_cast<const UChar*>(rInput.getStr()), rInput.getLength());
RegexMatcher aMatcher(sIcuPattern, sIcuInput, 0, nIcuError);
- if (U_SUCCESS(nIcuError) && aMatcher.matches(nIcuError) && U_SUCCESS(nIcuError))
- return true;
-
- return false;
+ return U_SUCCESS(nIcuError) && aMatcher.matches(nIcuError) && U_SUCCESS(nIcuError);
}
bool match(const OpenCLConfig::ImplMatcher& rListEntry, const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice)
diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx
index 796289362472..8660dd744816 100644
--- a/opencl/source/openclwrapper.cxx
+++ b/opencl/source/openclwrapper.cxx
@@ -791,9 +791,7 @@ void findDeviceInfoFromDeviceId(cl_device_id aDeviceId, size_t& rDeviceId, size_
bool canUseOpenCL()
{
- if (getenv("SAL_DISABLE_OPENCL") || !officecfg::Office::Common::Misc::UseOpenCL::get())
- return false;
- return true;
+ return !getenv("SAL_DISABLE_OPENCL") || !officecfg::Office::Common::Misc::UseOpenCL::get();
}
bool switchOpenCLDevice(const OUString* pDevice, bool bAutoSelect, bool bForceEvaluation, OUString& rOutSelectedDeviceVersionIDString)
diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx
index a979c7b8e71b..c5e5dd77d819 100644
--- a/sal/osl/unx/profile.cxx
+++ b/sal/osl/unx/profile.cxx
@@ -890,15 +890,7 @@ static bool OslProfile_lockFile(const osl_TFile* pFile, osl_TLockMode eMode)
sal_Char* pEnvValue;
pEnvValue = getenv( "STAR_PROFILE_LOCKING_DISABLED" );
- if ( pEnvValue == nullptr )
- {
- bLockingDisabled = false;
-
- }
- else
- {
- bLockingDisabled = true;
- }
+ bLockingDisabled = pEnvValue != nullptr;
bIsInitialized = true;
}
diff --git a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
index bcdc5c5ab07c..caad268044da 100644
--- a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
+++ b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
@@ -14661,11 +14661,7 @@ namespace rtl_OStringBuffer
OString sBufferString(_sStrBuf.getStr());
sal_Int32 nPos = sBufferString.indexOf(sFloatValue);
- if ( nPos >= 0 && nPos == _nLen)
- {
- return true;
- }
- return false;
+ return nPos >= 0 && nPos == _nLen;
}
};
@@ -15829,11 +15825,7 @@ namespace rtl_OStringBuffer
OString sBufferString(_sStrBuf.getStr());
sal_Int32 nPos = sBufferString.indexOf(sDoubleValue);
- if ( nPos >= 0 && nPos == _nLen)
- {
- return true;
- }
- return false;
+ return nPos >= 0 && nPos == _nLen;
}
};
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index 77ddcdede871..027c556d5cb8 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -351,10 +351,7 @@ inline bool checkDirectory( const ::rtl::OUString & str, oslCheckMode nCheckMode
case oslCheckMode::ReadAccess:
//rc = pDir->getNextItem( rItem, 0 );
rc = aDir.getNextItem( rItem );
- if ( ( rc == ::osl::FileBase::E_None ) || ( rc == ::osl::FileBase::E_NOENT ) )
- bCheckResult = true;
- else
- bCheckResult = false;
+ bCheckResult = ( rc == ::osl::FileBase::E_None ) || ( rc == ::osl::FileBase::E_NOENT );
break;
case oslCheckMode::WriteAccess:
( ( aUString += str ) += aSlashURL ) += aTmpName2;