From 15ff669dd0720d1725814f5aa80178a6fa93e228 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Thu, 14 Feb 2008 09:44:12 +0000 Subject: [PATCH] factorize code between GuiFontMetrics::rectText() and buttonText(). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23000 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiFontMetrics.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/frontends/qt4/GuiFontMetrics.cpp b/src/frontends/qt4/GuiFontMetrics.cpp index d71c0b034b..de83340cba 100644 --- a/src/frontends/qt4/GuiFontMetrics.cpp +++ b/src/frontends/qt4/GuiFontMetrics.cpp @@ -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; } -- 2.39.2