summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-05-29 11:36:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-05-29 20:56:17 +0200
commit80f28e377db0ca04da57eed77d42f44cbdea363d (patch)
tree44268ab2601aedd6a34a9a40f943cd1f55e400ea /sax
parent5f56f07e9278e357a079cbecb5366da98e36d97f (diff)
loplugin:simplifybool in oox..sd
Change-Id: I76cbd5d3e65f0b392d713a51607f5c88dae79593 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95101 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sax')
-rw-r--r--sax/source/expatwrap/saxwriter.cxx4
-rw-r--r--sax/source/expatwrap/xml2utf.cxx2
-rw-r--r--sax/source/tools/converter.cxx2
3 files changed, 4 insertions, 4 deletions
diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx
index f4f4c4bae142..2fe579648ce5 100644
--- a/sax/source/expatwrap/saxwriter.cxx
+++ b/sax/source/expatwrap/saxwriter.cxx
@@ -464,7 +464,7 @@ bool SaxWriterHelper::convertToXML( const sal_Unicode * pStr,
rPos = writeSequence();
// reset left-over surrogate
- if( ( nSurrogate != 0 ) && !( c >= 0xd800 && c < 0xdc00 ) )
+ if( ( nSurrogate != 0 ) && ( c < 0xd800 || c >= 0xdc00 ) )
{
OSL_ENSURE( nSurrogate != 0, "left-over Unicode surrogate" );
nSurrogate = 0;
@@ -901,7 +901,7 @@ sal_Int32 calcXMLByteLength( const OUString& rStr,
}
// surrogate processing
- if( ( nSurrogate != 0 ) && !( c >= 0xd800 && c < 0xdc00 ) )
+ if( ( nSurrogate != 0 ) && ( c < 0xd800 || c >= 0xdc00 ) )
nSurrogate = 0;
}
diff --git a/sax/source/expatwrap/xml2utf.cxx b/sax/source/expatwrap/xml2utf.cxx
index 420f90b6c3f0..9e531b13cfa6 100644
--- a/sax/source/expatwrap/xml2utf.cxx
+++ b/sax/source/expatwrap/xml2utf.cxx
@@ -117,7 +117,7 @@ sal_Int32 XMLFile2UTFConverter::readAndConvert( Sequence<sal_Int8> &seq , sal_In
void XMLFile2UTFConverter::removeEncoding( Sequence<sal_Int8> &seq )
{
const sal_Int8 *pSource = seq.getArray();
- if (!(seq.getLength() >= 5 && !strncmp(reinterpret_cast<const char *>(pSource), "<?xml", 5)))
+ if (seq.getLength() < 5 || strncmp(reinterpret_cast<const char *>(pSource), "<?xml", 5))
return;
// scan for encoding
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index ac6eba928526..1f070e0260e1 100644
--- a/sax/source/tools/converter.cxx
+++ b/sax/source/tools/converter.cxx
@@ -970,7 +970,7 @@ readUnsignedNumber(const OUString & rString,
while (nPos < rString.getLength())
{
const sal_Unicode c = rString[nPos];
- if (!(('0' <= c) && (c <= '9')))
+ if (('0' > c) || (c > '9'))
break;
++nPos;
}