summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell/docsh2.cxx
diff options
context:
space:
mode:
authorNoel Power <npower@openoffice.org>2009-09-29 14:47:18 +0000
committerNoel Power <npower@openoffice.org>2009-09-29 14:47:18 +0000
commit4aa9c65e8853a300c0da1ef2e7f544d4ca927359 (patch)
tree89f8bda1e93948ff4d742ae0867a9511a5ef3ecd /sc/source/ui/docshell/docsh2.cxx
parented107e6366ffec1352046998ec9c0f815ece4b53 (diff)
tweak VBAGlobals creation/insertion, also restore overwritten visibility
controls bits to moved ( erm delete and created in another director ) file. Add missing bits to enable Application.Quit and use preprocessor to include some uncompiled code
Diffstat (limited to 'sc/source/ui/docshell/docsh2.cxx')
-rw-r--r--sc/source/ui/docshell/docsh2.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index 7f213175a075..c79be9cb978b 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -53,7 +53,10 @@
#include <svx/unolingu.hxx>
#include <rtl/logfile.hxx>
-
+#include <comphelper/processfactory.hxx>
+#include <basic/sbstar.hxx>
+#include <basic/basmgr.hxx>
+#include <sfx2/app.hxx>
// INCLUDE ---------------------------------------------------------------
/*
@@ -102,6 +105,14 @@ BOOL __EXPORT ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xSt
InitItems();
CalcOutputFactor();
+ uno::Any aGlobs;
+ uno::Sequence< uno::Any > aArgs(1);
+ aArgs[ 0 ] <<= GetModel();
+ aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.Globals" ) ), aArgs );
+ GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", aGlobs );
+ BasicManager* pAppMgr = SFX_APP()->GetBasicManager();
+ if ( pAppMgr )
+ pAppMgr->SetGlobalUNOConstant( "ThisExcelDoc", aArgs[ 0 ] );
return bRet;
}