Bug 53094 - [PATCH] block container overflow error message
Summary: [PATCH] block container overflow error message
Status: RESOLVED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: all
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-17 13:54 UTC by Luis Bernardo
Modified: 2012-04-27 00:42 UTC (History)
0 users



Attachments
patch (12.44 KB, patch)
2012-04-17 13:54 UTC, Luis Bernardo
Details | Diff
test case and output (5.66 KB, application/x-gzip)
2012-04-17 13:57 UTC, Luis Bernardo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luis Bernardo 2012-04-17 13:54:46 UTC
Created attachment 28624 [details]
patch

If a block-container element has the overflow attribute set to error-if-overflow and the content inside the container does overflow then FOP:
- throws an exception if the overflow is BPD (block progression direction)
- emits a warning if the overflow is IPD (inline progression direction)
The attached patch tries to fix this inconsistency in behavior by issuing an error message in both cases; also, if the overflow attribute is set to something else, a warning message is issued instead.
Comment 1 Luis Bernardo 2012-04-17 13:57:17 UTC
Created attachment 28625 [details]
test case and output

The attached files are:
- a test.fo file to check the issue
- the console output before and after the fix
- the PDF output file
Comment 2 Glenn Adams 2012-04-17 16:20:44 UTC
patch landed at http://svn.apache.org/viewvc?rev=1327157&view=rev

thanks, and good work luis!
Comment 3 Vincent Hennebert 2012-04-25 14:49:59 UTC
The inconsistency is still there if the overflow property has been set on a region (e.g., region-before).

The overflow shouldn't be handled by LineLM at all as that class does not have the necessary information to decide whether to issue a warning or throw an error. Some overflow event should instead be triggered on its parent LM that will handle it if it can, or pass it on to its parent and so on.

Vincent
Comment 4 Glenn Adams 2012-04-25 15:28:33 UTC
(In reply to comment #3)
> The inconsistency is still there if the overflow property has been set on a
> region (e.g., region-before).
> 
> The overflow shouldn't be handled by LineLM at all as that class does not have
> the necessary information to decide whether to issue a warning or throw an
> error. Some overflow event should instead be triggered on its parent LM that
> will handle it if it can, or pass it on to its parent and so on.

luis, can you provide a new patch to address this?
Comment 5 Luis Bernardo 2012-04-26 21:37:44 UTC
sure, but this patch was intentionally of limited scope. as the title and the description says, it was only meant to address the inconsistency in error/warn messages in a block container with the overflow attribute set to error-if-overflow. the fact that it does not address possible similar inconsistencies when overflow happens in other elements is not a surprise. in fact I knew it didn't address that. nevertheless, I do agree that extending this patch to handle some other overflow situations is a good idea and I will look into that.

for testing purposes then, it would be helpful to have a sample FO file that causes all kinds of overflows messages meant to be handled by the new patch. so Vincent, since you raised the issue, would you like to provide the example FO file?
Comment 6 Glenn Adams 2012-04-27 00:42:03 UTC
i would rather close this bug and open a new bug to address a similar problem in region-*; that new bug can include a reference to this bug in its descriptive information