From 63c568821277e16db6b972b58b57c50d809df416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 4 Mar 2014 13:31:41 +0000 Subject: [PATCH] actively search for wizards dir in all internal templates Change-Id: I4ef6da4d9d1931917e0aaa6e110fd273bd917b26 --- wizards/com/sun/star/wizards/ui/WizardDialog.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/wizards/com/sun/star/wizards/ui/WizardDialog.py b/wizards/com/sun/star/wizards/ui/WizardDialog.py index 239644b..08a8c2d 100644 --- a/wizards/com/sun/star/wizards/ui/WizardDialog.py +++ b/wizards/com/sun/star/wizards/ui/WizardDialog.py @@ -23,6 +23,7 @@ from .UnoDialog2 import UnoDialog2, Desktop, PropertyNames, UIConsts, \ from .event.CommonListener import TerminateListenerProcAdapter from ..common.Resource import Resource from ..common.HelpIds import HelpIds +from ..common.FileAccess import FileAccess from ..document.OfficeDocument import OfficeDocument from ..text.TextDocument import TextDocument @@ -114,10 +115,17 @@ class WizardDialog(UnoDialog2): def initializePaths(self): xPropertySet = \ self.xMSF.createInstance("com.sun.star.util.PathSettings") - self.sTemplatePath = \ - xPropertySet.getPropertyValue("Template_internal")[0] self.sUserTemplatePath = \ xPropertySet.getPropertyValue("Template_writable") + myFA = FileAccess(self.xMSF) + aInternalPaths = xPropertySet.getPropertyValue("Template_internal") + self.sTemplatePath = "" + for path in aInternalPaths: + if myFA.exists(path + "/wizard", False): + self.sTemplatePath = path + break + if self.sTemplatePath == "": + raise Exception("could not find wizard templates") def addRoadmap(self): try: -- 1.8.5.3