Le 07/02/2018 à 16:44, Pavel Sanda a écrit :
Jean-Marc Lasgouttes wrote:
It is :)
Given that one needs this lfun twice per year, I don't think that's a big
deal...
Pavel
Here is what I had in mind. Works quite well.
Who would have guessed what the innocent commit of such esoteric lfun would
trigger :)
It is still small activity :) Does it work for you?
But since I caught your attention, would you mind writing down dociterator loop
through all graphic insets, which are currently marked in the block? I need
similar but more useful lfun in which all graphic insets get the same group ID
(by eg the first one).
I see hints in DocIterator.h, but the description of methods is not clear
enough to just use it instead of studying the whole iterator class to be sure
what I am doing...
Something like what inset-forall does?
The idea is to use an InsetIterator (just a DocIterator that does
forwardInset() with operator++ and returns the inset with operator*.
Then one has to check the inset code by hand (which is not nice IMO).
The situation would be better if we could declare lyxCode() as "static
virtual" for for some reason C++ does not allow that. The we would be
able to compare inset.lyxCode() to InsetGraphics::lyxCode(). It might be
though that the correct answer here is to use rtti (dynamic_cast).
JMarc