summaryrefslogtreecommitdiffstats
path: root/i18npool/source/transliteration/textToPronounce_zh.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'i18npool/source/transliteration/textToPronounce_zh.cxx')
-rw-r--r--i18npool/source/transliteration/textToPronounce_zh.cxx55
1 files changed, 5 insertions, 50 deletions
diff --git a/i18npool/source/transliteration/textToPronounce_zh.cxx b/i18npool/source/transliteration/textToPronounce_zh.cxx
index ad33bdf31dca..2057f8c43e28 100644
--- a/i18npool/source/transliteration/textToPronounce_zh.cxx
+++ b/i18npool/source/transliteration/textToPronounce_zh.cxx
@@ -21,10 +21,12 @@
#include <com/sun/star/i18n/MultipleCharsOutputException.hpp>
#include <com/sun/star/i18n/TransliterationType.hpp>
+#include <o3tl/temporary.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
#include <textToPronounce_zh.hxx>
+#include <indexentrysupplier_asian.hxx>
using namespace com::sun::star::i18n;
using namespace com::sun::star::uno;
@@ -43,7 +45,7 @@ TextToPronounce_zh::getPronounce(const sal_Unicode ch)
if (idx) {
sal_uInt16 address = idx[0][ch>>8];
if (address != 0xFFFF)
- return reinterpret_cast<sal_Unicode *>(
+ return reinterpret_cast<sal_Unicode const *>(
&idx[2][idx[1][address + (ch & 0xFF)]]);
}
return emptyString;
@@ -122,74 +124,27 @@ TextToPronounce_zh::equals( const OUString & str1, sal_Int32 pos1, sal_Int32 nCo
return (nCount1 == nCount2);
}
-#ifdef DISABLE_DYNLOADING
-
-extern "C" {
-
-sal_uInt16** get_zh_zhuyin();
-sal_uInt16** get_zh_pinyin();
-
-}
-
-#endif
-
TextToPinyin_zh_CN::TextToPinyin_zh_CN() :
-#ifndef DISABLE_DYNLOADING
- TextToPronounce_zh("get_zh_pinyin")
-#else
TextToPronounce_zh(get_zh_pinyin)
-#endif
{
transliterationName = "ChineseCharacterToPinyin";
implementationName = "com.sun.star.i18n.Transliteration.TextToPinyin_zh_CN";
}
TextToChuyin_zh_TW::TextToChuyin_zh_TW() :
-#ifndef DISABLE_DYNLOADING
- TextToPronounce_zh("get_zh_zhuyin")
-#else
TextToPronounce_zh(get_zh_zhuyin)
-#endif
{
transliterationName = "ChineseCharacterToChuyin";
implementationName = "com.sun.star.i18n.Transliteration.TextToChuyin_zh_TW";
}
-#ifndef DISABLE_DYNLOADING
-
-extern "C" { static void thisModule() {} }
-
-TextToPronounce_zh::TextToPronounce_zh(const char* func_name)
-{
-#ifdef SAL_DLLPREFIX
- OUString lib(SAL_DLLPREFIX"index_data" SAL_DLLEXTENSION);
-#else
- OUString lib("index_data" SAL_DLLEXTENSION);
-#endif
- hModule = osl_loadModuleRelative(
- &thisModule, lib.pData, SAL_LOADMODULE_DEFAULT );
- idx=nullptr;
- if (hModule) {
- sal_uInt16** (*function)() = reinterpret_cast<sal_uInt16** (*)()>(osl_getFunctionSymbol(hModule, OUString::createFromAscii(func_name).pData));
- if (function)
- idx=function();
- }
-}
-
-#else
-
-TextToPronounce_zh::TextToPronounce_zh(sal_uInt16 ** (*function)())
+TextToPronounce_zh::TextToPronounce_zh(sal_uInt16 const ** (*function)(sal_Int16 &))
{
- idx = function();
+ idx = function(o3tl::temporary(sal_Int16()));
}
-#endif
-
TextToPronounce_zh::~TextToPronounce_zh()
{
-#ifndef DISABLE_DYNLOADING
- if (hModule) osl_unloadModule(hModule);
-#endif
}
}