[Libreoffice] [PATCH] Simple fix for fontconfig.cxx to review (from cppcheck report)

Caolán McNamara caolanm at redhat.com
Mon Jan 16 02:21:14 PST 2012


On Sun, 2012-01-15 at 09:48 +0400, Ivan Timofeev wrote:
> AFAIK in arithmetic bools are concerted to int so that true->1 and false->0.
> Then, the result is converted back to bool (because the function returns 
> bool) so that 0->false and 'any other value'->true.
> 
> So "return bool1 - bool2" can be replaced with not-so-magic "return 
> bool1 != bool2", right?
> 
> By the way, the author of the code is Caolan, let's ask him. :)

I imagine what I would want to happen in the case that two fonts have
the same name, and one has a font version and one doesn't, that the one
that has a font version is sorted in the same order as if it had a font
version greater than the one that doesn't
i.e. return bHaveA > bHaveB;
committed that now and de-booled the comparison operands for some
"clarity".

C.



More information about the LibreOffice mailing list