Kaydet (Commit) 63339c48 authored tarafından Javier Fernandez's avatar Javier Fernandez

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
üst 084e7668
...@@ -22,6 +22,8 @@ from com.sun.star.frame.FrameSearchFlag import ALL, PARENT ...@@ -22,6 +22,8 @@ from com.sun.star.frame.FrameSearchFlag import ALL, PARENT
from com.sun.star.util import URL from com.sun.star.util import URL
from com.sun.star.i18n.KParseTokens import ANY_LETTER_OR_NUMBER, ASC_UNDERSCORE from com.sun.star.i18n.KParseTokens import ANY_LETTER_OR_NUMBER, ASC_UNDERSCORE
from com.sun.star.util import URL
class Desktop(object): class Desktop(object):
...@@ -35,7 +37,6 @@ class Desktop(object): ...@@ -35,7 +37,6 @@ class Desktop(object):
traceback.print_exc() traceback.print_exc()
else: else:
print ("Can't create a desktop. null pointer !") print ("Can't create a desktop. null pointer !")
return xDesktop return xDesktop
@classmethod @classmethod
...@@ -51,9 +52,7 @@ class Desktop(object): ...@@ -51,9 +52,7 @@ class Desktop(object):
@classmethod @classmethod
def getDispatcher(self, xMSF, xFrame, _stargetframe, oURL): def getDispatcher(self, xMSF, xFrame, _stargetframe, oURL):
try: try:
oURLArray = list(range(1)) xDispatch = xFrame.queryDispatch(oURL, _stargetframe, ALL)
oURLArray[0] = oURL
xDispatch = xFrame.queryDispatch(oURLArray[0], _stargetframe, ALL)
return xDispatch return xDispatch
except Exception: except Exception:
traceback.print_exc() traceback.print_exc()
...@@ -129,3 +128,17 @@ class Desktop(object): ...@@ -129,3 +128,17 @@ class Desktop(object):
def getUniqueName(self, xElementContainer, sElementName): def getUniqueName(self, xElementContainer, sElementName):
sIncSuffix = self.getIncrementSuffix(xElementContainer, sElementName) sIncSuffix = self.getIncrementSuffix(xElementContainer, sElementName)
return sElementName + sIncSuffix 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment