diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-01-04 23:58:13 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-03-29 14:29:49 +0200 |
commit | 8a622164d80c780863b09f01d16f4e5c919b869c (patch) | |
tree | 6a16260730fbe0ea9f2e9086e1455f2e0fb86117 /basctl | |
parent | 25bf8661d2a3ac1e4916efd32f44a716b345f2eb (diff) |
tdf#105069, store the VBA module info for new modules as well
This was never a problem until we started to export the VBA stream
instead of just writing back the imported stream.
Change-Id: I4e20e717bebd3dc649efcf1b9c18b6e5053303d9
Reviewed-on: https://gerrit.libreoffice.org/32741
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
(cherry picked from commit 2be139d76bdb66e77719613d802dc0047c284456)
Reviewed-on: https://gerrit.libreoffice.org/35198
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
(cherry picked from commit fd242f02b195f896b23336fe51773d7abf310d4e)
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/scriptdocument.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx index a99fefafe8a3..135ea2b9659b 100644 --- a/basctl/source/basicide/scriptdocument.cxx +++ b/basctl/source/basicide/scriptdocument.cxx @@ -34,6 +34,8 @@ #include <com/sun/star/document/XEmbeddedScripts.hpp> #include <com/sun/star/script/vba/XVBACompatibility.hpp> #include <com/sun/star/script/vba/XVBAModuleInfo.hpp> +#include <com/sun/star/script/ModuleInfo.hpp> +#include <com/sun/star/script/ModuleType.hpp> #include <sfx2/objsh.hxx> #include <sfx2/bindings.hxx> @@ -669,6 +671,14 @@ namespace basctl if ( _bCreateMain ) _out_rNewModuleCode += "Sub Main\n\nEnd Sub\n" ; + Reference< XVBAModuleInfo > xVBAModuleInfo(xLib, UNO_QUERY); + if (xVBAModuleInfo.is()) + { + css::script::ModuleInfo aModuleInfo; + aModuleInfo.ModuleType = css::script::ModuleType::NORMAL; + xVBAModuleInfo->insertModuleInfo(_rModName, aModuleInfo); + } + // insert module into library xLib->insertByName( _rModName, makeAny( _out_rNewModuleCode ) ); } |