summaryrefslogtreecommitdiff
path: root/vbahelper
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2022-10-06 20:00:07 -0400
committerJustin Luth <jluth@mail.com>2022-10-07 23:48:36 +0200
commit6834fda784f3066a89838cd6cda4fe945f4c7904 (patch)
treed972b8d62c56aedd70f2696ee291a934d7c341c5 /vbahelper
parent4a07e9e31a6cd93958f94354a15325af098c93b8 (diff)
related tdf#148806 xls/x vba: no auto_open if Auto_Open module
The presence of an Auto_Close module prevents any auto_close subroutines from running. Interestingly, Word is different. It doesn't care at all if such a module is present. (In fact, it uses that module's main() as an AutoClose if there is no Sub AutoClose.) Change-Id: I83a80b7f016dcf2ad3b7fd931acacb6f788241a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141036 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'vbahelper')
-rw-r--r--vbahelper/source/vbahelper/vbaeventshelperbase.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
index 1f92e449a156..dbd345c9bac7 100644
--- a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
+++ b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
@@ -320,6 +320,23 @@ void VbaEventsHelperBase::ensureVBALibrary()
}
}
+bool VbaEventsHelperBase::hasModule(const OUString& rModuleName)
+{
+ if (rModuleName.isEmpty())
+ return false;
+
+ bool bRet = false;
+ try
+ {
+ ensureVBALibrary();
+ bRet = mxModuleInfos->hasModuleInfo(rModuleName);
+ }
+ catch (uno::Exception&)
+ {}
+
+ return bRet;
+}
+
sal_Int32 VbaEventsHelperBase::getModuleType( const OUString& rModuleName )
{
// make sure the VBA library exists