Corrected logic for empty cells

This commit is contained in:
manongjohn 2018-12-14 22:53:46 -05:00
parent 592b09d168
commit f3163f8dfc
2 changed files with 8 additions and 1 deletions

View file

@ -801,7 +801,8 @@ QString TTool::updateEnabled(int rowIndex, int columnIndex) {
// If not in Level editor, let's use our current cell from the xsheet to
// find the nearest level before it
if (!m_application->getCurrentFrame()->isEditingLevel()) {
if (levelType == NO_XSHLEVEL &&
!m_application->getCurrentFrame()->isEditingLevel()) {
TXshCell cell = xsh->getCell(rowIndex, columnIndex);
xl = cell.isEmpty() ? 0 : (TXshLevel *)(&cell.m_level);
sl = cell.isEmpty() ? 0 : cell.getSimpleLevel();

View file

@ -118,6 +118,12 @@ void Toolbar::updateToolbar(bool forceReset) {
rowIndex = r;
break;
}
if (levelType == NO_XSHLEVEL) {
TXshCell cell = xsh->getCell(r0, colIndex);
levelType = cell.m_level->getType();
rowIndex = r0;
}
}
}
}