The UCB FileContent getPropertySetInfo command returns most of the time a correct array of 15 structures com.sun.star.beans.Property. From time to time, it returns a strange array of only 5 properties, named "sfCR", "sfCRLF", "srLF", "sfNEWLINE", "sfTAB". The code is (simplified) : URL = "file:///D:/OVH/afile.ods" ucbBroker = CreateUnoService("com.sun.star.ucb.UniversalContentBroker") fileID = ucbBroker.createContentIdentifier(URL) ucbContent = ucbBroker.queryContent(fileID) Dim command as new com.sun.star.ucb.Command command.Name = "getPropertySetInfo" command.Handle = -1 command.Argument = Nothing propSet = ucbContent.execute(command, 0, Nothing) properties = propSet.getProperties() I have observed the anomaly randomly several times, on LibreOffice 7.5 first, and now on LibreOffice 24.2.5.2, but have been enable to reproduce it. When the error occurs once, it then repeats each time I run the program until I quit and reload LibreOffice.
I still observe this bug while developping and testing a macro to experiment the UCB file provider. Though I'm unable to reproduce it voluntarily, it seems that it occurs after an exception occured during a former run of this macro. For instance an invalid parameter exception.
I have finally identified the origin, which is connected with the ScriptForge Library. Here is the code to get the bug. Sub Test 'If the ScriptForge Library is not loaded, the variable "properties" 'is an array of 15 com.sun.star.beans.Property => normal behaviour 'If the library is loaded, "properties" is an array of 5 strings : ' "sfCR", "sfCRLF", "srLF", "sfNEWLINE", "sfTAB" 'Uncomment the following line to get the bug 'GlobalScope.BasicLibraries.LoadLibrary("ScriptForge") URL = "file:///C:/Users/Public" ucbBroker = CreateUnoService("com.sun.star.ucb.UniversalContentBroker") fileID = ucbBroker.createContentIdentifier(URL) ucbContent = ucbBroker.queryContent(fileID) Dim command as new com.sun.star.ucb.Command command.Name = "getPropertySetInfo" command.Argument = Nothing propSet = ucbContent.execute(command, 0, Nothing) properties = propSet.getProperties() MsgBox("Number of Properties : " & (UBOUND(properties)+1)) End Sub I first thought it was connected with an exception for I use a personal tool to debug exceptions, and this tool uses the ScriptForge library.
I confirm the bug under Version: 24.2.4.2 (X86_64) / LibreOffice Community Build ID: 51a6219feb6075d9a4c46691dcfe0cd9c4fff3c2 CPU threads: 6; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb) Locale: fr-BE (en_US.UTF-8); UI: en-US Calc: threaded Additional infos: - the 5 undesired property names ("sfCR", "sfCRLF", "sfLF", "sfNEWLINE", "sfTAB") are described in the SF_String module of the ScriptForge Basic library: https://opengrok.libreoffice.org/xref/core/wizards/source/scriptforge/SF_String.xba?r=30a6bf39#105 - if I make the same test (after a LO restart and ...) after having replaced "ScriptForge" by "Access2Base", the execution of the script stops in the middle of the Access2Base library code with an "Object variable not set" error. Even more strange. Both libraries have in common to contain Basic class modules ... I tested a few other libraries without trouble.