[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-11 23:06:04
[Download RAW message or body]
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
["rowpatch3.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 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 ) {
____________________________________
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