Commit 48f14096 authored by Jérome Perrin's avatar Jérome Perrin

When guessing column width, use the translated title of the column, not only the column itself.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11298 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a03e7973
......@@ -14,7 +14,9 @@
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value> <string encoding="base64">O/INCg==</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
......@@ -66,7 +68,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># XXX this is just a copy / paste of the old implementation\n
<value> <string>N_ = context.Base_translateString\n
\n
# XXX this is just a copy / paste of the old implementation\n
# dirty code : if we are in domain or report tree, just use the old one, otherwise\n
# use the new one that gives better results in list mode.\n
if is_domain_tree_mode or is_report_tree_mode : \n
......@@ -136,13 +140,12 @@ for listboxline in listboxline_list:\n
line_width = 0\n
col_count = 0\n
for column_id, column_property in listboxline.getColumnItemList():\n
if column_property is None: \n
string_property = \'\'\n
else:\n
string_property = str(column_property)\n
line_width += len(string_property)\n
string_property = str(column_property or \'\')\n
if listboxline.isStatLine():\n
string_property = "%s longer" % string_property\n
elif listboxline.isTitleLine():\n
string_property = str(N_(string_property))\n
line_width += len(string_property)\n
new_column_max_len = max(len(string_property), max_line_len.get(column_id, 0))\n
update_dict = {}\n
update_dict[column_id] = new_column_max_len\n
......@@ -162,9 +165,17 @@ return result\n
<none/>
</value>
</item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value> <string>Script (Python):/nexedi/portal_skins/erp5_pdf_style/ListBox_getColumnWithDict</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
......@@ -205,13 +216,15 @@ return result\n
<string>is_report_tree_mode</string>
<string>frame_width</string>
<string>section_width</string>
<string>_getattr_</string>
<string>context</string>
<string>N_</string>
<string>result</string>
<string>min_column_width</string>
<string>_getiter_</string>
<string>listboxline</string>
<string>line_width</string>
<string>col_count</string>
<string>_getattr_</string>
<string>column_property</string>
<string>None</string>
<string>string_property</string>
......@@ -264,4 +277,25 @@ return result\n
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment