git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_ProcessingFeedback@638302 13f79535-47bb-0310-9956-ffa450edef68Temp_ProcessingFeedback
@@ -63,4 +63,6 @@ Any reference to it will be considered a reference to the first occurrence in th | |||
<message key="org.apache.fop.events.ResourceEventProducer.imageError">Image not available. URI: {uri}. Reason: {e}{{locator}}</message> | |||
<message key="org.apache.fop.events.ResourceEventProducer.imageIOError">I/O error while loading image. URI: {uri}. Reason: {ioe}{{locator}}</message> | |||
<message key="org.apache.fop.events.ResourceEventProducer.ifoNoIntrinsiceSize">The intrinsic dimensions of an instream-foreign-object could not be determined.{{locator}}</message> | |||
<message key="org.apache.fop.layoutmgr.inline.InlineLevelEventProducer.leaderWithoutContent">fo:leader is set to "use-content" but has no content.{{locator}}</message> | |||
<message key="org.apache.fop.layoutmgr.inline.InlineLevelEventProducer.lineOverflows">Line {line} of a paragraph overflows the available area by {overflowLength,choice,50000#{overflowLength} millipoints|50000<more than 50 points}.{{locator}}</message> | |||
</catalogue> |
@@ -19,9 +19,19 @@ | |||
package org.apache.fop.layoutmgr.inline; | |||
import java.util.ArrayList; | |||
import java.util.Iterator; | |||
import java.util.LinkedList; | |||
import java.util.List; | |||
import java.util.ListIterator; | |||
import org.apache.commons.logging.Log; | |||
import org.apache.commons.logging.LogFactory; | |||
import org.apache.fop.apps.FOUserAgent; | |||
import org.apache.fop.area.Area; | |||
import org.apache.fop.area.Block; | |||
import org.apache.fop.area.LineArea; | |||
import org.apache.fop.area.inline.InlineArea; | |||
import org.apache.fop.fo.Constants; | |||
import org.apache.fop.fo.pagination.Title; | |||
import org.apache.fop.layoutmgr.AbstractBaseLayoutManager; | |||
@@ -34,19 +44,8 @@ import org.apache.fop.layoutmgr.PageSequenceLayoutManager; | |||
import org.apache.fop.layoutmgr.Position; | |||
import org.apache.fop.layoutmgr.PositionIterator; | |||
import org.apache.fop.layoutmgr.SpaceSpecifier; | |||
import org.apache.fop.area.Area; | |||
import org.apache.fop.area.LineArea; | |||
import org.apache.fop.area.inline.InlineArea; | |||
import java.util.LinkedList; | |||
import java.util.List; | |||
import java.util.ListIterator; | |||
import java.util.ArrayList; | |||
import java.util.Iterator; | |||
import org.apache.fop.traits.MinOptMax; | |||
import org.apache.fop.area.Block; | |||
/** | |||
* Content Layout Manager. | |||
* For use with objects that contain inline areas such as | |||
@@ -60,7 +59,6 @@ public class ContentLayoutManager extends AbstractBaseLayoutManager | |||
*/ | |||
private static Log log = LogFactory.getLog(ContentLayoutManager.class); | |||
private FOUserAgent userAgent; | |||
private Area holder; | |||
private int stackSize; | |||
private LayoutManager parentLM; |
@@ -0,0 +1,66 @@ | |||
/* | |||
* 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$ */ | |||
package org.apache.fop.layoutmgr.inline; | |||
import org.xml.sax.Locator; | |||
import org.apache.fop.events.EventBroadcaster; | |||
import org.apache.fop.events.EventProducer; | |||
/** | |||
* Event producer interface for inline-level layout managers. | |||
*/ | |||
public interface InlineLevelEventProducer extends EventProducer { | |||
/** | |||
* Factory class for the event producer. | |||
*/ | |||
class Factory { | |||
/** | |||
* Creates a new event producer. | |||
* @param broadcaster the event broadcaster to use | |||
* @return the new event producer | |||
*/ | |||
public static InlineLevelEventProducer create(EventBroadcaster broadcaster) { | |||
return (InlineLevelEventProducer)broadcaster.getEventProducerFor( | |||
InlineLevelEventProducer.class); | |||
} | |||
} | |||
/** | |||
* fo:leader with "use-content" but without children. | |||
* @param source the event source | |||
* @param loc the location of the error or null | |||
* @event.severity ERROR | |||
*/ | |||
void leaderWithoutContent(Object source, Locator loc); | |||
/** | |||
* A line overflows. | |||
* @param source the event source | |||
* @param line the number number | |||
* @param overflowLength the length by which the content overflows the available space (in mpt) | |||
* @param loc the location of the error or null | |||
* @event.severity WARN | |||
*/ | |||
void lineOverflows(Object source, int line, int overflowLength, Locator loc); | |||
} |
@@ -19,11 +19,15 @@ | |||
package org.apache.fop.layoutmgr.inline; | |||
import java.util.LinkedList; | |||
import java.util.List; | |||
import org.apache.fop.area.Trait; | |||
import org.apache.fop.area.inline.FilledArea; | |||
import org.apache.fop.area.inline.InlineArea; | |||
import org.apache.fop.area.inline.Space; | |||
import org.apache.fop.area.inline.TextArea; | |||
import org.apache.fop.fo.FObj; | |||
import org.apache.fop.fo.flow.Leader; | |||
import org.apache.fop.fonts.Font; | |||
import org.apache.fop.fonts.FontInfo; | |||
@@ -41,10 +45,6 @@ import org.apache.fop.layoutmgr.PositionIterator; | |||
import org.apache.fop.layoutmgr.TraitSetter; | |||
import org.apache.fop.traits.MinOptMax; | |||
import java.util.List; | |||
import java.util.LinkedList; | |||
import org.apache.fop.fo.FObj; | |||
/** | |||
* LayoutManager for the fo:leader formatting object | |||
*/ | |||
@@ -159,7 +159,9 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager { | |||
leaderArea = fa; | |||
} else if (fobj.getLeaderPattern() == EN_USECONTENT) { | |||
if (fobj.getChildNodes() == null) { | |||
fobj.getLogger().error("Leader use-content with no content"); | |||
InlineLevelEventProducer eventProducer = InlineLevelEventProducer.Factory.create( | |||
getFObj().getUserAgent().getEventBroadcaster()); | |||
eventProducer.leaderWithoutContent(this, getFObj().getLocator()); | |||
return null; | |||
} | |||
@@ -344,9 +346,7 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager { | |||
getPSLM().addIDToPage(fobj.getId()); | |||
} | |||
/** | |||
* {@inheritDoc} | |||
*/ | |||
/** {@inheritDoc} */ | |||
public int getBaseLength(int lengthBase, FObj fobj) { | |||
return getParent().getBaseLength(lengthBase, getParent().getFObj()); | |||
} |
@@ -26,6 +26,7 @@ import java.util.ListIterator; | |||
import org.apache.commons.logging.Log; | |||
import org.apache.commons.logging.LogFactory; | |||
import org.apache.fop.area.Area; | |||
import org.apache.fop.area.LineArea; | |||
import org.apache.fop.area.Trait; | |||
@@ -33,7 +34,6 @@ import org.apache.fop.area.inline.InlineArea; | |||
import org.apache.fop.datatypes.Length; | |||
import org.apache.fop.datatypes.Numeric; | |||
import org.apache.fop.fo.Constants; | |||
import org.apache.fop.fo.FONode; | |||
import org.apache.fop.fo.flow.Block; | |||
import org.apache.fop.fo.properties.CommonHyphenation; | |||
import org.apache.fop.fonts.Font; | |||
@@ -383,11 +383,12 @@ public class LineLayoutManager extends InlineStackingLayoutManager | |||
if (log.isWarnEnabled()) { | |||
int lack = difference + bestActiveNode.availableShrink; | |||
if (lack < 0) { | |||
InlineLevelEventProducer eventProducer | |||
= InlineLevelEventProducer.Factory.create( | |||
getFObj().getUserAgent().getEventBroadcaster()); | |||
eventProducer.lineOverflows(this, addedPositions + 1, | |||
-lack, getFObj().getLocator()); | |||
String textDiff = (lack < -50000 ? "more than 50 points" : (-lack) + "mpt"); | |||
log.warn(FONode.decorateWithContextInfo( | |||
"Line " + (addedPositions + 1) | |||
+ " of a paragraph overflows the available area by " | |||
+ textDiff + ".", getFObj())); | |||
} | |||
} | |||
@@ -1432,7 +1433,9 @@ public class LineLayoutManager extends InlineStackingLayoutManager | |||
auxCount++; | |||
} | |||
} | |||
log.trace(" Word to hyphenate: " + sbChars.toString()); | |||
if (log.isTraceEnabled()) { | |||
log.trace(" Word to hyphenate: " + sbChars.toString()); | |||
} | |||
// find hyphenation points | |||
HyphContext hc = getHyphenContext(sbChars); | |||
// ask each LM to hyphenate its word fragment |