]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCommand.cpp
Merge branch 'master' into features/indexmacros
[lyx.git] / src / insets / InsetCommand.cpp
index 6d15c6886abf65e5f7b2b7a6176e687ce0e58208..9ca958b5f880857c6195614fa93dcdf9d14cc50c 100644 (file)
@@ -18,7 +18,6 @@
 #include "BufferParams.h"
 #include "BufferView.h"
 #include "Cursor.h"
-#include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
 #include "Lexer.h"
 
 #include "insets/InsetBox.h"
 #include "insets/InsetBranch.h"
-#include "insets/InsetCommand.h"
 #include "insets/InsetERT.h"
 #include "insets/InsetExternal.h"
 #include "insets/InsetFloat.h"
 #include "insets/InsetGraphics.h"
 #include "insets/InsetIndex.h"
-#include "insets/InsetLine.h"
 #include "insets/InsetListings.h"
 #include "insets/InsetNote.h"
 #include "insets/InsetPhantom.h"
 #include "insets/InsetSpace.h"
-#include "insets/InsetTabular.h"
 #include "insets/InsetVSpace.h"
 #include "insets/InsetWrap.h"
 
 #include "support/debug.h"
-#include "support/gettext.h"
 #include "support/lstrings.h"
 
 #include "frontends/Application.h"
@@ -190,7 +185,7 @@ void InsetCommand::validate(LaTeXFeatures & features) const
 
 void InsetCommand::changeCmdName(string const & new_name)
 {
-       string const old_name = getCmdName();
+       string const old_name = getCmdName();
        if (old_name == new_name)
                return;
 
@@ -221,6 +216,9 @@ void InsetCommand::doDispatch(Cursor & cur, FuncRequest & cmd)
                }
                InsetCommandParams p(p_.code());
                InsetCommand::string2params(to_utf8(cmd.argument()), p);
+               if (p == p_)
+                       // no change
+                       break;
                if (p.getCmdName().empty())
                        cur.noScreenUpdate();
                else {
@@ -231,6 +229,8 @@ void InsetCommand::doDispatch(Cursor & cur, FuncRequest & cmd)
                                string const data = InsetCommand::params2string(p);
                                lyx::dispatch(FuncRequest(LFUN_INSET_INSERT, data));
                                lyx::dispatch(FuncRequest(LFUN_CHAR_DELETE_FORWARD));
+                               cur.forceBufferUpdate();
+                               break;
                        } else
                                setParams(p);
                }