From koffice Thu Dec 11 23:06:04 2003 From: Sven Langkamp Date: Thu, 11 Dec 2003 23:06:04 +0000 To: koffice Subject: Re: [PATCH] Fix table column resizing X-MARC-Message: https://marc.info/?l=koffice&m=107118390106272 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_chP2/W+SQgFiHtQ" --Boundary-00=_chP2/W+SQgFiHtQ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Am Mittwoch, 10. Dezember 2003 00:49 schrieb Sven Langkamp: > Am Montag, 8. Dezember 2003 23:14 schrieb Thomas Zander: > > Please substitute m_rowPositions.count() with getRows(). > > Ok, changed. > > I removed row resizing form recalcRows(), so that the first row can be > changed too: > - if(lineNumber >= (int)row) { // below changed row > - if(*(j)-last < s_minFrameHeight) // Never make it smaller > then allowed! > - difference += s_minFrameHeight - *(j) + last; > - last=*(j); > - kdDebug(32004) << "moving " << *(j) << " by " << > difference << "; to " << (*j) + difference << endl; > - (*j) += difference; // move line. > - } Sorry, I have posted this patch too early. I didn't mentioned one case. I returned to the original patch. Additionally the patch fixes #69170. Can someone review this and tell me if the solution for #69170 ist ok? Sorry again Sven Langkamp --Boundary-00=_chP2/W+SQgFiHtQ Content-Type: text/x-diff; charset="iso-8859-1"; name="rowpatch3.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="rowpatch3.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 11 Dec 2003 22:50:06 -0000 @@ -326,6 +326,7 @@ //if(activeCell) activeCell->frame(0)->setMinFrameHeight(0); } updateFrames(); + layout(); //kdDebug(32004) << "end KWTableFrameSet::recalcCols" << endl; } @@ -727,7 +728,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<= getRows(); i++) + m_rowPositions[i] = m_rowPositions[i] + difference; + // move all cells under 'row' for (TableIter cell(this); cell; ++cell) { if ( cell->rowAfter() >= row ) { --Boundary-00=_chP2/W+SQgFiHtQ Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ____________________________________ koffice mailing list koffice@mail.kde.org To unsubscribe please visit: https://mail.kde.org/mailman/listinfo/koffice --Boundary-00=_chP2/W+SQgFiHtQ--