diff --git a/include/wx/generic/grid.h b/include/wx/generic/grid.h index e9b5dbb0c2..7c4de9a29f 100644 --- a/include/wx/generic/grid.h +++ b/include/wx/generic/grid.h @@ -696,6 +696,7 @@ public: bool HasEditor() const { return m_editor != NULL; } bool HasReadWriteMode() const { return m_isReadOnly != Unset; } bool HasOverflowMode() const { return m_overflow != UnsetOverflow; } + bool HasSize() const { return m_sizeRows != 1 || m_sizeCols != 1; } const wxColour& GetTextColour() const; const wxColour& GetBackgroundColour() const; diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 55049525f7..395e94ac5d 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -2142,8 +2142,8 @@ void wxGridCellAttr::MergeWith(wxGridCellAttr *mergefrom) mergefrom->GetAlignment( &hAlign, &vAlign); SetAlignment(hAlign, vAlign); } - - mergefrom->GetSize( &m_sizeRows, &m_sizeCols ); + if ( !HasSize() && mergefrom->HasSize() ) + mergefrom->GetSize( &m_sizeRows, &m_sizeCols ); // Directly access member functions as GetRender/Editor don't just return // m_renderer/m_editor @@ -2914,6 +2914,7 @@ wxGridCellAttr *wxGridTableBase::GetAttr(int row, int col, wxGridCellAttr::wxAtt return (wxGridCellAttr *)NULL; } + void wxGridTableBase::SetAttr(wxGridCellAttr* attr, int row, int col) { if ( m_attrProvider )