From: Angus Leeming Date: Sat, 22 Feb 2003 18:15:59 +0000 (+0000) Subject: Bugfix from Rob Lahaye. X-Git-Tag: 1.6.10~17457 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9ca600e9a9ec0bcabd04124f3c265dce6468064f;p=lyx.git Bugfix from Rob Lahaye. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6231 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 404c0145c3..cf38cc6af3 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,8 @@ +2003-02-17 Rob Lahaye + + * FormTexinfo.C: fix full filename lookup when showing + file without fullpath. + 2003-02-21 Angus Leeming * Timeout_pimpl.[Ch]: removed. diff --git a/src/frontends/xforms/FormTexinfo.C b/src/frontends/xforms/FormTexinfo.C index e67f351a5e..c16d440208 100644 --- a/src/frontends/xforms/FormTexinfo.C +++ b/src/frontends/xforms/FormTexinfo.C @@ -80,11 +80,8 @@ ButtonPolicy::SMInput FormTexinfo::input(FL_OBJECT * ob, long ob_value) { } else if (ob == dialog_->browser && ob_value == 2) { // double click in browser: view selected file - string selection = string(); - if (fl_get_button(dialog_->check_fullpath)) { - // contents in browser has full path - selection = getString(dialog_->browser); - } else { + string selection = getString(dialog_->browser); + if (!fl_get_button(dialog_->check_fullpath)) { // contents in browser has filenames without path // reconstruct path from controller getContents string const files = controller().getContents(activeStyle, true); @@ -92,12 +89,13 @@ ButtonPolicy::SMInput FormTexinfo::input(FL_OBJECT * ob, long ob_value) { // find line in files vector vector::const_iterator it = vec.begin(); - int const line = fl_get_browser(dialog_->browser); - for (int i = line; it != vec.end() && i > 0; ++it, --i) { - if (i == 1) selection = *it; + for (; it != vec.end(); ++it) { + if ((*it).find(selection) != string::npos) { + selection = *it; + break; + } } } - if (!selection.empty()) { controller().viewFile(selection); }