+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>
* Timeout_pimpl.[Ch]: removed.
} 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);
// find line in files vector
vector<string>::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);
}