diff options
author | Michaël Lefèvre <lefevre00@yahoo.fr> | 2014-04-07 11:44:43 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-05-12 11:32:38 +0200 |
commit | 70e744b2157ebe48f3a5c839560fedf6521d0464 (patch) | |
tree | 4e29618cc5a36f25557bd130226abdfe96e46848 /fpicker | |
parent | d1516d488c081ec3a5d730d2b1626a0c8dc39a73 (diff) |
fdo#43157 Remove OSL_POSTCOND, prefer SAL_WARN_IF
Change-Id: Ia89a2dce799c7ba90bcd19919195bfd2c7a4a180
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'fpicker')
7 files changed, 13 insertions, 17 deletions
diff --git a/fpicker/source/win32/filepicker/FilePicker.cxx b/fpicker/source/win32/filepicker/FilePicker.cxx index a8bb989091cf..bfc75fcda7fe 100644 --- a/fpicker/source/win32/filepicker/FilePicker.cxx +++ b/fpicker/source/win32/filepicker/FilePicker.cxx @@ -73,7 +73,7 @@ CFilePicker::CFilePicker( const uno::Reference<lang::XMultiServiceFactory>& xSer m_aAsyncEventNotifier(rBHelper) { HINSTANCE hInstance = GetModuleHandle(FILE_PICKER_DLL_NAME); - OSL_POSTCOND( hInstance, "The name of the service dll must have changed" ); + SAL_WARN_IF( !hInstance, "fpicker", "The name of the service dll must have changed" ); // create a default FileOpen dialog without any additional ui elements m_pImpl = std::auto_ptr< CWinFileOpenImpl >( @@ -677,7 +677,7 @@ void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments) } HINSTANCE hInstance = GetModuleHandle( FILE_PICKER_DLL_NAME ); - OSL_POSTCOND( hInstance, "The name of the service dll must have changed" ); + SAL_WARN_IF( !hInstance, "fpicker", The name of the service dll must have changed" ); // create a new impl-class here based on the // given string, if the given string is empty diff --git a/fpicker/source/win32/filepicker/PreviewCtrl.cxx b/fpicker/source/win32/filepicker/PreviewCtrl.cxx index e843182575de..e761e7714139 100644 --- a/fpicker/source/win32/filepicker/PreviewCtrl.cxx +++ b/fpicker/source/win32/filepicker/PreviewCtrl.cxx @@ -282,7 +282,7 @@ CFilePreview::~CFilePreview( ) sal_Bool bRet = UnregisterClass( (LPCTSTR)(DWORD_PTR)MAKELONG( m_atomPrevWndClass, 0 ), m_hInstance ); - OSL_POSTCOND( bRet, "Unregister preview window class failed" ); + SAL_WARN_IF( !bRet, "fpicker", "Unregister preview window class failed" ); } diff --git a/fpicker/source/win32/filepicker/asynceventnotifier.cxx b/fpicker/source/win32/filepicker/asynceventnotifier.cxx index b6a61b4da77f..6f0873461fc8 100644 --- a/fpicker/source/win32/filepicker/asynceventnotifier.cxx +++ b/fpicker/source/win32/filepicker/asynceventnotifier.cxx @@ -132,7 +132,7 @@ bool SAL_CALL CAsyncEventNotifier::startup(bool bCreateSuspended) m_bRun = true; } - OSL_POSTCOND(m_bRun,"Could not start event notifier!"); + SAL_WARN_IF( !m_bRun, "fpicker", "Could not start event notifier!"); return m_bRun; } diff --git a/fpicker/source/win32/filepicker/dibpreview.cxx b/fpicker/source/win32/filepicker/dibpreview.cxx index b8023a8a1dd5..8f9d1dc25ffa 100644 --- a/fpicker/source/win32/filepicker/dibpreview.cxx +++ b/fpicker/source/win32/filepicker/dibpreview.cxx @@ -84,12 +84,9 @@ CDIBPreview::CDIBPreview(HINSTANCE instance,HWND parent,sal_Bool bShowWindow) : // instance of this class ); - bool bSuccess = IsWindow(m_Hwnd); - - OSL_POSTCOND(bSuccess,"Coud not create preview window"); - - if (!bSuccess) + if (!IsWindow(m_Hwnd)) { + SAL_WARN("fpicker","Coud not create preview window"); UnregisterDibPreviewWindowClass(); throw std::runtime_error("Could not create preview window"); } @@ -401,12 +398,11 @@ ATOM SAL_CALL CDIBPreview::RegisterDibPreviewWindowClass() // Win2000 - the window class must be unregistered manually // if the dll is unloaded s_ClassAtom = RegisterClassEx(&wndClsEx); - - OSL_POSTCOND(s_ClassAtom,"Could not register preview window class"); - if (0 == s_ClassAtom) + { + SAL_WARN("fpicker", "Could not register preview window class"); throw std::runtime_error("Preview window class could not be registered"); - } + } // increment the register class counter // so that we keep track of the number diff --git a/fpicker/source/win32/filepicker/filepickerstate.cxx b/fpicker/source/win32/filepicker/filepickerstate.cxx index 2e0967aec361..5403b814a4ed 100644 --- a/fpicker/source/win32/filepicker/filepickerstate.cxx +++ b/fpicker/source/win32/filepicker/filepickerstate.cxx @@ -509,7 +509,7 @@ OUString SAL_CALL CExecuteFilePickerState::getLabel( sal_Int16 aControlId ) Sequence< OUString > SAL_CALL CExecuteFilePickerState::getFiles( CFileOpenDialog* aFileOpenDialog ) { - OSL_POSTCOND( aFileOpenDialog, "invalid parameter" ); + SAL_WARN_IF( !aFileOpenDialog, "fpicker", "invalid parameter" ); Sequence< OUString > aFilePathList; OUString aFilePathURL; @@ -545,7 +545,7 @@ Sequence< OUString > SAL_CALL CExecuteFilePickerState::getFiles( CFileOpenDialog OUString SAL_CALL CExecuteFilePickerState::getDisplayDirectory( CFileOpenDialog* aFileOpenDialog ) { - OSL_POSTCOND( aFileOpenDialog, "invalid parameter" ); + SAL_WARN_IF( !aFileOpenDialog, "fpicker", "invalid parameter" ); OUString pathURL; OUString displayDir; diff --git a/fpicker/source/win32/filepicker/getfilenamewrapper.cxx b/fpicker/source/win32/filepicker/getfilenamewrapper.cxx index 84c0b6f5f275..181ae5fa4626 100644 --- a/fpicker/source/win32/filepicker/getfilenamewrapper.cxx +++ b/fpicker/source/win32/filepicker/getfilenamewrapper.cxx @@ -164,7 +164,7 @@ namespace /* private */ HANDLE hThread = reinterpret_cast<HANDLE>( _beginthreadex(0, 0, ThreadProc, &gfnp, 0, &id)); - OSL_POSTCOND(hThread, "could not create STA thread"); + SAL_WARN_IF( !hThread, "fpicker", "could not create STA thread"); WaitForSingleObject(hThread, INFINITE); CloseHandle(hThread); diff --git a/fpicker/source/win32/folderpicker/MtaFop.hxx b/fpicker/source/win32/folderpicker/MtaFop.hxx index 35076bda8388..6469d93441b0 100644 --- a/fpicker/source/win32/folderpicker/MtaFop.hxx +++ b/fpicker/source/win32/folderpicker/MtaFop.hxx @@ -54,7 +54,7 @@ public: pBuff = new sal_Unicode[size]; - OSL_POSTCOND(pBuff,"Could not allocate path buffer"); + SAL_WARN_IF(!pBuff, "fpicker", "Could not allocate path buffer"); } ~CAutoPathBuff( ) |