summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-08-16 11:48:48 +0300
committerTor Lillqvist <tml@collabora.com>2014-08-16 18:45:57 +0300
commita8669b56b194a7cd6da771dfb9904710da24c0b4 (patch)
tree4ccf0d74b1a8170a51fab26fecc39c115c3174ce
parentbc19caa4f17ccbcd6e08634ae635fd9c741473ad (diff)
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
-rw-r--r--include/postwin.h9
-rw-r--r--vcl/win/source/gdi/salbmp.cxx19
2 files changed, 3 insertions, 25 deletions
diff --git a/include/postwin.h b/include/postwin.h
index a76bcb875226..64ac27eb5837 100644
--- a/include/postwin.h
+++ b/include/postwin.h
@@ -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
diff --git a/vcl/win/source/gdi/salbmp.cxx b/vcl/win/source/gdi/salbmp.cxx
index 2bccbd797560..912144401069 100644
--- a/vcl/win/source/gdi/salbmp.cxx
+++ b/vcl/win/source/gdi/salbmp.cxx
@@ -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 )