Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hi Christophe

perharps not perfect (and in fact surely ;) )
here is how i quickly solved this using macros
can be implemented in java

btw, perharps not the right mailing list

HTH

laurent

'-----

function isLibreOffice

        dim aSettings, nom

        aSettings = getConfigSetting("/org.openoffice.Setup/Product", false)
        nom = aSettings.ooName
        isLibreOffice = (nom = "LibreOffice")

end function

function getConfigSetting(target as string, forUpdate as boolean)

        dim service as String ' nom du service d'acces à la configuration
        dim aSettings, aConfigProvider
        dim aParams(0) As new com.sun.star.beans.PropertyValue
        dim varEmpty

        if forUpdate then
                service = "com.sun.star.configuration.ConfigurationUpdateAccess"
        else
                service = "com.sun.star.configuration.ConfigurationAccess"
        endif
        
        aConfigProvider = createUnoService(
"com.sun.star.configuration.ConfigurationProvider" )
        aParams(0).Name = "nodepath"
        aParams(0).Value = target

        
        aSettings = aConfigProvider.createInstanceWithArguments(service,
aParams() )
        
        getConfigSetting = aSettings

end function


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.