diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-08-10 21:21:04 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-08-11 11:10:37 +0100 |
commit | 35c83a7f4f84cb708b534c77d7344e8abb4539f9 (patch) | |
tree | ae8d40adece7afee8690f96a796ab400220e14a6 /tools | |
parent | c2a634416ba8f385c25c16cc52aeae6f68cab9db (diff) |
remove deprecated ByteString::CreateFromUnicode
Diffstat (limited to 'tools')
-rw-r--r-- | tools/inc/tools/string.hxx | 6 | ||||
-rw-r--r-- | tools/source/string/strcvt.cxx | 46 |
2 files changed, 1 insertions, 51 deletions
diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx index 4ace1289ffdd..0eaae971d663 100644 --- a/tools/inc/tools/string.hxx +++ b/tools/inc/tools/string.hxx @@ -175,9 +175,6 @@ private: // Append(char) void operator +=(int); // not implemented; to detect misuses // of operator +=(sal_Char) - - static sal_Size ConvertFromUnicode( sal_Unicode c, sal_Char* pBuf, sal_Size nBufLen, - rtl_TextEncoding eTextEncoding ); public: ByteString(); ByteString( const ByteString& rStr ); @@ -257,8 +254,7 @@ public: ByteString& Convert( rtl_TextEncoding eSource, rtl_TextEncoding eTarget, sal_Bool bReplace = sal_True ); - static sal_Char ConvertFromUnicode(sal_Unicode c, - rtl_TextEncoding eTextEncoding); + ByteString& ConvertLineEnd( LineEnd eLineEnd ); ByteString& ConvertLineEnd() { return ConvertLineEnd( GetSystemLineEnd() ); } diff --git a/tools/source/string/strcvt.cxx b/tools/source/string/strcvt.cxx index d5c734b332c6..1345a87d3297 100644 --- a/tools/source/string/strcvt.cxx +++ b/tools/source/string/strcvt.cxx @@ -384,52 +384,6 @@ ByteString& ByteString::Convert( rtl_TextEncoding eSource, rtl_TextEncoding eTar return *this; } -// ----------------------------------------------------------------------- - -char ByteString::ConvertFromUnicode(sal_Unicode c, rtl_TextEncoding eTextEncoding) -{ - sal_Size nLen; - char aBuf[30]; - nLen = ConvertFromUnicode(c, aBuf, sizeof( aBuf ), eTextEncoding); - if ( nLen == 1 ) - return aBuf[0]; - else - return 0; -} - -// ----------------------------------------------------------------------- - -sal_Size ByteString::ConvertFromUnicode( sal_Unicode c, char* pBuf, sal_Size nBufLen, rtl_TextEncoding eTextEncoding ) -{ - // TextEncoding Dontknow wird nicht konvertiert - if ( eTextEncoding == RTL_TEXTENCODING_DONTKNOW ) - return '\0'; - - rtl_UnicodeToTextConverter hConverter; - sal_uInt32 nInfo; - sal_Size nSrcChars; - sal_Size nDestBytes; - sal_Unicode cUni = c; - sal_uInt32 nFlags = RTL_UNICODETOTEXT_FLAGS_NONSPACING_IGNORE | - RTL_UNICODETOTEXT_FLAGS_CONTROL_IGNORE | - RTL_UNICODETOTEXT_FLAGS_FLUSH; - - nFlags |= RTL_UNICODETOTEXT_FLAGS_UNDEFINED_DEFAULT | - RTL_UNICODETOTEXT_FLAGS_INVALID_DEFAULT; - nFlags |= RTL_UNICODETOTEXT_FLAGS_UNDEFINED_REPLACE; - if ( nBufLen > 1 ) - nFlags |= RTL_UNICODETOTEXT_FLAGS_UNDEFINED_REPLACESTR; - - hConverter = rtl_createUnicodeToTextConverter( eTextEncoding ); - nDestBytes = rtl_convertUnicodeToText( hConverter, 0, - &cUni, 1, - (sal_Char*)pBuf, nBufLen, - nFlags, - &nInfo, &nSrcChars ); - rtl_destroyUnicodeToTextConverter( hConverter ); - return nDestBytes; -} - // ======================================================================= ByteString::ByteString( const rtl::OString& rStr ) |