[PATCH] Init: Pythonize the class CGSession.

Javier Fernandez (via Code Review) gerrit at gerrit.libreoffice.org
Mon Mar 25 03:47:34 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3024

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/24/3024/1

Init: Pythonize the class CGSession.

Change-Id: Iff1b076654be0b8b95e9802650e2803a274aaf98
---
M wizards/com/sun/star/wizards/web/data/CGSession.py
1 file changed, 17 insertions(+), 13 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/data/CGSession.py b/wizards/com/sun/star/wizards/web/data/CGSession.py
index dfa94db..211cea9 100644
--- a/wizards/com/sun/star/wizards/web/data/CGSession.py
+++ b/wizards/com/sun/star/wizards/web/data/CGSession.py
@@ -15,12 +15,17 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
-from common.ConfigGroup import ConfigGroup
-from common.ConfigSet import ConfigSet
-from CGContent import CGContent
-from CGDesign import CGDesign
-from CGGeneralInfo import CGGeneralInfo
-from CGPublish import CGPublish
+import uno
+
+from ...common.ConfigGroup import ConfigGroup
+from ...common.ConfigSet import ConfigSet
+from ...common.XMLHelper import XMLHelper
+from .CGContent import CGContent
+from .CGDesign import CGDesign
+from .CGGeneralInfo import CGGeneralInfo
+from .CGPublish import CGPublish
+
+from xml.dom.minidom import Document
 
 class CGSession(ConfigGroup):
 
@@ -37,7 +42,7 @@
     def createDOM(self, parent):
         root = XMLHelper.addElement(
             parent, "session", ["name", "screen-size"],
-            [self.cp_Name, getScreenSize()])
+            [self.cp_Name, self.getScreenSize()])
         self.cp_GeneralInfo.createDOM(root)
         self.cp_Content.createDOM(root)
         return root
@@ -54,13 +59,12 @@
             return "800"
 
     def getLayout(self):
-        return self. root.cp_Layouts.getElement(self.cp_Design.cp_Layout)
+        return self.root.cp_Layouts.getElement(self.cp_Design.cp_Layout)
 
     def getStyle(self):
-        return self.root.cp_Styles.getElement(self.cp_Design.cp_Style)
+        return self.root.cp_Styles.getElementAt(self.cp_Design.cp_Style)
 
-    def createDOM(self):
-        factory = DocumentBuilderFactory.newInstance()
-        doc = factory.newDocumentBuilder().newDocument()
-        createDOM(doc)
+    def createDOM1(self):
+        doc = Document()
+        self.createDOM(doc)
         return doc

-- 
To view, visit https://gerrit.libreoffice.org/3024
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff1b076654be0b8b95e9802650e2803a274aaf98
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez <javier.fgb at gmail.com>



More information about the LibreOffice mailing list