Op 1-9-2011 16:22, Uwe Stöhr schreef:
Am 29.08.2011 20:22, schrieb Pavel Sanda:
you can call methods via class::method() only when they are static.
otherwise you need real existing object for that class to call
class_variable.method().
generally you need either the variable or to declare that method
to be static.
How can I do this? Sorry for this stupid question but I never learned
C++. All I know is from looking at the LyX code. Therefore my skills
in the header business are quite low.
You can declare it static by putting "static" in front of it. But you
can never declare InsetSpace::latex static. It needs to know whether
it's a protected space, or maybe a horizontal fill or whatever. So you
need an object, set these properties and then you can call latex for
that object.
I guess what you need is:
InsetSpaceParams params;
params.kind = PROTECTED;
InsetSpace space(params);
space.latex(os, runparams);
or create a static function:
class InsetSpace {
...
static latexForKind(Kind kind, os, runparams);
...
}
and call
InsetSpace::latexForKind(PROTECTED, os, runparams);
Vincent