mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-14 04:21:56 +00:00
fix bug 1285 (selecting font properly in the prefs combo)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7354 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
6b67e6829a
commit
192f2c94b2
@ -1,3 +1,9 @@
|
||||
2003-07-24 John Levon <levon@movementarian.org>
|
||||
|
||||
* QPrefs.C: make sure to correctly split a default
|
||||
lyxrc font for finding the font in the combo box
|
||||
(bug 1285)
|
||||
|
||||
2003-07-23 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* QExternal.C (apply, update_contents):
|
||||
|
@ -342,7 +342,7 @@ void setComboxFont(QComboBox * cb, string const & family, string const & foundry
|
||||
}
|
||||
}
|
||||
|
||||
// Try matching without foundary name
|
||||
// Try matching without foundry name
|
||||
|
||||
// We count in reverse in order to prefer the Xft foundry
|
||||
for (int i = cb->count() - 1; i >= 0; --i) {
|
||||
@ -353,6 +353,18 @@ void setComboxFont(QComboBox * cb, string const & family, string const & foundry
|
||||
}
|
||||
}
|
||||
|
||||
// family alone can contain e.g. "Helvetica [Adobe]"
|
||||
pair<string, string> tmpfam = parseFontName(family);
|
||||
|
||||
// We count in reverse in order to prefer the Xft foundry
|
||||
for (int i = cb->count() - 1; i >= 0; --i) {
|
||||
pair<string, string> tmp = parseFontName(fromqstr(cb->text(i)));
|
||||
if (compare_no_case(tmp.first, tmpfam.first) == 0) {
|
||||
cb->setCurrentItem(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Bleh, default fonts, and the names couldn't be found. Hack
|
||||
// for bug 1063. Qt makes baby Jesus cry.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user