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


On Tuesday 07 of May 2019, Noel Grandin wrote:
On 2019/05/07 1:06 PM, Luboš Luňák wrote:
  The class can't be both, internally it stores just one value, and there
are functions such as the Size ctor or operator<< that do take a side
(although in line with the general stupidity, different functions take a
different side). And while the class gets used extensively, the usage can
be fixed mechanically.

I'd be happy to be proven wrong, but I'm not aware of any mechanical fixes.

 A clang plugin that rewrites all "getWidth()" to "(GetWidth() + 1)" (or the 
other way around).

And I would not be surprised to find code that calls both getWidth() and
GetWidth() on the same object.

 The way I see it, that doesn't matter. The class internally stores 4 
coordinates, the problem is just the interpretation of width/height. But 
that's purely a matter of definition, not of actual code. If the fix would be 
(let's say) defining that the class uses closed range and dumping getWidth(), 
then changing all getWidth() to (GetWidth() + 1) will keep the functionality 
exactly the same. It may lead to some code looking silly, but how should that 
break anything if the functionality doesn't change?

-- 
 Luboš Luňák
 l.lunak@collabora.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.