Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hello Kohei,

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.

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.

Regards,
Markus

2011/4/22 Kohei Yoshida <kyoshida@novell.com>

On Thu, 2011-04-21 at 22:34 +0200, Markus Mohrhard wrote:
Hello,

here a short patch that reworks the
ScVbaWorksheet::getAutoFilterMode/setAutoFilterMode methods.

Hi Markus,

Just a minor thing.  In ScVbaWorksheet::setAutoFilterMode(), you do

+        if (bAutoFilterMode && pDoc)

but you've already de-referenced pDoc before that line

+    ScDBData* pDBData = pDoc->GetAnonymousDBData(getSheetID());

so it's probably pointless to check for pDoc pointer value in that if
statement.

Taking this a step further, if you want to check the existence of the
document model to be extra safe, it's better to check the value of
pDocShell.  ScDocument instance is a concrete member of ScDocShell, so
if the ScDocShell instance exists, ScDocument that returns from it is
pretty much guaranteed to exist.

Other than that, the rest looks good to me, but I'd like Noel's blessing
on the VBA part.

Kohei

--
Kohei Yoshida, LibreOffice hacker, Calc
<kyoshida@novell.com>



Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.