Bug 70949

Summary: Please provide utility functions to get the current product (Office Suite) name, version, etc.
Product: LibreOffice Reporter: Lionel Elie Mamane <lionel>
Component: BASICAssignee: Not Assigned <libreoffice-bugs>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: medium CC: dicollecte, pierre-yves.samyn, tim
Version: 4.2.0.0.alpha0+ Master   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 70947    

Description Lionel Elie Mamane 2013-10-28 09:11:10 UTC
Although it is possible from Basic script to get the version of LibrOffice it is running under, the way to do so is rather baroque and (worse!) undocumented. It should just be a call to a utility function, like e.g.

 getOfficeVersion
 getOfficeProductName
 ...

For reference, that's how one can do it now:

Sub Main
    Dim cfgProv As Object
    Set cfgProv = CreateUnoService("com.sun.star.configuration.ConfigurationProvider")
    Dim arg1 as new "com.sun.star.beans.PropertyValue"
    Dim args(1) as new "com.sun.star.beans.PropertyValue"
    arg1.Name = "nodepath"
    arg1.Value="/org.openoffice.Setup/Product"
    args(0) = arg1
    Dim cfgAccess As Object
    Set cfgAccess = cfgProv.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", args)
    MsgBox cfgAccess.ooName & " version " & cfgAccess.ooSetupVersion & ", provided by """ & cfgAccess.ooVendor & """"
End Sub

This provides a string; it would be better if the version were provided as a (set of) _number_s.
Comment 1 pierre-yves samyn 2013-10-31 07:28:25 UTC
Hello

I completely agree with this request.

Only slight attenuation: the current procedure for obtaining this information is a *little* documented (see GetRegistryKeyContent and GetProductname examples in the Misc module of Tools library).

I also agree with the "type" request for ooSetupxxx properties(Extension, Version, ooSetupVersionAboutBox...).

Could we not add to request a getBuildID utility function equivalent to:

sub GetBuildID
dim sID as string
   FA = createunoservice("com.sun.star.sheet.FunctionAccess")
     sID = FA.callFunction("INFO", array("Release")
     msgbox "Build ID: " & sID
end sub

Regards
Pierre-Yves

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.