sw/source/core/unocore/unoobj.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
New commits: commit 7623f0f1afcdcb2ed63cea5220e10f7619ad53f1 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sun Oct 21 14:58:15 2018 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sun Oct 21 22:27:31 2018 +0200 pvs-studio: V590 The expression is excessive or contains a misprint Change-Id: Ibe61e593b7f0fb3abc033132450ce620ee3294c9 Reviewed-on: https://gerrit.libreoffice.org/62136 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 6594a6d00d96..4e2907dcafa2 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -1848,6 +1848,14 @@ void SwUnoCursorHelper::SetPropertyValues( throw beans::PropertyVetoException(aPropertyVetoExMsg, static_cast<cppu::OWeakObject *>(nullptr)); } +namespace +{ + bool NotInRange(sal_uInt16 nWID, sal_uInt16 nStart, sal_uInt16 nEnd) + { + return nWID < nStart || nWID > nEnd; + } +} + uno::Sequence< beans::PropertyState > SwUnoCursorHelper::GetPropertyStates( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, @@ -1889,10 +1897,8 @@ SwUnoCursorHelper::GetPropertyStates( } if (((SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION == eCaller) || (SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT == eCaller)) && - pEntry->nWID < FN_UNO_RANGE_BEGIN && - pEntry->nWID > FN_UNO_RANGE_END && - pEntry->nWID < RES_CHRATR_BEGIN && - pEntry->nWID > RES_TXTATR_END ) + NotInRange(pEntry->nWID, FN_UNO_RANGE_BEGIN, FN_UNO_RANGE_END) && + NotInRange(pEntry->nWID, RES_CHRATR_BEGIN, RES_TXTATR_END) ) { pStates[i] = beans::PropertyState_DEFAULT_VALUE; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits