[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kspread
From:       Ariya Hidayat <ariya () kde ! org>
Date:       2004-01-26 16:04:57
Message-ID: 20040126160457.1F4328FED () office ! kde ! org
[Download RAW message or body]

CVS commit by ariya: 

use the new dissociate cell command


  M +2 -8      kspread_sheet.cc   1.529
  M +1 -1      kspread_sheet.h   1.254
  M +12 -7     kspread_view.cc   1.755
  M +1 -1      dialogs/kspread_dlg_layout.cc   1.209


--- koffice/kspread/kspread_sheet.cc  #1.528:1.529
@@ -5891,5 +5891,5 @@ void KSpreadSheet::changeMergedCell( int
    if( m_iExtraX==0 && m_iExtraY==0)
    {
-     dissociateCell( QPoint( m_iCol,m_iRow),false);
+     dissociateCell( QPoint( m_iCol,m_iRow));
      return;
    }
@@ -5925,5 +5925,5 @@ void KSpreadSheet::mergeCells( const QRe
 }
 
-void KSpreadSheet::dissociateCell( const QPoint &cellRef, bool makeUndo)
+void KSpreadSheet::dissociateCell( const QPoint &cellRef )
 {
   QPoint marker(cellRef);
@@ -5932,9 +5932,4 @@ void KSpreadSheet::dissociateCell( const
     return;
 
-  if ( !m_pDoc->undoLocked() && makeUndo)
-  {
-    KSpreadUndoMergedCell *undo = new KSpreadUndoMergedCell( m_pDoc, this, \
                marker.x() ,marker.y(), cell->extraXCells(), cell->extraYCells());
-    m_pDoc->addCommand( undo );
-  }
     int x = cell->extraXCells() + 1;
     if( x == 0 )

--- koffice/kspread/kspread_sheet.h  #1.253:1.254
@@ -702,5 +702,5 @@ public:
 
     void mergeCells( const QRect &area );
-    void dissociateCell( const QPoint &cellRef, bool makeUndo=true );
+    void dissociateCell( const QPoint &cellRef );
     void changeMergedCell( int m_iCol, int m_iRow, int m_iExtraX, int m_iExtraY);
 

--- koffice/kspread/kspread_view.cc  #1.754:1.755
@@ -3790,12 +3790,17 @@ void KSpreadView::mergeCell()
 void KSpreadView::dissociateCell()
 {
-  if ( !d->activeSheet )
+  // sanity check
+  if( !d->activeSheet )
+    return;    
+  if( d->activeSheet->isProtected() )
+    return;
+  if( d->doc->workbook()->isProtected() )
     return;
 
-  d->doc->emitBeginOperation( false );
-
-  d->activeSheet->dissociateCell( QPoint( d->canvas->markerColumn(),
+  KSpreadCell* cell = d->activeSheet->nonDefaultCell( QPoint( \
d->canvas->markerColumn(),  d->canvas->markerRow() ) );
-  d->doc->emitEndOperation( d->activeSheet->visibleRect( d->canvas ) );
+  KCommand* command = new DissociateCellCommand( cell ); 
+  d->doc->addCommand( command );
+  command->execute();  
 }
 

--- koffice/kspread/dialogs/kspread_dlg_layout.cc  #1.208:1.209
@@ -1005,5 +1005,5 @@ void CellFormatDlg::slotApply()
       macroUndo->addCommand(undo);
       
-      m_table->dissociateCell(QPoint(left,top),false);
+      m_table->dissociateCell(QPoint(left,top));
     }    
   }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic