xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerem...@apache.org
Subject svn commit: r619313 - /xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/fo/FOTreeBuilder.java
Date Thu, 07 Feb 2008 09:14:16 GMT
Author: jeremias
Date: Thu Feb  7 01:14:15 2008
New Revision: 619313

URL: http://svn.apache.org/viewvc?rev=619313&view=rev
Log:
Make sure no events are now just silently swallowed because after upgrading a user doesn't
know about the event system.

Modified:
    xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/fo/FOTreeBuilder.java

Modified: xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/fo/FOTreeBuilder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/fo/FOTreeBuilder.java?rev=619313&r1=619312&r2=619313&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/fo/FOTreeBuilder.java
(original)
+++ xmlgraphics/fop/branches/Temp_ProcessingFeedback/src/java/org/apache/fop/fo/FOTreeBuilder.java
Thu Feb  7 01:14:15 2008
@@ -35,6 +35,8 @@
 import org.apache.fop.apps.FOUserAgent;
 import org.apache.fop.apps.FormattingResults;
 import org.apache.fop.area.AreaTreeHandler;
+import org.apache.fop.events.EventBroadcaster;
+import org.apache.fop.events.LoggingEventListener;
 import org.apache.fop.fo.ElementMapping.Maker;
 import org.apache.fop.fo.extensions.ExtensionElementMapping;
 import org.apache.fop.fo.pagination.Root;
@@ -147,6 +149,15 @@
             throw new IllegalStateException("FOTreeBuilder (and the Fop class) cannot be
reused."
                     + " Please instantiate a new instance.");
         }
+        
+        //Backwards-compatibility: Make sure at least the LoggingEventListener is plugged
in
+        //so no events are just silently swallowed.
+        EventBroadcaster broadcaster = userAgent.getEventBroadcaster(); 
+        if (broadcaster.getListenerCount() == 0) {
+            broadcaster.addEventListener(
+                    new LoggingEventListener(LogFactory.getLog(FOUserAgent.class)));
+        }
+        
         used = true;
         empty = true;
         rootFObj = null;    // allows FOTreeBuilder to be reused



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message