summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell/docsh.cxx
diff options
context:
space:
mode:
authorNoel Power <npower@openoffice.org>2009-09-18 15:24:22 +0000
committerNoel Power <npower@openoffice.org>2009-09-18 15:24:22 +0000
commit1cab3d63faaf6c3d782e32dca9bd68d39286d60f (patch)
tree7025f05bfe4388f006a6e367af57dde0cadd0f98 /sc/source/ui/docshell/docsh.cxx
parent077574a53512824a398065fe352235fb6dd87a54 (diff)
initial commit of code reorg, existing files that are modified
Diffstat (limited to 'sc/source/ui/docshell/docsh.cxx')
-rw-r--r--sc/source/ui/docshell/docsh.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index f76b4a40f..1581a4097 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -128,7 +128,8 @@
#include <rtl/logfile.hxx>
#include <comphelper/processfactory.hxx>
-
+#include <basic/sbstar.hxx>
+#include <basic/basmgr.hxx>
using namespace com::sun::star;
// STATIC DATA -----------------------------------------------------------
@@ -358,7 +359,16 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet)
}
else
aDocument.SetInsertingFromOtherDoc( FALSE );
-
+ // add vba globals ( if they are availabl )
+ SfxObjectShell* pShell = aDocument.GetDocumentShell();
+ if ( pShell )
+ {
+ uno::Any aGlobs;
+ uno::Sequence< uno::Any > aArgs(1);
+ aArgs[ 0 ] <<= pShell->GetModel();
+ aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.Globals" ) ), aArgs );
+ pShell->GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", aGlobs );
+ }
aDocument.SetImportingXML( FALSE );
aDocument.EnableExecuteLink( true );
aDocument.EnableUndo( TRUE );