summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-19 09:07:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-05-30 10:49:51 +0200
commitd6c32cffb5cc81989b4bb4a221a152bbe607bd98 (patch)
tree2c4ef9ec2a201ffcfea145ed5a0b901f2b6853ea /svl
parent9ab64dc48a6a61edce6ff3724093162ca1cf8331 (diff)
loplugin:simplifybool extend to expression like !(a < b || c > d)
mostly to catch stuff from the flatten work, but I think this looks good in general Change-Id: I7be5b7bcf1f3d9f980c748ba20793965cef957e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92493 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/misc/urihelper.cxx2
-rw-r--r--svl/source/numbers/zformat.cxx6
-rw-r--r--svl/source/numbers/zforscan.cxx2
-rw-r--r--svl/source/passwordcontainer/passwordcontainer.cxx2
4 files changed, 6 insertions, 6 deletions
diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx
index 127134d1ab72..507c8c4f0bb9 100644
--- a/svl/source/misc/urihelper.cxx
+++ b/svl/source/misc/urihelper.cxx
@@ -433,7 +433,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText,
INetURLObject::EncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
{
- if (!(rBegin <= rEnd && rEnd <= rText.getLength()))
+ if (rBegin > rEnd || rEnd > rText.getLength())
return OUString();
// Search for the first substring of [rBegin..rEnd[ that matches any of the
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 774b8fdd0d42..f683b4c62f12 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -2984,7 +2984,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber,
bRes |= ImpNumberFillWithThousands(sStr, fNumber, k, j, nIx,
rInfo.nCntPre);
}
- if (bSign && !(nFrac == 0 && fNum == 0.0))
+ if (bSign && (nFrac != 0 || fNum != 0.0))
{
sBuff.insert(0, '-'); // Not -0
}
@@ -5561,8 +5561,8 @@ OUString SvNumberformat::impTransliterateImpl(const OUString& rStr,
nField = rNum.GetParams().indexOf(rKeywords[nDateKey] + "=", ++nField);
}
while (nField != -1 && nField != 0 &&
- !(rNum.GetParams()[nField - 1] == ',' ||
- rNum.GetParams()[nField - 1] == ' '));
+ (rNum.GetParams()[nField - 1] != ',' &&
+ rNum.GetParams()[nField - 1] != ' '));
// no format specified for actual keyword
if (nField == -1)
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index bf408885a319..200095d3ac82 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -796,7 +796,7 @@ short ImpSvNumberformatScan::Next_Symbol( const OUString& rStr,
// "$U" (symbol) of "[$UYU]" (abbreviation).
if ( nCurrPos >= 0 && sCurString.getLength() > 1 &&
nPos-1 + sCurString.getLength() <= rStr.getLength() &&
- !(nPos > 1 && rStr[nPos-2] == '[') )
+ (nPos <= 1 || rStr[nPos-2] != '[') )
{
OUString aTest = pChrCls->uppercase( rStr.copy( nPos-1, sCurString.getLength() ) );
if ( aTest == sCurString )
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx
index 8bdc1adb7314..506772366e87 100644
--- a/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -92,7 +92,7 @@ static std::vector< OUString > getInfoFromInd( const OUString& aInd )
else
aStart = false;
- while( *pLine && !( pLine[0] == '_' && pLine[1] == '_' ))
+ while( *pLine && ( pLine[0] != '_' || pLine[1] != '_' ))
if( *pLine != '_' )
{
newItem.append( *pLine );