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

List:       koffice
Subject:    Re: [PATCH] Fix table column resizing
From:       Sven Langkamp <longamp () reallygood ! de>
Date:       2003-12-08 21:56:50
[Download RAW message or body]

Am Sonntag, 7. Dezember 2003 15:45 schrieb David Faure:
> On Sunday 07 December 2003 11:50, Sven Langkamp wrote:
> > Am Samstag, 6. Dezember 2003 23:52 schrieb David Faure:
> > > On Saturday 06 December 2003 16:15, Sven Langkamp wrote:
> > > > I have improved the patch by calling updateFrames() in recalcCols()
> > > > to avoid rendering errors.
> > >
> > > Applied, many thanks.
> > >
> > > Maybe resizing rows needs the same fix?
> >
> > Yes, resizing rows has the same problem. But the fix is much more
> > difficult. The following rows have to be moved and it resize can make the
> > table bigger than one page, which causes still errors ( see bug 65741,
> > 48017 !! , 41954)
>
> Yes, this case is really not handled well currently - I wasn't expecting
> you to fix that :)
The original idea to base the tables on frames is good, but it also has the 
disadvantage that moving, resizing of single cells and some other things 
can't really handled well. I think I heared that it had been discussed at the 
kastle meeting to redesign this.
Unfortunaltey I don't know enough about kword's frame handling and rendering, 
so I can't make bigger improvements.

> But fixing the normal case (table in one page) would
> already be an improvement :-)
I tried to fix, the fix avoids overlapping and moves the rows. It only works 
if the table is on one page. But there is still a problem: I can't resize the 
first row. Perhaps somebody has idea what the reason for this could be.

["rowpatch.diff" (text/x-diff)]

Index: kword/kwtableframeset.cc
===================================================================
RCS file: /home/kde/koffice/kword/kwtableframeset.cc,v
retrieving revision 1.259
diff -u -r1.259 kwtableframeset.cc
--- kword/kwtableframeset.cc	6 Dec 2003 22:52:36 -0000	1.259
+++ kword/kwtableframeset.cc	8 Dec 2003 21:13:47 -0000
@@ -727,7 +727,21 @@
 void KWTableFrameSet::resizeRow( unsigned int row, double y )
 {
     kdDebug() << k_funcinfo << row << "," << y << endl;
-    m_rowPositions[ row ] = y;
+    double difference = m_rowPositions[row];
+    if ((row != 0) && (y - m_rowPositions[ row-1 ] < s_minFrameHeight))
+      m_rowPositions[ row ] = m_rowPositions[ row-1 ] + s_minFrameHeight;
+    else
+      if ((row != getRows()) && (m_rowPositions[ row + 1 ] - y < s_minFrameHeight))
+        m_rowPositions[row] = m_rowPositions[ row + 1 ] - s_minFrameHeight;
+      else
+        m_rowPositions[ row ] = y;
+    difference = m_rowPositions[row] - difference;
+
+    //move all rows under 'row'
+    if (row != 0)
+       for (int i=row+1; i< m_rowPositions.count(); i++)
+           m_rowPositions[i] = m_rowPositions[i] + difference;
+
     // move all cells under 'row'
     for (TableIter cell(this); cell; ++cell) {
         if ( cell->rowAfter() >= row ) {


____________________________________
koffice mailing list
koffice@mail.kde.org
To unsubscribe please visit:
https://mail.kde.org/mailman/listinfo/koffice


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

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