From 4b4ee0dc63abddffdc64355429e4ea9ccaa4d36d Mon Sep 17 00:00:00 2001 From: marha Date: Sun, 9 May 2010 21:30:23 +0000 Subject: svn merge -r577:HEAD ^/branches/released . --- xorg-server/dix/dispatch.c | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) (limited to 'xorg-server/dix/dispatch.c') diff --git a/xorg-server/dix/dispatch.c b/xorg-server/dix/dispatch.c index b813136c7..3e5a7ac74 100644 --- a/xorg-server/dix/dispatch.c +++ b/xorg-server/dix/dispatch.c @@ -1324,22 +1324,13 @@ ProcQueryFont(ClientPtr client) { xQueryFontReply *reply; FontPtr pFont; - GC *pGC; int rc; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); - client->errorValue = stuff->id; /* EITHER font or gc */ - rc = dixLookupResourceByType((pointer *)&pFont, stuff->id, RT_FONT, client, - DixGetAttrAccess); - if (rc == BadValue) { - rc = dixLookupResourceByType((pointer *)&pGC, stuff->id, RT_GC, client, - DixGetAttrAccess); - if (rc == Success) - pFont = pGC->font; - } + rc = dixLookupFontable(&pFont, stuff->id, client, DixGetAttrAccess); if (rc != Success) - return (rc == BadValue) ? BadFont: rc; + return rc; { xCharInfo *pmax = FONTINKMAX(pFont); @@ -1380,24 +1371,15 @@ ProcQueryTextExtents(ClientPtr client) { xQueryTextExtentsReply reply; FontPtr pFont; - GC *pGC; ExtentInfoRec info; unsigned long length; int rc; REQUEST(xQueryTextExtentsReq); REQUEST_AT_LEAST_SIZE(xQueryTextExtentsReq); - client->errorValue = stuff->fid; /* EITHER font or gc */ - rc = dixLookupResourceByType((pointer *)&pFont, stuff->fid, RT_FONT, client, - DixGetAttrAccess); - if (rc == BadValue) { - rc = dixLookupResourceByType((pointer *)&pGC, stuff->fid, RT_GC, client, - DixGetAttrAccess); - if (rc == Success) - pFont = pGC->font; - } + rc = dixLookupFontable(&pFont, stuff->fid, client, DixGetAttrAccess); if (rc != Success) - return (rc == BadValue) ? BadFont: rc; + return rc; length = client->req_len - bytes_to_int32(sizeof(xQueryTextExtentsReq)); length = length << 1; -- cgit v1.2.3