[Libreoffice-commits] core.git: i18npool/source
Ian Barkley-Yeung (via logerrit)
logerrit at kemper.freedesktop.org
Mon Apr 27 07:41:27 UTC 2020
i18npool/source/breakiterator/breakiteratorImpl.cxx | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
New commits:
commit 27306e0eeee8a22e554f6f5bebccca4f778ae731
Author: Ian Barkley-Yeung <ibarkleyyeung at gmail.com>
AuthorDate: Sun Apr 26 20:18:33 2020 -0700
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Mon Apr 27 09:40:47 2020 +0200
tdf#42982: Improve UNO API error reporting
Improve error repoting in BreakIteratorImpl
Change-Id: I0be64a758ed81b7a720c8b26af14de6b51cc5dbc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92955
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index a6ce162270ef..5037a7c63474 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -53,7 +53,9 @@ BreakIteratorImpl::~BreakIteratorImpl()
sal_Int32 SAL_CALL BreakIteratorImpl::nextCharacters( const OUString& Text, sal_Int32 nStartPos,
const Locale &rLocale, sal_Int16 nCharacterIteratorMode, sal_Int32 nCount, sal_Int32& nDone )
{
- if (nCount < 0) throw RuntimeException();
+ if (nCount < 0)
+ throw RuntimeException("BreakIteratorImpl::nextCharacters: expected nCount >=0, got "
+ + OUString::number(nCount));
return LBI->nextCharacters( Text, nStartPos, rLocale, nCharacterIteratorMode, nCount, nDone);
}
@@ -61,7 +63,9 @@ sal_Int32 SAL_CALL BreakIteratorImpl::nextCharacters( const OUString& Text, sal_
sal_Int32 SAL_CALL BreakIteratorImpl::previousCharacters( const OUString& Text, sal_Int32 nStartPos,
const Locale& rLocale, sal_Int16 nCharacterIteratorMode, sal_Int32 nCount, sal_Int32& nDone )
{
- if (nCount < 0) throw RuntimeException();
+ if (nCount < 0)
+ throw RuntimeException("BreakIteratorImpl::previousCharacters: expected nCount >=0, got "
+ + OUString::number(nCount));
return LBI->previousCharacters( Text, nStartPos, rLocale, nCharacterIteratorMode, nCount, nDone);
}
@@ -647,7 +651,7 @@ BreakIteratorImpl::getLocaleSpecificBreakIterator(const Locale& rLocale)
return xBI;
}
}
- throw RuntimeException();
+ throw RuntimeException("getLocaleSpecificBreakIterator: iterator not found");
}
OUString SAL_CALL
More information about the Libreoffice-commits
mailing list