[Libreoffice-commits] core.git: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Sep 25 20:20:27 UTC 2018


 sw/source/uibase/uno/unoatxt.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 05b45cc9aa165f895beae0b8f9eb192243812999
Author:     Vasily Melenchuk <vasily.melenchuk at cib.de>
AuthorDate: Tue Sep 25 21:03:03 2018 +0300
Commit:     Thorsten Behrens <Thorsten.Behrens at 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.Behrens at 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()


More information about the Libreoffice-commits mailing list