diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2018-07-26 00:17:41 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2018-07-27 08:01:03 +0200 |
commit | 76bf3939b0583212a56c317c85aea110f8ac6fee (patch) | |
tree | d2c0fa7c2080b84054289fa82b510e6ae91fd30b | |
parent | 5a7d18e432571fb1e9b2cd54d6168353d25c6f19 (diff) |
related tdf#109132, ugly hack to ensure the VBA mode is setup during import
Change-Id: Ia48e4b19eb690ba7ab24a37538f6de11a74ad4d3
Reviewed-on: https://gerrit.libreoffice.org/58148
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r-- | include/basic/sbstar.hxx | 3 | ||||
-rw-r--r-- | sc/source/core/tool/interpr4.cxx | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/include/basic/sbstar.hxx b/include/basic/sbstar.hxx index 86b0d8e7a0c6..884974597388 100644 --- a/include/basic/sbstar.hxx +++ b/include/basic/sbstar.hxx @@ -62,7 +62,6 @@ class BASIC_DLLPUBLIC StarBASIC : public SbxObject bool bQuit; SbxObjectRef pVBAGlobals; - BASIC_DLLPRIVATE SbxObject* getVBAGlobals( ); BASIC_DLLPRIVATE void implClearDependingVarsOnDelete( StarBASIC* pDeletedBasic ); @@ -155,6 +154,8 @@ public: void QuitAndExitApplication(); bool IsQuitApplication() { return bQuit; }; + SbxObject* getVBAGlobals( ); + static css::uno::Reference< css::frame::XModel > GetModelFromBasic( SbxObject* pBasic ); diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 4d836828eeba..fe02c2fe765d 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -3215,6 +3215,11 @@ void ScInterpreter::ScMacro() OSL_ENSURE(dynamic_cast<const StarBASIC *>(pObject) != nullptr, "No Basic found!"); OUString aMacroStr = pObject->GetName() + "." + pModule->GetName() + "." + pMethod->GetName(); OUString aBasicStr; + if (pRoot && bUseVBAObjects) + { + // just here to make sure the VBA objects when we run the macro during ODF import + pRoot->getVBAGlobals(); + } if (pObject->GetParent()) { aBasicStr = pObject->GetParent()->GetName(); // document BASIC |