Kaydet (Commit) 2be139d7 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

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/32741Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst e885c442
......@@ -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 ) );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment