[
https://issues.apache.org/jira/browse/FOP-2469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14560986#comment-14560986
]
Gregor Berg commented on FOP-2469:
----------------------------------
I tried to pass the information (whether the current LM is contained in an
element using automatic layout and whether the current invocation is part of
the preprocessing step) *down* using LayoutContexts (LCs).
What I found is:
* I had to propagate the two corresponding booleans at least 5 times to a new
childLC (= LayoutContext.newInstance())
** if this propagation is skipped/forgotten at any point in the LC chain, the
results are catastrophic
** since any LM should be able to contain any other LM, each LM's individual
version of creating a new LC (e.g. BlockStackingLM's
makeChildLayoutContext(LC)) needs to be adapted to *always* propagate these two
new values
* in the current version of the patch, most decisions of how to continue or
which value to return are based on the LM and its bottom-up lookup instead of
the LC
** the LM is almost always explicitly accessible, while the LC neets to be
passed down (up to 5 times, through stacks of other methods) into individual
methods were the decision is made
While I think that the second point might be solved through refactoring,
changing the way LCs are initialized throughout FOP (first point) may not be
feasible for this context.
A patch file illustrating such a refactoring
(2015-05-27-LM-to-LC-refactoring.patch: covers some cases, others will produce
incorrect results) will be attached shortly - it will show how much additional
effort would have to go into LC initialization.
> [PATCH] auto table layout
> -------------------------
>
> Key: FOP-2469
> URL: https://issues.apache.org/jira/browse/FOP-2469
> Project: FOP
> Issue Type: Bug
> Components: layout/unqualified
> Affects Versions: trunk
> Environment: Windows 7, JDK 7
> Reporter: Gregor Berg
> Fix For: trunk
>
> Attachments: 2015-05-13-auto-table-layout.patch,
> FOP2469-auto-table-layout.xml
>
>
> Hi,
> this is a patch which enables table-layout=auto. It is quite robust, it can
> not only handle linebreaks and pagebreaks, but it also copes with auto tables
> in fixed tables in auto tables.
> Essentially, it is the patch of issue FOP-2450 adapted to the trunk version
> of FOP.
> Best regards,
> Gregor
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)