Bug 40694 - Image gets moved into another area even if there is space
Summary: Image gets moved into another area even if there is space
Status: CLOSED WONTFIX
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: page-master/layout (show other bugs)
Version: 0.20.5
Hardware: PC Windows XP
: P4 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-06 05:32 UTC by Denis Mikhalkin
Modified: 2012-04-01 13:49 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Mikhalkin 2006-10-06 05:32:37 UTC
Sorry, can't provide test at this moment - need to filter out proprietary
information.

But, if you look at the code of ExternalGraphics and Area, you may notice the
following:

// We estimate the space left in the area

            if (area.spaceLeft() < (height + spaceBefore)) {
                return Status.AREA_FULL_NONE;
            }

// ... blah

// We modify the space left in the area (addDisplaySpace changes
Area.currentHeight, and spaceLeft uses currentHeight)
            if ((spaceBefore != 0) && (this.marker == 0)) {
                area.addDisplaySpace(spaceBefore);
            }

// ... blah

// We modify the space left in the area 
            if (spaceAfter != 0) {
                area.addDisplaySpace(spaceAfter);
            }

// We use the space left in the area, but AFTER the modifications above
            if (breakBefore == BreakBefore.PAGE
                    || ((spaceBefore + imageArea.getHeight())
                        > area.spaceLeft())) {
                return Status.FORCE_PAGE_BREAK;
            }


The result is - sometimes image doesn't fit.  Reading spaceLeft into a variable
before modification and using the variable in the remaining places fixed the
problem, for me at least.
Comment 1 Chris Bowditch 2006-10-09 02:19:56 UTC
Fop 0.20.x is no longer supported. Please retest your sample with FOP 
0.92beta. Feel free to re-open the bug if your test fails on 0.92beta.
Comment 2 Glenn Adams 2012-04-01 13:49:53 UTC
batch transition to closed remaining pre-FOP1.0 resolved bugs