diff options
author | Javier Fernandez <jfernandez@igalia.com> | 2013-05-03 13:29:15 +0000 |
---|---|---|
committer | Javier Fernandez <jfernandez@igalia.com> | 2013-05-08 09:36:37 +0000 |
commit | 63339c48f577d25ece59c075e450c86f33ceb560 (patch) | |
tree | eaeeb8b89f163f101b5f3d5a8927b42fd711ad85 /wizards | |
parent | 084e766844fb53482a447d85d471fb1e0f55c063 (diff) |
PyWebWizard: Fixing bugs and implementation of mising features.
Completing the preview implementation.
- New method getDispatchURL added.
- Using directly the URL instead of an array.
Change-Id: I0bc78b5998792b149c64815b20217933e6599b3b
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/com/sun/star/wizards/common/Desktop.py | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/wizards/com/sun/star/wizards/common/Desktop.py b/wizards/com/sun/star/wizards/common/Desktop.py index 6dfe1ee477bf..f91caa9c9c15 100644 --- a/wizards/com/sun/star/wizards/common/Desktop.py +++ b/wizards/com/sun/star/wizards/common/Desktop.py @@ -22,6 +22,8 @@ from com.sun.star.frame.FrameSearchFlag import ALL, PARENT from com.sun.star.util import URL from com.sun.star.i18n.KParseTokens import ANY_LETTER_OR_NUMBER, ASC_UNDERSCORE +from com.sun.star.util import URL + class Desktop(object): @@ -35,7 +37,6 @@ class Desktop(object): traceback.print_exc() else: print ("Can't create a desktop. null pointer !") - return xDesktop @classmethod @@ -51,9 +52,7 @@ class Desktop(object): @classmethod def getDispatcher(self, xMSF, xFrame, _stargetframe, oURL): try: - oURLArray = list(range(1)) - oURLArray[0] = oURL - xDispatch = xFrame.queryDispatch(oURLArray[0], _stargetframe, ALL) + xDispatch = xFrame.queryDispatch(oURL, _stargetframe, ALL) return xDispatch except Exception: traceback.print_exc() @@ -129,3 +128,17 @@ class Desktop(object): def getUniqueName(self, xElementContainer, sElementName): sIncSuffix = self.getIncrementSuffix(xElementContainer, sElementName) return sElementName + sIncSuffix + + @classmethod + def getDispatchURL(self, xMSF, _sURL): + try: + oTransformer = xMSF.createInstance("com.sun.star.util.URLTransformer") + oURL = URL() + oURL.Complete = _sURL + ok, oURL = oTransformer.parseStrict(oURL) + if (not ok): + return None + return oURL + except Exception: + traceback.print_exc() + return None |