void TXsheet::insertCells(int row, int col, int rowCount) { TXshColumnP column = m_imp->m_columnSet.getColumn(col); if (!column || column->isLocked()) return; TXshCellColumn *xshColumn = column->getCellColumn(); if (!xshColumn) return; xshColumn->insertEmptyCells(row, rowCount); // aggiorno il frame count int fc = xshColumn->getMaxFrame() + 1; if (fc > m_imp->m_frameCount) m_imp->m_frameCount = fc; }
void TXsheet::clearCells(int row, int col, int rowCount) { const TXshColumnP &column = m_imp->m_columnSet.getColumn(col); if (!column || column->isLocked()) return; TXshCellColumn *xshCellColumn = column->getCellColumn(); if (!xshCellColumn) return; int oldColRowCount = xshCellColumn->getMaxFrame() + 1; xshCellColumn->clearCells(row, rowCount); // aggiornamento framecount if (oldColRowCount == m_imp->m_frameCount) updateFrameCount(); }
void TXsheet::removeCells(int row, int col, int rowCount) { TXshColumnP column = m_imp->m_columnSet.getColumn(col); if (!column || column->isLocked()) return; TXshCellColumn *xshCellColumn = column->getCellColumn(); if (!xshCellColumn) return; int oldColRowCount = xshCellColumn->getMaxFrame() + 1; xshCellColumn->removeCells(row, rowCount); // aggiornamento framecount if (oldColRowCount == m_imp->m_frameCount) updateFrameCount(); TNotifier::instance()->notify(TXsheetChange()); }
bool TXsheet::setCells(int row, int col, int rowCount, const TXshCell cells[]) { static const TXshCell emptyCell; int i = 0; while (i < rowCount && cells[i].isEmpty()) i++; // inserito da Elisa verso novembre 2009. // cosi' ha il difetto che se assegno celle vuote non fa nulla // per ora lo commento. bisogna indagare se questo rompe qualcosa // ho modificato il seguito per gestire il caso in cui i>=rowCount // => niente livelli dentro cells // if(i>=rowCount) // return false; TXshColumn::ColumnType type = TXshColumn::eLevelType; if (i < rowCount) { TXshLevel *level = cells[i].m_level.getPointer(); int levelType = level->getType(); if (levelType == SND_XSHLEVEL) type = TXshColumn::eSoundType; else if (levelType == SND_TXT_XSHLEVEL) type = TXshColumn::eSoundTextType; else if (levelType == PLT_XSHLEVEL) type = TXshColumn::ePaletteType; else if (levelType == ZERARYFX_XSHLEVEL) type = TXshColumn::eZeraryFxType; else if (levelType == MESH_XSHLEVEL) type = TXshColumn::eMeshType; } bool wasColumnEmpty = isColumnEmpty(col); TXshCellColumn *column = touchColumn(col, type)->getCellColumn(); if (!column) return false; int oldColRowCount = column->getMaxFrame() + 1; bool ret = column->setCells(row, rowCount, cells); if (!ret || column->isLocked()) { if (wasColumnEmpty) { removeColumn(col); insertColumn(col); } return false; } int newColRowCount = column->getMaxFrame() + 1; TFx *fx = column->getFx(); if (wasColumnEmpty && fx && fx->getOutputConnectionCount() == 0) getFxDag()->addToXsheet(fx); column->setXsheet(this); if (newColRowCount > m_imp->m_frameCount) m_imp->m_frameCount = newColRowCount; else { if (oldColRowCount == m_imp->m_frameCount && newColRowCount < m_imp->m_frameCount) updateFrameCount(); } return true; }