From cf422d5d9335674b629c605485ed90d1e248248c Mon Sep 17 00:00:00 2001 From: Adrian Cumiskey Date: Fri, 19 Jun 2009 11:04:13 +0000 Subject: [PATCH] No code change here, just fixing the indentation of the if (useInclude) block that somehow got messed up by a previous commit/merge (http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPResourceManager.java?revision=746664&view=markup). git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@786453 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/fop/afp/AFPResourceManager.java | 57 +++++++++---------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/src/java/org/apache/fop/afp/AFPResourceManager.java b/src/java/org/apache/fop/afp/AFPResourceManager.java index c44698a10..09ebde296 100644 --- a/src/java/org/apache/fop/afp/AFPResourceManager.java +++ b/src/java/org/apache/fop/afp/AFPResourceManager.java @@ -165,39 +165,38 @@ public class AFPResourceManager { AFPResourceLevel resourceLevel = resourceInfo.getLevel(); ResourceGroup resourceGroup = streamer.getResourceGroup(resourceLevel); + useInclude &= resourceGroup != null; if (useInclude) { - - boolean usePageSegment = dataObjectInfo.isCreatePageSegment(); - - // if it is to reside within a resource group at print-file or external level - if (resourceLevel.isPrintFile() || resourceLevel.isExternal()) { + boolean usePageSegment = dataObjectInfo.isCreatePageSegment(); + + // if it is to reside within a resource group at print-file or external level + if (resourceLevel.isPrintFile() || resourceLevel.isExternal()) { + if (usePageSegment) { + String pageSegmentName = "S10" + namedObj.getName().substring(3); + namedObj.setName(pageSegmentName); + PageSegment seg = new PageSegment(pageSegmentName); + seg.addObject(namedObj); + namedObj = seg; + } + + // wrap newly created data object in a resource object + namedObj = dataObjectFactory.createResource(namedObj, resourceInfo, objectType); + } + + // add data object into its resource group destination + resourceGroup.addObject(namedObj); + + // create the include object + objectName = namedObj.getName(); if (usePageSegment) { - String pageSegmentName = "S10" + namedObj.getName().substring(3); - namedObj.setName(pageSegmentName); - PageSegment seg = new PageSegment(pageSegmentName); - seg.addObject(namedObj); - namedObj = seg; + includePageSegment(dataObjectInfo, objectName); + pageSegmentMap.put(resourceInfo, objectName); + } else { + includeObject(dataObjectInfo, objectName); + // record mapping of resource info to data object resource name + includeNameMap.put(resourceInfo, objectName); } - - // wrap newly created data object in a resource object - namedObj = dataObjectFactory.createResource(namedObj, resourceInfo, objectType); - } - - // add data object into its resource group destination - resourceGroup.addObject(namedObj); - - // create the include object - objectName = namedObj.getName(); - if (usePageSegment) { - includePageSegment(dataObjectInfo, objectName); - pageSegmentMap.put(resourceInfo, objectName); - } else { - includeObject(dataObjectInfo, objectName); - // record mapping of resource info to data object resource name - includeNameMap.put(resourceInfo, objectName); - } - } else { // not to be included so inline data object directly into the current page dataStream.getCurrentPage().addObject(namedObj); -- 2.39.5