diff options
Diffstat (limited to 'xorg-server/dix/dispatch.c')
-rw-r--r-- | xorg-server/dix/dispatch.c | 26 |
1 files changed, 4 insertions, 22 deletions
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;
|