]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTOC.cpp
#7379 avoid the wrap spell check question when buffer is empty
[lyx.git] / src / insets / InsetTOC.cpp
index c1ead0f1142587c5799a7aedd7cc8f1fb5e235ca..e297ef4be68738388f4dd5a2c291d5ae9513e215 100644 (file)
@@ -14,7 +14,9 @@
 
 #include "Buffer.h"
 #include "BufferParams.h"
+#include "Cursor.h"
 #include "DispatchResult.h"
+#include "Font.h"
 #include "FuncRequest.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
@@ -36,7 +38,7 @@ namespace lyx {
 
 
 InsetTOC::InsetTOC(Buffer * buf, InsetCommandParams const & p)
-       : InsetCommand(buf, p, "toc")
+       : InsetCommand(buf, p)
 {}
 
 
@@ -58,6 +60,21 @@ docstring InsetTOC::screenLabel() const
 }
 
 
+void InsetTOC::doDispatch(Cursor & cur, FuncRequest & cmd) {
+       switch (cmd.action()) {
+       case LFUN_MOUSE_RELEASE:
+               if (!cur.selection() && cmd.button() == mouse_button::button1) {
+                       showInsetDialog(&cur.bv());
+                       cur.dispatched();
+               }
+               break;
+       
+       default:
+               InsetCommand::doDispatch(cur, cmd);
+       }
+}
+
+
 int InsetTOC::plaintext(odocstream & os, OutputParams const &) const
 {
        os << screenLabel() << "\n\n";
@@ -161,7 +178,7 @@ docstring InsetTOC::xhtml(XHTMLStream &, OutputParams const & op) const
                // FIXME XHTML 
                // There ought to be a simple way to customize this.
                // Maybe if we had an InsetLayout for TOC...
-               xs << XHTMLStream::NextRaw() << "&seArr;";
+               xs << XHTMLStream::ESCAPE_NONE << "&gt;";
                xs << html::EndTag("a");                
        }
        for (int i = lastdepth; i > 0; --i)