From 31a8929a3da5d34e4be025c96c5ca499653c818d Mon Sep 17 00:00:00 2001
From: Nicolas Dumazet <nicolas.dumazet@nexedi.com>
Date: Tue, 16 Mar 2010 02:51:51 +0000
Subject: [PATCH] Silence Matrix rendering errors

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33738 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../erp5_pdm/TransformedResource_asCellRange.xml           | 7 +++++++
 bt5/erp5_pdm/bt/revision                                   | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/TransformedResource_asCellRange.xml b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/TransformedResource_asCellRange.xml
index c52c67296f..751e3d2801 100644
--- a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/TransformedResource_asCellRange.xml
+++ b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/TransformedResource_asCellRange.xml
@@ -91,6 +91,11 @@ for c in ([line_base_category, column_base_category] + tab_base_category_list):\
 # Remove empty range\n
 cell_range = filter(lambda x: x != [], cell_range)\n
 \n
+dimension = len(cell_range)\n
+if matrixbox and dimension<3:\n
+  # Matrixbox view always expects three dimensions (lines, columns, tabs)\n
+  # It costs very little to avoid noisy rendering tracebacks\n
+  return cell_range + [[]]*(3-dimension)\n
 return cell_range\n
 
 
@@ -147,6 +152,8 @@ return cell_range\n
                             <string>getattr</string>
                             <string>_getitem_</string>
                             <string>map</string>
+                            <string>len</string>
+                            <string>dimension</string>
                           </tuple>
                         </value>
                     </item>
diff --git a/bt5/erp5_pdm/bt/revision b/bt5/erp5_pdm/bt/revision
index 281cd66131..4af7c92223 100644
--- a/bt5/erp5_pdm/bt/revision
+++ b/bt5/erp5_pdm/bt/revision
@@ -1 +1 @@
-469
\ No newline at end of file
+470
\ No newline at end of file
-- 
2.30.9