Apache OpenOffice (AOO) Bugzilla – Issue 22742
script::XStarBasicLibraryInfo::getModuleContainer() does not work
Last modified: 2013-02-24 21:07:58 UTC
(Yes, com::sun::star::script::XStarBasicLibraryInfo is deprecated, but there seems to be no other way to access the macros from C++.) The problem: com::sun::star::script::XStarBasicLibraryInfo::getModuleContainer() returns an empty container for password-protected libraries. Therefore, seems to be impossible to access password-protected modules from C++. In particular, it's impossible to write an export filter which saves password-protected libraries.
forwarding to responsible developer
AB->EM2: There is a way to access Basic macro inside a document. Try: Sub Main msgbox ThisComponent.BasicLibraries.dbg_methods End Sub The component's BasicLibraries property returns an object implementing the interfaces com.sun.star.script.XLibraryContainer/XLibraryContainer2/ XLibraryContainerPassword. These interfaces are documented in the IDL documentation. Using these interfaces you can access the modules contai- ned in the library by using the methods of XNameAccess where XLibraryCon- tainer is derived from. And you can use XLibraryContainerPassword::veri- fyLibraryPassword() to set the password and extract the source code af- terwards. Of course it is not possible to get the source code without knowing the password because otherwise the API could be use to easily get information that is intendend to be password protected. -> WONTFIX
-> Closed
Created attachment 73091