Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,8 @@ public void updateData2(KnuthNode bestActiveNode,
InlineLevelEventProducer eventProducer
= InlineLevelEventProducer.Provider.get(
getFObj().getUserAgent().getEventBroadcaster());
if (curChildLM.getFObj() == null) {
// curChildLM is null on the float re-layout pass (PageBreaker.handleFloatLayout)
if (curChildLM == null || curChildLM.getFObj() == null) {
eventProducer.lineOverflows(this, getFObj().getName(), bestActiveNode.line,
-lack, getFObj().getLocator());
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<testcase>
<info>
<p>
This test checks a line that overflows beside a float wider than the measure. On the float
re-layout pass the line breaking algorithm reported the overflow through curChildLM, which
is null there, and FOP threw a NullPointerException instead of reporting it.
</p>
</info>
<fo>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="page" page-width="595pt" page-height="842pt" margin="85pt">
<fo:region-body/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="page">
<fo:flow flow-name="xsl-region-body">
<fo:block><fo:float float="start"><fo:block-container width="480pt" height="200pt"><fo:block> </fo:block></fo:block-container></fo:float></fo:block>
<fo:block><fo:block>block child</fo:block><fo:inline>Overflowing ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ</fo:inline></fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</fo>
<checks>
<eval expected="1" xpath="count(//pageViewport)"/>
<true xpath="boolean(//word[starts-with(., 'ABCDEFGHIJ')])"/>
</checks>
</testcase>