diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-05-05 16:50:03 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-05-06 12:22:59 +0200 |
commit | 76d762fea934df31cd81768d467d5d40d439cb67 (patch) | |
tree | a3f735d1bfa4ad8ffabafceea2407ea8852bd16f /sw/source | |
parent | 5326e00cf37ebc796c650bff774441b7ec40dec8 (diff) |
do the casts just once so this is readable
Change-Id: Idb9eefa31c084604a134f28892b333c56f6d6fc2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167161
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/bastyp/calc.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 1633090972d0..fbfc4b701457 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -119,22 +119,22 @@ const sal_Int32 coContFlags = & ~i18n::KParseTokens::IGNORE_LEADING_WS; extern "C" { -static int OperatorCompare( const void *pFirst, const void *pSecond) +static int OperatorCompare(const void *pA, const void *pB) { + const CalcOp *pFirst = static_cast<const CalcOp*>(pA); + const CalcOp *pSecond = static_cast<const CalcOp*>(pB); + int nRet = 0; - if( CALC_NAME == static_cast<const CalcOp*>(pFirst)->eOp ) + if( CALC_NAME == pFirst->eOp ) { - nRet = static_cast<const CalcOp*>(pFirst)->aName.compareTo( - static_cast<const CalcOp*>(pSecond)->aName ); + nRet = pFirst->aName.compareTo(pSecond->aName ); } else { - if( CALC_NAME == static_cast<const CalcOp*>(pSecond)->eOp ) - nRet = -1 * static_cast<const CalcOp*>(pSecond)->aName.compareTo( - static_cast<const CalcOp*>(pFirst)->aName ); + if( CALC_NAME == pSecond->eOp ) + nRet = -1 * pSecond->aName.compareTo(pFirst->aName); else - nRet = static_cast<const CalcOp*>(pFirst)->aName.compareTo( - static_cast<const CalcOp*>(pSecond)->aName ); + nRet = pFirst->aName.compareTo(pSecond->aName); } return nRet; } |