コード例 #1
0
ファイル: xshcellmover.cpp プロジェクト: SaierMe/opentoonz
  void redo() const override {
    int ca       = m_cellsMover.getStartPos().x;
    int cb       = m_cellsMover.getPos().x;
    int colCount = m_cellsMover.getColumnCount();

    if (ca != cb) {
      if (m_cellsMover.m_uffa & 1) m_cellsMover.emptyColumns(ca);
      if (m_cellsMover.m_uffa & 2) m_cellsMover.restoreColumns(cb);
    }

    if ((m_cellsMover.getQualifiers() & CellsMover::eCopyCells) == 0 &&
        (m_cellsMover.getQualifiers() & CellsMover::eOverwriteCells) == 0)
      m_cellsMover.undoMoveCells(m_cellsMover.getStartPos());
    if (m_cellsMover.getQualifiers() &
        CellsMover::eOverwriteCells) {  // rimuove le celle vecchie
      int c, ra = m_cellsMover.getStartPos().y,
             rowCount = m_cellsMover.getRowCount();
      TXsheet *xsh    = TApp::instance()->getCurrentXsheet()->getXsheet();
      for (c = ca; c < ca + colCount; c++) xsh->clearCells(ra, c, rowCount);
    }
    m_cellsMover.moveCells();

    TApp::instance()->getCurrentXsheet()->getXsheet()->updateFrameCount();
    TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
    if (m_cellsMover.getColumnTypeFromCell(0) == TXshColumn::eSoundType)
      TApp::instance()->getCurrentXsheet()->notifyXsheetSoundChanged();
  }
コード例 #2
0
ファイル: columncommand.cpp プロジェクト: opentoonz/opentoonz
 void redo() const override {
   TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
   int r0, r1;
   xsh->getCellRange(m_col, r0, r1);
   if (r0 <= r1) {
     xsh->clearCells(r0, m_col, r1 - r0 + 1);
     xsh->updateFrameCount();
     TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
   }
 }
コード例 #3
0
ファイル: xshcellmover.cpp プロジェクト: SaierMe/opentoonz
void CellsMover::undoMoveCells(const TPoint &pos) const {
  TXsheet *xsh = getXsheet();
  int r        = pos.y;
  int c        = pos.x;
  if (m_qualifiers & eInsertCells) {
    for (int i = 0; i < m_colCount; i++) xsh->removeCells(r, c + i, m_rowCount);
  } else {
    for (int i = 0; i < m_colCount; i++) xsh->clearCells(r, c + i, m_rowCount);
    if (m_qualifiers & eOverwriteCells) setCells(m_oldCells, r, c);
  }
}
コード例 #4
0
ファイル: columncommand.cpp プロジェクト: opentoonz/opentoonz
 void redo() const override {
   TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
   int r0, r1;
   xsh->getCellRange(m_index, r0, r1);
   assert(r0 <= r1);
   if (r0 > r1) return;
   TXshCell cell = xsh->getCell(r0, m_index);
   assert(!cell.isEmpty());
   assert(cell.m_level->getChildLevel());
   xsh->clearCells(r0, m_index, r1 - r0 + 1);
   for (int i = 0; i < m_newFramesCount; i++) {
     cell.m_frameId = TFrameId(i + 1);
     xsh->setCell(m_r0 + i, m_index, cell);
   }
   TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
 }
コード例 #5
0
ファイル: columncommand.cpp プロジェクト: opentoonz/opentoonz
 void undo() const override {
   TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
   int r0, r1;
   xsh->getCellRange(m_index, r0, r1);
   assert(r0 <= r1);
   if (r0 > r1) return;
   TXshCell cell = xsh->getCell(r0, m_index);
   assert(!cell.isEmpty());
   assert(cell.m_level->getChildLevel());
   xsh->clearCells(r0, m_index, r1 - r0 + 1);
   for (int i = 0; i < (int)m_oldFrames.size(); i++) {
     TFrameId fid = m_oldFrames[i];
     if (fid != TFrameId::EMPTY_FRAME) {
       cell.m_frameId = fid;
       xsh->setCell(m_r0 + i, m_index, cell);
     }
   }
   TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
 }