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

List:       koffice
Subject:    Re: A bug fix patch of KChart
From:       Toshitaka Fujioka <tositaka () soft ! kusa ! ac ! jp>
Date:       2000-12-19 7:57:39
[Download RAW message or body]

Hello.

I fixed a patch to be easy to come to understand program.
Action is same as a former patch. (CVS of 18/12)

# Thank you for adopting my patch. (^o^)
# I make effort to make a good patch for KOffice (KDE).

["koffice-kchart-bug-20001219.diff" (text/plain)]

Only in koffice/kchart: #table.cc#
Only in koffice.org/kchart: koffice-kchart-bug-20001219.diff
diff -ur koffice.org/kchart/table.cc koffice/kchart/table.cc
--- koffice.org/kchart/table.cc	Tue Dec 19 13:53:20 2000
+++ koffice/kchart/table.cc	Tue Dec 19 13:52:49 2000
@@ -51,7 +51,8 @@
         input = new QLineEdit(this);
         input->setFrame(false);
         input->resize( cellWidth()-2, cellHeight()-2 );
-        moveInput(0,0,0);
+        inCol_inRow_initialization = TRUE;
+        moveInput(0,0);
         input->setFocus();
         connect( input, SIGNAL(returnPressed()), this, SLOT(nextInput()) );
       }
@@ -140,17 +141,18 @@
     int r = ( inRow + 1 ) % numRows();
     if ( !r )
         c = ( inCol + 1 ) % numCols();
-    moveInput( r, c,1 );
+    inCol_inRow_initialization = FALSE;
+    moveInput( r, c );
 }
   
-void SheetTable::moveInput( int row, int col,int initialization )
+void SheetTable::moveInput( int row, int col )
 {
     if ( col < 0 || row < 0 )
         return;
     if ( col == inCol && row == inRow )
         return;
-
-    if ( col == 0 && row == 0 && initialization == 0 ) {
+    // Initialization of inCol and inRow
+    if ( col == 0 && row == 0 && inCol_inRow_initialization ) {
         inCol = col;
         inRow = row;
     }
@@ -193,7 +195,8 @@
     {
       int col = findCol(e->pos().x());
       int row = findRow(e->pos().y());
-      moveInput( row, col,1 );
+      inCol_inRow_initialization = FALSE;
+      moveInput( row, col );
     }
 }
 
diff -ur koffice.org/kchart/table.h koffice/kchart/table.h
--- koffice.org/kchart/table.h	Tue Dec 19 13:59:46 2000
+++ koffice/kchart/table.h	Tue Dec 19 13:52:04 2000
@@ -39,7 +39,7 @@
 public slots:
     void showText( int row, int col, QString s) { setText( row, col, s); }
     void nextInput();
-    void moveInput( int row, int col, int initialization );
+    void moveInput( int row, int col );
     void makeVisible( int row, int col );
 
 signals:
@@ -67,6 +67,7 @@
     QLineEdit *input;
     int inRow;
     int inCol;
+    bool inCol_inRow_initialization;
     void placeInput();
 
     friend class Sheet; //###


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

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