factorize code between GuiFontMetrics::rectText() and buttonText().

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23000 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-02-14 09:44:12 +00:00
parent 9e4780ffd8
commit 15ff669dd0

View File

@ -192,9 +192,8 @@ void GuiFontMetrics::rectText(docstring const & str,
void GuiFontMetrics::buttonText(docstring const & str,
int & w, int & ascent, int & descent) const
{
w = width(str) + 2 * Inset::TEXT_TO_INSET_OFFSET;
ascent = metrics_.ascent() + d;
descent = metrics_.descent() + d;
rectText(str, w, ascent, descent);
w += Inset::TEXT_TO_INSET_OFFSET;
}