summaryrefslogtreecommitdiff
path: root/wizards/com/sun/star/wizards/document
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2011-08-10 02:23:02 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-08-18 02:57:45 +0200
commit9e5ad1ef6566f609cea1bb09bdec0a73299f93d6 (patch)
tree44292e0e81eec8c183870b06ef320b2a1d3ee89b /wizards/com/sun/star/wizards/document
parent1723ba129281ac791a2e5faad67cd9a7de2b8ab4 (diff)
Implement add button
Diffstat (limited to 'wizards/com/sun/star/wizards/document')
-rw-r--r--wizards/com/sun/star/wizards/document/OfficeDocument.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/wizards/com/sun/star/wizards/document/OfficeDocument.py b/wizards/com/sun/star/wizards/document/OfficeDocument.py
index 62f385a61265..a5eef40992dd 100644
--- a/wizards/com/sun/star/wizards/document/OfficeDocument.py
+++ b/wizards/com/sun/star/wizards/document/OfficeDocument.py
@@ -242,19 +242,20 @@ class OfficeDocument(object):
except Exception, e:
traceback.print_exc()
+ @classmethod
def getFileMediaDecriptor(self, xmsf, url):
typeDetect = xmsf.createInstance(
"com.sun.star.document.TypeDetection")
mediaDescr = range(1)
- mediaDescr[0][0] = uno.createUnoStruct(
+ mediaDescr[0] = uno.createUnoStruct(
'com.sun.star.beans.PropertyValue')
- mediaDescr[0][0].Name = "URL"
- mediaDescr[0][0].Value = url
- Type = typeDetect.queryTypeByDescriptor(mediaDescr, True)
- if Type.equals(""):
+ mediaDescr[0].Name = "URL"
+ mediaDescr[0].Value = url
+ Type = typeDetect.queryTypeByDescriptor(tuple(mediaDescr), True)[0]
+ if Type == "":
return None
else:
- return typeDetect.getByName(type)
+ return typeDetect.getByName(Type)
@classmethod
def getTypeMediaDescriptor(self, xmsf, type):