Wrong indentation which leads to segfault in sc/source/ui/docshell/docfunc.cxx

Lubos Lunak l.lunak at suse.cz
Wed Jan 2 08:20:43 PST 2013


On Tuesday 01 of January 2013, John LeMoyne Castle wrote:
> Julien,
>
> Looks to me like a very nice catch ...
...
> The next version (2011.07.05)
> http://opengrok.libreoffice.org/xref/core/sc/source/ui/docshell/docfunc.cxx
>?r=2b88f6d32f572792597ccbb15276b9db52db7d10 is a commit labelled
> "change remaining manual loops to
> ScMarkData::iterator " and the braces disappear on just one of the
> loops.  Because the braces were once there and, especially because the else
> block has ~ same action within the braces, I say that they should
> definitely come back.  Even though, I am not at all clear what this code is
> doing (whilst autoformatting selected cells in Calc)... this is an obvious
> oopsie within a greater code cleanup that should be corrected.
...
> I note that, for all its type mushiness, BASIC will not allow this kind of
> mistake.  The then-clause must either be all on one line (can do IF test
> THEN StmtA : StmtB : StmtC) and a multi-line then-clause must be terminated
> with End If or Else.

http://tinderbox.libreoffice.org/cgi-bin/gunzip.cgi?tree=MASTER&full-log=1356992414.21678#20458 :

20458         In file included from <stdin>:1:
20459         /home/tinderbox/clang-master-build/sc/source/ui/docshell/docfunc.cxx:3743:17: 
warning: statement aligned as second statement in for body but not in a 
statement block [loplugin]
20460                         SetWidthOrHeight( false,1,nRows, *itr, 
SC_SIZE_VISOPT, 0, false, false);
20461                         ^
20462         /home/tinderbox/clang-master-build/sc/source/ui/docshell/docfunc.cxx:3742:17: 
note: for body statement is here [loplugin]
20463                         SetWidthOrHeight( sal_True, 1,nCols, *itr, 
SC_SIZE_VISOPT, STD_EXTRA_WIDTH, false, sal_True);
20464                         ^
20465         1 warning generated.

-- 
 Lubos Lunak
 l.lunak at suse.cz


More information about the LibreOffice mailing list