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

List:       koffice-devel
Subject:    patch: kspread formatting problem
From:       Ariya Hidayat <ariya () kde ! org>
Date:       2003-10-30 22:20:46
[Download RAW message or body]

There's formatting problem in KSpread. To reproduce: type something in
A1, make the text as bold, type another thing in B1, select the entire
first row (by clicking the row header), make it as italic. The text in
cell A1 will still only be in bold, not italic.

Looking at the code, I was suspicious why the logic for applying the
formatting only exists in column selection, but not row selection. And
the attached patch would fix the problem (and among others, bug #65504).
Please review, as this is a rather "touchy" part of KSpread code.

Best regards,

Ariya Hidayat
http://ariya.pandu.org


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

--- kspread_sheet.cc.orig	2003-10-30 18:46:44.000000000 +0100
+++ kspread_sheet.cc	2003-10-30 18:45:59.000000000 +0100
@@ -1023,7 +1023,7 @@ KSpreadSheet::SelectionType KSpreadSheet
   {
     for ( RowFormat * rw = m_rows.first(); rw; rw = rw->next() )
     {
-      if ( !rw->isDefault() && worker.testCondition( rw ) )
+      if ( worker.testCondition( rw ) )
       {
         for ( int col = left; col <= right; ++col )
         {
@@ -1074,6 +1074,20 @@ KSpreadSheet::SelectionType KSpreadSheet
         RowFormat * rw = nonDefaultRowFormat(i);
         worker.doWork( rw );
       }
+
+      for ( int row = top; row <= bottom; ++row )
+      {
+        cell = getFirstCellRow( row );
+        while ( cell )
+        {
+          if ( worker.testCondition( cell ) )
+          {
+            worker.doWork( cell, false, cell->column(), row );
+          }
+        cell = getNextCellRight( cell->column(), row );
+        }
+      }
+
     }
     result = CompleteRows;
   }
@@ -1112,7 +1126,7 @@ KSpreadSheet::SelectionType KSpreadSheet
 
       for ( RowFormat * rw = m_rows.first(); rw; rw = rw->next() )
       {
-        if ( !rw->isDefault() && worker.testCondition( rw ) )
+        if ( worker.testCondition( rw ) )
         {
           for ( int i = left; i <= right; ++i )
           {



_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://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