summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorNoel Power <npower@openoffice.org>2009-09-30 09:08:19 +0000
committerNoel Power <npower@openoffice.org>2009-09-30 09:08:19 +0000
commit95eeb6c233eb2718399b5ffa69c1e9de86bf6bf5 (patch)
tree137b270ea38359d0efb5c93ff1e76348acc22b28 /sc/source
parent4aa9c65e8853a300c0da1ef2e7f544d4ca927359 (diff)
add some comments
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/docshell/docsh.cxx11
-rw-r--r--sc/source/ui/docshell/docsh2.cxx11
2 files changed, 22 insertions, 0 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 0dbde19943be..afc9327f7d8f 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -365,6 +365,17 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet)
aArgs[ 0 ] <<= GetModel();
aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.Globals" ) ), aArgs );
GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", aGlobs );
+ // Fake ThisComponent being setup by Activate ( which is a view
+ // related thing ),
+ // a) if another document is opened then in theory ThisComponent
+ // will be reset as before,
+ // b) when this document is 'really' Activated then ThisComponent
+ // again will be set as before
+ // The only wrinkle seems if this document is loaded 'InVisible'
+ // but.. I don't see that this is possible from the vba API
+ // I could be wrong though
+ // There may be implications setting the current component
+ // too early :-/ so I will just manually set the Basic Variables
BasicManager* pAppMgr = SFX_APP()->GetBasicManager();
if ( pAppMgr )
pAppMgr->SetGlobalUNOConstant( "ThisExcelDoc", aArgs[ 0 ] );
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index c79be9cb978b..742d66e6bcb9 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -110,6 +110,17 @@ BOOL __EXPORT ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xSt
aArgs[ 0 ] <<= GetModel();
aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.Globals" ) ), aArgs );
GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", aGlobs );
+ // Fake ThisComponent being setup by Activate ( which is a view
+ // related thing ),
+ // a) if another document is opened then in theory ThisComponent
+ // will be reset as before,
+ // b) when this document is 'really' Activated then ThisComponent
+ // again will be set as before
+ // The only wrinkle seems if this document is loaded 'InVisible'
+ // but.. I don't see that this is possible from the vba API
+ // I could be wrong though
+ // There may be implications setting the current component
+ // too early :-/ so I will just manually set the Basic Variables
BasicManager* pAppMgr = SFX_APP()->GetBasicManager();
if ( pAppMgr )
pAppMgr->SetGlobalUNOConstant( "ThisExcelDoc", aArgs[ 0 ] );