diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2018-09-25 21:03:03 +0300 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-09-25 22:20:02 +0200 |
commit | 05b45cc9aa165f895beae0b8f9eb192243812999 (patch) | |
tree | 23717ce9096f068016d94bbf275125785570c6f1 /sw/source | |
parent | 6328c56e1819cf85cb58539f7f3bace8ff577245 (diff) |
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.Behrens@CIB.de>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/uibase/uno/unoatxt.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
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() |