The branch, odt2lyx, has been updated.

- Log -----------------------------------------------------------------

commit aa1f4d7a4a90d428a3318b72ced1e1bb1b6510b8
Author: Prannoy Pilligundla <[email protected]>
Date:   Sun Aug 10 22:36:17 2014 +0530

    Fixed a minor error while handling pdf images in ooffice.4ht

diff --git a/tests/ooffice.4ht b/tests/ooffice.4ht
index 80a0c75..136113b 100644
--- a/tests/ooffice.4ht
+++ b/tests/ooffice.4ht
@@ -6734,7 +6734,7 @@ xmlns:source="tex4ht"\Hnewline
          {\Needs{"convert \csname Gin@base\endcsname.pdf -scale
                          \expandafter\dim\the\csname 
Gin@req@width\endcsname\space
                          "\csname Gin@base\endcsname-\expandafter\the\csname 
Gin@req@width\endcsname.png"    "}%
-          \Picture[pict]{\csname Gin@base\endcsname.png}%
+          \Picture[pict]{\csname Gin@base\endcsname-\expandafter\the\csname 
Gin@req@width\endcsname.png}%
           \special{t4ht+@File: \csname 
Gin@base\endcsname-\expandafter\the\csname Gin@req@width\endcsname.png}
          }
          {

commit 28c411efb3df7bba8a4f7167fe32094b44b69f33
Author: Prannoy Pilligundla <[email protected]>
Date:   Mon Aug 4 00:04:09 2014 +0530

    Wrote a method to return styling of a node on request

diff --git a/odt2lyx/parseodt.py b/odt2lyx/parseodt.py
index 4175e4b..6fceac9 100644
--- a/odt2lyx/parseodt.py
+++ b/odt2lyx/parseodt.py
@@ -238,11 +238,18 @@ class Element(list):
                             doc_content = doc_content + "\n\\end_layout\n" + 
"\n\\end_inset\n\n"
         doc_content = doc_content + "\n\n\\end_layout\n\n\\end_inset\n\n"
                 
-                
+    def returnStyle(self):
+        """Returns the styling of that particular node after parsing all the 
styles in the content.xml"""
+        global odtStyles
+        node = self
+        for e in odtStyles:
+            if node.attrs.get(u'text:style-name',"") == 
e.attrs.get(u'style:name',""):
+                return e
+        return None
         
     def processElement(self):
         """Recursively called to get information about each node i.e each 
Element one by one"""
-        global doc_content, docbody, paragraphStyles, headingStyles, modified
+        global doc_content, docbody, paragraphStyles, headingStyles, modified, 
odtStyles
         node = self
         noSupport = False #True implies that a particular tag is of no use for 
the outputfile lyx file. 
         textStyle = False #True implies that a particular text style(other 
than default) is currently on
@@ -252,6 +259,9 @@ class Element(list):
                     doc_content = doc_content + u'\n\\begin_body\n\n'
             #Determining whether the odt file is modified after export from 
lyx or not. modified becomes true even if the odt is a new one which has not 
come via lyx
             if not docbody and node.name=="office:document-content" and 
node.attrs.get(u'xmlns:source',"")!="tex4ht": modified = True
+            #Proc
+            if node.name=="office:automatic-styles":
+                odtStyles = node
             #At the point node.name and node.attrs will be processed and 
appropriate lyx command for it will be written into the lyx file
             if docbody and node.name!="office:body" and 
node.name!="office:text":
                     #Checking if the node belongs to a Sectioning category of 
LyX
@@ -359,6 +369,8 @@ ODTDocTree = TreeBuilder()
 parser.StartElementHandler  = ODTDocTree.start_element #To handle start of a 
tag
 parser.EndElementHandler    = ODTDocTree.end_element #To Handle ending of a tag
 parser.CharacterDataHandler = ODTDocTree.char_data #To Handle content in 
between starting and ending of a tag
+
+odtStyles = Element(None, None) #It is set to the node 
"office:automatic-styles" in content.xml when it is encountered while parsing
  
 #Parse the data
 xmldata = xmldata.replace("<text:s/>"," ") #<text:s/> represents space in xml 
terminology, so replacing it with a space

-----------------------------------------------------------------------

Summary of changes:
 odt2lyx/parseodt.py |   16 ++++++++++++++--
 tests/ooffice.4ht   |    2 +-
 2 files changed, 15 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Repositories for GSOC work

Reply via email to