]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetIndex.cpp
Fix bug #6315: counters in insets that don't produce output have ghost values.
[lyx.git] / src / insets / InsetIndex.cpp
index a9e5f99ceff958e8e13809f5ddfab76beb764ca5..86da890e02dab8654dad6a399eb7f88f1239cb87 100644 (file)
@@ -207,6 +207,7 @@ void InsetIndex::doDispatch(Cursor & cur, FuncRequest & cmd)
 
        case LFUN_INSET_MODIFY: {
                if (cmd.getArg(0) == "changetype") {
+                       cur.recordUndoInset(ATOMIC_UNDO, this);
                        params_.index = from_utf8(cmd.getArg(1));
                        break;
                }
@@ -478,6 +479,7 @@ void InsetPrintIndex::doDispatch(Cursor & cur, FuncRequest & cmd)
                                cmd = subst(cmd, "printindex", "printsubindex");
                        else
                                cmd = subst(cmd, "printsubindex", "printindex");
+                       cur.recordUndo();
                        setCmdName(cmd);
                        break;
                } else if (cmd.argument() == from_ascii("check-printindex*")) {
@@ -485,6 +487,7 @@ void InsetPrintIndex::doDispatch(Cursor & cur, FuncRequest & cmd)
                        if (suffixIs(cmd, '*'))
                                break;
                        cmd += '*';
+                       cur.recordUndo();
                        setParam("type", docstring());
                        setCmdName(cmd);
                        break;
@@ -792,7 +795,7 @@ docstring InsetPrintIndex::xhtml(XHTMLStream &, OutputParams const & op) const
                        if (level == 3) {
                                // another subsubentry
                                xs << html::StartTag("li", "class='subsubentry'") 
-                                  << XHTMLStream::NextRaw() << subsub;
+                                  << XHTMLStream::ESCAPE_NONE << subsub;
                        } else if (level == 2) {
                                // there are two ways we can be here: 
                                // (i) we can actually be inside a sub-entry already and be about
@@ -806,13 +809,13 @@ docstring InsetPrintIndex::xhtml(XHTMLStream &, OutputParams const & op) const
                                // have a sub-sub-entry.
                                if (eit->sub != last.sub)
                                        xs << html::StartTag("li", "class='subentry'") 
-                                          << XHTMLStream::NextRaw() << sub;
+                                          << XHTMLStream::ESCAPE_NONE << sub;
                                if (!subsub.empty()) {
                                        // it's actually a subsubentry, so we need to start that list
                                        xs.cr();
                                        xs << html::StartTag("ul", "class='subsubentry'") 
                                           << html::StartTag("li", "class='subsubentry'") 
-                                          << XHTMLStream::NextRaw() << subsub;
+                                          << XHTMLStream::ESCAPE_NONE << subsub;
                                        level = 3;
                                } 
                        } else {
@@ -833,14 +836,14 @@ docstring InsetPrintIndex::xhtml(XHTMLStream &, OutputParams const & op) const
                                        xs.cr();
                                        xs << html::StartTag("ul", "class='subentry'") 
                                           << html::StartTag("li", "class='subentry'") 
-                                          << XHTMLStream::NextRaw() << sub;
+                                          << XHTMLStream::ESCAPE_NONE << sub;
                                        level = 2;
                                        if (!subsub.empty()) {
                                                // and a sub-sub-entry
                                                xs.cr();
                                                xs << html::StartTag("ul", "class='subsubentry'") 
                                                   << html::StartTag("li", "class='subsubentry'") 
-                                                  << XHTMLStream::NextRaw() << subsub;
+                                                  << XHTMLStream::ESCAPE_NONE << subsub;
                                                level = 3;
                                        }
                                }