]> git.lyx.org Git - features.git/commitdiff
Cosmetics per JMarc's suggestions.
authorPavel Sanda <sanda@lyx.org>
Fri, 9 Feb 2018 22:46:14 +0000 (23:46 +0100)
committerPavel Sanda <sanda@lyx.org>
Fri, 9 Feb 2018 22:46:56 +0000 (23:46 +0100)
src/BufferView.cpp

index ad8ed46e582c6036c8a054c2228a41eace8ff0f9..0f4b6346d0331b3af26e43795a9fc2a7fae69828 100644 (file)
@@ -1709,11 +1709,12 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                from = cur.selectionBegin();
                to = cur.selectionEnd();
 
-               string newId = cmd.getArg(0);
-               bool fetchId=newId.empty(); //if we wait for groupId from first graphics inset
+               string const newId = cmd.getArg(0);
+               bool fetchId = newId.empty(); //if we wait for groupId from first graphics inset
 
                InsetGraphicsParams grp_par;
-               InsetGraphics::string2params(graphics::getGroupParams(buffer_, newId), buffer_, grp_par);
+               if (!fetchId)
+                       InsetGraphics::string2params(graphics::getGroupParams(buffer_, newId), buffer_, grp_par);
 
                if (!from.nextInset())  //move to closest inset
                        from.forwardInset();
@@ -1722,15 +1723,12 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                        Inset * inset = from.nextInset();
                        if (!inset)
                                break;
-                       if (inset->lyxCode() == GRAPHICS_CODE) {
-                               InsetGraphics * ig = inset->asInsetGraphics();
-                               if (!ig)
-                                       break;
+                       InsetGraphics * ig = inset->asInsetGraphics();
+                       if (ig) {
                                InsetGraphicsParams inspar = ig->getParams();
                                if (fetchId) {
                                        grp_par = inspar;
                                        fetchId = false;
-
                                } else {
                                        grp_par.filename = inspar.filename;
                                        ig->setParams(grp_par);