Patch for when rowspan or colspan equals 0

Carlos Licea carlos_licea at hotmail.com
Fri Apr 3 21:30:27 BST 2009


Dear kfm-devel list:
	I've been working on a patch to solve the behaviour for when a a cell is 
defined to have a rowspan or a colspan of 0.	Attached is a patch which nearly 
solves the problem. The colspan is solved but the rowspan, even though the 
code is doing nearly the same as for colspan, of course adapted for rows; and 
it's behaving like I intended, is not solving the problem yet. Let me explain 
how's the process:
	->If we find that the current column has a span of 0 we save it as "write this 
cell in it's row whenever you reach the next column". That's it we save the 
cell and we wait till we've changed the column, (say, from 0 to 1) and then we 
mark the cell 0,0 as occupied and update the span properly (from 1 to 2 in 
this case).
	->For rows is the same story, we save the cell and the column number whenever 
we find ourselves in the same column we take ownership of the cell and 
increment the span by one.
	This seems to work perfectly for the colspan but for some reason I cannot 
understand it just doesn't cut it for the rowspan after span > 2.
	That's why I thought I had already solved it 'couse I was testing 
testcase.html. But when I incremented the number of rows (in testcase2.html) 
the cell wasn't expanded properly. Right now I can't answer why so although 
I'll keep looking I decided to let new eyes have a look to this.
 	Something even weirder happens if you test case found in 
http://bugsfiles.kde.org/attachment.cgi?id=8334 even though it behaves nearly 
like the testcase2.html (in which is not expanded beyond rowspan>2) it has a 
new behaviour: one of the cells is dropped! (this is quite a surprise and 
*might* not be my fault since it seems that what I receive is that row as the 
current one), so further investigation is needed, but we're almost there.

	Finally I'm concerned that since I need to change the colspan and rowspan of 
the cell from 0 the the actual number we might change the behaviour when, say, 
a new row/column is inserted... will it reset the span to 0 so that we can 
recalculate it properly again or will it just live happily thinking that its 
span must not be recalculated and hence leaving a row or a column not covered? 
if so, should we add a flag so that we see "oh there's this special cell, 
recalculate it's span not meter which span it has"?. I can't answer those 
questions right now and I'd like to have some help with them.

PS:remember the idea of inserting the cells on a later time, once all the rows 
and cols are inserted? can't be done we need to mark the cell as used before 
someone else takes it.
PPS: the patch is a little bigger than it should since I added comments and 
proper indentation to the code so that it can be more easily read plus 
KDevelop erased trailing spaces.

--
Carlos

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20090403/cf6152a5/attachment.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20090403/cf6152a5/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tables.diff
Type: text/x-patch
Size: 8589 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20090403/cf6152a5/attachment.bin>


More information about the kfm-devel mailing list