[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-13 10:42:23
[Download RAW message or body]

Hello.

There was a bug to the patch which I sent yesterday.
(I'm sorry.)

About a bug:
For example, "Year 2000" has become "Year 2003" when I open
"KChart Data Editor" and click "Year 2003" and click "Year 2000".

I will attach the patch which fixed a bug.

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

diff -ur koffice.org/kchart/table.cc koffice/kchart/table.cc
--- koffice.org/kchart/table.cc	Tue Dec 12 00:47:55 2000
+++ koffice/kchart/table.cc	Wed Dec 13 19:13:38 2000
@@ -51,7 +51,7 @@
         input = new QLineEdit(this);
         input->setFrame(false);
         input->resize( cellWidth()-2, cellHeight()-2 );
-        moveInput(0,0);
+        moveInput(0,0,0);
         input->setFocus();
         connect( input, SIGNAL(returnPressed()), this, SLOT(nextInput()) );
       }
@@ -140,16 +140,21 @@
     int r = ( inRow + 1 ) % numRows();
     if ( !r )
         c = ( inCol + 1 ) % numCols();
-    moveInput( r, c );
+    moveInput( r, c, 1 );
 }

-void SheetTable::moveInput( int row, int col )
+void SheetTable::moveInput( int row, int col, int initialization )
 {
     if ( col < 0 || row < 0 )
         return;
     if ( col == inCol && row == inRow )
         return;

+    if ( (col == 0 && row == 0) && initialization == 0 ) {
+        inCol = col;
+        inRow = row;
+    }
+
    if ( inRow >= 0 && inCol >= 0 ) {
         QString str = input->text();
         setText( inRow, inCol, str );
@@ -189,7 +194,7 @@
     {
       int col = findCol(e->pos().x());
       int row = findRow(e->pos().y());
-      moveInput( row, col );
+      moveInput( row, col, 1 );
     }
 }

diff -ur koffice.org/kchart/table.h koffice/kchart/table.h
--- koffice.org/kchart/table.h	Tue Dec 12 00:47:55 2000
+++ koffice/kchart/table.h	Wed Dec 13 19:09:15 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 );
+    void moveInput( int row, int col, int initialization );
     void makeVisible( int row, int col );

 signals:


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

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