If you call WTableView::setColumnHidden before the table has been
rendered, e.g. right after constructing the WTableView, the application
will crash because the widgets for the header have not yet been created
and an out-of-bounds error occurs.
I have attached a patch that fixes the problem for me.
In future, is this the best way to submit patches, or is there a more
official route?
Tristan
>From f408e79341215f3b0eef5d0eba052ecabc02f627 Mon Sep 17 00:00:00 2001
From: Tristan Bonsall <[email protected]>
Date: Tue, 14 Dec 2010 13:59:02 +0000
Subject: [PATCH] Fix hiding column before render
---
src/Wt/WTableView.C | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/Wt/WTableView.C b/src/Wt/WTableView.C
index 4257984..80a35aa 100644
--- a/src/Wt/WTableView.C
+++ b/src/Wt/WTableView.C
@@ -852,6 +852,9 @@ void WTableView::setColumnHidden(int column, bool hidden)
if (column < firstColumn())
setSpannerCount(Left, spannerCount(Left));
+ if (renderState_ >= NeedRerenderHeader)
+ return;
+
WWidget *hc = headers_->widget(column);
if (!ajaxMode())
hc->parent()->setHidden(hidden);
--
1.7.3.1.msysgit.0
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest