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

List:       koffice-devel
Subject:    Bug #46612
From:       John Dailey <dailey () vt ! edu>
Date:       2002-08-29 2:17:54
[Download RAW message or body]

Here's a patch to solve the bug.  There are 2 separate problems working 
together for this bug:
In KSpreadSelection, don't take into account merged cells if the selection is 
of a full row or column.
In KSpreadDoc::RetrieveMarkerInfo, be aware that dblWidth of a cell will 
return the total width of the merged area.  Row/Column Layout objects should 
be used there instead since the selection area is already set properly.

-John
["properSelection.diff" (text/x-diff)]

Index: kspread_doc.cc
===================================================================
RCS file: /home/kde/koffice/kspread/kspread_doc.cc,v
retrieving revision 1.209
diff -p -u -3 -r1.209 kspread_doc.cc
--- kspread_doc.cc	2002/08/08 14:02:13	1.209
+++ kspread_doc.cc	2002/08/29 02:04:37
@@ -913,12 +913,12 @@ void KSpreadDoc::RetrieveMarkerInfo(cons
   double ypos = table->dblRowPos( marker.top() );
 
   double x = table->dblColumnPos( marker.right() );
-  const KSpreadCell *cell = table->cellAt( marker.right(), marker.top() );
-  double tw = cell->dblWidth( marker.right() );
+  const ColumnLayout *columnLayout = table->columnLayout( marker.right() );
+  double tw = columnLayout->dblWidth( );
   double w = ( x - xpos ) + tw;
-  cell = table->cellAt( marker.left(), marker.bottom() );
+  const RowLayout* rowLayout = table->rowLayout( marker.bottom() );
   double y = table->dblRowPos( marker.bottom() );
-  double th = cell->dblHeight( marker.bottom() );
+  double th = rowLayout->dblHeight( );
   double h = ( y - ypos ) + th;
 
   /* left, top, right, bottom */
Index: kspread_selection.cc
===================================================================
RCS file: /home/kde/koffice/kspread/kspread_selection.cc,v
retrieving revision 1.9
diff -p -u -3 -r1.9 kspread_selection.cc
--- kspread_selection.cc	2002/07/19 08:58:03	1.9
+++ kspread_selection.cc	2002/08/29 02:04:38
@@ -128,14 +128,18 @@ void KSpreadSelection::setSelection( con
   m_marker = newMarker;
   m_anchor = newAnchor;
 
+  QRect newSelection = selection();
+
   const KSpreadCell* cell = table->cellAt(newMarker);
-  if (cell->isObscured() && cell->isObscuringForced())
+  if (!util_isColumnSelected(newSelection) &&
+      !util_isRowSelected(newSelection) &&
+      cell->isObscured() && cell->isObscuringForced())
   {
     cell = cell->obscuringCells().first();
     m_marker = QPoint(cell->column(), cell->row());
   }
 
-  QRect newSelection = selection();
+  newSelection = selection();
 
   /* see if we've actually changed anything */
   if ( newSelection == oldSelection && newMarker == oldMarker &&

_______________________________________________
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