Bug 47347

Summary: [PATCH] auto table layout - yet another patch
Product: Fop - Now in Jira Reporter: Achim Derigs <achim.derigs>
Component: page-master/layoutAssignee: fop-dev
Status: NEW ---    
Severity: normal CC: apache.bugzilla, carsten.pfeiffer, jens.b
Priority: P2    
Version: trunk   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Bug Depends on: 40271    
Bug Blocks:    
Attachments: auto-table-layout.diff

Description Achim Derigs 2009-06-10 07:14:38 UTC
Hi,

this is yet another patch to enable auto table layout. I've done some work for one of our customers who needs auto table layout. This patch is doing the job.

I've tried several ways to minimize side effects (and implementation efforts) as much as possible. Now it hardly affects the existing process.

May be there are cases which are not considered currently. It's certainly an improvable approach.

Best Regards
Achim
Comment 1 Achim Derigs 2009-06-10 07:21:24 UTC
Created attachment 23787 [details]
auto-table-layout.diff
Comment 2 Vincent Hennebert 2009-06-11 03:54:03 UTC
Hi Achim,

(In reply to comment #0)
> Hi,
> 
> this is yet another patch to enable auto table layout. I've done some work for
> one of our customers who needs auto table layout. This patch is doing the job.
> 
> I've tried several ways to minimize side effects (and implementation efforts)
> as much as possible. Now it hardly affects the existing process.
> 
> May be there are cases which are not considered currently. It's certainly an
> improvable approach.
> 
> Best Regards
> Achim

Thank you very much for your patch. It may prove useful to other users who need this feature to work on simple tables.

We are not going to apply it to the Trunk, though, as it only cover very simple cases. For example, it doesn't handle the case of a cell consisting of a long paragraph that must be broken into lines. Also it doesn't seem to do well with nested tables.

Still, like I said above some users with only simple cases may be interested in applying this patch to their local copy.

I hope you understand.
Thanks,
Vincent
Comment 3 Peterdk 2010-03-23 19:21:53 UTC
I tried the patch.
It doesn't work with current trunk revision, but it does (of course) work with the revision specified in the diff (783305). Not really a problem.

It works great for simple tables. Main problem I have with the patch is that it doesn't work when the block that contains the table, or the table itself has a margin-left set. It falls back to the original FOP behaviour, which is unwanted.

That's quite a problem, since you can't layout any table on the page this way.

I hope this can be easily adjusted, but since this patch is almost a year old, I am afraid it won't happen. Will try to look into it myself, but the codebase is too advanced for me to really grasp.

I do have some money to spend as a bounty for getting it to work however.
Comment 4 Peterdk 2010-03-26 13:05:31 UTC
In case anyone needs to use this auto layout table with a margin-left set on containing block:
Use a 2 column table. Set first column-width to the required left-margin. Fill the second column with the table that you want auto-layouted. This way the auto-layout still works and you have a left margin.

So, this will do for me.
Comment 5 Glenn Adams 2012-04-07 01:42:05 UTC
resetting P2 open bugs to P3 pending further review
Comment 6 Glenn Adams 2012-04-11 03:22:13 UTC
increase priority for bugs with a patch