diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2018-06-22 13:27:08 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2018-06-26 11:58:47 +0200 |
commit | e9430571c41367625110cdcde168da178b8b30a9 (patch) | |
tree | 4fc083a81d97087aedfb2a2e0dbd7814a3875d39 /i18npool/source | |
parent | 364af18d7394c113dc8624c0c84de28c2747a927 (diff) |
remove the useOffset thread-unsafe hack from transliteration
And instead pass it as an argument to an implementation function.
Otherwise this is thread-unsafe for Calc's threaded calculation,
and transliteration is used in various places in Calc code.
Change-Id: Ibdf95e4b6867ec251618f6ff91e605acb69667c0
Reviewed-on: https://gerrit.libreoffice.org/56290
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'i18npool/source')
16 files changed, 76 insertions, 99 deletions
diff --git a/i18npool/source/transliteration/fullwidthToHalfwidth.cxx b/i18npool/source/transliteration/fullwidthToHalfwidth.cxx index 267ec26a0b60..226d0ef40ec5 100644 --- a/i18npool/source/transliteration/fullwidthToHalfwidth.cxx +++ b/i18npool/source/transliteration/fullwidthToHalfwidth.cxx @@ -43,17 +43,14 @@ fullwidthToHalfwidth::fullwidthToHalfwidth() * The output is a reference of OUString. You MUST delete this object when you do not need to use it any more * The output string contains a transliterated string only, not whole string. */ -OUString SAL_CALL -fullwidthToHalfwidth::transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset ) +OUString +fullwidthToHalfwidth::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset ) { // Decomposition: GA --> KA + voice-mark const OUString& newStr = i18nutil::widthfolding::decompose_ja_voiced_sound_marks (inStr, startPos, nCount, offset, useOffset); // One to One mapping - useOffset = false; - const OUString &tmp = transliteration_OneToOne::transliterate( newStr, 0, newStr.getLength(), offset); - useOffset = true; - return tmp; + return transliteration_OneToOne::transliterateImpl( newStr, 0, newStr.getLength(), offset, false); } sal_Unicode SAL_CALL @@ -76,17 +73,14 @@ fullwidthKatakanaToHalfwidthKatakana::fullwidthKatakanaToHalfwidthKatakana() /** * Transliterate fullwidth katakana to halfwidth katakana. */ -OUString SAL_CALL -fullwidthKatakanaToHalfwidthKatakana::transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset ) +OUString +fullwidthKatakanaToHalfwidthKatakana::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset ) { // Decomposition: GA --> KA + voice-mark const OUString& newStr = i18nutil::widthfolding::decompose_ja_voiced_sound_marks (inStr, startPos, nCount, offset, useOffset); // One to One mapping - useOffset = false; - const OUString &tmp = transliteration_OneToOne::transliterate( newStr, 0, newStr.getLength(), offset); - useOffset = true; - return tmp; + return transliteration_OneToOne::transliterateImpl( newStr, 0, newStr.getLength(), offset, false); } sal_Unicode SAL_CALL @@ -109,18 +103,14 @@ fullwidthToHalfwidthLikeASC::fullwidthToHalfwidthLikeASC() /** * Transliterate fullwidth to halfwidth like Excel's ASC function. */ -OUString SAL_CALL -fullwidthToHalfwidthLikeASC::transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset ) +OUString +fullwidthToHalfwidthLikeASC::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset ) { // Decomposition: GA --> KA + voice-mark const OUString& newStr = i18nutil::widthfolding::decompose_ja_voiced_sound_marks (inStr, startPos, nCount, offset, useOffset); // One to One mapping - useOffset = false; - const OUString &tmp = transliteration_OneToOne::transliterate( newStr, 0, newStr.getLength(), offset); - useOffset = true; - - return tmp; + return transliteration_OneToOne::transliterateImpl( newStr, 0, newStr.getLength(), offset, false); } sal_Unicode SAL_CALL diff --git a/i18npool/source/transliteration/halfwidthToFullwidth.cxx b/i18npool/source/transliteration/halfwidthToFullwidth.cxx index 14b23ee95707..4857f2896ecf 100644 --- a/i18npool/source/transliteration/halfwidthToFullwidth.cxx +++ b/i18npool/source/transliteration/halfwidthToFullwidth.cxx @@ -35,17 +35,14 @@ halfwidthToFullwidth::halfwidthToFullwidth() implementationName = "com.sun.star.i18n.Transliteration.HALFWIDTH_FULLWIDTH"; } -OUString SAL_CALL -halfwidthToFullwidth::transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset ) +OUString +halfwidthToFullwidth::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset ) { - bool _useOffset = useOffset; // One to One mapping - useOffset = false; - const OUString& newStr = transliteration_OneToOne::transliterate( inStr, startPos, nCount, offset); - useOffset = _useOffset; + const OUString& newStr = transliteration_OneToOne::transliterateImpl( inStr, startPos, nCount, offset, false); // Composition: KA + voice-mark --> GA - return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr, 0, newStr.getLength(), offset, _useOffset ); + return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr, 0, newStr.getLength(), offset, useOffset ); } halfwidthKatakanaToFullwidthKatakana::halfwidthKatakanaToFullwidthKatakana() @@ -56,17 +53,14 @@ halfwidthKatakanaToFullwidthKatakana::halfwidthKatakanaToFullwidthKatakana() implementationName = "com.sun.star.i18n.Transliteration.HALFWIDTHKATAKANA_FULLWIDTHKATAKANA"; } -OUString SAL_CALL -halfwidthKatakanaToFullwidthKatakana::transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset ) +OUString +halfwidthKatakanaToFullwidthKatakana::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset ) { - bool _useOffset = useOffset; // One to One mapping - useOffset = false; - const OUString& newStr = transliteration_OneToOne::transliterate( inStr, startPos, nCount, offset); - useOffset = _useOffset; + const OUString& newStr = transliteration_OneToOne::transliterateImpl( inStr, startPos, nCount, offset, false); // Composition: KA + voice-mark --> GA - return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr, 0, newStr.getLength(), offset, _useOffset ); + return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr, 0, newStr.getLength(), offset, useOffset ); } halfwidthToFullwidthLikeJIS::halfwidthToFullwidthLikeJIS() @@ -77,17 +71,14 @@ halfwidthToFullwidthLikeJIS::halfwidthToFullwidthLikeJIS() implementationName = "com.sun.star.i18n.Transliteration.HALFWIDTH_FULLWIDTH_LIKE_JIS"; } -OUString SAL_CALL -halfwidthToFullwidthLikeJIS::transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset ) +OUString +halfwidthToFullwidthLikeJIS::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset ) { - bool _useOffset = useOffset; // One to One mapping - useOffset = false; - const OUString& newStr = transliteration_OneToOne::transliterate( inStr, startPos, nCount, offset); - useOffset = _useOffset; + const OUString& newStr = transliteration_OneToOne::transliterateImpl( inStr, startPos, nCount, offset, false); // Composition: KA + voice-mark --> GA - return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr, 0, newStr.getLength(), offset, _useOffset, WIDTHFOLDNIG_DONT_USE_COMBINED_VU ); + return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr, 0, newStr.getLength(), offset, useOffset, WIDTHFOLDNIG_DONT_USE_COMBINED_VU ); } diff --git a/i18npool/source/transliteration/ignoreDiacritics_CTL.cxx b/i18npool/source/transliteration/ignoreDiacritics_CTL.cxx index 53cfc15790da..3fec622b74db 100644 --- a/i18npool/source/transliteration/ignoreDiacritics_CTL.cxx +++ b/i18npool/source/transliteration/ignoreDiacritics_CTL.cxx @@ -47,9 +47,9 @@ ignoreDiacritics_CTL::transliterateChar2Char(sal_Unicode nInChar) return aChar[0]; } -OUString SAL_CALL -ignoreDiacritics_CTL::folding(const OUString& rInStr, sal_Int32 nStartPos, - sal_Int32 nCount, css::uno::Sequence<sal_Int32>& rOffset) +OUString +ignoreDiacritics_CTL::foldingImpl(const OUString& rInStr, sal_Int32 nStartPos, + sal_Int32 nCount, css::uno::Sequence<sal_Int32>& rOffset, bool useOffset) { if (!m_transliterator) throw css::uno::RuntimeException(); diff --git a/i18npool/source/transliteration/ignoreIandEfollowedByYa_ja_JP.cxx b/i18npool/source/transliteration/ignoreIandEfollowedByYa_ja_JP.cxx index c23555a0b2b0..f466cf9d2693 100644 --- a/i18npool/source/transliteration/ignoreIandEfollowedByYa_ja_JP.cxx +++ b/i18npool/source/transliteration/ignoreIandEfollowedByYa_ja_JP.cxx @@ -63,8 +63,8 @@ i18nutil::OneToOneMappingTable_t const IandE[] = { }; -OUString SAL_CALL -ignoreIandEfollowedByYa_ja_JP::folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset ) +OUString +ignoreIandEfollowedByYa_ja_JP::foldingImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset ) { // Create a string buffer which can hold nCount + 1 characters. // The reference count is 1 now. diff --git a/i18npool/source/transliteration/ignoreIterationMark_ja_JP.cxx b/i18npool/source/transliteration/ignoreIterationMark_ja_JP.cxx index 5777b9fc6f2b..9395daa8ed5c 100644 --- a/i18npool/source/transliteration/ignoreIterationMark_ja_JP.cxx +++ b/i18npool/source/transliteration/ignoreIterationMark_ja_JP.cxx @@ -79,8 +79,8 @@ i18nutil::OneToOneMappingTable_t const ignoreIterationMark_ja_JP_mappingTable[] }; -OUString SAL_CALL -ignoreIterationMark_ja_JP::folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset ) +OUString +ignoreIterationMark_ja_JP::foldingImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset ) { i18nutil::oneToOneMapping aTable(ignoreIterationMark_ja_JP_mappingTable, sizeof(ignoreIterationMark_ja_JP_mappingTable)); diff --git a/i18npool/source/transliteration/ignoreKana.cxx b/i18npool/source/transliteration/ignoreKana.cxx index 97a6875d760a..3267fc06d919 100644 --- a/i18npool/source/transliteration/ignoreKana.cxx +++ b/i18npool/source/transliteration/ignoreKana.cxx @@ -28,11 +28,11 @@ using namespace com::sun::star::lang; namespace i18npool { -OUString SAL_CALL -ignoreKana::folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset ) +OUString +ignoreKana::foldingImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset ) { rtl::Reference< hiraganaToKatakana > t1(new hiraganaToKatakana); - return t1->transliterate(inStr, startPos, nCount, offset); + return t1->transliterateImpl(inStr, startPos, nCount, offset, useOffset); } Sequence< OUString > SAL_CALL diff --git a/i18npool/source/transliteration/ignoreKiKuFollowedBySa_ja_JP.cxx b/i18npool/source/transliteration/ignoreKiKuFollowedBySa_ja_JP.cxx index 9750b522f7a7..1c9c9e491eb0 100644 --- a/i18npool/source/transliteration/ignoreKiKuFollowedBySa_ja_JP.cxx +++ b/i18npool/source/transliteration/ignoreKiKuFollowedBySa_ja_JP.cxx @@ -24,8 +24,8 @@ using namespace com::sun::star::lang; namespace i18npool { -OUString SAL_CALL -ignoreKiKuFollowedBySa_ja_JP::folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset ) +OUString +ignoreKiKuFollowedBySa_ja_JP::foldingImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset ) { // Create a string buffer which can hold nCount + 1 characters. // The reference count is 1 now. diff --git a/i18npool/source/transliteration/ignoreProlongedSoundMark_ja_JP.cxx b/i18npool/source/transliteration/ignoreProlongedSoundMark_ja_JP.cxx index 932934b81c40..ca1cb82d407a 100644 --- a/i18npool/source/transliteration/ignoreProlongedSoundMark_ja_JP.cxx +++ b/i18npool/source/transliteration/ignoreProlongedSoundMark_ja_JP.cxx @@ -286,8 +286,8 @@ static const sal_Unicode table_halfwidth[] = { }; -OUString SAL_CALL -ignoreProlongedSoundMark_ja_JP::folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset ) +OUString +ignoreProlongedSoundMark_ja_JP::foldingImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset ) { // Create a string buffer which can hold nCount + 1 characters. // The reference count is 1 now. diff --git a/i18npool/source/transliteration/ignoreSize_ja_JP.cxx b/i18npool/source/transliteration/ignoreSize_ja_JP.cxx index 420bcdcfd47f..143c679a9b31 100644 --- a/i18npool/source/transliteration/ignoreSize_ja_JP.cxx +++ b/i18npool/source/transliteration/ignoreSize_ja_JP.cxx @@ -26,11 +26,11 @@ using namespace com::sun::star::lang; namespace i18npool { -OUString SAL_CALL -ignoreSize_ja_JP::folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset ) +OUString +ignoreSize_ja_JP::foldingImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset ) { rtl::Reference< smallToLarge_ja_JP > t1(new smallToLarge_ja_JP); - return t1->transliterate(inStr, startPos, nCount, offset); + return t1->transliterateImpl(inStr, startPos, nCount, offset, useOffset); } diff --git a/i18npool/source/transliteration/ignoreWidth.cxx b/i18npool/source/transliteration/ignoreWidth.cxx index 2317d2f00e24..e0e9ef7b701d 100644 --- a/i18npool/source/transliteration/ignoreWidth.cxx +++ b/i18npool/source/transliteration/ignoreWidth.cxx @@ -28,11 +28,11 @@ using namespace com::sun::star::lang; namespace i18npool { -OUString SAL_CALL -ignoreWidth::folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset ) +OUString +ignoreWidth::foldingImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset ) { rtl::Reference< fullwidthToHalfwidth > t1(new fullwidthToHalfwidth); - return t1->transliterate(inStr, startPos, nCount, offset); + return t1->transliterateImpl(inStr, startPos, nCount, offset, useOffset); } Sequence< OUString > SAL_CALL diff --git a/i18npool/source/transliteration/textToPronounce_zh.cxx b/i18npool/source/transliteration/textToPronounce_zh.cxx index d9ca2ece5dd2..d513786e4525 100644 --- a/i18npool/source/transliteration/textToPronounce_zh.cxx +++ b/i18npool/source/transliteration/textToPronounce_zh.cxx @@ -48,9 +48,9 @@ TextToPronounce_zh::getPronounce(const sal_Unicode ch) return emptyString; } -OUString SAL_CALL -TextToPronounce_zh::folding(const OUString & inStr, sal_Int32 startPos, - sal_Int32 nCount, Sequence< sal_Int32 > & offset) +OUString +TextToPronounce_zh::foldingImpl(const OUString & inStr, sal_Int32 startPos, + sal_Int32 nCount, Sequence< sal_Int32 > & offset, bool useOffset) { OUStringBuffer sb; const sal_Unicode * chArr = inStr.getStr() + startPos; diff --git a/i18npool/source/transliteration/transliteration_Ignore.cxx b/i18npool/source/transliteration/transliteration_Ignore.cxx index 3a256fd34ae0..01444d3bfeac 100644 --- a/i18npool/source/transliteration/transliteration_Ignore.cxx +++ b/i18npool/source/transliteration/transliteration_Ignore.cxx @@ -78,12 +78,12 @@ transliteration_Ignore::getType() } -OUString SAL_CALL -transliteration_Ignore::transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, - Sequence< sal_Int32 >& offset ) +OUString +transliteration_Ignore::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, + Sequence< sal_Int32 >& offset, bool useOffset) { // The method folding is defined in a sub class. - return folding( inStr, startPos, nCount, offset); + return foldingImpl( inStr, startPos, nCount, offset, useOffset); } Sequence< OUString > @@ -114,9 +114,9 @@ transliteration_Ignore::transliterateRange( const OUString& str1, const OUString return r; } -OUString SAL_CALL -transliteration_Ignore::folding( const OUString& inStr, sal_Int32 startPos, - sal_Int32 nCount, Sequence< sal_Int32 >& offset) +OUString +transliteration_Ignore::foldingImpl( const OUString& inStr, sal_Int32 startPos, + sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset) { // Create a string buffer which can hold nCount + 1 characters. // The reference count is 1 now. diff --git a/i18npool/source/transliteration/transliteration_Numeric.cxx b/i18npool/source/transliteration/transliteration_Numeric.cxx index d7cca08ba58f..733f3f7dc100 100644 --- a/i18npool/source/transliteration/transliteration_Numeric.cxx +++ b/i18npool/source/transliteration/transliteration_Numeric.cxx @@ -34,8 +34,8 @@ sal_Int16 SAL_CALL transliteration_Numeric::getType() return TransliterationType::NUMERIC; } -OUString SAL_CALL - transliteration_Numeric::folding( const OUString& /*inStr*/, sal_Int32 /*startPos*/, sal_Int32 /*nCount*/, Sequence< sal_Int32 >& /*offset*/ ) +OUString + transliteration_Numeric::foldingImpl( const OUString& /*inStr*/, sal_Int32 /*startPos*/, sal_Int32 /*nCount*/, Sequence< sal_Int32 >& /*offset*/, bool ) { throw RuntimeException(); } @@ -58,7 +58,7 @@ Sequence< OUString > SAL_CALL OUString transliteration_Numeric::transliterateBullet( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, - Sequence< sal_Int32 >& offset ) + Sequence< sal_Int32 >& offset, bool useOffset ) { sal_Int32 number = -1, j = 0, endPos = startPos + nCount; @@ -110,12 +110,12 @@ transliteration_Numeric::transliterateBullet( const OUString& inStr, sal_Int32 s return OUString( pStr, SAL_NO_ACQUIRE ); } -OUString SAL_CALL -transliteration_Numeric::transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, - Sequence< sal_Int32 >& offset ) +OUString +transliteration_Numeric::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, + Sequence< sal_Int32 >& offset, bool useOffset ) { if (tableSize) - return transliterateBullet( inStr, startPos, nCount, offset); + return transliterateBullet( inStr, startPos, nCount, offset, useOffset); else return rtl::Reference<NativeNumberSupplierService>(new NativeNumberSupplierService(useOffset))->getNativeNumberString( inStr.copy(startPos, nCount), aLocale, nNativeNumberMode, offset ); } diff --git a/i18npool/source/transliteration/transliteration_OneToOne.cxx b/i18npool/source/transliteration/transliteration_OneToOne.cxx index 70fddaff190f..986bb555ef7a 100644 --- a/i18npool/source/transliteration/transliteration_OneToOne.cxx +++ b/i18npool/source/transliteration/transliteration_OneToOne.cxx @@ -30,9 +30,9 @@ sal_Int16 SAL_CALL transliteration_OneToOne::getType() return TransliterationType::ONE_TO_ONE; } -OUString SAL_CALL -transliteration_OneToOne::folding( const OUString& /*inStr*/, sal_Int32 /*startPos*/, - sal_Int32 /*nCount*/, Sequence< sal_Int32 >& /*offset*/) +OUString +transliteration_OneToOne::foldingImpl( const OUString& /*inStr*/, sal_Int32 /*startPos*/, + sal_Int32 /*nCount*/, Sequence< sal_Int32 >& /*offset*/, bool) { throw RuntimeException(); } @@ -50,9 +50,9 @@ transliteration_OneToOne::transliterateRange( const OUString& /*str1*/, const OU throw RuntimeException(); } -OUString SAL_CALL -transliteration_OneToOne::transliterate( const OUString& inStr, sal_Int32 startPos, - sal_Int32 nCount, Sequence< sal_Int32 >& offset) +OUString +transliteration_OneToOne::transliterateImpl( const OUString& inStr, sal_Int32 startPos, + sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset) { // Create a string buffer which can hold nCount + 1 characters. // The reference count is 1 now. diff --git a/i18npool/source/transliteration/transliteration_body.cxx b/i18npool/source/transliteration/transliteration_body.cxx index 8608e26f7eb0..d99c98e26c4a 100644 --- a/i18npool/source/transliteration/transliteration_body.cxx +++ b/i18npool/source/transliteration/transliteration_body.cxx @@ -88,10 +88,10 @@ static MappingType lcl_getMappingTypeForToggleCase( MappingType nMappingType, sa return nRes; } -OUString SAL_CALL -Transliteration_body::transliterate( +OUString +Transliteration_body::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, - Sequence< sal_Int32 >& offset) + Sequence< sal_Int32 >& offset, bool useOffset) { const sal_Unicode *in = inStr.getStr() + startPos; @@ -201,11 +201,11 @@ Transliteration_body::transliterateChar2Char( sal_Unicode inChar ) return map.map[0]; } -OUString SAL_CALL -Transliteration_body::folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, - Sequence< sal_Int32 >& offset) +OUString +Transliteration_body::foldingImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, + Sequence< sal_Int32 >& offset, bool useOffset) { - return transliterate(inStr, startPos, nCount, offset); + return transliterateImpl(inStr, startPos, nCount, offset, useOffset); } Transliteration_casemapping::Transliteration_casemapping() @@ -303,9 +303,9 @@ static OUString transliterate_titlecase_Impl( // this function expects to be called on a word-by-word basis, // namely that startPos points to the first char of the word -OUString SAL_CALL Transliteration_titlecase::transliterate( +OUString Transliteration_titlecase::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, - Sequence< sal_Int32 >& offset ) + Sequence< sal_Int32 >& offset, bool ) { return transliterate_titlecase_Impl( inStr, startPos, nCount, aLocale, offset ); } @@ -319,9 +319,9 @@ Transliteration_sentencecase::Transliteration_sentencecase() // this function expects to be called on a sentence-by-sentence basis, // namely that startPos points to the first word (NOT first char!) in the sentence -OUString SAL_CALL Transliteration_sentencecase::transliterate( +OUString Transliteration_sentencecase::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, - Sequence< sal_Int32 >& offset ) + Sequence< sal_Int32 >& offset, bool ) { return transliterate_titlecase_Impl( inStr, startPos, nCount, aLocale, offset ); } diff --git a/i18npool/source/transliteration/transliteration_commonclass.cxx b/i18npool/source/transliteration/transliteration_commonclass.cxx index a00a5eb1e5ed..7673a2c25b51 100644 --- a/i18npool/source/transliteration/transliteration_commonclass.cxx +++ b/i18npool/source/transliteration/transliteration_commonclass.cxx @@ -31,7 +31,6 @@ transliteration_commonclass::transliteration_commonclass() { transliterationName = ""; implementationName = ""; - useOffset = true; } OUString SAL_CALL transliteration_commonclass::getName() @@ -109,10 +108,7 @@ OUString SAL_CALL transliteration_commonclass::transliterateString2String( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount ) { Sequence < sal_Int32 > dummy_offset; - useOffset = false; - OUString tmpStr = transliterate(inStr, startPos, nCount, dummy_offset); - useOffset = true; - return tmpStr; + return transliterateImpl(inStr, startPos, nCount, dummy_offset, false); } OUString SAL_CALL |