Jean-Marc Lasgouttes wrote: > Le 08/02/2018 ?? 22:00, Pavel Sanda a écrit : >> commit b88ed81e7f1d2f59bb606351d95e093380b4eead >> Author: Pavel Sanda <sa...@lyx.org> >> Date: Thu Feb 8 21:33:37 2018 +0100 >> Unify graphics-groups inside marked block functionality. > > Is there a reason why this should not do the whole document when there is > no selection?
I was thinking about this for some time. These reasons finally gained weight: 1. Usability-wise I can't remember I ever needed this while many times I needed partial grouping. 2. Having this in context menu in generic case seemed overkill/overpopulating, but having it a must when you need this functionality, enabling it only in marked-block situation and thus visible seemed a good compromise. 3. There is trivial workaround for whole document by selecting all. >> + InsetGraphicsParams grp_par; >> + InsetGraphics::string2params(graphics::getGroupParams(buffer_, >> newId), >> buffer_, grp_par); > > So this is set to some value even if no newId is given? Correct. It's harmless, since it will be overwritten later in case of no newId but I can put it under if clause if you wish. >> + while (!from.empty() && from < to) { >> + Inset * inset = from.nextInset(); >> + if (!inset) >> + break; >> + if (inset->lyxCode() == GRAPHICS_CODE) { >> + InsetGraphics * ig = inset->asInsetGraphics(); > > + if (!ig) > > + break; > > Contrary to what I told you to do, it seems that here asInsetGraphics > already does the correct check. You can use: > InsetGraphics * ig = inset->asInsetGraphics(); I actually tried to get rid of that and got immediate crash. Can try again if there was some other interfering cause. Pavel