]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCommand.cpp
Cocoa based Qt-4.6 needs to paint every character separately to match metrics computa...
[lyx.git] / src / insets / InsetCommand.cpp
index a429e27435fb1d4fbfe2af73d71568792e047fe9..fd86d03989a9047c038479fb177df6469c2fa295 100644 (file)
@@ -29,6 +29,7 @@
 #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"
@@ -118,11 +119,10 @@ void InsetCommand::setParams(InsetCommandParams const & p)
 }
 
 
-int InsetCommand::latex(odocstream & os, OutputParams const & runparams_in) const
+void InsetCommand::latex(otexstream & os, OutputParams const & runparams_in) const
 {
        OutputParams runparams = runparams_in;
        os << getCommand(runparams);
-       return 0;
 }
 
 
@@ -156,8 +156,10 @@ void InsetCommand::doDispatch(Cursor & cur, FuncRequest & cmd)
                InsetCommand::string2params(to_utf8(cmd.argument()), p);
                if (p.getCmdName().empty())
                        cur.noScreenUpdate();
-               else
+               else {
+                       cur.recordUndo();
                        setParams(p);
+               }
                // FIXME We might also want to check here if this one is in the TOC.
                // But I think most of those are labeled.
                if (isLabeled())
@@ -208,7 +210,7 @@ bool InsetCommand::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
-docstring InsetCommand::contextMenu(BufferView const &, int, int) const
+docstring InsetCommand::contextMenuName() const
 {
        return from_ascii("context-") + from_ascii(insetName(p_.code()));
 }
@@ -263,7 +265,7 @@ bool decodeInsetParam(string const & name, string & data,
        switch (code) {
        case BIBITEM_CODE:
        case BIBTEX_CODE:
-       case INDEX_CODE:
+       case INDEX_PRINT_CODE:
        case LABEL_CODE:
        case LINE_CODE:
        case NOMENCL_CODE:
@@ -315,6 +317,11 @@ bool decodeInsetParam(string const & name, string & data,
                data = InsetFloat::params2string(p);
                break;
        }
+       case INDEX_CODE: {
+               InsetIndexParams p;
+               data = InsetIndex::params2string(p);
+               break;
+       }
        case LISTINGS_CODE: {
                InsetListingsParams p;
                data = InsetListings::params2string(p);