<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<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);">
<br>
</div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>De :</b> Michael Stahl <mst@libreoffice.org><br>
<b>Envoyé :</b> mercredi 10 juillet 2019 11:25<br>
<b>À :</b> Adrien Ollier; Tomaž Vajngerl<br>
<b>Cc :</b> libreoffice@lists.freedesktop.org<br>
<b>Objet :</b> Re: tdf#74702 2/2</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">On 09.07.19 22:54, Adrien Ollier wrote:<br>
> *De :* Michael Stahl <mst@libreoffice.org><br>
> On 08.07.19 13:06, Tomaž Vajngerl wrote:<br>
>> <br>
>> Well IMHO the problem that you even have to think about this is that <br>
>> OutputDevice is a enormous class, and then you have to deal with another <br>
>> even more enormous subclass vcl::Window, which should never be a <br>
>> subclass of OutputDevice in the first place. However the work to change <br>
>> that is quite big and non-trivial. <br>
> <br>
> i rarely work with VCL's implementation so i can't really have an<br>
> informed opinion but if you say that delegation instead of inheritance<br>
> would be an improvement here i'm all for it.<br>
> <br>
> <br>
> Hello Michael,<br>
> <br>
> thank you for your answer.<br>
> Can you explain what delegation means for you? I don't understand what <br>
> you mean.<br>
<br>
you'd have to ask Tomaž who knows a lot more about OutputDevice, but my <br>
understanding is that instead of Window inheriting from OutputDevice <br>
he'd want Window to have a OutputDevice member, probably held by unique_ptr.<br>
<br>
> Also, I quite disagree with you.<br>
> First, C++ allows an overriding function to have a return type that is a <br>
> subclass of the return type of the overridden function.<br>
<br>
you can do that with covariance of course, but how would it help?  is <br>
there a pre-existing class hierarchy somewhere that runs parallel to <br>
OutputDevice and its subclasses where this would fit in?  it wouldn't <br>
help if you put it in OutputDevice itself, because then if you call the <br>
baseclass getter you get an OutputDevice*.</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">----------</div>
<div class="PlainText">Hi Michael,</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">I agree with you when you say that won't help. And I also agree when you say that my proposal is error-prone because it is easy to call the wrong function.</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">I am waiting for the validation of one change but in the future I am quite sure that every change will require a discussion for the best way to solve it.</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">Thank you very much for your help.</div>
<div class="PlainText">Regards,</div>
<div class="PlainText">Adrien Ollier<br>
</div>
</span></font></div>
</div>
</body>
</html>