]> git.lyx.org Git - features.git/commitdiff
Fix bug #7176: Clicking TOC doesn't bring up outline
authorVincent van Ravesteijn <vfr@lyx.org>
Fri, 17 Dec 2010 13:12:43 +0000 (13:12 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Fri, 17 Dec 2010 13:12:43 +0000 (13:12 +0000)
Previously LFUN_INSET_SETTINGS was misused to show the outliner. As a TOC doesn't have settings, it was no longer showed after a refactorization of LFUN_INSET_SETTINGS/LFUN_MOUSE_RELEASE because InsetToc::hasSettings() returns false.

As this is a special case, we should handle this special case in InsetTOC itself.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36907 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetTOC.cpp
src/insets/InsetTOC.h

index db94ccc2f64a16dde31a68a9df778e7092d7846e..e297ef4be68738388f4dd5a2c291d5ae9513e215 100644 (file)
 
 #include "Buffer.h"
 #include "BufferParams.h"
+#include "Cursor.h"
 #include "DispatchResult.h"
 #include "Font.h"
+#include "FuncRequest.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
 #include "OutputParams.h"
@@ -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";
index 5dba25ca8d0a4806a3fcc27212586bbae7bc7cee..cb32c66ac3f18c85b1df6313a151c12f3cba773f 100644 (file)
@@ -39,6 +39,8 @@ public:
        int docbook(odocstream &, OutputParams const &) const;
        ///
        docstring xhtml(XHTMLStream & xs, OutputParams const &) const;
+       ///
+       void doDispatch(Cursor & cur, FuncRequest & cmd);
        //@}
 
        /// \name Static public methods obligated for InsetCommand derived classes