error detected by loplugin:staticaccess

Mike Kaganski mikekaganski at hotmail.com
Sun Oct 25 16:03:41 UTC 2020


Hi Regina,

On 25.10.2020 17:12, Regina Henschel wrote:
> Hi all,
> 
> I got an error in https://gerrit.libreoffice.org/c/core/+/104643
> But I do not know, how to write it correctly. Can you please help me?
> The other compilers are fine, with the way I have written it.

Since GetObjData is a static method, it does not belong to an object, 
but to the class. So writing pDrawLayer->GetObjData(aObj) (which looks 
as if GetObjData was operating on pDrawLayer) is conceptually wrong, and 
[loplugin:staticaccess] suggests you to we-write it as

     ScDrawObjData* pData = ScDrawLayer::GetObjData(aObj);

instead.

-- 
Best regards,
Mike Kaganski


More information about the LibreOffice mailing list