diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2013-04-04 20:10:11 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2013-04-04 20:11:36 +0200 |
commit | 7dce1c9fd2d26c9c2c53f0d307aa281972d2e82d (patch) | |
tree | a7e33a263b3a8c8cb169c66bdeccb629bb06ccce | |
parent | remove -dylib_file mappings that are not needed anymore (diff) | |
download | core-7dce1c9fd2d26c9c2c53f0d307aa281972d2e82d.tar.gz core-7dce1c9fd2d26c9c2c53f0d307aa281972d2e82d.zip |
Simplification by retrieving system encoding
See http://nabble.documentfoundation.org/Cppcheck-redundantAssignment-about-encoding-in-CreatePasswordToModifyHash-docfile-cxx-sfx2-module-td4047586.html
Change-Id: I845f4e4518901be8cba6e82a3199505d63efac62
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 1f1525c46af8..59ccfd069aad 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -2619,36 +2619,7 @@ sal_uInt32 SfxMedium::CreatePasswordToModifyHash( const ::rtl::OUString& aPasswd } else { - rtl_TextEncoding nEncoding = RTL_TEXTENCODING_UTF8; - - // if the MS-filter should be used - // use the inconsistent algorithm to find the encoding specified by MS - nEncoding = osl_getThreadTextEncoding(); - switch( nEncoding ) - { - case RTL_TEXTENCODING_ISO_8859_15: - case RTL_TEXTENCODING_MS_874: - case RTL_TEXTENCODING_MS_1250: - case RTL_TEXTENCODING_MS_1251: - case RTL_TEXTENCODING_MS_1252: - case RTL_TEXTENCODING_MS_1253: - case RTL_TEXTENCODING_MS_1254: - case RTL_TEXTENCODING_MS_1255: - case RTL_TEXTENCODING_MS_1256: - case RTL_TEXTENCODING_MS_1257: - case RTL_TEXTENCODING_MS_1258: - case RTL_TEXTENCODING_SHIFT_JIS: - case RTL_TEXTENCODING_GB_2312: - case RTL_TEXTENCODING_BIG5: - // in case the system uses an encoding from the list above, it should be used - break; - - default: - // in case other encoding is used, use one of the encodings from the list - nEncoding = RTL_TEXTENCODING_MS_1250; - break; - } - + rtl_TextEncoding nEncoding = osl_getThreadTextEncoding(); nHash = ::comphelper::DocPasswordHelper::GetXLHashAsUINT16( aPasswd, nEncoding ); } } |