This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/AOO42X by this push:
new 535d1d4 Fixed typo (HORZ_BODER_SPACE -> HORZ_BORDER_SPACE), removed
whitespace
535d1d4 is described below
commit 535d1d4a42fe7db9c6b6c0d3351d38f5eaf7b6a2
Author: mseidel <[email protected]>
AuthorDate: Tue Jul 20 16:32:57 2021 +0200
Fixed typo (HORZ_BODER_SPACE -> HORZ_BORDER_SPACE), removed whitespace
(cherry picked from commit f1c05e21e151fd6d3a5fec0e99070fa13f5a0cb5)
---
.../source/win32/filepicker/PreviewCtrl.cxx | 214 ++++++++++-----------
.../fpicker/source/win32/filepicker/dibpreview.cxx | 111 +++++------
2 files changed, 162 insertions(+), 163 deletions(-)
diff --git a/main/fpicker/source/win32/filepicker/PreviewCtrl.cxx
b/main/fpicker/source/win32/filepicker/PreviewCtrl.cxx
index 3eca4c4..f6814c7 100644
--- a/main/fpicker/source/win32/filepicker/PreviewCtrl.cxx
+++ b/main/fpicker/source/win32/filepicker/PreviewCtrl.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -51,10 +51,10 @@
#define HIMETRIC_INCH 2540
// means 3 pixel left and 3 pixel right
-#define HORZ_BODER_SPACE 6
+#define HORZ_BORDER_SPACE 6
// means 3 pixel top and 3 pixel bottom
-#define VERT_BORDER_SPACE 6
+#define VERT_BORDER_SPACE 6
//---------------------------------------------------
// static member initialization
@@ -69,11 +69,11 @@ CFilePreview::FILEPREVIEW_SINGLETON_DESTROYER_T
CFilePreview::s_SingletonDestroy
namespace // private
{
- class CPreviewException
- {
- // used when registering or creation
- // of the preview window failed
- };
+ class CPreviewException
+ {
+ // used when registering or creation
+ // of the preview window failed
+ };
//------------------------------------------------------------
//
@@ -109,7 +109,7 @@ namespace // private
//
//------------------------------------------------------------
- inline
+ inline
sal_uInt32 _getHeightRect( const RECT& aRect )
{
return ( aRect.bottom - aRect.top );
@@ -120,7 +120,7 @@ namespace // private
// displayed centered within the given window
//------------------------------------------------------------
- inline
+ inline
POINT _calcULCorner( HWND hwnd, const CDimension& aPicSize )
{
RECT rect;
@@ -128,7 +128,7 @@ namespace // private
sal_Int32 nWidthWnd = _getWidthRect( rect );
sal_Int32 nHeightWnd = _getHeightRect( rect );
-
+
POINT ulCorner;
ulCorner.x = SubDiv( nWidthWnd, aPicSize.m_cx, 2 );
ulCorner.y = SubDiv( nHeightWnd, aPicSize.m_cy, 2 );
@@ -141,22 +141,22 @@ namespace // private
// arbitrary window
// we expect the width and height to be in pixel
//------------------------------------------------------------
-
+
inline
sal_Bool _pictureSizeFitsWindowSize( HWND hwnd, const CDimension&
aPicSize )
{
RECT rect;
GetClientRect( hwnd, &rect );
-
+
sal_Int32 nWidthWnd = _getWidthRect( rect );
sal_Int32 nHeightWnd = _getHeightRect( rect );
- return ( ( ( nWidthWnd - HORZ_BODER_SPACE ) >= aPicSize.m_cx
) &&
+ return ( ( ( nWidthWnd - HORZ_BORDER_SPACE ) >= aPicSize.m_cx
) &&
( ( nHeightWnd - VERT_BORDER_SPACE ) >=
aPicSize.m_cy ) );
}
//------------------------------------------------------------
- // calc the dimemsions so that a given picture fits into a
+ // calc the dimensions so that a given picture fits into a
// given window, if the picture fits into the given window
// the original CDimension will be returned
//------------------------------------------------------------
@@ -165,13 +165,13 @@ namespace // private
CDimension _scalePictureSize( HWND hwnd, const CDimension& aPicSize )
{
CDimension scaledPicSize = aPicSize;
-
+
if ( !_pictureSizeFitsWindowSize( hwnd, aPicSize ) )
{
RECT rect;
GetClientRect( hwnd, &rect );
-
- // the dimensions of the preview wnd are not equal
+
+ // the dimensions of the preview wnd are not equal
// that's why we equalize it
sal_Int32 nHeightWnd = _getHeightRect( rect ) -
VERT_BORDER_SPACE;
sal_Int32 nWidthWnd = nHeightWnd;
@@ -179,14 +179,14 @@ namespace // private
if ( aPicSize.m_cx >= aPicSize.m_cy )
{
scaledPicSize.m_cx = nWidthWnd;
- scaledPicSize.m_cy =
- static_cast< sal_Int32 >(
- aPicSize.m_cy * nWidthWnd / aPicSize.m_cx );
+ scaledPicSize.m_cy =
+ static_cast< sal_Int32 >(
+ aPicSize.m_cy * nWidthWnd / aPicSize.m_cx );
}
else
{
- scaledPicSize.m_cx =
- static_cast< sal_Int32 >(
+ scaledPicSize.m_cx =
+ static_cast< sal_Int32 >(
aPicSize.m_cx * nHeightWnd / aPicSize.m_cy );
scaledPicSize.m_cy = nHeightWnd;
}
@@ -197,24 +197,24 @@ namespace // private
} // end namespace
-
+
//---------------------------------------------------
// to ensure only one instance (singleton)
//---------------------------------------------------
-CFilePreview* CFilePreview::createInstance(
- HWND aParent,
- POINT ulCorner,
- const CDimension& aSize,
- HINSTANCE hInstance,
- sal_Bool bShow,
- sal_Bool bEnabled )
+CFilePreview* CFilePreview::createInstance(
+ HWND aParent,
+ POINT ulCorner,
+ const CDimension& aSize,
+ HINSTANCE hInstance,
+ sal_Bool bShow,
+ sal_Bool bEnabled )
{
if ( !s_FilePreviewInst )
{
try
{
- s_FilePreviewInst = new CFilePreview(
+ s_FilePreviewInst = new CFilePreview(
aParent, ulCorner, aSize, hInstance, bShow,
bEnabled );
s_SingletonDestroyer.reset( s_FilePreviewInst );
}
@@ -237,18 +237,18 @@ CFilePreview* CFilePreview::createInstance(
//
//---------------------------------------------------
-CFilePreview::CFilePreview(
- HWND aParent,
- POINT ulCorner,
- const CDimension& aSize,
- HINSTANCE hInstance,
- sal_Bool bShow,
- sal_Bool bEnabled ) :
+CFilePreview::CFilePreview(
+ HWND aParent,
+ POINT ulCorner,
+ const CDimension& aSize,
+ HINSTANCE hInstance,
+ sal_Bool bShow,
+ sal_Bool bEnabled ) :
m_hInstance( hInstance ),
m_bEnabled( bEnabled )
{
- // register the preview window class
- WNDCLASSEX wndClsEx;
+ // register the preview window class
+ WNDCLASSEX wndClsEx;
ZeroMemory(&wndClsEx, sizeof(wndClsEx));
wndClsEx.cbSize = sizeof(wndClsEx);
@@ -257,21 +257,21 @@ CFilePreview::CFilePreview(
wndClsEx.hInstance = m_hInstance;
wndClsEx.hbrBackground = (HBRUSH)( COLOR_INACTIVEBORDER + 1 );
wndClsEx.lpszClassName = PREVIEWWND_CLASS_NAME;
-
+
// register the preview window class
- // !!! Win95 - the window class will be unregistered automatically
+ // !!! Win95 - the window class will be unregistered automatically
// if the dll is unloaded
// Win2000 - the window class must be unregistered manually
// if the dll is unloaded
m_atomPrevWndClass = RegisterClassEx(&wndClsEx);
if ( !m_atomPrevWndClass )
throw CPreviewException( );
-
+
// create the preview window in invisible state
sal_uInt32 dwStyle = bShow ? (WS_CHILD | WS_VISIBLE) : WS_CHILD;
- m_hwnd = CreateWindowEx(
- WS_EX_CLIENTEDGE,
- PREVIEWWND_CLASS_NAME,
+ m_hwnd = CreateWindowEx(
+ WS_EX_CLIENTEDGE,
+ PREVIEWWND_CLASS_NAME,
TEXT(""),
dwStyle,
ulCorner.x,
@@ -279,7 +279,7 @@ CFilePreview::CFilePreview(
aSize.m_cx,
aSize.m_cy,
aParent,
- (HMENU)100, // for child windows this will
+ (HMENU)100, // for child windows this will
// be used as child window identifier
m_hInstance,
0 );
@@ -292,12 +292,12 @@ CFilePreview::CFilePreview(
//---------------------------------------------------
CFilePreview::~CFilePreview( )
-{
+{
// unregister preview window class
- sal_Bool bRet = UnregisterClass(
+ sal_Bool bRet = UnregisterClass(
(LPCTSTR)MAKELONG( m_atomPrevWndClass, 0 ),
m_hInstance );
- OSL_POSTCOND( bRet, "Unregister preview window class failed" );
+ OSL_POSTCOND( bRet, "Unregister preview window class failed" );
}
//---------------------------------------------------
@@ -307,19 +307,19 @@ CFilePreview::~CFilePreview( )
sal_Bool SAL_CALL CFilePreview::setSize( const CDimension& aSize )
{
OSL_PRECOND( IsWindow( m_hwnd ), "Preview window not initialized" );
-
+
// resize the fileopen file listbox
- return SetWindowPos(
- m_hwnd,
- NULL,
- 0,
- 0,
- aSize.m_cx,
- aSize.m_cy,
+ return SetWindowPos(
+ m_hwnd,
+ NULL,
+ 0,
+ 0,
+ aSize.m_cx,
+ aSize.m_cy,
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE );
}
-//---------------------------------------------------
+//---------------------------------------------------
// returns the dimension of the preview
//---------------------------------------------------
@@ -337,7 +337,7 @@ sal_Bool SAL_CALL CFilePreview::getSize( CDimension&
theSize ) const
}
//---------------------------------------------------
-// sets the position of the upper left corner
+// sets the position of the upper left corner
// of the preview window relative to the
// upper left corner of the parent window
//---------------------------------------------------
@@ -347,13 +347,13 @@ sal_Bool SAL_CALL CFilePreview::setPos( POINT ulCorner )
OSL_PRECOND( IsWindow( m_hwnd ), "Preview window not initialized" );
// resize the fileopen file listbox
- return SetWindowPos(
- m_hwnd,
- NULL,
- ulCorner.x,
- ulCorner.y,
- 0,
- 0,
+ return SetWindowPos(
+ m_hwnd,
+ NULL,
+ ulCorner.x,
+ ulCorner.y,
+ 0,
+ 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
}
@@ -381,16 +381,16 @@ sal_Bool SAL_CALL CFilePreview::getPos( POINT& ulCorner )
const
}
//---------------------------------------------------
-//
+//
//---------------------------------------------------
void SAL_CALL CFilePreview::enable( sal_Bool bEnable )
{
m_bEnabled = bEnable;
-
+
// force a redraw
InvalidateRect( m_hwnd, NULL, sal_True );
- UpdateWindow( m_hwnd );
+ UpdateWindow( m_hwnd );
}
//---------------------------------------------------
@@ -410,33 +410,33 @@ sal_Bool SAL_CALL CFilePreview::show( sal_Bool bShow )
return ShowWindow( m_hwnd, showState );
}
-//---------------------------------------------------
-// if the preview is shown and enabled
+//---------------------------------------------------
+// if the preview is shown and enabled
// preview of the given file will be shown
// returns true on success or false if an error
// occurred (the file in not there or not accessible etc.)
//---------------------------------------------------
sal_Bool SAL_CALL CFilePreview::update( const rtl::OUString& aFileName )
-{
+{
OSL_PRECOND( IsWindow( m_hwnd ), "Preview window not initialized" );
try
{
if ( m_bEnabled )
- {
+ {
if ( m_IPicture )
m_IPicture.Release( );
loadFile( aFileName );
-
+
// force a complete window redraw
InvalidateRect( m_hwnd, NULL, sal_True );
- UpdateWindow( m_hwnd );
+ UpdateWindow( m_hwnd );
}
- }
+ }
catch( _com_error& )
- {
+ {
}
return sal_True;
@@ -451,8 +451,8 @@ void SAL_CALL CFilePreview::onPaint( HWND hWnd, HDC hDC )
OSL_PRECOND( IsWindow( m_hwnd ), "Preview window not initialized" );
try
- {
- if ( m_bEnabled )
+ {
+ if ( m_bEnabled )
{
// get width and height of picture
long cxPicHIMETRIC;
@@ -460,16 +460,16 @@ void SAL_CALL CFilePreview::onPaint( HWND hWnd, HDC hDC )
m_IPicture->get_Width( &cxPicHIMETRIC );
m_IPicture->get_Height( &cyPicHIMETRIC );
-
+
// convert himetric to pixels
- int cxPicPIXEL = Himetric2Pixel( hDC, cxPicHIMETRIC,
LOGPIXELSX );
- int cyPicPIXEL = Himetric2Pixel( hDC, cyPicHIMETRIC,
LOGPIXELSY );
-
+ int cxPicPIXEL = Himetric2Pixel( hDC, cxPicHIMETRIC,
LOGPIXELSX );
+ int cyPicPIXEL = Himetric2Pixel( hDC, cyPicHIMETRIC,
LOGPIXELSY );
+
// scale the picture based on the size of the preview
window
RECT rcPrevWnd;
GetClientRect(hWnd, &rcPrevWnd);
- CDimension scaledPicSize = _scalePictureSize(
+ CDimension scaledPicSize = _scalePictureSize(
hWnd, CDimension( cxPicPIXEL, cyPicPIXEL ) );
// calc the upper left corner so that the picture
@@ -487,18 +487,18 @@ void SAL_CALL CFilePreview::onPaint( HWND hWnd, HDC hDC )
cyPicHIMETRIC,
cxPicHIMETRIC,
-cyPicHIMETRIC,
- &rcPrevWnd );
+ &rcPrevWnd );
} // end if ( m_bEnabled )
}
catch( _com_error& )
- {
+ {
}
}
//---------------------------------------------------
//
//---------------------------------------------------
-
+
sal_Bool CFilePreview::loadFile( const rtl::OUString& aFileName )
{
HANDLE hFile = 0;
@@ -508,8 +508,8 @@ sal_Bool CFilePreview::loadFile( const rtl::OUString&
aFileName )
HRESULT hr = E_FAIL;
sal_Bool bRet;
sal_uInt32 nBytesRead;
- sal_uInt32 fszExtra;
- sal_uInt32 fsize;
+ sal_uInt32 fszExtra;
+ sal_uInt32 fsize;
hFile = CreateFile(
aFileName.getStr( ),
@@ -523,10 +523,10 @@ sal_Bool CFilePreview::loadFile( const rtl::OUString&
aFileName )
goto CLEANUP_AND_EXIT;
fszExtra = 0;
- fsize = GetFileSize( hFile, &fszExtra );
+ fsize = GetFileSize( hFile, &fszExtra );
// empty file, error or file to big
- if ( -1 == fsize || 0 == fsize || fszExtra )
+ if ( -1 == fsize || 0 == fsize || fszExtra )
goto CLEANUP_AND_EXIT;
hGlobal = GlobalAlloc( GMEM_MOVEABLE, fsize );
@@ -536,23 +536,23 @@ sal_Bool CFilePreview::loadFile( const rtl::OUString&
aFileName )
pData = GlobalLock( hGlobal );
if ( !pData )
goto CLEANUP_AND_EXIT;
-
+
bRet = ReadFile(
hFile, pData, fsize, &nBytesRead, NULL );
if ( !bRet )
goto CLEANUP_AND_EXIT;
-
+
hr = CreateStreamOnHGlobal(
hGlobal, sal_False, &pIStream );
if ( SUCCEEDED( hr ) )
{
hr = OleLoadPicture(
- pIStream, fsize, sal_False,
+ pIStream, fsize, sal_False,
__uuidof( IPicture ), (LPVOID*)&m_IPicture );
}
-
+
CLEANUP_AND_EXIT:
if ( hFile )
CloseHandle( hFile );
@@ -569,9 +569,9 @@ CLEANUP_AND_EXIT:
//---------------------------------------------------
//
//---------------------------------------------------
-
-LRESULT CALLBACK CFilePreview::WndProc(
- HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
+
+LRESULT CALLBACK CFilePreview::WndProc(
+ HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
LRESULT lResult = 0;
@@ -582,7 +582,7 @@ LRESULT CALLBACK CFilePreview::WndProc(
OSL_PRECOND( s_FilePreviewInst, "Static member not initialized"
);
HDC hDC;
- PAINTSTRUCT ps;
+ PAINTSTRUCT ps;
hDC = BeginPaint( hWnd, &ps );
s_FilePreviewInst->onPaint( hWnd, hDC );
@@ -590,8 +590,8 @@ LRESULT CALLBACK CFilePreview::WndProc(
}
break;
- // under windows 95/98 the creation of the
- // hidden target request window fails if
+ // under windows 95/98 the creation of the
+ // hidden target request window fails if
// we don't handle this message ourself
// because the DefWindowProc returns 0 as
// a result of handling WM_NCCREATE what
@@ -607,5 +607,3 @@ LRESULT CALLBACK CFilePreview::WndProc(
return lResult;
}
-
-
diff --git a/main/fpicker/source/win32/filepicker/dibpreview.cxx
b/main/fpicker/source/win32/filepicker/dibpreview.cxx
index 3353916..25094ed 100644
--- a/main/fpicker/source/win32/filepicker/dibpreview.cxx
+++ b/main/fpicker/source/win32/filepicker/dibpreview.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -59,7 +59,7 @@ using rtl::OUString;
namespace /* private */
{
- const LPTSTR CURRENT_INSTANCE = TEXT("CurrInst");
+ const LPTSTR CURRENT_INSTANCE = TEXT("CurrInst");
};
//------------------------------------------------------------------------
@@ -69,10 +69,10 @@ namespace /* private */
#define PREVIEWWND_CLASS_NAME TEXT("DIBPreviewWnd###")
// means 3 pixel left and 3 pixel right
-#define HORZ_BODER_SPACE 6
+#define HORZ_BORDER_SPACE 6
// means 3 pixel top and 3 pixel bottom
-#define VERT_BORDER_SPACE 6
+#define VERT_BORDER_SPACE 6
//---------------------------------------------------
// static member initialization
@@ -102,13 +102,13 @@ CDIBPreview::CDIBPreview(HINSTANCE instance,HWND
parent,sal_Bool bShowWindow) :
TEXT(""),
dwStyle,
0, 0, 0, 0,
- parent,
+ parent,
(HMENU)0x0, // for child windows this will
// be used as child window identifier
m_Instance,
- (LPVOID)this // pass a pointer to the current
- // instance of this class
- );
+ (LPVOID)this // pass a pointer to the current
+ // instance of this class
+ );
bool bSuccess = IsWindow(m_Hwnd);
@@ -127,12 +127,12 @@ CDIBPreview::CDIBPreview(HINSTANCE instance,HWND
parent,sal_Bool bShowWindow) :
CDIBPreview::~CDIBPreview( )
{
- // remember: we don't have to destroy the
- // preview window because it will be destroyed
- // by it's parent window (the FileOpen dialog)
- // but we have to unregister the window class
- //if ( m_bWndClassRegistered )
- UnregisterDibPreviewWindowClass();
+ // remember: we don't have to destroy the
+ // preview window because it will be destroyed
+ // by its parent window (the FileOpen dialog)
+ // but we have to unregister the window class
+ //if ( m_bWndClassRegistered )
+ UnregisterDibPreviewWindowClass();
}
//-------------------------------
@@ -142,12 +142,12 @@ CDIBPreview::~CDIBPreview( )
sal_Int32 SAL_CALL CDIBPreview::getTargetColorDepth() throw (RuntimeException)
{
HDC hdc = GetDC(m_Hwnd);
- int clrRes = 0;
+ int clrRes = 0;
- if (hdc)
- clrRes = GetDeviceCaps(hdc, COLORRES);
+ if (hdc)
+ clrRes = GetDeviceCaps(hdc, COLORRES);
- return clrRes;
+ return clrRes;
}
//-------------------------------
@@ -161,8 +161,8 @@ sal_Int32 SAL_CALL CDIBPreview::getAvailableWidth() throw
(RuntimeException)
sal_Int32 cx = 0;
- if ( bRet )
- cx = rect.right;
+ if ( bRet )
+ cx = rect.right;
return cx;
}
@@ -178,8 +178,8 @@ sal_Int32 SAL_CALL CDIBPreview::getAvailableHeight() throw
(RuntimeException)
sal_Int32 cy = 0;
- if ( bRet )
- cy = rect.bottom;
+ if ( bRet )
+ cy = rect.bottom;
return cy;
}
@@ -215,7 +215,7 @@ sal_Bool SAL_CALL CDIBPreview::setShowState(sal_Bool
bShowState) throw (RuntimeE
{
PreviewBase::setShowState(bShowState);
ShowWindow(m_Hwnd, m_bShowState ? SW_SHOW : SW_HIDE);
- return sal_True;
+ return sal_True;
}
//-------------------------------
@@ -243,10 +243,10 @@ HWND SAL_CALL CDIBPreview::getWindowHandle() const
void SAL_CALL CDIBPreview::onPaint(HWND hWnd, HDC hDC)
{
BITMAPFILEHEADER* pbmfh;
- BITMAPINFO * pbmi;
- sal_uInt8 * pBits;
- int cxDib;
- int cyDib;
+ BITMAPINFO * pbmi;
+ sal_uInt8 * pBits;
+ int cxDib;
+ int cyDib;
osl::MutexGuard aGuard(m_PaintLock);
@@ -272,12 +272,12 @@ void SAL_CALL CDIBPreview::onPaint(HWND hWnd, HDC hDC)
int nY = abs(nHeight - cyDib) / 2;
int GDIError = GDI_ERROR;
- GDIError = StretchDIBits(
+ GDIError = StretchDIBits(
hDC, nX, nY, cxDib, cyDib,
0, 0, cxDib, cyDib, pBits, pbmi,
DIB_RGB_COLORS, SRCCOPY);
-
- OSL_ASSERT(GDI_ERROR != GDIError);
+
+ OSL_ASSERT(GDI_ERROR != GDIError);
// paint the border
RECT rc;
@@ -334,16 +334,16 @@ void SAL_CALL CDIBPreview::onPaint(HWND hWnd, HDC hDC)
//---------------------------------------------------
LRESULT CALLBACK CDIBPreview::WndProc(
- HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+ HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LRESULT lResult = 0;
switch(uMsg)
{
- // we connect a pointer to the current instance
- // with a window instance via SetProp
- case WM_CREATE:
+ // we connect a pointer to the current instance
+ // with a window instance via SetProp
+ case WM_CREATE:
{
LPCREATESTRUCT lpcs =
reinterpret_cast< LPCREATESTRUCT >(lParam);
@@ -403,7 +403,7 @@ LRESULT CALLBACK CDIBPreview::WndProc(
ATOM SAL_CALL CDIBPreview::RegisterDibPreviewWindowClass()
{
- osl::MutexGuard aGuard( s_Mutex );
+ osl::MutexGuard aGuard( s_Mutex );
if (0 == s_ClassAtom)
{
@@ -425,7 +425,7 @@ ATOM SAL_CALL CDIBPreview::RegisterDibPreviewWindowClass()
// if the dll is unloaded
s_ClassAtom = RegisterClassEx(&wndClsEx);
- OSL_POSTCOND(s_ClassAtom,"Could not register preview window
class");
+ OSL_POSTCOND(s_ClassAtom,"Could not register preview window
class");
if (0 == s_ClassAtom)
throw std::runtime_error("Preview window class could
not be registered");
@@ -446,23 +446,24 @@ ATOM SAL_CALL CDIBPreview::RegisterDibPreviewWindowClass()
void SAL_CALL CDIBPreview::UnregisterDibPreviewWindowClass()
{
- osl::MutexGuard aGuard( s_Mutex );
+ osl::MutexGuard aGuard( s_Mutex );
- OSL_ASSERT( ( (0 != s_ClassAtom) && (s_RegisterDibPreviewWndCount > 0)) ||
- ( (0 == s_ClassAtom) && (0 == s_RegisterDibPreviewWndCount) )
);
+ OSL_ASSERT( ( (0 != s_ClassAtom) && (s_RegisterDibPreviewWndCount > 0))
||
+ ( (0 == s_ClassAtom) && (0 ==
s_RegisterDibPreviewWndCount) ) );
- // update the register class counter
- // and unregister the window class if
- // counter drops to zero
- if (0 != s_ClassAtom)
- {
- s_RegisterDibPreviewWndCount--;
- OSL_ASSERT(s_RegisterDibPreviewWndCount >= 0);
- }
+ // update the register class counter
+ // and unregister the window class if
+ // counter drops to zero
+ if (0 != s_ClassAtom)
+ {
+ s_RegisterDibPreviewWndCount--;
+ OSL_ASSERT(s_RegisterDibPreviewWndCount >= 0);
+ }
- if (0 == s_RegisterDibPreviewWndCount)
- {
- UnregisterClass((LPCTSTR)MAKELONG(s_ClassAtom,0),m_Instance);
- s_ClassAtom = 0;
- }
+ if (0 == s_RegisterDibPreviewWndCount)
+ {
+ UnregisterClass((LPCTSTR)MAKELONG(s_ClassAtom,0),m_Instance);
+ s_ClassAtom = 0;
+ }
}
+