cosmetic + try to avoid App::instance()->display() calls when not needed

This commit is contained in:
akir 2004-09-10 16:12:49 +00:00
parent 97d2577f1a
commit bf48239dee

View file

@ -19,7 +19,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//$Id: XftFontImp.cc,v 1.4 2004/08/29 08:33:13 rathnor Exp $
//$Id: XftFontImp.cc,v 1.5 2004/09/10 16:12:49 akir Exp $
#include "XftFontImp.hh"
#include "App.hh"
@ -132,10 +132,11 @@ unsigned int XftFontImp::textWidth(const char * const text, unsigned int len) co
return 0;
XGlyphInfo ginfo;
Display* disp = App::instance()->display();
#ifdef HAVE_XFT_UTF8_STRING
if (m_utf8mode) {
XftTextExtentsUtf8(App::instance()->display(),
XftTextExtentsUtf8(disp,
m_xftfont,
(XftChar8 *)text, len,
&ginfo);
@ -146,7 +147,7 @@ unsigned int XftFontImp::textWidth(const char * const text, unsigned int len) co
}
#endif //HAVE_XFT_UTF8_STRING
XftTextExtents8(App::instance()->display(),
XftTextExtents8(disp,
m_xftfont,
(XftChar8 *)text, len,
&ginfo);