summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2018-06-22 13:27:08 +0200
committerLuboš Luňák <l.lunak@collabora.com>2018-07-04 16:52:35 +0200
commit4d91b3c21a3dd87fa1743b0dbe4ffe2f05eb45a2 (patch)
treeac65739b1d28962af924b972526c067a9656959a /i18npool
parent6b5d49e129ba1f480ff74b4db657bd0e0dcd2bdf (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> (cherry picked from commit e9430571c41367625110cdcde168da178b8b30a9) Reviewed-on: https://gerrit.libreoffice.org/56450
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/inc/textToPronounce_zh.hxx4
-rw-r--r--i18npool/inc/transliteration_Ignore.hxx20
-rw-r--r--i18npool/inc/transliteration_Numeric.hxx10
-rw-r--r--i18npool/inc/transliteration_OneToOne.hxx24
-rw-r--r--i18npool/inc/transliteration_body.hxx14
-rw-r--r--i18npool/inc/transliteration_commonclass.hxx13
-rw-r--r--i18npool/source/transliteration/fullwidthToHalfwidth.cxx28
-rw-r--r--i18npool/source/transliteration/halfwidthToFullwidth.cxx33
-rw-r--r--i18npool/source/transliteration/ignoreDiacritics_CTL.cxx6
-rw-r--r--i18npool/source/transliteration/ignoreIandEfollowedByYa_ja_JP.cxx4
-rw-r--r--i18npool/source/transliteration/ignoreIterationMark_ja_JP.cxx4
-rw-r--r--i18npool/source/transliteration/ignoreKana.cxx6
-rw-r--r--i18npool/source/transliteration/ignoreKiKuFollowedBySa_ja_JP.cxx4
-rw-r--r--i18npool/source/transliteration/ignoreProlongedSoundMark_ja_JP.cxx4
-rw-r--r--i18npool/source/transliteration/ignoreSize_ja_JP.cxx6
-rw-r--r--i18npool/source/transliteration/ignoreWidth.cxx6
-rw-r--r--i18npool/source/transliteration/textToPronounce_zh.cxx6
-rw-r--r--i18npool/source/transliteration/transliteration_Ignore.cxx14
-rw-r--r--i18npool/source/transliteration/transliteration_Numeric.cxx14
-rw-r--r--i18npool/source/transliteration/transliteration_OneToOne.cxx12
-rw-r--r--i18npool/source/transliteration/transliteration_body.cxx22
-rw-r--r--i18npool/source/transliteration/transliteration_commonclass.cxx6
22 files changed, 123 insertions, 137 deletions
diff --git a/i18npool/inc/textToPronounce_zh.hxx b/i18npool/inc/textToPronounce_zh.hxx
index d573cc1128ce..c311b8955875 100644
--- a/i18npool/inc/textToPronounce_zh.hxx
+++ b/i18npool/inc/textToPronounce_zh.hxx
@@ -41,8 +41,8 @@ public:
#endif
virtual ~TextToPronounce_zh() override;
- OUString SAL_CALL
- folding(const OUString & inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 > & offset) override;
+ OUString
+ foldingImpl(const OUString & inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 > & offset, bool useOffset) override;
sal_Int16 SAL_CALL getType() override;
diff --git a/i18npool/inc/transliteration_Ignore.hxx b/i18npool/inc/transliteration_Ignore.hxx
index 6e01a3e8a1e9..4f46d10131c9 100644
--- a/i18npool/inc/transliteration_Ignore.hxx
+++ b/i18npool/inc/transliteration_Ignore.hxx
@@ -30,8 +30,8 @@ namespace i18npool {
class transliteration_Ignore : public transliteration_commonclass
{
public:
- virtual OUString SAL_CALL
- folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset) override;
+ virtual OUString
+ foldingImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset, bool useOffset ) override;
// This method is shared.
sal_Bool SAL_CALL
@@ -46,8 +46,8 @@ public:
// Methods which are shared.
sal_Int16 SAL_CALL getType( ) override;
- OUString SAL_CALL
- transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset ) override;
+ OUString
+ transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset, bool useOffset ) override;
virtual sal_Unicode SAL_CALL
transliterateChar2Char( sal_Unicode inChar) override;
@@ -95,8 +95,8 @@ class ignoreDiacritics_CTL : public transliteration_Ignore
public:
ignoreDiacritics_CTL();
- OUString SAL_CALL
- folding(const OUString& rInStr, sal_Int32 nStartPos, sal_Int32 nCount, css::uno::Sequence<sal_Int32>& rOffset) override;
+ OUString
+ foldingImpl(const OUString& rInStr, sal_Int32 nStartPos, sal_Int32 nCount, css::uno::Sequence<sal_Int32>& rOffset, bool useOffset) override;
sal_Unicode SAL_CALL
transliterateChar2Char(sal_Unicode nInChar) override;
@@ -114,8 +114,8 @@ public:\
transliterationName = "ignore"#name;\
implementationName = "com.sun.star.i18n.Transliteration.ignore"#name;\
};\
- OUString SAL_CALL folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, \
- css::uno::Sequence< sal_Int32 >& offset) override; \
+ OUString foldingImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, \
+ css::uno::Sequence< sal_Int32 >& offset, bool useOffset) override; \
};
TRANSLITERATION_IGNORE(KiKuFollowedBySa_ja_JP)
@@ -135,8 +135,8 @@ public:\
transliterationName = "ignore"#name;\
implementationName = "com.sun.star.i18n.Transliteration.ignore"#name;\
};\
- OUString SAL_CALL folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, \
- css::uno::Sequence< sal_Int32 >& offset) override; \
+ OUString foldingImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, \
+ css::uno::Sequence< sal_Int32 >& offset, bool useOffset) override; \
using transliteration_Ignore::transliterateRange;\
css::uno::Sequence< OUString > SAL_CALL transliterateRange( const OUString& str1, \
const OUString& str2 ) override; \
diff --git a/i18npool/inc/transliteration_Numeric.hxx b/i18npool/inc/transliteration_Numeric.hxx
index b1ab5b423dbf..8ebf2a394a4a 100644
--- a/i18npool/inc/transliteration_Numeric.hxx
+++ b/i18npool/inc/transliteration_Numeric.hxx
@@ -25,8 +25,8 @@ namespace i18npool {
class transliteration_Numeric : public transliteration_commonclass {
public:
- virtual OUString SAL_CALL
- transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset ) override;
+ virtual OUString
+ transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset, bool useOffset ) override;
virtual sal_Unicode SAL_CALL
transliterateChar2Char( sal_Unicode inChar) override;
@@ -34,8 +34,8 @@ public:
// Methods which are shared.
virtual sal_Int16 SAL_CALL getType( ) override;
- virtual OUString SAL_CALL
- folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset ) override;
+ virtual OUString
+ foldingImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset, bool useOffset ) override;
virtual sal_Bool SAL_CALL
equals( const OUString& str1, sal_Int32 pos1, sal_Int32 nCount1, sal_Int32& nMatch1, const OUString& str2, sal_Int32 pos2, sal_Int32 nCount2, sal_Int32& nMatch2 ) override;
@@ -51,7 +51,7 @@ private:
/// @throws css::uno::RuntimeException
OUString
transliterateBullet( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount,
- css::uno::Sequence< sal_Int32 >& offset );
+ css::uno::Sequence< sal_Int32 >& offset, bool useOffset );
};
}
diff --git a/i18npool/inc/transliteration_OneToOne.hxx b/i18npool/inc/transliteration_OneToOne.hxx
index e87ef1ed93df..ae594e754377 100644
--- a/i18npool/inc/transliteration_OneToOne.hxx
+++ b/i18npool/inc/transliteration_OneToOne.hxx
@@ -29,8 +29,8 @@ typedef sal_Unicode (*TransFunc)(const sal_Unicode);
class transliteration_OneToOne : public transliteration_commonclass
{
public:
- OUString SAL_CALL
- transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset ) override;
+ OUString
+ transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset, bool useOffset ) override;
sal_Unicode SAL_CALL
transliterateChar2Char( sal_Unicode inChar) override;
@@ -38,8 +38,8 @@ public:
// Methods which are shared.
sal_Int16 SAL_CALL getType() override;
- OUString SAL_CALL
- folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset) override;
+ OUString
+ foldingImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset, bool useOffset ) override;
sal_Bool SAL_CALL
equals( const OUString& str1, sal_Int32 pos1, sal_Int32 nCount1, sal_Int32& nMatch1,
@@ -58,8 +58,8 @@ class name : public transliteration_OneToOne \
{ \
public: \
name (); \
- OUString SAL_CALL \
- transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset ) \
+ OUString \
+ transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset, bool useOffset ) \
override; \
sal_Unicode SAL_CALL \
transliterateChar2Char( sal_Unicode inChar) \
@@ -74,22 +74,22 @@ class halfwidthToFullwidth : public transliteration_OneToOne
{
public:
halfwidthToFullwidth();
- OUString SAL_CALL
- transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset ) override;
+ OUString
+ transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset, bool useOffset ) override;
};
class halfwidthKatakanaToFullwidthKatakana : public transliteration_OneToOne
{
public:
halfwidthKatakanaToFullwidthKatakana();
- OUString SAL_CALL
- transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset ) override;
+ OUString
+ transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset, bool useOffset ) override;
};
class halfwidthToFullwidthLikeJIS : public transliteration_OneToOne
{
public:
halfwidthToFullwidthLikeJIS();
- OUString SAL_CALL
- transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset ) override;
+ OUString
+ transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset, bool useOffset ) override;
};
#undef TRANSLITERATION_ONETOONE
diff --git a/i18npool/inc/transliteration_body.hxx b/i18npool/inc/transliteration_body.hxx
index 5e9d2d7971ba..5476cc841454 100644
--- a/i18npool/inc/transliteration_body.hxx
+++ b/i18npool/inc/transliteration_body.hxx
@@ -32,8 +32,8 @@ public:
// Methods which are shared.
sal_Int16 SAL_CALL getType() override;
- OUString SAL_CALL transliterate(const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount,
- css::uno::Sequence< sal_Int32 >& offset) override;
+ OUString transliterateImpl(const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount,
+ css::uno::Sequence< sal_Int32 >& offset, bool useOffset) override;
OUString SAL_CALL
transliterateChar2String( sal_Unicode inChar) override;
@@ -41,8 +41,8 @@ public:
virtual sal_Unicode SAL_CALL
transliterateChar2Char( sal_Unicode inChar) override;
- OUString SAL_CALL folding(const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount,
- css::uno::Sequence< sal_Int32 >& offset) override;
+ OUString foldingImpl(const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount,
+ css::uno::Sequence< sal_Int32 >& offset, bool useOffset) override;
sal_Bool SAL_CALL equals(
const OUString& str1, sal_Int32 pos1, sal_Int32 nCount1, sal_Int32& nMatch1,
@@ -85,7 +85,8 @@ class Transliteration_titlecase : public Transliteration_body
public:
Transliteration_titlecase();
- virtual OUString SAL_CALL transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset ) override;
+ virtual OUString transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount,
+ css::uno::Sequence< sal_Int32 >& offset, bool useOffset ) override;
};
class Transliteration_sentencecase : public Transliteration_body
@@ -93,7 +94,8 @@ class Transliteration_sentencecase : public Transliteration_body
public:
Transliteration_sentencecase();
- virtual OUString SAL_CALL transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset ) override;
+ virtual OUString transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount,
+ css::uno::Sequence< sal_Int32 >& offset, bool useOffset ) override;
};
}
diff --git a/i18npool/inc/transliteration_commonclass.hxx b/i18npool/inc/transliteration_commonclass.hxx
index ebf3dc4b60a4..48d6688df36f 100644
--- a/i18npool/inc/transliteration_commonclass.hxx
+++ b/i18npool/inc/transliteration_commonclass.hxx
@@ -58,10 +58,12 @@ public:
virtual sal_Int16 SAL_CALL getType( ) override = 0;
virtual OUString SAL_CALL
- transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset ) override = 0;
+ transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset ) override final
+ { return transliterateImpl( inStr, startPos, nCount, offset, true ); }
virtual OUString SAL_CALL
- folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset) override = 0;
+ folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset) override final
+ { return foldingImpl( inStr, startPos, nCount, offset, true ); }
// Methods in XExtendedTransliteration
virtual OUString SAL_CALL
@@ -88,10 +90,15 @@ public:
virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
protected:
+ virtual OUString
+ transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset, bool useOffset ) = 0;
+
+ virtual OUString
+ foldingImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset, bool useOffset ) = 0;
+
css::lang::Locale aLocale;
const sal_Char* transliterationName;
const sal_Char* implementationName;
- bool useOffset;
};
}
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 5d1a92e467c7..ad1edfbeb4a6 100644
--- a/i18npool/source/transliteration/transliteration_Numeric.cxx
+++ b/i18npool/source/transliteration/transliteration_Numeric.cxx
@@ -35,8 +35,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();
}
@@ -59,7 +59,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;
@@ -111,12 +111,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 ea5682daec4f..9abff30c3df7 100644
--- a/i18npool/source/transliteration/transliteration_body.cxx
+++ b/i18npool/source/transliteration/transliteration_body.cxx
@@ -89,10 +89,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;
@@ -202,11 +202,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()
@@ -304,9 +304,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 );
}
@@ -320,9 +320,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