[FIX] Base_report_designer : Latin-1 encoding replaced by utf-8
lp bug: https://launchpad.net/bugs/516143 fixed bzr revid: jvo@tinyerp.com-20100203061738-96k32cbzej09feth
This commit is contained in:
parent
6242ee9588
commit
c4851f039c
|
@ -202,7 +202,7 @@ class DomApi(DomApiGeneral):
|
||||||
s.appendChild(temp)
|
s.appendChild(temp)
|
||||||
c = self.findChildrenByName(s,"style:properties")
|
c = self.findChildrenByName(s,"style:properties")
|
||||||
c = c[0]
|
c = c[0]
|
||||||
dict = self.style_properties_dict[(s.getAttribute("style:name")).encode("latin-1")] or {}
|
dict = self.style_properties_dict[(s.getAttribute("style:name")).encode("utf-8")] or {}
|
||||||
for attribute in dict.keys():
|
for attribute in dict.keys():
|
||||||
c.setAttribute(self.openOfficeStringUtf8(attribute),self.openOfficeStringUtf8(dict[attribute]))
|
c.setAttribute(self.openOfficeStringUtf8(attribute),self.openOfficeStringUtf8(dict[attribute]))
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ class DomApi(DomApiGeneral):
|
||||||
Caution: in this dict the nodes from two dom apis are merged!"""
|
Caution: in this dict the nodes from two dom apis are merged!"""
|
||||||
for st in (self.styles_dom,self.content_dom):
|
for st in (self.styles_dom,self.content_dom):
|
||||||
for s in st.getElementsByTagName("style:style"):
|
for s in st.getElementsByTagName("style:style"):
|
||||||
name = s.getAttribute("style:name").encode("latin-1")
|
name = s.getAttribute("style:name").encode("utf-8")
|
||||||
self.style_dict[name] = s
|
self.style_dict[name] = s
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -262,14 +262,14 @@ class DomApi(DomApiGeneral):
|
||||||
res = {}
|
res = {}
|
||||||
|
|
||||||
if self.style_dict[style_name].hasAttribute("style:parent-style-name"):
|
if self.style_dict[style_name].hasAttribute("style:parent-style-name"):
|
||||||
parent = self.style_dict[style_name].getAttribute("style:parent-style-name").encode("latin-1")
|
parent = self.style_dict[style_name].getAttribute("style:parent-style-name").encode("utf-8")
|
||||||
res = self.getStylePropertiesDict(parent)
|
res = self.getStylePropertiesDict(parent)
|
||||||
|
|
||||||
childs = self.style_dict[style_name].childNodes
|
childs = self.style_dict[style_name].childNodes
|
||||||
for c in childs:
|
for c in childs:
|
||||||
if c.nodeType == c.ELEMENT_NODE and c.nodeName.find("properties")>0 :
|
if c.nodeType == c.ELEMENT_NODE and c.nodeName.find("properties")>0 :
|
||||||
for attr in c._attrs.keys():
|
for attr in c._attrs.keys():
|
||||||
res[attr] = c.getAttribute(attr).encode("latin-1")
|
res[attr] = c.getAttribute(attr).encode("utf-8")
|
||||||
return res
|
return res
|
||||||
|
|
||||||
class PyOpenOffice(object):
|
class PyOpenOffice(object):
|
||||||
|
|
Loading…
Reference in New Issue