summaryrefslogtreecommitdiff
path: root/fpicker/source/win32/filepicker/dibpreview.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'fpicker/source/win32/filepicker/dibpreview.cxx')
-rw-r--r--fpicker/source/win32/filepicker/dibpreview.cxx40
1 files changed, 20 insertions, 20 deletions
diff --git a/fpicker/source/win32/filepicker/dibpreview.cxx b/fpicker/source/win32/filepicker/dibpreview.cxx
index 6a8e6ad63abe..86201a438fb6 100644
--- a/fpicker/source/win32/filepicker/dibpreview.cxx
+++ b/fpicker/source/win32/filepicker/dibpreview.cxx
@@ -50,7 +50,7 @@ ATOM CDIBPreview::s_ClassAtom = 0;
sal_Int32 CDIBPreview::s_RegisterDibPreviewWndCount = 0;
-CDIBPreview::CDIBPreview(HINSTANCE instance,HWND parent,sal_Bool bShowWindow) :
+CDIBPreview::CDIBPreview(HINSTANCE instance,HWND parent,bool bShowWindow) :
m_Instance(instance)
{
RegisterDibPreviewWindowClass();
@@ -67,10 +67,10 @@ CDIBPreview::CDIBPreview(HINSTANCE instance,HWND parent,sal_Bool bShowWindow) :
dwStyle,
0, 0, 0, 0,
parent,
- (HMENU)0x0, // for child windows this will
+ nullptr, // for child windows this will
// be used as child window identifier
m_Instance,
- (LPVOID)this // pass a pointer to the current
+ this // pass a pointer to the current
// instance of this class
);
@@ -149,22 +149,22 @@ void SAL_CALL CDIBPreview::setImage(sal_Int16 aImageFormat, const Any& aImage)
aGuard.clear();
- InvalidateRect(m_Hwnd,NULL,sal_False);
+ InvalidateRect(m_Hwnd,nullptr,false);
UpdateWindow(m_Hwnd);
}
-sal_Bool SAL_CALL CDIBPreview::setShowState(sal_Bool bShowState) throw (RuntimeException)
+bool SAL_CALL CDIBPreview::setShowState(bool bShowState) throw (RuntimeException)
{
PreviewBase::setShowState(bShowState);
ShowWindow(m_Hwnd, m_bShowState ? SW_SHOW : SW_HIDE);
- return sal_True;
+ return true;
}
-sal_Bool SAL_CALL CDIBPreview::getShowState() throw (RuntimeException)
+bool SAL_CALL CDIBPreview::getShowState() throw (RuntimeException)
{
- return (sal_Bool)IsWindowVisible(m_Hwnd);
+ return bool(IsWindowVisible(m_Hwnd));
}
@@ -186,7 +186,7 @@ void SAL_CALL CDIBPreview::onPaint(HWND hWnd, HDC hDC)
(pbmfh->bfType == ('B' | ('M' << 8))) )
{
BITMAPINFO * pbmi = reinterpret_cast<BITMAPINFO*>((pbmfh + 1));
- sal_uInt8 * pBits = reinterpret_cast<sal_uInt8*>(((DWORD_PTR)pbmfh) + pbmfh->bfOffBits);
+ sal_uInt8 * pBits = reinterpret_cast<sal_uInt8*>(pbmfh) + pbmfh->bfOffBits;
int cxDib = pbmi->bmiHeader.biWidth;
int cyDib = abs (pbmi->bmiHeader.biHeight);
@@ -216,14 +216,14 @@ void SAL_CALL CDIBPreview::onPaint(HWND hWnd, HDC hDC)
rc.top = 0;
rc.right = nWidth;
rc.bottom = nY;
- FillRect(hDC,&rc,(HBRUSH)(COLOR_INACTIVEBORDER + 1));
+ FillRect(hDC,&rc,reinterpret_cast<HBRUSH>(COLOR_INACTIVEBORDER + 1));
// bottom
rc.left = 0;
rc.top = nHeight - nY - 1;
rc.right = nWidth;
rc.bottom = nHeight;
- FillRect(hDC,&rc,(HBRUSH)(COLOR_INACTIVEBORDER + 1));
+ FillRect(hDC,&rc,reinterpret_cast<HBRUSH>(COLOR_INACTIVEBORDER + 1));
}
if (nX > 0)
@@ -233,26 +233,26 @@ void SAL_CALL CDIBPreview::onPaint(HWND hWnd, HDC hDC)
rc.top = nY;
rc.right = nX;
rc.bottom = nHeight - nY;
- FillRect(hDC,&rc,(HBRUSH)(COLOR_INACTIVEBORDER + 1));
+ FillRect(hDC,&rc,reinterpret_cast<HBRUSH>(COLOR_INACTIVEBORDER + 1));
// right
rc.left = nWidth - nX - 1;
rc.top = nY;
rc.right = nWidth;
rc.bottom = nHeight - nY;
- FillRect(hDC,&rc,(HBRUSH)(COLOR_INACTIVEBORDER + 1));
+ FillRect(hDC,&rc,reinterpret_cast<HBRUSH>(COLOR_INACTIVEBORDER + 1));
}
}
else // clear background
{
RECT rc;
GetClientRect(hWnd,&rc);
- FillRect(hDC,&rc,(HBRUSH)(COLOR_INACTIVEBORDER + 1));
+ FillRect(hDC,&rc,reinterpret_cast<HBRUSH>(COLOR_INACTIVEBORDER + 1));
}
}
catch(...)
{
- OSL_ASSERT(sal_False);
+ OSL_ASSERT(false);
}
}
@@ -284,8 +284,8 @@ LRESULT CALLBACK CDIBPreview::WndProc(
case WM_NCDESTROY:
{
// RemoveProp returns the saved value on success
- if (reinterpret_cast<CDIBPreview*>(
- RemovePropW(hWnd, CURRENT_INSTANCE)) == NULL)
+ if (static_cast<CDIBPreview*>(
+ RemovePropW(hWnd, CURRENT_INSTANCE)) == nullptr)
{
OSL_ASSERT(false);
}
@@ -294,7 +294,7 @@ LRESULT CALLBACK CDIBPreview::WndProc(
case WM_PAINT:
{
- CDIBPreview* pImpl = reinterpret_cast<CDIBPreview*>(
+ CDIBPreview* pImpl = static_cast<CDIBPreview*>(
GetPropW(hWnd, CURRENT_INSTANCE));
OSL_ASSERT(pImpl);
@@ -336,7 +336,7 @@ ATOM SAL_CALL CDIBPreview::RegisterDibPreviewWindowClass()
wndClsEx.style = CS_HREDRAW | CS_VREDRAW;
wndClsEx.lpfnWndProc = CDIBPreview::WndProc;
wndClsEx.hInstance = m_Instance;
- wndClsEx.hbrBackground = (HBRUSH)(COLOR_INACTIVEBORDER + 1);
+ wndClsEx.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_INACTIVEBORDER + 1);
wndClsEx.lpszClassName = PREVIEWWND_CLASS_NAME;
// register the preview window class
@@ -380,7 +380,7 @@ void SAL_CALL CDIBPreview::UnregisterDibPreviewWindowClass()
if (0 == s_RegisterDibPreviewWndCount)
{
- UnregisterClassW((PCWSTR)(DWORD_PTR)MAKELONG(s_ClassAtom,0),m_Instance);
+ UnregisterClassW(reinterpret_cast<PCWSTR>((DWORD_PTR)MAKELONG(s_ClassAtom,0)),m_Instance);
s_ClassAtom = 0;
}
}