diff options
author | Hans-Joachim Lankenau <hjs@openoffice.org> | 2010-12-17 13:36:59 +0100 |
---|---|---|
committer | Hans-Joachim Lankenau <hjs@openoffice.org> | 2010-12-17 13:36:59 +0100 |
commit | 0feae64efb6e6330ad2236d5eeb6d9678ea6fb98 (patch) | |
tree | 64225de00225469117e0908343c63c7c5d47b6f7 /sfx2/source/doc/objxtor.cxx | |
parent | 94160afa68a6bf633c5fb14944c5f239187fa7c1 (diff) | |
parent | 75b47018bbe9e37d00ae2af2e6011b463a60a21e (diff) |
CWS-TOOLING: integrate CWS mib19
Diffstat (limited to 'sfx2/source/doc/objxtor.cxx')
-rw-r--r-- | sfx2/source/doc/objxtor.cxx | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 13fb08445431..693911f0404c 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -805,11 +805,33 @@ void SfxObjectShell::InitBasicManager_Impl() */ { + /* #163556# (DR) - Handling of recursive calls while creating the Bacic + manager. + + It is possible that (while creating the Basic manager) the code that + imports the Basic storage wants to access the Basic manager again. + Especially in VBA compatibility mode, there is code that wants to + access the "VBA Globals" object which is stored as global UNO constant + in the Basic manager. + + To achieve correct handling of the recursive calls of this function + from lcl_getBasicManagerForDocument(), the implementation of the + function BasicManagerRepository::getDocumentBasicManager() has been + changed to return the Basic manager currently under construction, when + called repeatedly. + + The variable pImp->bBasicInitialized will be set to TRUE after + construction now, to ensure that the recursive call of the function + lcl_getBasicManagerForDocument() will be routed into this function too. + + Calling BasicManagerHolder::reset() twice is not a big problem, as it + does not take ownership but stores only the raw pointer. Owner of all + Basic managers is the global BasicManagerRepository instance. + */ DBG_ASSERT( !pImp->bBasicInitialized && !pImp->pBasicManager->isValid(), "Lokaler BasicManager bereits vorhanden"); - pImp->bBasicInitialized = TRUE; - pImp->pBasicManager->reset( BasicManagerRepository::getDocumentBasicManager( GetModel() ) ); DBG_ASSERT( pImp->pBasicManager->isValid(), "SfxObjectShell::InitBasicManager_Impl: did not get a BasicManager!" ); + pImp->bBasicInitialized = TRUE; } //-------------------------------------------------------------------- |