From b90de3dc5cb7d69218ca94525d12d255f2ffee42 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Fri, 17 Dec 2010 13:12:43 +0000 Subject: [PATCH] Fix bug #7176: Clicking TOC doesn't bring up outline 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 | 17 +++++++++++++++++ src/insets/InsetTOC.h | 2 ++ 2 files changed, 19 insertions(+) diff --git a/src/insets/InsetTOC.cpp b/src/insets/InsetTOC.cpp index db94ccc2f6..e297ef4be6 100644 --- a/src/insets/InsetTOC.cpp +++ b/src/insets/InsetTOC.cpp @@ -14,8 +14,10 @@ #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"; diff --git a/src/insets/InsetTOC.h b/src/insets/InsetTOC.h index 5dba25ca8d..cb32c66ac3 100644 --- a/src/insets/InsetTOC.h +++ b/src/insets/InsetTOC.h @@ -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 -- 2.39.2