diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-02-07 11:55:24 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-02-11 07:07:30 +0100 |
commit | 121182bddbce8f14cccdf7db9af8c08867a0912f (patch) | |
tree | dbad1ab9b7a4a4ea0f5862ae1a8679aa117c8829 /sw/source/uibase/uno/unoatxt.cxx | |
parent | 6e8c9bdf0a55141d3cbd181862aec89b788bb060 (diff) |
tdf#120703 PVS: V560 A part of conditional expression is always true/false
Change-Id: I67462369d93e9d9ff3c056800947c4b75f71ba5f
Reviewed-on: https://gerrit.libreoffice.org/67486
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source/uibase/uno/unoatxt.cxx')
-rw-r--r-- | sw/source/uibase/uno/unoatxt.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx index ad6b68a6cfd5..19562ec3382a 100644 --- a/sw/source/uibase/uno/unoatxt.cxx +++ b/sw/source/uibase/uno/unoatxt.cxx @@ -274,7 +274,7 @@ void SwXAutoTextGroup::renameByName(const OUString& aElementName, if(!pGlosGroup || pGlosGroup->GetError()) throw uno::RuntimeException(); - sal_uInt16 nIdx = pGlosGroup->GetIndex( aElementName); + const sal_uInt16 nIdx = pGlosGroup->GetIndex( aElementName); if(USHRT_MAX == nIdx) throw lang::IllegalArgumentException(); OUString aNewShort(aNewElementName); @@ -282,9 +282,8 @@ void SwXAutoTextGroup::renameByName(const OUString& aElementName, sal_uInt16 nOldLongIdx = pGlosGroup->GetLongIndex( aNewShort ); sal_uInt16 nOldIdx = pGlosGroup->GetIndex( aNewName ); - if( nIdx != USHRT_MAX && - (nOldLongIdx == USHRT_MAX || nOldLongIdx == nIdx )&& - (nOldIdx == USHRT_MAX || nOldIdx == nIdx )) + if ((nOldLongIdx == USHRT_MAX || nOldLongIdx == nIdx) + && (nOldIdx == USHRT_MAX || nOldIdx == nIdx)) { pGlosGroup->Rename( nIdx, &aNewShort, &aNewName ); if(pGlosGroup->GetError() != ERRCODE_NONE) |