]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCommand.cpp
Fix bug #6315: counters in insets that don't produce output have ghost values.
[lyx.git] / src / insets / InsetCommand.cpp
index 55c185e9eeef5b302b7cd9d45323768832761a97..a429e27435fb1d4fbfe2af73d71568792e047fe9 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "Buffer.h"
 #include "BufferView.h"
+#include "Cursor.h"
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
@@ -28,7 +29,6 @@
 #include "insets/InsetExternal.h"
 #include "insets/InsetFloat.h"
 #include "insets/InsetGraphics.h"
-#include "insets/InsetInclude.h"
 #include "insets/InsetLine.h"
 #include "insets/InsetListings.h"
 #include "insets/InsetNote.h"
@@ -99,13 +99,13 @@ void InsetCommand::draw(PainterInfo & pi, int x, int y) const
 }
 
 
-void InsetCommand::setParam(std::string const & name, docstring const & value)
+void InsetCommand::setParam(string const & name, docstring const & value)
 {
        p_[name] = value;
 }
 
 
-docstring const & InsetCommand::getParam(std::string const & name) const
+docstring const & InsetCommand::getParam(string const & name) const
 {
        return p_[name];
 }
@@ -146,7 +146,9 @@ void InsetCommand::doDispatch(Cursor & cur, FuncRequest & cmd)
        switch (cmd.action()) {
        case LFUN_INSET_MODIFY: {
                if (cmd.getArg(0) == "changetype") {
+                       cur.recordUndo();
                        p_.setCmdName(cmd.getArg(1));
+                       cur.forceBufferUpdate();
                        initView();
                        break;
                }