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


Thank you John for your investigation about all this.

In fact, I was leafing through some cppcheck reports.
To simplify,  I pushed some slight fixes  in
sc/source/core/tool/autoform.cxx (see
http://cgit.freedesktop.org/libreoffice/core/commit/?id=2e1abe1c59b1121ffb5d46afe82ce985cb70c4db).
So now we've got this:
[sc/source/core/tool/autoform.cxx:1102] ->
[sc/source/core/tool/autoform.cxx:1105]: (performance) 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);

So bRet value of 1102 isn't taken into account since there's another
assignation line 1105.
But just after, I noticed that at line 1107 "it" variable was increased
without checking it != itEnd
So I checked bugs concerning autoformats and ran into fdo#47466.
I gave a try to it by adding an "if (it != itEnd)" before line 1107 and
finally had the bt of my first message.

So I looked at the git history as you indicated and found about the missing
braces was due to a slight mistake during a cleaning.

I pushed a fix (see
http://cgit.freedesktop.org/libreoffice/core/commit/?id=f843850ee9994653673ef5591aae875d7fb22fed).

Now there are still the cppcheck report + the potential lacking of iterator
test before loop

Julien



--
View this message in context: 
http://nabble.documentfoundation.org/Wrong-indentation-which-leads-to-segfault-in-sc-source-ui-docshell-docfunc-cxx-tp4026726p4026790.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.