[Libreoffice-commits] .: 4 commits - rsc/source svl/source tools/inc vcl/win
Tor Lillqvist
tml at kemper.freedesktop.org
Sun Jan 23 14:58:11 PST 2011
rsc/source/rscpp/cpp3.c | 10 +++-------
svl/source/svdde/ddeimp.hxx | 4 ++--
tools/inc/tools/postsys.h | 1 +
tools/inc/tools/presys.h | 1 +
vcl/win/inc/saldata.hxx | 10 ++++------
vcl/win/inc/wincomp.hxx | 14 +++++++-------
vcl/win/source/gdi/salgdi.cxx | 9 +++++----
vcl/win/source/window/salframe.cxx | 4 ++--
8 files changed, 25 insertions(+), 28 deletions(-)
New commits:
commit ba94a13c51e2a00aa3b5dcc23b8e809e59d2fc39
Author: Tor Lillqvist <tlillqvist at novell.com>
Date: Mon Jan 24 00:54:51 2011 +0200
Hide and reveal also ULONG in presys.h / postsys.h
Although, I fail to understand why the duplication of work done in
prewin.h/postwin.h vs. presys.h/postsys.h is needed.
diff --git a/tools/inc/tools/postsys.h b/tools/inc/tools/postsys.h
index 68711b3..8ea6779 100644
--- a/tools/inc/tools/postsys.h
+++ b/tools/inc/tools/postsys.h
@@ -34,6 +34,7 @@
#undef PolyPolygon
#undef Polygon
#undef Rectangle
+#undef ULONG
#undef BYTE
#undef BOOL
#undef DELETE
diff --git a/tools/inc/tools/presys.h b/tools/inc/tools/presys.h
index 8d27515..dfec860 100644
--- a/tools/inc/tools/presys.h
+++ b/tools/inc/tools/presys.h
@@ -35,6 +35,7 @@
#define BOOL WIN_BOOL
#define BYTE WIN_BYTE
+#define ULONG WIN_ULONG
#define Rectangle BLA_Rectangle
#define Polygon BLA_Polygon
commit a2fa7227bdf250ff0edb24314c3d4dee21101e1c
Author: Tor Lillqvist <tlillqvist at novell.com>
Date: Sun Jan 23 23:45:55 2011 +0200
Fix compilation on 64-bit Windows
diff --git a/vcl/win/inc/saldata.hxx b/vcl/win/inc/saldata.hxx
index 7d3729f..616848e 100644
--- a/vcl/win/inc/saldata.hxx
+++ b/vcl/win/inc/saldata.hxx
@@ -342,8 +342,6 @@ int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 );
// -----------------
// A/W-Wrapper
-LONG ImplSetWindowLong( HWND hWnd, int nIndex, DWORD dwNewLong );
-LONG ImplGetWindowLong( HWND hWnd, int nIndex );
WIN_BOOL ImplPostMessage( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam );
WIN_BOOL ImplSendMessage( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam );
WIN_BOOL ImplGetMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax );
@@ -352,22 +350,22 @@ LONG ImplDispatchMessage( CONST MSG *lpMsg );
inline void SetWindowPtr( HWND hWnd, WinSalFrame* pThis )
{
- ImplSetWindowLong( hWnd, SAL_FRAME_THIS, (LONG)pThis );
+ SetWindowLongPtr( hWnd, SAL_FRAME_THIS, (LONG_PTR)pThis );
}
inline WinSalFrame* GetWindowPtr( HWND hWnd )
{
- return (WinSalFrame*)ImplGetWindowLong( hWnd, SAL_FRAME_THIS );
+ return (WinSalFrame*)GetWindowLongPtrW( hWnd, SAL_FRAME_THIS );
}
inline void SetSalObjWindowPtr( HWND hWnd, WinSalObject* pThis )
{
- ImplSetWindowLong( hWnd, SAL_OBJECT_THIS, (LONG)pThis );
+ SetWindowLongPtr( hWnd, SAL_OBJECT_THIS, (LONG_PTR)pThis );
}
inline WinSalObject* GetSalObjWindowPtr( HWND hWnd )
{
- return (WinSalObject*)ImplGetWindowLong( hWnd, SAL_OBJECT_THIS );
+ return (WinSalObject*)GetWindowLongPtr( hWnd, SAL_OBJECT_THIS );
}
#endif // _SV_SALDATA_HXX
diff --git a/vcl/win/inc/wincomp.hxx b/vcl/win/inc/wincomp.hxx
index d879f71..2740ffe 100644
--- a/vcl/win/inc/wincomp.hxx
+++ b/vcl/win/inc/wincomp.hxx
@@ -150,37 +150,37 @@ inline HFONT GetWindowFont( HWND hWnd )
inline void SetClassCursor( HWND hWnd, HCURSOR hCursor )
{
- SetClassLong( hWnd, GCL_HCURSOR, (DWORD)hCursor );
+ SetClassLongPtr( hWnd, GCLP_HCURSOR, (LONG_PTR)hCursor );
}
inline HCURSOR GetClassCursor( HWND hWnd )
{
- return (HCURSOR)GetClassLong( hWnd, GCL_HCURSOR );
+ return (HCURSOR)GetClassLongPtr( hWnd, GCLP_HCURSOR );
}
inline void SetClassIcon( HWND hWnd, HICON hIcon )
{
- SetClassLong( hWnd, GCL_HICON, (DWORD)hIcon );
+ SetClassLongPtr( hWnd, GCLP_HICON, (LONG_PTR)hIcon );
}
inline HICON GetClassIcon( HWND hWnd )
{
- return (HICON)GetClassLong( hWnd, GCL_HICON );
+ return (HICON)GetClassLongPtr( hWnd, GCLP_HICON );
}
inline HBRUSH SetClassBrush( HWND hWnd, HBRUSH hBrush )
{
- return (HBRUSH)SetClassLong( hWnd, GCL_HBRBACKGROUND, (DWORD)hBrush );
+ return (HBRUSH)SetClassLongPtr( hWnd, GCLP_HBRBACKGROUND, (LONG_PTR)hBrush );
}
inline HBRUSH GetClassBrush( HWND hWnd )
{
- return (HBRUSH)GetClassLong( hWnd, GCL_HBRBACKGROUND );
+ return (HBRUSH)GetClassLongPtr( hWnd, GCLP_HBRBACKGROUND );
}
inline HINSTANCE GetWindowInstance( HWND hWnd )
{
- return (HINSTANCE)GetWindowLong( hWnd, GWL_HINSTANCE );
+ return (HINSTANCE)GetWindowLongPtr( hWnd, GWLP_HINSTANCE );
}
// ------------------------
diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx
index 1ca0068..16c8b11 100644
--- a/vcl/win/source/gdi/salgdi.cxx
+++ b/vcl/win/source/gdi/salgdi.cxx
@@ -621,7 +621,7 @@ void ImplClearHDCCache( SalData* pData )
// Make sure pWinPointAry and pWinFlagAry are big enough
void ImplPreparePolyDraw( bool bCloseFigures,
ULONG nPoly,
- const ULONG* pPoints,
+ const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
const BYTE* const* pFlgAry,
POINT* pWinPointAry,
@@ -632,7 +632,7 @@ void ImplPreparePolyDraw( bool bCloseFigures,
{
const POINT* pCurrPoint = reinterpret_cast<const POINT*>( *pPtAry++ );
const BYTE* pCurrFlag = *pFlgAry++;
- const ULONG nCurrPoints = *pPoints++;
+ const sal_uInt32 nCurrPoints = *pPoints++;
const bool bHaveFlagArray( pCurrFlag );
ULONG nCurrPoint;
@@ -1459,7 +1459,8 @@ sal_Bool WinSalGraphics::drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAr
pWinFlagAry = aStackAry2;
}
- ImplPreparePolyDraw(true, 1, &nPoints, &pPtAry, &pFlgAry, pWinPointAry, pWinFlagAry);
+ sal_uInt32 nPoints_i32(nPoints);
+ ImplPreparePolyDraw(true, 1, &nPoints_i32, &pPtAry, &pFlgAry, pWinPointAry, pWinFlagAry);
sal_Bool bRet( sal_False );
@@ -1497,7 +1498,7 @@ sal_Bool WinSalGraphics::drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt
"WinSalGraphics::DrawPolyPolygonBezier(): POINT != SalPoint" );
ULONG nCurrPoly, nTotalPoints;
- const ULONG* pCurrPoints = pPoints;
+ const sal_uInt32* pCurrPoints = pPoints;
for( nCurrPoly=0, nTotalPoints=0; nCurrPoly<nPoly; ++nCurrPoly )
nTotalPoints += *pCurrPoints++;
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index 2625210..a0b455c 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -6292,12 +6292,12 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP
break;
#if WINVER >= 0x0500
case WM_IME_REQUEST:
- if ( PtrToInt( wParam ) == IMR_RECONVERTSTRING )
+ if ( (sal_uIntPtr)( wParam ) == IMR_RECONVERTSTRING )
{
nRet = ImplHandleIMEReconvertString( hWnd, lParam );
rDef = FALSE;
}
- else if( PtrToInt( wParam ) == IMR_CONFIRMRECONVERTSTRING )
+ else if( (sal_uIntPtr)( wParam ) == IMR_CONFIRMRECONVERTSTRING )
{
nRet = ImplHandleIMEConfirmReconvertString( hWnd, lParam );
rDef = FALSE;
commit f1bcc1da04d6fafbcca64fee6b5911512efb9602
Author: Tor Lillqvist <tlillqvist at novell.com>
Date: Sun Jan 23 22:52:58 2011 +0200
Fix compilation error on 64-bit Windows
diff --git a/svl/source/svdde/ddeimp.hxx b/svl/source/svdde/ddeimp.hxx
index 9c94086..0614b03 100644
--- a/svl/source/svdde/ddeimp.hxx
+++ b/svl/source/svdde/ddeimp.hxx
@@ -156,11 +156,11 @@ struct DdeInstData
DdeConnections* pConnections;
// Server
long hCurConvSvr;
- ULONG hDdeInstSvr;
+ DWORD hDdeInstSvr;
short nInstanceSvr;
DdeServices* pServicesSvr;
// Client
- ULONG hDdeInstCli;
+ DWORD hDdeInstCli;
short nInstanceCli;
};
commit 674ad4fdadf5caf0a5c8a39f536cbef0a0c98762
Author: Tor Lillqvist <tlillqvist at novell.com>
Date: Sun Jan 23 22:51:44 2011 +0200
Fix compilation on 64-bit Windows
No need to force use of 32-bit time_t (which doesn't exist for 64-bit
Windows), just use defaults.
diff --git a/rsc/source/rscpp/cpp3.c b/rsc/source/rscpp/cpp3.c
index f81be48..afe97b7 100644
--- a/rsc/source/rscpp/cpp3.c
+++ b/rsc/source/rscpp/cpp3.c
@@ -25,10 +25,6 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#if defined(_MSC_VER) && (_MSC_VER > 1310)
-#define _USE_32BIT_TIME_T
-#endif
-
#include <stdio.h>
#ifdef UNX
#include <stdlib.h>
@@ -467,7 +463,7 @@ void initdefines()
register char *tp;
register DEFBUF *dp;
int i;
- long tvec;
+ time_t tvec;
#if !defined( ZTC ) && !defined( WNT ) && !defined(BLC) && !defined(G3)
extern char *ctime();
@@ -505,9 +501,9 @@ void initdefines()
dp = defendel("__DATE__", FALSE);
dp->repl = tp = getmem(27);
dp->nargs = DEF_NOARGS;
- time( (time_t*)&tvec);
+ time( &tvec);
*tp++ = '"';
- strcpy(tp, ctime((const time_t*)&tvec));
+ strcpy(tp, ctime(&tvec));
tp[24] = '"'; /* Overwrite newline */
#endif
}
More information about the Libreoffice-commits
mailing list