Applied AutoWrap Renderer Bugfix by Roger Gammans (Patch 467479).
Blindly tried to fix crash reported by Roman Vanicek on Mailing list: SetCellHighlightColour sometimes segfaults in wxGTK. The application crashes in LookupAttr. Tentative explanation: Cache handling gets confused if LookupAttr gets called on wxGridNoCell. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16904 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -6788,7 +6788,6 @@ void wxGrid::DrawTextRectangle( wxDC& dc,
|
|||||||
{
|
{
|
||||||
wxArrayString lines;
|
wxArrayString lines;
|
||||||
|
|
||||||
dc.SetClippingRegion( rect );
|
|
||||||
StringToLines( value, lines );
|
StringToLines( value, lines );
|
||||||
|
|
||||||
|
|
||||||
@@ -6810,6 +6809,7 @@ void wxGrid::DrawTextRectangle( wxDC& dc,
|
|||||||
long textWidth, textHeight;
|
long textWidth, textHeight;
|
||||||
long lineWidth, lineHeight;
|
long lineWidth, lineHeight;
|
||||||
|
|
||||||
|
dc.SetClippingRegion( rect );
|
||||||
if ( lines.GetCount() )
|
if ( lines.GetCount() )
|
||||||
{
|
{
|
||||||
GetTextBoxSize( dc, lines, &textWidth, &textHeight );
|
GetTextBoxSize( dc, lines, &textWidth, &textHeight );
|
||||||
@@ -8509,12 +8509,18 @@ bool wxGrid::LookupAttr(int row, int col, wxGridCellAttr **attr) const
|
|||||||
|
|
||||||
wxGridCellAttr *wxGrid::GetCellAttr(int row, int col) const
|
wxGridCellAttr *wxGrid::GetCellAttr(int row, int col) const
|
||||||
{
|
{
|
||||||
wxGridCellAttr *attr;
|
wxGridCellAttr *attr = NULL;
|
||||||
|
// Additional test to avoid looking at the cache e.g. for
|
||||||
|
// wxNoCellCoords, as this will confuse memory management.
|
||||||
|
if ( row >= 0 )
|
||||||
|
{
|
||||||
if ( !LookupAttr(row, col, &attr) )
|
if ( !LookupAttr(row, col, &attr) )
|
||||||
{
|
{
|
||||||
attr = m_table ? m_table->GetAttr(row, col , wxGridCellAttr::Any) : (wxGridCellAttr *)NULL;
|
attr = m_table ? m_table->GetAttr(row, col , wxGridCellAttr::Any)
|
||||||
|
: (wxGridCellAttr *)NULL;
|
||||||
CacheAttr(row, col, attr);
|
CacheAttr(row, col, attr);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (attr)
|
if (attr)
|
||||||
{
|
{
|
||||||
attr->SetDefAttr(m_defaultCellAttr);
|
attr->SetDefAttr(m_defaultCellAttr);
|
||||||
|
Reference in New Issue
Block a user