summaryrefslogtreecommitdiff
path: root/sal/textenc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-01-05 14:50:44 +0100
committerStephan Bergmann <sbergman@redhat.com>2012-01-05 23:24:08 +0100
commit7a7b346a527c4fca52b68281e419e1f876fbac59 (patch)
tree147f2f4d71158abff4845d2a87aa607e47bbd250 /sal/textenc
parentce3ffbaec7a23d4e04048def3fd3da53a911043c (diff)
Properly assign objects to only those libraries that actually use them.
For that, moved aImplJavaUtf8TextEncodingData from tables.cxx to textenc.cxx, as it shares code with aImplUTF8TextEncoding (but does not drag lots of expensive data back into sal from sal_textenc).
Diffstat (limited to 'sal/textenc')
-rw-r--r--sal/textenc/tables.cxx3
-rw-r--r--sal/textenc/tcvtuni1.tab27
-rw-r--r--sal/textenc/textenc.cxx25
3 files changed, 27 insertions, 28 deletions
diff --git a/sal/textenc/tables.cxx b/sal/textenc/tables.cxx
index c8d9c19cd11a..096876119a20 100644
--- a/sal/textenc/tables.cxx
+++ b/sal/textenc/tables.cxx
@@ -133,6 +133,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT ImplTextEncodingData const *
assert(
nEncoding != RTL_TEXTENCODING_ASCII_US &&
nEncoding != RTL_TEXTENCODING_ISO_8859_1 &&
+ nEncoding != RTL_TEXTENCODING_JAVA_UTF8 &&
nEncoding != RTL_TEXTENCODING_MS_1252 &&
nEncoding != RTL_TEXTENCODING_UTF8);
// handled by Impl_getTextEncodingData
@@ -227,7 +228,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT ImplTextEncodingData const *
&aImplTis620TextEncodingData, /* TIS_620 */
&aImplKoi8UTextEncodingData, /* KOI8_U */
&aImplIsciiDevanagariTextEncodingData, /* ISCII_DEVANAGARI */
- &aImplJavaUtf8TextEncodingData, /* JAVA_UTF8 */
+ NULL, /* JAVA_UTF8, see above */
&adobeStandardEncodingData, /* ADOBE_STANDARD */
&adobeSymbolEncodingData, /* ADOBE_SYMBOL */
&aImplPT154TextEncodingData }; /* PT154 */
diff --git a/sal/textenc/tcvtuni1.tab b/sal/textenc/tcvtuni1.tab
index 83f0a5edc39d..63039c0346c9 100644
--- a/sal/textenc/tcvtuni1.tab
+++ b/sal/textenc/tcvtuni1.tab
@@ -25,10 +25,6 @@
*
************************************************************************/
-#ifndef INCLUDED_RTL_TEXTENC_CONTEXT_H
-#include "context.h"
-#endif
-
/* Unicode Encodings */
static ImplTextEncodingData const aImplUTF7TextEncodingData
@@ -53,26 +49,3 @@ static ImplTextEncodingData const aImplUTF7TextEncodingData
| RTL_TEXTENCODING_INFO_MULTIBYTE
| RTL_TEXTENCODING_INFO_MIME };
/* SCRIPT_UNICODE, pc code page 850 */
-
-static char aImplJavaUtf8TextConverterTag;
- /* The value of this tag is irrelevant. Only its address != NULL is used to
- distinguish between RTL_TEXTENCODING_UTF8 and
- RTL_TEXTENCODING_JAVA_UTF8. */
-
-static ImplTextEncodingData const aImplJavaUtf8TextEncodingData
- = { { &aImplJavaUtf8TextConverterTag,
- &ImplConvertUtf8ToUnicode,
- &ImplConvertUnicodeToUtf8,
- &ImplCreateUtf8ToUnicodeContext,
- &ImplDestroyContext,
- &ImplResetUtf8ToUnicodeContext,
- &ImplCreateUnicodeToUtf8Context,
- &ImplDestroyContext,
- &ImplResetUnicodeToUtf8Context },
- 1,
- 3,
- 1,
- 0,
- NULL,
- NULL,
- RTL_TEXTENCODING_INFO_UNICODE | RTL_TEXTENCODING_INFO_MULTIBYTE };
diff --git a/sal/textenc/textenc.cxx b/sal/textenc/textenc.cxx
index 9b3e25623073..05550a505365 100644
--- a/sal/textenc/textenc.cxx
+++ b/sal/textenc/textenc.cxx
@@ -339,6 +339,29 @@ static ImplTextEncodingData const aImplUTF8TextEncodingData
| RTL_TEXTENCODING_INFO_MIME };
/* SCRIPT_UNICODE, pc code page 850 */
+static char aImplJavaUtf8TextConverterTag;
+ /* The value of this tag is irrelevant. Only its address != NULL is used to
+ distinguish between RTL_TEXTENCODING_UTF8 and
+ RTL_TEXTENCODING_JAVA_UTF8. */
+
+static ImplTextEncodingData const aImplJavaUtf8TextEncodingData
+ = { { &aImplJavaUtf8TextConverterTag,
+ &ImplConvertUtf8ToUnicode,
+ &ImplConvertUnicodeToUtf8,
+ &ImplCreateUtf8ToUnicodeContext,
+ &ImplDestroyContext,
+ &ImplResetUtf8ToUnicodeContext,
+ &ImplCreateUnicodeToUtf8Context,
+ &ImplDestroyContext,
+ &ImplResetUnicodeToUtf8Context },
+ 1,
+ 3,
+ 1,
+ 0,
+ NULL,
+ NULL,
+ RTL_TEXTENCODING_INFO_UNICODE | RTL_TEXTENCODING_INFO_MULTIBYTE };
+
namespace {
#if defined IOS
@@ -408,6 +431,8 @@ Impl_getTextEncodingData(rtl_TextEncoding nEncoding) SAL_THROW_EXTERN_C()
return &aImplMS1252TextEncodingData; break;
case RTL_TEXTENCODING_UTF8:
return &aImplUTF8TextEncodingData; break;
+ case RTL_TEXTENCODING_JAVA_UTF8:
+ return &aImplJavaUtf8TextEncodingData; break;
case RTL_TEXTENCODING_ISO_8859_1:
return &aImplISO88591TextEncodingData; break;
default: