Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hello,

Cppcheck reported this:
sfx2/source/doc/docfile.cxx
2626    redundantAssignment     style   Variable 'nEncoding' is reassigned a value
before the old one has been used.

   2610 sal_uInt32 SfxMedium::CreatePasswordToModifyHash( const
::rtl::OUString& aPasswd, sal_Bool bWriter )
   2611 {
   2612     sal_uInt32 nHash = 0;
   2613 
   2614     if ( !aPasswd.isEmpty() )
   2615     {
   2616         if ( bWriter )
   2617         {
   2618             nHash =
::comphelper::DocPasswordHelper::GetWordHashAsUINT32( aPasswd );
   2619         }
   2620         else
   2621         {
   2622             rtl_TextEncoding nEncoding = RTL_TEXTENCODING_UTF8;
   2623 
   2624             // if the MS-filter should be used
   2625             // use the inconsistent algorithm to find the encoding
specified by MS
   2626             nEncoding = osl_getThreadTextEncoding();

See
http://opengrok.libreoffice.org/xref/core/sfx2/source/doc/docfile.cxx#2610

I took a look to the git history but it's quite confusing. Moreover UTF8
doesn't appear in the switch some lines below.

Any idea how should it be changed ?

Julien



--
View this message in context: 
http://nabble.documentfoundation.org/Cppcheck-redundantAssignment-about-encoding-in-CreatePasswordToModifyHash-docfile-cxx-sfx2-module-tp4047586.html
Sent from the Dev mailing list archive at Nabble.com.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.