Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Wt/WContainerWidget.C
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ int WContainerWidget::indexOf(WWidget *widget) const

WWidget *WContainerWidget::widget(int index) const
{
if (index < 0 || index >= children_.size())
throw Wt::WException("WContainerWidget::widget: index " + std::to_string(index)
+ " is out of range [0, " + std::to_string(children_.size()) + ")");
return children_[index];
}

Expand Down
8 changes: 6 additions & 2 deletions src/Wt/WTableView.C
Original file line number Diff line number Diff line change
Expand Up @@ -1315,8 +1315,12 @@ WWidget* WTableView::headerWidget(int column, bool contentsOnly)
result = headers_->widget(column - headerColumnsTable_->count());
}
} else
if (plainTable_ && column < plainTable_->columnCount())
result = plainTable_->elementAt(0, column)->widget(0);
if (plainTable_ && column < plainTable_->columnCount()) {
WTableCell *headerCell = plainTable_->elementAt(0, column);
if (headerCell->count() == 0)
return result;
result = headerCell->widget(0);
}

if (result && contentsOnly)
return result->find("contents");
Expand Down