diff options
author | Rüdiger Timm <rt@openoffice.org> | 2004-09-17 12:57:21 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2004-09-17 12:57:21 +0000 |
commit | 5cbf763bc9c0601240fda1a127784a2438869021 (patch) | |
tree | 7156d23b43199f19912cdf82d268d4facd6f37b3 /i18npool | |
parent | 65000b89f876eba2915f047fbb0a702100ae5745 (diff) |
INTEGRATION: CWS os34 (1.2.116); FILE MERGED
2004/07/23 06:57:26 khong 1.2.116.3: #i29300# check string length
2004/07/23 06:52:48 khong 1.2.116.2: #i29300# check string length
2004/07/23 06:43:22 khong 1.2.116.1: #i29300# check string length
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/textconversion/textconversionImpl.cxx | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/i18npool/source/textconversion/textconversionImpl.cxx b/i18npool/source/textconversion/textconversionImpl.cxx index 75c75077aeb8..8aaabc5d2213 100644 --- a/i18npool/source/textconversion/textconversionImpl.cxx +++ b/i18npool/source/textconversion/textconversionImpl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: textconversionImpl.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: vg $ $Date: 2003-04-17 17:53:51 $ + * last change: $Author: rt $ $Date: 2004-09-17 13:57:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -70,31 +70,37 @@ namespace com { namespace sun { namespace star { namespace i18n { TextConversionResult SAL_CALL TextConversionImpl::getConversions( const OUString& aText, sal_Int32 nStartPos, sal_Int32 nLength, - const Locale& aLocale, sal_Int16 nConversionType, sal_Int32 nConversionOptions) + const Locale& rLocale, sal_Int16 nConversionType, sal_Int32 nConversionOptions) throw( RuntimeException, IllegalArgumentException, NoSupportException ) { - getLocaleSpecificTextConversion(aLocale); + getLocaleSpecificTextConversion(rLocale); - return xTC->getConversions(aText, nStartPos, nLength, aLocale, nConversionType, nConversionOptions); + sal_Int32 len = aText.getLength() - nStartPos; + if (nLength > len) + nLength = len > 0 ? len : 0; + return xTC->getConversions(aText, nStartPos, nLength, rLocale, nConversionType, nConversionOptions); } OUString SAL_CALL TextConversionImpl::getConversion( const OUString& aText, sal_Int32 nStartPos, sal_Int32 nLength, - const Locale& aLocale, sal_Int16 nConversionType, sal_Int32 nConversionOptions) + const Locale& rLocale, sal_Int16 nConversionType, sal_Int32 nConversionOptions) throw( RuntimeException, IllegalArgumentException, NoSupportException ) { - getLocaleSpecificTextConversion(aLocale); + getLocaleSpecificTextConversion(rLocale); - return xTC->getConversion(aText, nStartPos, nLength, aLocale, nConversionType, nConversionOptions); + sal_Int32 len = aText.getLength() - nStartPos; + if (nLength > len) + nLength = len > 0 ? len : 0; + return xTC->getConversion(aText, nStartPos, nLength, rLocale, nConversionType, nConversionOptions); } sal_Bool SAL_CALL -TextConversionImpl::interactiveConversion( const Locale& aLocale, sal_Int16 nTextConversionType, sal_Int32 nTextConversionOptions ) +TextConversionImpl::interactiveConversion( const Locale& rLocale, sal_Int16 nTextConversionType, sal_Int32 nTextConversionOptions ) throw( RuntimeException, IllegalArgumentException, NoSupportException ) { - getLocaleSpecificTextConversion(aLocale); + getLocaleSpecificTextConversion(rLocale); - return xTC->interactiveConversion(aLocale, nTextConversionType, nTextConversionOptions); + return xTC->interactiveConversion(rLocale, nTextConversionType, nTextConversionOptions); } static inline sal_Bool operator != (const Locale& l1, const Locale& l2) { |