Hello Kohei,<br><br>yes you're right. This part was copied from another method and I didn't notice it. But I don't think that you must check for ScDocShell, because the whole class is build without any check for it.<br>
<br>Should I send a reworked patch? There are just the two occurences of this check. Only the check if(pDBData) is important in this context.<br><br>Regards,<br>Markus<br><br><div class="gmail_quote">2011/4/22 Kohei Yoshida <span dir="ltr"><<a href="mailto:kyoshida@novell.com">kyoshida@novell.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Thu, 2011-04-21 at 22:34 +0200, Markus Mohrhard wrote:<br>
> Hello,<br>
><br>
> here a short patch that reworks the<br>
> ScVbaWorksheet::getAutoFilterMode/setAutoFilterMode methods.<br>
<br>
</div>Hi Markus,<br>
<br>
Just a minor thing. In ScVbaWorksheet::setAutoFilterMode(), you do<br>
<br>
+ if (bAutoFilterMode && pDoc)<br>
<br>
but you've already de-referenced pDoc before that line<br>
<br>
+ ScDBData* pDBData = pDoc->GetAnonymousDBData(getSheetID());<br>
<br>
so it's probably pointless to check for pDoc pointer value in that if<br>
statement.<br>
<br>
Taking this a step further, if you want to check the existence of the<br>
document model to be extra safe, it's better to check the value of<br>
pDocShell. ScDocument instance is a concrete member of ScDocShell, so<br>
if the ScDocShell instance exists, ScDocument that returns from it is<br>
pretty much guaranteed to exist.<br>
<br>
Other than that, the rest looks good to me, but I'd like Noel's blessing<br>
on the VBA part.<br>
<br>
Kohei<br>
<font color="#888888"><br>
--<br>
Kohei Yoshida, LibreOffice hacker, Calc<br>
<<a href="mailto:kyoshida@novell.com">kyoshida@novell.com</a>><br>
<br>
</font></blockquote></div><br>