diff --git a/product/ERP5Form/ScribusUtils.py b/product/ERP5Form/ScribusUtils.py index b6aa11769f862819081984284a21cdaad285f7f9..dfc3a2636ff6bd3411ddad15677d7f11fd3c3e72 100644 --- a/product/ERP5Form/ScribusUtils.py +++ b/product/ERP5Form/ScribusUtils.py @@ -1235,10 +1235,9 @@ class ScribusParser: This function is used to get attributes'values in an object_dict and to be sure a compatible value is returned (for that use default value) """ - #return object_dict.get(check_key, None) or default_value if object_dict.has_key(check_key): # 'check_key' exists - if len(object_dict[check_key]) != 0: + if len(object_dict[check_key]): # check_key corresponding value is not null # returning this value return object_dict[check_key] @@ -1261,6 +1260,15 @@ class ScribusParser: containing a dict of all the relative attributes """ + # XXX this is a hack to correct a scribus problem + # actualy scribus (version 1.3.3.12svn) use some invali xml caracters + # like the '' caracter wich is a carriage return caratere, used for + # example in a text frame with many lines + # this problem is well knowed by scribus community and perhaps will be + # correct in futur scribus version + xml_string = xml_string.replace('', '\n') + xml_string = xml_string.replace('', '\t') + # Create DOM tree from the xml string print " > create DOM tree" dom_tree = minidom.parseString(xml_string) @@ -1351,7 +1359,7 @@ class ScribusParser: # end parsing document version 1.2.* else: - print " found Scribus Doucment format 1.3" + print " found Scribus Doucment format 1.3 or higher" # assuming version is compliant with 1.3.* specifications keep_page = 1