diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2010-05-10 18:24:45 +0200 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2010-05-10 18:24:45 +0200 |
commit | 02bdaee3115c6f67afa625c8ee6a4c4b11873fc2 (patch) | |
tree | 5520b010499b85157fa2c6d5d8bad2e453d12852 /rsc | |
parent | 4209cd2a3168c16b75dce990c9352d2c933a1476 (diff) | |
parent | 5ce0b830dc8d9e3ec411182693901d95812e390e (diff) |
CWS-TOOLING: integrate CWS vcl110
Diffstat (limited to 'rsc')
-rw-r--r-- | rsc/inc/rsctools.hxx | 1 | ||||
-rw-r--r-- | rsc/source/tools/rscchar.cxx | 133 |
2 files changed, 0 insertions, 134 deletions
diff --git a/rsc/inc/rsctools.hxx b/rsc/inc/rsctools.hxx index 287a079f63c8..3a3eff653cd7 100644 --- a/rsc/inc/rsctools.hxx +++ b/rsc/inc/rsctools.hxx @@ -68,7 +68,6 @@ class RscChar { public: static char * MakeUTF8( char * pStr, UINT16 nTextEncoding ); - static char * MakeUTF8FromL( char * pStr ); }; /****************** R s c P t r P t r ************************************/ diff --git a/rsc/source/tools/rscchar.cxx b/rsc/source/tools/rscchar.cxx index ca421dde372a..c23022e4222e 100644 --- a/rsc/source/tools/rscchar.cxx +++ b/rsc/source/tools/rscchar.cxx @@ -194,136 +194,3 @@ char * RscChar::MakeUTF8( char * pStr, UINT16 nTextEncoding ) return pUtf8; }; - -/************************************************************************* -|* -|* RscChar::MakeChar() -|* -|* Beschreibung Der String wird nach C-Konvention umgesetzt -|* Ersterstellung MM 20.03.91 -|* Letzte Aenderung MM 20.03.91 -|* -*************************************************************************/ -char * RscChar::MakeUTF8FromL( char * pStr ) -{ - sal_Size nUniPos = 0; - sal_Unicode * pUniCode = new sal_Unicode[ strlen( pStr ) + 1 ]; - - char cOld = '1'; - while( cOld != 0 ) - { - sal_Unicode c; - if( *pStr == '\\' ) - { - ++pStr; - switch( *pStr ) - { - case 'a': - c = '\a'; - break; - case 'b': - c = '\b'; - break; - case 'f': - c = '\f'; - break; - case 'n': - c = '\n'; - break; - case 'r': - c = '\r'; - break; - case 't': - c = '\t'; - break; - case 'v': - c = '\v'; - break; - case '\\': - c = '\\'; - break; - case '?': - c = '\?'; - break; - case '\'': - c = '\''; - break; - case '\"': - c = '\"'; - break; - default: - { - if( '0' <= *pStr && '7' >= *pStr ) - { - UINT32 nChar = 0; - int i = 0; - while( '0' <= *pStr && '7' >= *pStr && i != 6 ) - { - nChar = nChar * 8 + (BYTE)*pStr - (BYTE)'0'; - ++pStr; - i++; - } - if( nChar > 0xFFFF ) - // Wert zu gross, oder kein 3 Ziffern - return( FALSE ); - c = (UINT16)nChar; - pStr--; - } - else if( 'x' == *pStr || 'X' == *pStr ) - { - UINT32 nChar = 0; - int i = 0; - ++pStr; - while( isxdigit( *pStr ) && i != 4 ) - { - if( isdigit( *pStr ) ) - nChar = nChar * 16 + (BYTE)*pStr - (BYTE)'0'; - else if( isupper( *pStr ) ) - nChar = nChar * 16 + (BYTE)*pStr - (BYTE)'A' +10; - else - nChar = nChar * 16 + (BYTE)*pStr - (BYTE)'a' +10; - ++pStr; - i++; - } - c = (UINT16)nChar; - pStr--; - } - else - c = *pStr; - }; - } - } - else - c = *pStr; - - pUniCode[ nUniPos++ ] = c; - cOld = *pStr; - pStr++; - } - - // factor fo 6 is the maximum size of an UNICODE character as utf8 - sal_Size nMaxUtf8Len = nUniPos * 6; - if( nUniPos * 6 > 0x0FFFFF ) - RscExit( 10 ); - - char * pUtf8 = (char *)rtl_allocateMemory( nMaxUtf8Len ); - rtl_TextToUnicodeConverter hConv = rtl_createUnicodeToTextConverter( RTL_TEXTENCODING_UTF8 ); - - sal_uInt32 nInfo; - sal_Size nSrcCvtBytes; - rtl_convertUnicodeToText( hConv, 0, - pUniCode, nUniPos, - pUtf8, nMaxUtf8Len, - RTL_UNICODETOTEXT_FLAGS_UNDEFINED_DEFAULT - | RTL_UNICODETOTEXT_FLAGS_INVALID_DEFAULT - | RTL_UNICODETOTEXT_FLAGS_FLUSH, - &nInfo, - &nSrcCvtBytes ); - - rtl_destroyUnicodeToTextConverter( hConv ); - - delete[] pUniCode; - - return pUtf8; -}; - |