error: this member function can be declared static [loplugin:staticmethods] when adding a event function in a dialog

Caolán McNamara caolan.mcnamara at collabora.com
Thu Mar 28 17:09:14 UTC 2024


On Fri, 2024-03-29 at 00:16 +0800, Sakura286 wrote:
> 
> In file included from 
> /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil
> _64/cui/source/dialogs/nanpayloadwarningdlg.cxx:21:
> /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil
> _64/cui/source/inc/nanpayloadwarningdlg.hxx:33:15: 
> error: this member function can be declared static
> [loplugin:staticmethods]
>      DECL_LINK(OnRejectClick, weld::Button&, void);

You might want DECL_STATIC_LINK instead of DECL_LINK. The matching
IMPL_LINK then needs to be IMPL_STATIC_LINK etc.

https://cgit.freedesktop.org/libreoffice/core/tree/sfx2/source/appl/sfxhelp.cxx#n91
which has a DECL_STATIC_LINK and IMPL_STATIC_LINK_NOARG pair close
together might be a helpful example


More information about the LibreOffice mailing list