Mercurial > hg > octave-nkf
changeset 17035:08f0e372d006
doc viewer: correct the anchor position of the desired doc entry
* parser.cc(get_next_node): correct the size of lines read from the info files
where image links are discarded,
(node_text_to_html): use redled.png as marker for the desired doc entry
author | Torsten <ttl@justmail.de> |
---|---|
date | Mon, 22 Jul 2013 23:18:50 +0200 |
parents | 8d84dc5f5b5d |
children | 08dd9458684a |
files | libgui/src/qtinfo/parser.cc |
diffstat | 1 files changed, 26 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/qtinfo/parser.cc +++ b/libgui/src/qtinfo/parser.cc @@ -179,9 +179,29 @@ parser::get_next_node (QIODevice *io) { QString text; + QByteArray line, line_buffer; + char c; + int i; + while (!io->atEnd ()) { - QByteArray line = io->readLine (); + io->getChar (&c); + if (c) + { // first char is not equal 0 + io->ungetChar (c); + line = io->readLine (); + } + else + { // 0 was read -> image -> text length changes + line_buffer = io->readLine (); // image tag that is not needed + line = io->readLine (); // firsts line of text message + for (i=1; i<line_buffer.size ()+6; i++) // correct the size + line.insert (line.size ()-1,QByteArray(" ")); // by adding blanks + } + + if (line.at (0) == '"' && line.size () == 5) // end of image construct + line = " "; + if (line.at(0) == 31) { break; @@ -341,7 +361,9 @@ info_to_html (text1); info_to_html (text2); - text = text1 + "<a name='" + anchor + "' /><img src=':/actions/icons/stop.png'>" + text2; + text = text1 + "<a name='" + anchor + + "'/><img src=':/actions/icons/redled.png'><br> " + + text2; } else { @@ -371,7 +393,9 @@ text.append (navigationLinks); text.prepend ("<html><body>\n"); text.append ("</body></html>\n"); + return text; + } void