Kaydet (Commit) d0a0da71 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: tdf#91057 transliterateChar2Char throws MultipleCharsOutputException

for ß, but toTitle only allows RuntimeException, which is our usual
awesomeness

Change-Id: Ib5618a55a369fa5cd1d323f657f0798776828386
üst 220c9fc2
...@@ -21,8 +21,10 @@ ...@@ -21,8 +21,10 @@
#include <com/sun/star/i18n/UnicodeScript.hpp> #include <com/sun/star/i18n/UnicodeScript.hpp>
#include <com/sun/star/i18n/UnicodeType.hpp> #include <com/sun/star/i18n/UnicodeType.hpp>
#include <com/sun/star/i18n/KCharacterType.hpp> #include <com/sun/star/i18n/KCharacterType.hpp>
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <unicode/uchar.h> #include <unicode/uchar.h>
#include <comphelper/string.hxx> #include <comphelper/string.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/supportsservice.hxx>
#include <breakiteratorImpl.hxx> #include <breakiteratorImpl.hxx>
...@@ -79,6 +81,8 @@ cclass_Unicode::toLower( const OUString& Text, sal_Int32 nPos, sal_Int32 nCount, ...@@ -79,6 +81,8 @@ cclass_Unicode::toLower( const OUString& Text, sal_Int32 nPos, sal_Int32 nCount,
OUString SAL_CALL OUString SAL_CALL
cclass_Unicode::toTitle( const OUString& Text, sal_Int32 nPos, sal_Int32 nCount, const Locale& rLocale ) throw(RuntimeException, std::exception) { cclass_Unicode::toTitle( const OUString& Text, sal_Int32 nPos, sal_Int32 nCount, const Locale& rLocale ) throw(RuntimeException, std::exception) {
try
{
sal_Int32 len = Text.getLength(); sal_Int32 len = Text.getLength();
if (nPos >= len) if (nPos >= len)
return OUString(); return OUString();
...@@ -100,6 +104,18 @@ cclass_Unicode::toTitle( const OUString& Text, sal_Int32 nPos, sal_Int32 nCount, ...@@ -100,6 +104,18 @@ cclass_Unicode::toTitle( const OUString& Text, sal_Int32 nPos, sal_Int32 nCount,
} }
*out = 0; *out = 0;
return OUString( pStr, SAL_NO_ACQUIRE ); return OUString( pStr, SAL_NO_ACQUIRE );
}
catch (const RuntimeException&)
{
throw;
}
catch (const Exception& e)
{
uno::Any a(cppu::getCaughtException());
throw lang::WrappedTargetRuntimeException(
"wrapped Exception " + e.Message,
uno::Reference<uno::XInterface>(), a);
}
} }
sal_Int16 SAL_CALL sal_Int16 SAL_CALL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment