Index: gc_core/py/oxt/helpers.py ================================================================== --- gc_core/py/oxt/helpers.py +++ gc_core/py/oxt/helpers.py @@ -91,5 +91,13 @@ sFullPath = xPackageInfoProvider.getPackageLocation("French.linguistic.resources.from.Dicollecte.by.OlivierR") if sPath and not sPath.startswith("/"): sPath = "/" + sPath sFullPath = sFullPath[8:] + sPath return os.path.abspath(sFullPath) + + +def getProductNameAndVersion (): + "returns tuple of software name and version" + xSettings = getConfigSetting("org.openoffice.Setup/Product", False) + sProdName = xSettings.getByName("ooName") + sVersion = xSettings.getByName("ooSetupVersion") + return (sProdName, sVersion) Index: gc_lang/fr/oxt/ContextMenu/ContextMenu.py ================================================================== --- gc_lang/fr/oxt/ContextMenu/ContextMenu.py +++ gc_lang/fr/oxt/ContextMenu/ContextMenu.py @@ -137,14 +137,11 @@ def execute (self, args): if not args: return try: - # what version of the software? - xSettings = helpers.getConfigSetting("org.openoffice.Setup/Product", False) - sProdName = xSettings.getByName("ooName") - sVersion = xSettings.getByName("ooSetupVersion") + sProdName, sVersion = helpers.getProductNameAndVersion() if (sProdName == "LibreOffice" and sVersion < "4") or sProdName == "OpenOffice.org": return # what event? bCorrectEvent = False