]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNomencl.cpp
Cocoa based Qt-4.6 needs to paint every character separately to match metrics computa...
[lyx.git] / src / insets / InsetNomencl.cpp
index ac990b14080423c447de52e9dceaae3507ae2747..cd0a526ea0222f5fe36702627fa9c72febe18f01 100644 (file)
@@ -16,6 +16,7 @@
 #include "InsetNote.h"
 
 #include "Buffer.h"
+#include "Cursor.h"
 #include "DispatchResult.h"
 #include "Font.h"
 #include "Encoding.h"
@@ -174,6 +175,8 @@ void InsetPrintNomencl::doDispatch(Cursor & cur, FuncRequest & cmd)
                        cur.noScreenUpdate();
                        break;
                }
+
+               cur.recordUndo();
                setParams(p);
                break;
        }
@@ -207,6 +210,8 @@ docstring InsetPrintNomencl::xhtml(XHTMLStream &, OutputParams const &) const
 }
 
 
+// FIXME This should be changed to use the TOC. Perhaps
+// that could be done when XHTML output is added.
 int InsetPrintNomencl::docbook(odocstream & os, OutputParams const &) const
 {
        os << "<glossary>\n";
@@ -289,10 +294,9 @@ docstring nomenclWidest(Buffer const & buffer, OutputParams const & runparams)
 } // namespace anon
 
 
-int InsetPrintNomencl::latex(odocstream & os, OutputParams const & runparams_in) const
+void InsetPrintNomencl::latex(otexstream & os, OutputParams const & runparams_in) const
 {
        OutputParams runparams = runparams_in;
-       int lines = 0;
        if (getParam("set_width") == "auto") {
                docstring widest = nomenclWidest(buffer(), runparams);
                // Set the label width via nomencl's command \nomlabelwidth.
@@ -301,7 +305,6 @@ int InsetPrintNomencl::latex(odocstream & os, OutputParams const & runparams_in)
                        os << "\\settowidth{\\nomlabelwidth}{"
                           << widest
                           << "}\n";
-                       ++lines;
                }
        } else if (getParam("set_width") == "custom") {
                // custom length as optional arg of \printnomenclature
@@ -312,11 +315,10 @@ int InsetPrintNomencl::latex(odocstream & os, OutputParams const & runparams_in)
                   << '['
                   << from_ascii(width)
                   << "]{}";
-               return lines;
+               return;
        }
        // output the command \printnomenclature
        os << getCommand(runparams);
-       return lines;
 }
 
 
@@ -332,7 +334,7 @@ InsetCode InsetPrintNomencl::lyxCode() const
 }
 
 
-docstring InsetPrintNomencl::contextMenu(BufferView const &, int, int) const
+docstring InsetPrintNomencl::contextMenuName() const
 {
        return from_ascii("context-nomenclprint");
 }