From 05b45cc9aa165f895beae0b8f9eb192243812999 Mon Sep 17 00:00:00 2001 From: Vasily Melenchuk Date: Tue, 25 Sep 2018 21:03:03 +0300 Subject: 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 --- sw/source/uibase/uno/unoatxt.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sw') 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() -- cgit