Kaydet (Commit) 17be3629 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Fix the text width array going out of sync when shifting row positions.

Change-Id: I7b9c5554e38a25dd4ff6980e6ae0d1eff241a746
üst 41afb3ec
...@@ -200,7 +200,9 @@ void ScColumn::FreeAll() ...@@ -200,7 +200,9 @@ void ScColumn::FreeAll()
maItems[i].pCell->Delete(); maItems[i].pCell->Delete();
maItems.clear(); maItems.clear();
// Text width should keep a logical empty range of 0-MAXROW when the cell array is empty.
maTextWidths.clear(); maTextWidths.clear();
maTextWidths.resize(MAXROW);
CellStorageModified(); CellStorageModified();
} }
...@@ -257,6 +259,12 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize ) ...@@ -257,6 +259,12 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize )
else else
i = nFirstIndex; i = nFirstIndex;
// There are cells below the deletion point. Shift their row positions.
// Shift the text width array too (before the broadcast).
maTextWidths.erase(nStartRow, nSize);
maTextWidths.resize(MAXROW);
ScAddress aAdr( nCol, 0, nTab ); ScAddress aAdr( nCol, 0, nTab );
ScHint aHint( SC_HINT_DATACHANGED, aAdr, NULL ); // only areas (ScBaseCell* == NULL) ScHint aHint( SC_HINT_DATACHANGED, aAdr, NULL ); // only areas (ScBaseCell* == NULL)
ScAddress& rAddress = aHint.GetAddress(); ScAddress& rAddress = aHint.GetAddress();
...@@ -300,6 +308,7 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize ) ...@@ -300,6 +308,7 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize )
pDocument->AreaBroadcastInRange( aRange, aHint ); pDocument->AreaBroadcastInRange( aRange, aHint );
} }
CellStorageModified();
pDocument->SetAutoCalc( bOldAutoCalc ); pDocument->SetAutoCalc( bOldAutoCalc );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment