sw/source/uibase/uno/unoatxt.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
New commits: commit 05b45cc9aa165f895beae0b8f9eb192243812999 Author: Vasily Melenchuk <vasily.melenc...@cib.de> AuthorDate: Tue Sep 25 21:03:03 2018 +0300 Commit: Thorsten Behrens <thorsten.behr...@cib.de> CommitDate: Tue Sep 25 22:20:02 2018 +0200 uno: extra exception for XAutoTextGroup:removeByName According to idl, removeByName() should throw NoSuchElementException on invalid element, but it does not Change-Id: I4ae84cd8c5a0f46bedeb3df6da4dee076888295f Reviewed-on: https://gerrit.libreoffice.org/60978 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx index 521ff75f09ac..05a7afb55d59 100644 --- a/sw/source/uibase/uno/unoatxt.cxx +++ b/sw/source/uibase/uno/unoatxt.cxx @@ -440,8 +440,10 @@ void SwXAutoTextGroup::removeByName(const OUString& aEntryName) throw container::NoSuchElementException(); sal_uInt16 nIdx = pGlosGroup->GetIndex(aEntryName); - if ( nIdx != USHRT_MAX ) - pGlosGroup->Delete(nIdx); + if ( nIdx == USHRT_MAX ) + throw container::NoSuchElementException(); + + pGlosGroup->Delete(nIdx); } OUString SwXAutoTextGroup::getName() _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits