Changeset a07ee70 in git


Ignore:
Timestamp:
26/07/10 07:26:47 (9 years ago)
Author:
Olly Betts <olly@…>
Branches:
add-show-splays, line_contents, master, stereo, svn/github/master, svn/origin/master, svn/tags/1.1.14, svn/tags/1.1.15, svn/tags/1.1.16, svn/tags/1.2.0, svn/tags/1.2.1, svn/tags/1.2.2, svn/tags/1.2.3, svn/tags/1.2.4, svn/tags/1.2.5, svn/trunk, travis-osx
Children:
1edaf8d
Parents:
652b73b
Message:

src/cavernlog.cc: Fix highlighting of links in CavernLog? window to
highlight just <file>:<line> (and not the ': ' after), and to make
the title for the terminal the warning/error message. Make the
checking stricter by checking that the linenumber is a number, to
avoid false positives.

git-svn-id: file:///home/survex-svn/survex/trunk@3491 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r652b73b ra07ee70  
     1Mon Jul 26 06:24:35 GMT 2010  Olly Betts <olly@survex.com>
     2
     3        * src/cavernlog.cc: Fix highlighting of links in CavernLog window to
     4          highlight just <file>:<line> (and not the ': ' after), and to make
     5          the title for the terminal the warning/error message.  Make the
     6          checking stricter by checking that the linenumber is a number, to
     7          avoid false positives.
     8
    19Mon Jul 26 04:48:12 GMT 2010  Olly Betts <olly@survex.com>
    210
  • src/cavernlog.cc

    r652b73b ra07ee70  
    247247            case '\n': {
    248248                if (cur.empty()) continue;
     249#ifndef __WXMSW__
    249250                size_t colon = cur.find(':');
    250 #ifdef __WXMSW__
     251#else
    251252                // If the path is "C:\path\to\file.svx" then don't split at the
    252253                // : after the drive letter!  FIXME: better to look for ": "?
    253                 if (colon == 1) colon = cur.find(':', 2);
    254 #endif
    255                 if (colon != wxString::npos) {
    256                     size_t colon2 = cur.find(':', colon + 1);
    257                     if (colon2 != wxString::npos && colon2 != cur.size() - 1) {
    258                         wxString href = cur.substr(0, colon2);
    259                         size_t colon3 = colon2;
    260                         while (++colon3 < cur.size()) {
    261                             if (cur[colon3] != ' ') break;
    262                         }
     254                size_t colon = cur.find(':', 2);
     255#endif
     256                if (colon != wxString::npos && colon < cur.size() - 1) {
     257                    ++colon;
     258                    size_t i = colon;
     259                    while (i < cur.size() - 1 &&
     260                           cur[i] >= wxT('0') && cur[i] <= wxT('9')) {
     261                        ++i;
     262                    }
     263                    if (i > colon && cur[i] == wxT(':') ) {
     264                        colon = i;
    263265                        wxString tag = wxT("<a href=\"");
    264                         tag.append(cur, 0, colon2);
     266                        tag.append(cur, 0, colon);
     267                        while (cur[++i] == wxT(' ')) { }
    265268                        tag += wxT("\" target=\"");
    266                         tag.append(cur, colon3);
     269                        tag.append(cur, i, wxString::npos);
    267270                        tag += wxT("\">");
    268271                        cur.insert(0, tag);
    269                         cur.insert(colon3 + tag.size(), wxT("</a>"));
     272                        cur.insert(colon + tag.size(), wxT("</a>"));
    270273                        ++link_count;
    271274                    }
Note: See TracChangeset for help on using the changeset viewer.