[RESOLVED] Re: Wrong copy paste in SwFieldFormCheckboxPortion::Format ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commented here: https://cgit.freedesktop.org/libreoffice/core/commit/?id=8a82100c8274d3c0e6d8386116fe8c48543fc4c3
Le mardi 19 novembre 2019 à 11:22:49 UTC+1, Julien <serval2412@xxxxxxxx> a écrit :


Hi Michael

There's no function "GetTextWidth" (or I missed it), so can't do this assertion.
See https://opengrok.libreoffice.org/xref/core/sw/source/core/text/portxt.cxx?r=7ade17fd#810

Julien
Le mardi 19 novembre 2019 à 11:12:24 UTC+1, Michael Stahl <mst@xxxxxxxxxxxxxxx> a écrit :


On 19.11.19 09:20, Miklos Vajna wrote:

> Hi Julien,
>
> Oh sorry, I didn't realize this pattern is:
>
> SetWidth(GetHeight())
> SetHeight(GetHeight())
>
> I thought it's:
>
> SetWidth(GetHeight())
> SetHeight(GetWidth())
>
> With that in mind, the current code is just OK, the width of the
> checkbox portion is the same as its height, since it's a square (and
> that size depends on the font size).
>
> Perhaps add a comment explaining this to make it easier for the next
> person to understand. :-)


even better: add an assertion that the width and the height are the
same, then you'll find out in case your assumption isn't true.

assertions are executable documentation :)

_______________________________________________
LibreOffice mailing list
LibreOffice@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/libreoffice

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux