[Libreoffice-commits] core.git: sfx2/source

Julien Nabet serval2412 at yahoo.fr
Thu Apr 4 11:13:49 PDT 2013


 sfx2/source/doc/docfile.cxx |   31 +------------------------------
 1 file changed, 1 insertion(+), 30 deletions(-)

New commits:
commit 7dce1c9fd2d26c9c2c53f0d307aa281972d2e82d
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Thu Apr 4 20:10:11 2013 +0200

    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

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 1f1525c..59ccfd0 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 );
         }
     }


More information about the Libreoffice-commits mailing list