From 5daf578f56ee9d82d5c8a448f8281e1fcc60bf60 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 9 Oct 2008 13:03:37 +0000 Subject: [PATCH] Patch level : 10.0 Files correlati : ba8 Ricompilazione Demo : [ ] Commento : Limitata la larghezza massima degli spreadsheet a 128 colonne circa, o meglio a 16000 pixel (sempre circa) git-svn-id: svn://10.65.10.50/trunk@17401 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/sheet.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/sheet.cpp b/include/sheet.cpp index c839b9677..c0c560647 100755 --- a/include/sheet.cpp +++ b/include/sheet.cpp @@ -122,6 +122,7 @@ TSheet_control::TSheet_control( TToken_string new_header(header.size()); int f_width = NUMBER_WIDTH; // Stima larghezza colonne fisse int max_width = f_width; // Stima larghezza della colonna piu' grande + int tot_width = f_width; int lines_in_header = 1; const char * h; @@ -188,6 +189,10 @@ TSheet_control::TSheet_control( max_width = v; new_header.add(testa); + + tot_width += v_width[i]; + if (tot_width > 2048) // Taglio corto con gli sheet enormi > 16000 pixel + break; } // Calcola rettangolo massimo per lo sheet @@ -261,8 +266,9 @@ TSheet_control::TSheet_control( } } - RCT rd; xi_get_def_rect(listdef, (XinRect *) &rd); - if ((rd.right - rd.left) > (rct.right - rct.left)) + // Attenzione: negli sheet molto grandi succede che rd.right < 0 + RCT rd; xi_get_def_rect(listdef, (XinRect *) &rd); + if (rd.right < 0 || (rd.right - rd.left) > (rct.right - rct.left)) l->width = rct.right - rct.left; _obj = xi_create(itf, listdef); // Create the whole thing!