summaryrefslogtreecommitdiff
path: root/embedserv
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-10-05 09:42:11 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-10-05 09:42:11 +0200
commit4355ef6a6265c8e8dbba44b832f4847c6c8cd9bf (patch)
tree2470573bb0a72a65c7c6f91000a16c6d99c07c8a /embedserv
parentbe8bbd297e8eada7658783fef727b690fda5f224 (diff)
loplugin:blockblock (clang-cl)
Change-Id: I210c322ab44057e45e2b75b3ce3d13529fb62d13
Diffstat (limited to 'embedserv')
-rw-r--r--embedserv/source/inprocserv/inprocembobj.cxx52
1 files changed, 25 insertions, 27 deletions
diff --git a/embedserv/source/inprocserv/inprocembobj.cxx b/embedserv/source/inprocserv/inprocembobj.cxx
index 51173c9c9c65..4cc083652f68 100644
--- a/embedserv/source/inprocserv/inprocembobj.cxx
+++ b/embedserv/source/inprocserv/inprocembobj.cxx
@@ -150,34 +150,32 @@ BOOL InprocEmbedDocument_Impl::CheckDefHandler()
HRESULT hr = OleCreateDefaultHandler( m_guid, nullptr, IID_IUnknown, reinterpret_cast<void**>(&m_pDefHandler) );
if ( SUCCEEDED( hr ) )
{
+ if ( m_nInitMode == INIT_FROM_STORAGE )
{
- if ( m_nInitMode == INIT_FROM_STORAGE )
- {
- ComSmart< IPersistStorage > pPersist;
- hr = m_pDefHandler->QueryInterface( IID_IPersistStorage, reinterpret_cast<void**>(&pPersist) );
-
- ULONGGuard aGuard( &m_nCallsOnStack ); // avoid reentrance problem
- if ( SUCCEEDED( hr ) && pPersist && m_pStorage )
- hr = pPersist->InitNew( m_pStorage );
- }
- else if ( m_nInitMode == LOAD_FROM_STORAGE )
- {
- ComSmart< IPersistStorage > pPersist;
- hr = m_pDefHandler->QueryInterface( IID_IPersistStorage, reinterpret_cast<void**>(&pPersist) );
-
- ULONGGuard aGuard( &m_nCallsOnStack ); // avoid reentrance problem
- if ( SUCCEEDED( hr ) && pPersist && m_pStorage )
- hr = pPersist->Load( m_pStorage );
- }
- else if ( m_nInitMode == LOAD_FROM_FILE )
- {
- ComSmart< IPersistFile > pPersistFile;
- hr = m_pDefHandler->QueryInterface( IID_IPersistFile, reinterpret_cast<void**>(&pPersistFile) );
-
- ULONGGuard aGuard( &m_nCallsOnStack ); // avoid reentrance problem
- if ( SUCCEEDED( hr ) && pPersistFile && m_pFileName )
- hr = pPersistFile->Load( m_pFileName, m_nFileOpenMode );
- }
+ ComSmart< IPersistStorage > pPersist;
+ hr = m_pDefHandler->QueryInterface( IID_IPersistStorage, reinterpret_cast<void**>(&pPersist) );
+
+ ULONGGuard aGuard( &m_nCallsOnStack ); // avoid reentrance problem
+ if ( SUCCEEDED( hr ) && pPersist && m_pStorage )
+ hr = pPersist->InitNew( m_pStorage );
+ }
+ else if ( m_nInitMode == LOAD_FROM_STORAGE )
+ {
+ ComSmart< IPersistStorage > pPersist;
+ hr = m_pDefHandler->QueryInterface( IID_IPersistStorage, reinterpret_cast<void**>(&pPersist) );
+
+ ULONGGuard aGuard( &m_nCallsOnStack ); // avoid reentrance problem
+ if ( SUCCEEDED( hr ) && pPersist && m_pStorage )
+ hr = pPersist->Load( m_pStorage );
+ }
+ else if ( m_nInitMode == LOAD_FROM_FILE )
+ {
+ ComSmart< IPersistFile > pPersistFile;
+ hr = m_pDefHandler->QueryInterface( IID_IPersistFile, reinterpret_cast<void**>(&pPersistFile) );
+
+ ULONGGuard aGuard( &m_nCallsOnStack ); // avoid reentrance problem
+ if ( SUCCEEDED( hr ) && pPersistFile && m_pFileName )
+ hr = pPersistFile->Load( m_pFileName, m_nFileOpenMode );
}
}