Hello,

Cppcheck reported this:
sc/source/core/tool/autoform.cxx
1105    redundantAssignment     style   Variable 'bRet' is reassigned a value 
before
the old one has been used.

   1102         bRet = (rStream.GetError() == 0);
   1103        
//-----------------------------------------------------------
   1104         rStream << (sal_uInt16)(maData.size() - 1);
   1105         bRet = (rStream.GetError() == 0);
   1106         MapType::iterator it = maData.begin(), itEnd = maData.end();
   1107         for (++it; bRet && it != itEnd; ++it) // Skip the first
item.
   1108             bRet = it->second->Save(rStream, fileVersion);

What should we do with bRet value, after line 1102?

Also, notice the line 1107 "++it" to skip the first item. Shouldn't we add a
wrapper if(it != itEnd) for the "for loop" to be sure?

see
http://opengrok.libreoffice.org/xref/core/sc/source/core/tool/autoform.cxx#1105

Julien 



--
View this message in context: 
http://nabble.documentfoundation.org/Cppcheck-Variable-bRet-is-reassigned-a-value-in-autoform-cxx-tp4030054.html
Sent from the Dev mailing list archive at Nabble.com.
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to