Applied patch #15183 (wxRichTextTable::DeleteColumns doesn't remove the deleted columns: dghart)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73939 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -10241,8 +10241,8 @@ bool wxRichTextTable::SetCellStyle(const wxRichTextSelection& selection, const w
|
|||||||
|
|
||||||
bool wxRichTextTable::DeleteRows(int startRow, int noRows)
|
bool wxRichTextTable::DeleteRows(int startRow, int noRows)
|
||||||
{
|
{
|
||||||
wxASSERT((startRow + noRows) < m_rowCount);
|
wxASSERT((startRow + noRows) <= m_rowCount);
|
||||||
if ((startRow + noRows) >= m_rowCount)
|
if ((startRow + noRows) > m_rowCount)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int i, j;
|
int i, j;
|
||||||
@@ -10267,8 +10267,8 @@ bool wxRichTextTable::DeleteRows(int startRow, int noRows)
|
|||||||
|
|
||||||
bool wxRichTextTable::DeleteColumns(int startCol, int noCols)
|
bool wxRichTextTable::DeleteColumns(int startCol, int noCols)
|
||||||
{
|
{
|
||||||
wxASSERT((startCol + noCols) < m_colCount);
|
wxASSERT((startCol + noCols) <= m_colCount);
|
||||||
if ((startCol + noCols) >= m_colCount)
|
if ((startCol + noCols) > m_colCount)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
bool deleteRows = (noCols == m_colCount);
|
bool deleteRows = (noCols == m_colCount);
|
||||||
@@ -10277,10 +10277,11 @@ bool wxRichTextTable::DeleteColumns(int startCol, int noCols)
|
|||||||
for (i = 0; i < m_rowCount; i++)
|
for (i = 0; i < m_rowCount; i++)
|
||||||
{
|
{
|
||||||
wxRichTextObjectPtrArray& colArray = m_cells[deleteRows ? 0 : i];
|
wxRichTextObjectPtrArray& colArray = m_cells[deleteRows ? 0 : i];
|
||||||
for (j = startCol; j < (startCol+noCols); j++)
|
for (j = 0; j < noCols; j++)
|
||||||
{
|
{
|
||||||
wxRichTextObject* cell = colArray[j];
|
wxRichTextObject* cell = colArray[startCol];
|
||||||
RemoveChild(cell, true);
|
RemoveChild(cell, true);
|
||||||
|
colArray.RemoveAt(startCol);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (deleteRows)
|
if (deleteRows)
|
||||||
|
Reference in New Issue
Block a user