]> git.lyx.org Git - lyx.git/blobdiff - src/Text3.cpp
Ensure the focus is returned to the editing area after a dispatch.
[lyx.git] / src / Text3.cpp
index b5bdc3b4ec0816027853d61ae8722b37fcb9e7dc..947975530204c41b5f0085728084277c541ba58b 100644 (file)
@@ -57,6 +57,8 @@
 #include "insets/InsetSpecialChar.h"
 #include "insets/InsetText.h"
 #include "insets/InsetInfo.h"
+#include "insets/InsetGraphics.h"
+#include "insets/InsetGraphicsParams.h"
 
 #include "support/convert.h"
 #include "support/debug.h"
@@ -890,6 +892,28 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                break;
        }
 
+       case LFUN_SET_GRAPHICS_GROUP: {
+               InsetGraphics * ins = InsetGraphics::getCurrentGraphicsInset(cur);
+               if (!ins)
+                       break;
+
+               cur.recordUndoFullDocument();
+
+               string id = to_utf8(cmd.argument());
+               string grp = InsetGraphics::getGroupParams(bv->buffer(), id);
+               InsetGraphicsParams tmp, inspar = ins->getParams();
+
+               if (id.empty())
+                       inspar.groupId = to_utf8(cmd.argument());
+               else {
+                       InsetGraphics::string2params(grp, bv->buffer(), tmp);
+                       tmp.filename = inspar.filename;
+                       inspar = tmp;
+               }
+
+               ins->setParams(inspar);
+       }
+
        case LFUN_SPACE_INSERT:
                if (cur.paragraph().layout().free_spacing)
                        insertChar(cur, ' ');
@@ -1682,7 +1706,6 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
        case LFUN_ACCENT_UNDERDOT:
        case LFUN_ACCENT_UNDERBAR:
        case LFUN_ACCENT_CARON:
-       case LFUN_ACCENT_SPECIAL_CARON:
        case LFUN_ACCENT_BREVE:
        case LFUN_ACCENT_TIE:
        case LFUN_ACCENT_HUNGARIAN_UMLAUT:
@@ -2236,7 +2259,6 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_ACCENT_UNDERDOT:
        case LFUN_ACCENT_UNDERBAR:
        case LFUN_ACCENT_CARON:
-       case LFUN_ACCENT_SPECIAL_CARON:
        case LFUN_ACCENT_BREVE:
        case LFUN_ACCENT_TIE:
        case LFUN_ACCENT_HUNGARIAN_UMLAUT: