Mercurial > octave-antonio
changeset 19445:8c47eb286151 gui-release
open doc browser for keywords correctly (bug #41110)
* parser.cc (is_ref): nodes can also be handled as valid refs;
(find_ref): nodes can also be handled as valid refs if the node name
is related to a keyword statement
* documentation-dock-widget.cc (showDoc): widget is shown but does not get
the focus
author | Torsten <ttl@justmail.de> |
---|---|
date | Tue, 30 Dec 2014 22:02:56 +0100 |
parents | 521d4959fc42 |
children | 50aedabe6bfb |
files | libgui/src/documentation-dock-widget.cc libgui/src/qtinfo/parser.cc |
diffstat | 2 files changed, 22 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/documentation-dock-widget.cc Tue Dec 30 15:38:57 2014 +0100 +++ b/libgui/src/documentation-dock-widget.cc Tue Dec 30 22:02:56 2014 +0100 @@ -60,10 +60,9 @@ void documentation_dock_widget::showDoc (const QString &name) { - // show the doc pane + // show the doc pane without focus for carrying on typing in the console if (!isVisible ()) setVisible (true); - setFocus (); raise (); _webinfo->load_ref (name);
--- a/libgui/src/qtinfo/parser.cc Tue Dec 30 15:38:57 2014 +0100 +++ b/libgui/src/qtinfo/parser.cc Tue Dec 30 22:02:56 2014 +0100 @@ -115,6 +115,10 @@ return ref.pos-_node_map [ref._node_name].pos; } + if (_node_map.contains (node)) + { + return 0; // node: show from the beginning + } return -1; } @@ -653,8 +657,25 @@ { // found ref, so return its name text = "XREF" + ref_name; + break; } } + + if (text.isEmpty ()) // try the statement-nodes + { + QHash<QString, node_map_item>::iterator itn; + for (itn=_node_map.begin (); itn!=_node_map.end (); ++itn) + { + QString k = itn.key (); + if (k == "The " + ref_name + " Statement") + { + // found ref, so return its name + text = k; + break; + } + } + } + return text; }