Fix selection after Increase Step, undo and redo

This commit is contained in:
manongjohn 2022-04-06 13:53:53 -04:00
parent 672bc53513
commit 7e7bcaebe4

View file

@ -1025,6 +1025,10 @@ void IncreaseStepUndo::redo() const {
TApp::instance()->getCurrentXsheet()->notifyXsheetChanged(); TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
TApp::instance()->getCurrentScene()->setDirtyFlag(true); TApp::instance()->getCurrentScene()->setDirtyFlag(true);
TCellSelection *cellSelection = dynamic_cast<TCellSelection *>(
TApp::instance()->getCurrentSelection()->getSelection());
if (cellSelection) cellSelection->selectCells(m_r0, m_c0, m_newR1, m_c1);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -1043,6 +1047,11 @@ void IncreaseStepUndo::undo() const {
app->getCurrentXsheet()->notifyXsheetChanged(); app->getCurrentXsheet()->notifyXsheetChanged();
TApp::instance()->getCurrentScene()->setDirtyFlag(true); TApp::instance()->getCurrentScene()->setDirtyFlag(true);
TCellSelection *cellSelection = dynamic_cast<TCellSelection *>(
TApp::instance()->getCurrentSelection()->getSelection());
if (cellSelection)
cellSelection->selectCells(m_r0, m_c0, (m_r0 + (m_rowsCount - 1)), m_c1);
} }
} // namespace } // namespace
@ -1069,11 +1078,6 @@ void TCellSelection::increaseStepCells() {
TUndoManager::manager()->add(undo); TUndoManager::manager()->add(undo);
undo->redo(); undo->redo();
if (undo->m_newR1 != m_range.m_r1) {
m_range.m_r1 = undo->m_newR1;
TApp::instance()->getCurrentSelection()->notifySelectionChanged();
}
} }
//********************************************************************************* //*********************************************************************************