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

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to