Jean-Marc Lasgouttes wrote:
rgh...@lyx.org writes:
+docstring InsetCollapsable::getCaptionText(OutputParams const & runparams)
const
Is there a reason why this is in InsetCollapsable and not InsetText? It
would be a good thing to lean up in InsetCollapsable all the stuff that
is not related to collapsableness.
I just moved it up far enough for my purposes. But I can move it to
InsetText, too.
It (and the related ones) could even be free-standing functions, but I
do not know where we stand in the "inset methods vs. functions" debate.
No, me either.
+{
+ if (paragraphs().empty())
+ return docstring();
Does something wrong happens if you remove this check? It looks
superfluous to me.
This came from the pre-existing version of getCaptionText(). I can
remove it, I think.
+
+ InsetCaption const * ins = getCaptionInset();
+ if (ins == 0)
+ return docstring();
+
+ odocstringstream ods;
+ ins->getCaptionText(ods, runparams);
So we have two different Inset*::getCaptionText methods with different
signatures? This looks ugly, I'd rather standardize on one.
I've changed the name to "getCaptionAsPlaintext()", which is what it does.
Actually, I suspect that, with the changes above, getCaptionText/HTML
will become so thin that they are not worth keeping (unless they are
called in a lot of places, of course).
They're each called in a couple places now, and could be called anywhere
a caption was needed.
Finally, remember to remove code from InsetWrap.cpp too...
Done.
The exact same code appeared in at least six places. :-(
rh