https://bz.apache.org/ooo/show_bug.cgi?id=127897

--- Comment #3 from Arrigo Marchiori <[email protected]> ---
(In reply to Peter from comment #2)
> Hi Arrigo,
> 
> This Property is only valid for Custom Shapes. How does this work for
> Regular shapes? I find this Code a bit disturbing.

Me too.

Looking at openoffice/main/cui/source/tabpages/textattr.cxx, in method
SvxTextAttrPage::Construct(), the aTsbAutoGrowSize TriStateBox is enabled if
bAutoGrowSizeEnabled is true; and it is true only in case of custom shapes. In
those cases, the aTsbAutoGrowHeight TriStateBox is surely disabled.

At lines 728-730 aTsbAutoGrowHeight could be enabled, but the condition is
always AND-ed with the variable bAutoGrowHeightEnabled set in the Construct()
method above.

In other words, the "Auto-grow size" and "Auto-grow height" boxes are never
enabled at the same time.

The reported "strange" mapping (i.e. aTsbAutoGrowSize set based on
SDRATTR_TEXT_AUTOGROWHEIGHT) is exactly reversed at lines 424-428: an 
SdrTextAutoGrowHeightItem is set based on the value of aTsbAutoGrowSize.

Petru-Florin may take this file as a good test case for his CodeSonar plugin:
two inversions in the same file should have been both reported! ;-)

Apart from jokes, I believe that the second one is harder to spot because it
involves data types and variable names instead of constants. At least, it took
me quite some time to notice it!

[...]
> I am not really satisfied with the situation. Argh is a good Comment.
> If this is Correct we should at least add a comment in
> openoffice/main/cui/source/tabpages/textattr.cxx too.

I agree with you. Shall we close this bug and continue on the pull request?

-- 
You are receiving this mail because:
You are the assignee for the issue.

Reply via email to