tdf#74702 2/2

Adrien Ollier adr.ollier at hotmail.fr
Sat Jul 6 17:59:33 UTC 2019


So to close bug #74702, we require to keep the real type of any OutputDevice* a function gets as argument.

If we are in a function g(OutputDevice*), we must rewind to its caller f(OutputDevice*), and so on until a(OutputDevice*) which is called after creation of an instance of a subclass of OutputDevice.

As you understand, it is very hard because there are many and many functions to modify and to rewind to get the real type of the OutputDevice* (OutputDevice subclass) that was passed as parameter.


An alternative is to use dynamic_cast and test the result. This solution does not require so much changes but is less elegant and efficient.


Community, which solution do you prefer?
I could try the first solution but to do so I need you to understand that keeping the real type of an object is crucial, essential. And to get this achevied, I need your cooperation for modifying functions that do not return the real type of an newly created object into a function that returns the real type of the object.

Example is OutputDevice* Application::GetDefaultDevice() which calls ImplGetDefaultWindow() which returns a vcl::Window*.

Application::GetDefaultDeviceā€‹ should return a vcl::Window* so that functions that act differently for Windows can be used instead of functions that take any OutputDevice but that are in trouble when they require to do something special with Windows.


I hope that all of you understand that it is important you to know this information so that you do not break all my work.

Best regards,
Adrien Ollier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20190706/666351eb/attachment.html>


More information about the LibreOffice mailing list