Ignore:
Timestamp:
Mar 27, 2001, 10:47:53 PM (24 years ago)
Author:
sandervl
Message:

DeleteDC check for DIB section + SelectObject fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/objhandle.cpp

    r4963 r5390  
    1 /* $Id: objhandle.cpp,v 1.11 2001-01-18 18:13:18 sandervl Exp $ */
     1/* $Id: objhandle.cpp,v 1.12 2001-03-27 20:47:53 sandervl Exp $ */
    22/*
    33 * Win32 Handle Management Code for OS/2
     
    177177  if(DIBSection::getSection() != NULL)
    178178  {
    179         DIBSection *dsect = DIBSection::find(hObject);
     179        DIBSection *dsect = DIBSection::findObj(hObject);
    180180        if(dsect)
    181181        {
     
    236236{
    237237 HGDIOBJ rc;
    238 
    239     dprintf2(("GDI32: SelectObject %x %x", hdc, hObj));
    240 
    241     if(ObjGetHandleType(hObj) == GDIOBJ_REGION) {
     238 DWORD   handleType = GetObjectType(hObj);
     239
     240    dprintf2(("GDI32: SelectObject %x %x type %x", hdc, hObj, handleType));
     241
     242    if(handleType == GDIOBJ_REGION) {
    242243        //Return complexity here; not previously selected clip region
    243244        return (HGDIOBJ)SelectClipRgn(hdc, hObj);
    244245    }
    245246
    246     if(DIBSection::getSection() != NULL)
     247    if(handleType == OBJ_BITMAP && DIBSection::getSection() != NULL)
    247248    {
    248249        DIBSection *dsect;
    249250
    250         dsect = DIBSection::find(hdc);
     251        dsect = DIBSection::findHDC(hdc);
    251252        if(dsect)
    252253        {
     
    254255            dsect->UnSelectDIBObject();
    255256        }
    256         dsect = DIBSection::find((DWORD)hObj);
     257        dsect = DIBSection::findObj(hObj);
    257258        if(dsect)
    258259        {
     
    261262    }
    262263    rc = O32_SelectObject(hdc, hObj);
    263     if(rc != 0 && DIBSection::getSection != NULL)
    264     {
    265         DIBSection *dsect = DIBSection::find((DWORD)rc);
     264    if(rc != 0 && GetObjectType(rc) == OBJ_BITMAP && DIBSection::getSection != NULL)
     265    {
     266        DIBSection *dsect = DIBSection::findObj(rc);
    266267        if(dsect)
    267268        {
     
    270271    }
    271272#ifdef USING_OPEN32
    272     if(O32_GetObjectType(hObj) == OBJ_BITMAP)
     273    if(handleType == OBJ_BITMAP)
    273274    {
    274275        //SvL: Open32 messes up the height of the hdc (for windows)
     
    286287}
    287288//******************************************************************************
     289//Called from user32 ReleaseDC (for non CS_OWNDC hdcs)
     290//******************************************************************************
     291VOID WIN32API UnselectGDIObjects(HDC hdc)
     292{
     293    DIBSection *dsect;
     294
     295    dsect = DIBSection::findHDC(hdc);
     296    if(dsect)
     297    {
     298        //remove previously selected dibsection
     299        dsect->UnSelectDIBObject();
     300    }
     301}
     302//******************************************************************************
    288303//******************************************************************************
    289304DWORD WIN32API GetObjectType( HGDIOBJ hObj)
Note: See TracChangeset for help on using the changeset viewer.