Bugfix from Rob Lahaye.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6231 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2003-02-22 18:15:59 +00:00
parent a4276f27f7
commit 9ca600e9a9
2 changed files with 12 additions and 9 deletions

View File

@ -1,3 +1,8 @@
2003-02-17 Rob Lahaye <lahaye@snu.ac.kr>
* FormTexinfo.C: fix full filename lookup when showing
file without fullpath.
2003-02-21 Angus Leeming <leeming@lyx.org> 2003-02-21 Angus Leeming <leeming@lyx.org>
* Timeout_pimpl.[Ch]: removed. * Timeout_pimpl.[Ch]: removed.

View File

@ -80,11 +80,8 @@ ButtonPolicy::SMInput FormTexinfo::input(FL_OBJECT * ob, long ob_value) {
} else if (ob == dialog_->browser && ob_value == 2) { } else if (ob == dialog_->browser && ob_value == 2) {
// double click in browser: view selected file // double click in browser: view selected file
string selection = string(); string selection = getString(dialog_->browser);
if (fl_get_button(dialog_->check_fullpath)) { if (!fl_get_button(dialog_->check_fullpath)) {
// contents in browser has full path
selection = getString(dialog_->browser);
} else {
// contents in browser has filenames without path // contents in browser has filenames without path
// reconstruct path from controller getContents // reconstruct path from controller getContents
string const files = controller().getContents(activeStyle, true); 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 // find line in files vector
vector<string>::const_iterator it = vec.begin(); vector<string>::const_iterator it = vec.begin();
int const line = fl_get_browser(dialog_->browser); for (; it != vec.end(); ++it) {
for (int i = line; it != vec.end() && i > 0; ++it, --i) { if ((*it).find(selection) != string::npos) {
if (i == 1) selection = *it; selection = *it;
break;
}
} }
} }
if (!selection.empty()) { if (!selection.empty()) {
controller().viewFile(selection); controller().viewFile(selection);
} }