bug 74702 - Issue with bool OutputDevice::IsNativeControlSupported(ControlType, ControlPart)

Kaganski Mike mikekaganski at hotmail.com
Mon Apr 15 07:50:27 UTC 2019


On 15.04.2019 10:44, Adrien Ollier wrote:
> OutputDevice::AcquireGraphics() is a pure virtual function, so we cannot 
> know in the general case what it does.
> And what is written is not really equivalent to what you wrote because 
> if AcquireGraphics() is false, there is not a second check for 
> mpGraphics. That's why it is an issue.

AcquireGraphics() is not just "any function". Despite someone could of 
course implement it to play poker, its purpose is to acquire mpGraphics 
and return if it succeeded. Failing that is programmer's error breaking 
contract. There's no use to introduce that kind of checks here. Please 
see existing implementations, like VirtualDevice::AcquireGraphics() in 
vcl/source/gdi/virdev.cxx.

-- 
Best regards,
Mike Kaganski


More information about the LibreOffice mailing list