<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
So to close bug #74702, we require to keep the real type of any OutputDevice* a function gets as argument.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Community, which solution do you prefer?</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Example is <span style="font-family: "Courier New", monospace;">OutputDevice*</span><span style="font-family: "Courier New", monospace;">
</span><span style="font-family: "Courier New", monospace;">Application::GetDefaultDevice()</span><span style="font-family: Calibri, Helvetica, sans-serif;"> which calls
</span><span style="font-family: "Courier New", monospace;">ImplGetDefaultWindow()</span><span style="font-family: Calibri, Helvetica, sans-serif;"> which returns a
</span><span style="font-family: "Courier New", monospace;">vcl::Window*.</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: "Courier New", monospace;"><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: "Courier New", monospace;">Application::GetDefaultDevice</span><span style="font-family: Calibri, Helvetica, sans-serif;">​ should return a
</span><span style="font-family: "Courier New", monospace;">vcl::Window*</span><span style="font-family: Calibri, Helvetica, sans-serif;"> so that functions that act differently for
</span><span style="font-family: "Courier New", monospace;">Window</span><span style="font-family: Calibri, Helvetica, sans-serif;">s can be used instead of functions that take any
</span><span style="font-family: "Courier New", monospace;">OutputDevice</span><span style="font-family: Calibri, Helvetica, sans-serif;"> but that are in trouble when they require to do something special with
</span><span style="font-family: "Courier New", monospace;">Window</span><span style="font-family: Calibri, Helvetica, sans-serif;">s.</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Calibri, Helvetica, sans-serif;"><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Best regards,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Adrien Ollier<br>
</div>
</body>
</html>