summaryrefslogtreecommitdiff
path: root/starmath
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 /starmath
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 'starmath')
-rw-r--r--starmath/source/accessibility.cxx8
-rw-r--r--starmath/source/node.cxx2
2 files changed, 5 insertions, 5 deletions
diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx
index 854f09443712..014bc79e7ac5 100644
--- a/starmath/source/accessibility.cxx
+++ b/starmath/source/accessibility.cxx
@@ -435,7 +435,7 @@ Sequence< beans::PropertyValue > SAL_CALL SmGraphicAccessible::getCharacterAttri
{
SolarMutexGuard aGuard;
sal_Int32 nLen = GetAccessibleText_Impl().getLength();
- if (!(0 <= nIndex && nIndex < nLen))
+ if (0 > nIndex || nIndex >= nLen)
throw IndexOutOfBoundsException();
return Sequence< beans::PropertyValue >();
}
@@ -455,7 +455,7 @@ awt::Rectangle SAL_CALL SmGraphicAccessible::getCharacterBounds( sal_Int32 nInde
if (!pDoc)
throw RuntimeException();
OUString aTxt( GetAccessibleText_Impl() );
- if (!(0 <= nIndex && nIndex <= aTxt.getLength())) // aTxt.getLength() is valid
+ if (0 > nIndex || nIndex > aTxt.getLength()) // aTxt.getLength() is valid
throw IndexOutOfBoundsException();
// find a reasonable rectangle for position aTxt.getLength().
@@ -595,8 +595,8 @@ sal_Bool SAL_CALL SmGraphicAccessible::setSelection(
{
SolarMutexGuard aGuard;
sal_Int32 nLen = GetAccessibleText_Impl().getLength();
- if (!(0 <= nStartIndex && nStartIndex < nLen) ||
- !(0 <= nEndIndex && nEndIndex < nLen))
+ if (0 > nStartIndex || nStartIndex >= nLen ||
+ 0 > nEndIndex || nEndIndex >= nLen)
throw IndexOutOfBoundsException();
return false;
}
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 6238416a6bda..ba62c4d9a484 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -2658,7 +2658,7 @@ void SmSpecialNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell
static const sal_Unicode cUppercaseOmega = 0x03A9;
sal_Unicode cChar = rTmp[0];
// uppercase letters should be straight and lowercase letters italic
- bItalic = !(cUppercaseAlpha <= cChar && cChar <= cUppercaseOmega);
+ bItalic = (cUppercaseAlpha > cChar || cChar > cUppercaseOmega);
}
}