Kaydet (Commit) a8669b56 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

fdo#82580: Win32 GetObject() simplification

We call the Win32 GetObject() in just one source file and there it is
the A version we mean. (As such, as we call it to get BITMAP objects,
which do not have different A and W variants, we could as well call
GetObjectW().)

Note that we have several own member functions called GetObject(), so
until those are renamed we still need to #undef the GetObject
definition (from <windows.h>).

(No, I am not working on the EasyHack fdo#82580 as a whole. It is
intended for some less mature LO contributor. I just did a few small
things because I couldn't resist.)

Change-Id: Idab79503b3d899ef19f0608677752a62b20302ff
üst bc19caa4
......@@ -34,16 +34,7 @@
#undef WB_LEFT
#undef WB_RIGHT
#ifdef GetObject
#undef GetObject
#ifdef UNICODE
#define WIN_GetObject GetObjectW
#else
#define WIN_GetObject GetObjectA
#endif
#else
#define WIN_GetObject GetObject
#endif
#ifdef SetPrinter
#undef SetPrinter
......
......@@ -43,21 +43,8 @@
#pragma warning(push, 1)
#endif
#ifdef __MINGW32__
#ifdef GetObject
#undef GetObject
#endif
#define GetObject GetObjectA
#endif
#include <gdiplus.h>
#ifdef __MINGW32__
#ifdef GetObject
#undef GetObject
#endif
#endif
#if defined _MSC_VER
#pragma warning(pop)
#endif
......@@ -555,7 +542,7 @@ bool WinSalBitmap::Create( HANDLE hBitmap, bool bDIB, bool bCopyHandle )
{
BITMAP aDDBInfo;
if( WIN_GetObject( mhDDB, sizeof( BITMAP ), &aDDBInfo ) )
if( GetObjectA( mhDDB, sizeof( BITMAP ), &aDDBInfo ) )
{
maSize = Size( aDDBInfo.bmWidth, aDDBInfo.bmHeight );
mnBitCount = aDDBInfo.bmPlanes * aDDBInfo.bmBitsPixel;
......@@ -651,7 +638,7 @@ bool WinSalBitmap::Create( const SalBitmap& rSSalBmp, SalGraphics* pSGraphics )
GlobalUnlock( rSalBmp.mhDIB );
if( hNewDDB && WIN_GetObject( hNewDDB, sizeof( BITMAP ), &aDDBInfo ) )
if( hNewDDB && GetObjectA( hNewDDB, sizeof( BITMAP ), &aDDBInfo ) )
{
mhDDB = hNewDDB;
maSize = Size( aDDBInfo.bmWidth, aDDBInfo.bmHeight );
......@@ -839,7 +826,7 @@ HANDLE WinSalBitmap::ImplCopyDIBOrDDB( HANDLE hHdl, bool bDIB )
BITMAP aBmp;
// find out size of source bitmap
WIN_GetObject( hHdl, sizeof( BITMAP ), (LPSTR) &aBmp );
GetObjectA( hHdl, sizeof( BITMAP ), (LPSTR) &aBmp );
// create destination bitmap
if ( (hCopy = CreateBitmapIndirect( &aBmp )) != 0 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment