summaryrefslogtreecommitdiff
path: root/dtrans
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2019-11-24 10:43:47 +0100
committerJulien Nabet <serval2412@yahoo.fr>2019-11-24 14:14:20 +0100
commit0be61adb0771a9bc0386b6e8d90e4bffd8dfa0e7 (patch)
tree991a018b9ba73a494e4376e64f7aebcb8aa58c40 /dtrans
parent4582222a3ade99584514a86dbaddf0c80f7e7196 (diff)
cppcheck: performing init in init list (dbaccess/desktop/dtrans/e.)
Change-Id: I7909df04a550a4fa843a70d20b5192231c3f175e Reviewed-on: https://gerrit.libreoffice.org/83600 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'dtrans')
-rw-r--r--dtrans/source/win32/clipb/MtaOleClipb.cxx26
1 files changed, 11 insertions, 15 deletions
diff --git a/dtrans/source/win32/clipb/MtaOleClipb.cxx b/dtrans/source/win32/clipb/MtaOleClipb.cxx
index b58f8ea89d24..5ab8e1adb9a9 100644
--- a/dtrans/source/win32/clipb/MtaOleClipb.cxx
+++ b/dtrans/source/win32/clipb/MtaOleClipb.cxx
@@ -176,18 +176,16 @@ static HRESULT UnmarshalIDataObjectAndReleaseStream( LPSTREAM lpStream, IDataObj
class CAutoComInit
{
public:
- CAutoComInit( )
+ /*
+ to be safe we call CoInitialize
+ although it is not necessary if
+ the calling thread was created
+ using osl_CreateThread because
+ this function calls CoInitialize
+ for every thread it creates
+ */
+ CAutoComInit( ) : m_hResult( CoInitialize( nullptr ) )
{
- /*
- to be safe we call CoInitialize
- although it is not necessary if
- the calling thread was created
- using osl_CreateThread because
- this function calls CoInitialize
- for every thread it creates
- */
- m_hResult = CoInitialize( nullptr );
-
if ( S_OK == m_hResult )
OSL_FAIL(
"com was not yet initialized, the thread was not created using osl_createThread" );
@@ -221,7 +219,8 @@ private:
CMtaOleClipboard::CMtaOleClipboard( ) :
m_hOleThread( nullptr ),
m_uOleThreadId( 0 ),
- m_hEvtThrdReady( nullptr ),
+ // signals that the thread was successfully setup
+ m_hEvtThrdReady(CreateEventW( nullptr, MANUAL_RESET, INIT_NONSIGNALED, nullptr )),
m_hwndMtaOleReqWnd( nullptr ),
// signals that the window is destroyed - to stop waiting any winproc result
m_hEvtWndDisposed(CreateEventW(nullptr, MANUAL_RESET, INIT_NONSIGNALED, nullptr)),
@@ -232,9 +231,6 @@ CMtaOleClipboard::CMtaOleClipboard( ) :
m_hTerminateClipboardChangedNotifierEvent( m_hClipboardChangedNotifierEvents[1] ),
m_ClipboardChangedEventCount( 0 )
{
- // signals that the thread was successfully setup
- m_hEvtThrdReady = CreateEventW( nullptr, MANUAL_RESET, INIT_NONSIGNALED, nullptr );
-
OSL_ASSERT( nullptr != m_hEvtThrdReady );
SAL_WARN_IF(!m_hEvtWndDisposed, "dtrans", "CreateEventW failed: m_hEvtWndDisposed is nullptr");