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

List:       koffice-devel
Subject:    kspread: selection patch
From:       Ariya Hidayat <ariya () kde ! org>
Date:       2003-11-03 1:16:39
[Download RAW message or body]

The attached patch fixes various problems which happen during entering 
or editing a formula inside a cell, among others:
- can't make reference from another sheet (bug #60455)
- no indicator of chosen/selected cells (bug #58098)
- in-place cell editing still visible while choosing other sheet
- switching to other sheet places the marker still on the same row and 
column position

If nobody objects, I will commit it.


Best regards,

Ariya Hidayat
http://ariya.pandu.org

["choose.patch" (text/plain)]

--- kspread_canvas.h.orig	2003-07-01 00:13:12.000000000 +0200
+++ kspread_canvas.h	2003-11-03 12:30:29.000000000 +0100
@@ -236,6 +236,8 @@ public:
     void startChoose( const QRect& selection );
     void endChoose();

+    bool chooseMode(){ return m_bChoose; }
+
     /**
     * Adjust a area in height and width
     */
--- kspread_canvas.cc.orig	2003-08-21 19:54:30.000000000 +0200
+++ kspread_canvas.cc	2003-11-03 13:37:17.000000000 +0100
@@ -425,12 +424,13 @@ void KSpreadCanvas::endChoose()

   updateChooseRect(QPoint(0,0), QPoint(0,0));

+  length_namecell = 0;
+  m_bChoose = FALSE;
+
   KSpreadSheet *table=m_pView->doc()->map()->findTable(m_chooseStartTable->tableName());
   if (table)
-        m_pView->setActiveTable(table);
+    m_pView->setActiveTable(table);

-  length_namecell = 0;
-  m_bChoose = FALSE;
   m_chooseStartTable = 0;
 }

@@ -534,6 +534,13 @@ void KSpreadCanvas::gotoLocation( QPoint
     if (m_bChoose)
     {
       updateChooseRect(topLeft, topLeft);
+      if( m_pEditor )
+      {
+        if( m_chooseStartTable != table )
+          m_pEditor->hide();
+        else
+          m_pEditor->show();
+      }
     }
     else
     {
@@ -2965,6 +2973,9 @@ void KSpreadCanvas::closeEditor()

 void KSpreadCanvas::updateChooseRect(const QPoint &newMarker, const QPoint &newAnchor)
 {
+  if( !m_bChoose )
+    return;
+
   KSpreadSheet* table = activeTable();

   QPoint oldAnchor = selectionInfo()->getChooseAnchor();
@@ -2993,7 +3004,10 @@ void KSpreadCanvas::updateChooseRect(con
     selectionInfo()->setChooseCursor(table, newMarker);
   }

+  m_pDoc->emitBeginOperation();
   setSelectionChangePaintDirty(table, oldChooseRect, newChooseRect);
+  repaint();
+  m_pDoc->emitEndOperation();

   /* this signal is used in the formula editor to update the text display */
   emit m_pView->sig_chooseSelectionChanged(activeTable(), newChooseRect);
@@ -3603,6 +3617,10 @@ void KSpreadCanvas::paintChooseRect(QPai

 void KSpreadCanvas::paintNormalMarker(QPainter& painter, const KoRect &viewRect)
 {
+
+  if( m_bChoose )
+    return;
+
   double positions[4];
   bool paintSides[4];

--- kspread_view.cc.orig	2003-11-03 13:40:10.000000000 +0100
+++ kspread_view.cc	2003-11-03 13:40:33.000000000 +0100
@@ -3172,6 +3172,11 @@ void KSpreadView::setActiveTable( KSprea
   QPoint newAnchor = (it == savedAnchors.end()) ? QPoint(1,1) : *it;
   QPoint newMarker = (it2 == savedMarkers.end()) ? QPoint(1,1) : *it2;
   selectionInfo()->setSelection(newMarker, newAnchor, m_pTable);
+  if( m_pCanvas->chooseMode())
+  {
+    selectionInfo()->setChooseTable( m_pTable );
+    selectionInfo()->setChooseMarker( QPoint(0,0) );
+  }

   m_pCanvas->scrollToCell(newMarker);
   resultOfCalc();


_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


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

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