]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetLine.cpp
Better TOC output for XHTML, per Rob and Pavel.
[lyx.git] / src / insets / InsetLine.cpp
index deb5597730caed5d53eff4cb26ddfe096c5c718f..515efbba4f50931ec144fbeb11a7285435e811c6 100644 (file)
@@ -15,6 +15,7 @@
 #include "InsetLine.h"
 
 #include "Buffer.h"
+#include "Cursor.h"
 #include "Dimension.h"
 #include "DispatchResult.h"
 #include "FuncRequest.h"
@@ -42,7 +43,7 @@ using frontend::Painter;
 
 
 InsetLine::InsetLine(Buffer * buf, InsetCommandParams const & p)
-       : InsetCommand(buf, p, "line")
+       : InsetCommand(buf, p)
 {}
 
 
@@ -71,12 +72,12 @@ void InsetLine::doDispatch(Cursor & cur, FuncRequest & cmd)
        case LFUN_INSET_MODIFY: {
                InsetCommandParams p(LINE_CODE);
                // FIXME UNICODE
-               InsetCommand::string2params("line",
-                       to_utf8(cmd.argument()), p);
+               InsetCommand::string2params(to_utf8(cmd.argument()), p);
                if (p.getCmdName().empty()) {
                        cur.noScreenUpdate();
                        break;
                }
+               cur.recordUndo();
                setParams(p);
                break;
        }
@@ -160,7 +161,7 @@ void InsetLine::draw(PainterInfo & pi, int x, int y) const
 }
 
 
-int InsetLine::latex(odocstream & os, OutputParams const &) const
+void InsetLine::latex(otexstream & os, OutputParams const &) const
 {
        bool have_offset = true;
        Length offset_len = Length(to_ascii(getParam("offset")));
@@ -179,8 +180,6 @@ int InsetLine::latex(odocstream & os, OutputParams const &) const
        if (have_offset)
                os      << "[" << from_ascii(offset) << "]";
        os << "{" << from_ascii(width) << "}{" << from_ascii(height) << '}';
-
-       return 0;
 }
 
 
@@ -200,8 +199,7 @@ int InsetLine::docbook(odocstream & os, OutputParams const &) const
 
 docstring InsetLine::xhtml(XHTMLStream & xs, OutputParams const &) const
 {
-       xs << html::CompTag("hr");
-       xs.cr();
+       xs << html::CompTag("hr") << html::CR();
        return docstring();
 }