Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjphillips2009-01-29 14:41:33 +0000
committerjphillips2009-01-29 14:41:33 +0000
commit242c75de4c91ee78652f2f6a5b9bfc29be3926b2 (patch)
treea26d87c00f5e07bd8148342dbdf033f0cfe8d83a /org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render
parent7286e2e1650019dfe92f96e96a1912e3b2484fe4 (diff)
downloadorg.eclipse.osee-242c75de4c91ee78652f2f6a5b9bfc29be3926b2.tar.gz
org.eclipse.osee-242c75de4c91ee78652f2f6a5b9bfc29be3926b2.tar.xz
org.eclipse.osee-242c75de4c91ee78652f2f6a5b9bfc29be3926b2.zip
Diffstat (limited to 'org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render')
-rw-r--r--org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java42
1 files changed, 25 insertions, 17 deletions
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java
index fac6d84bc5d..ea3cbc846e3 100644
--- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java
+++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java
@@ -114,6 +114,7 @@ public class WordTemplateProcessor {
private List<AttributeElement> attributeElements = new LinkedList<AttributeElement>();
final List<Artifact> nonTemplateArtifacts = new LinkedList<Artifact>();
private Set<String> ignoreAttributeExtensions = new HashSet<String>();
+ private Set<Artifact> processedArtifacts = new HashSet<Artifact>();
private int previousTemplateCopyIndex;
private IRenderer renderer;
@@ -302,6 +303,8 @@ public class WordTemplateProcessor {
for (Artifact artifact : artifacts) {
processObjectArtifact(artifact, wordMl, outlineType, presentationType, artifacts.size() > 1);
}
+ //maintain a list of artifacts that have been processed so we do not have duplicates.
+ processedArtifacts.clear();
}
/**
@@ -422,26 +425,31 @@ public class WordTemplateProcessor {
private void processObjectArtifact(Artifact artifact, WordMLProducer wordMl, String outlineType, PresentationType presentationType, boolean multipleArtifacts) throws OseeCoreException {
if (!artifact.isOfType(WordArtifact.WHOLE_WORD) && !artifact.isOfType("Native")) {
- if (outlining) {
- String headingText = artifact.getSoleAttributeValue(headingAttributeName, "");
- CharSequence paragraphNumber = wordMl.startOutlineSubSection("Times New Roman", headingText, outlineType);
-
- VariableMap options = renderer.getOptions();
- if (renderer.getBooleanOption(WordTemplateRenderer.UPDATE_PARAGRAPH_NUMBER_OPTION)) {
- if (artifact.isAttributeTypeValid("Imported Paragraph Number")) {
- artifact.setSoleAttributeValue("Imported Paragraph Number", paragraphNumber.toString());
- artifact.persistAttributes((SkynetTransaction) options.getValue(ITemplateRenderer.TRANSACTION_OPTION));
+ //If the artifact has not been processed
+ if (!processedArtifacts.contains(artifact)) {
+ if (outlining) {
+ String headingText = artifact.getSoleAttributeValue(headingAttributeName, "");
+ CharSequence paragraphNumber =
+ wordMl.startOutlineSubSection("Times New Roman", headingText, outlineType);
+
+ VariableMap options = renderer.getOptions();
+ if (renderer.getBooleanOption(WordTemplateRenderer.UPDATE_PARAGRAPH_NUMBER_OPTION)) {
+ if (artifact.isAttributeTypeValid("Imported Paragraph Number")) {
+ artifact.setSoleAttributeValue("Imported Paragraph Number", paragraphNumber.toString());
+ artifact.persistAttributes((SkynetTransaction) options.getValue(ITemplateRenderer.TRANSACTION_OPTION));
+ }
}
}
- }
- processAttributes(artifact, wordMl, presentationType, multipleArtifacts);
- if (recurseChildren) {
- for (Artifact childArtifact : artifact.getChildren()) {
- processObjectArtifact(childArtifact, wordMl, outlineType, presentationType, multipleArtifacts);
+ processAttributes(artifact, wordMl, presentationType, multipleArtifacts);
+ if (recurseChildren) {
+ for (Artifact childArtifact : artifact.getChildren()) {
+ processObjectArtifact(childArtifact, wordMl, outlineType, presentationType, multipleArtifacts);
+ }
}
- }
- if (outlining) {
- wordMl.endOutlineSubSection();
+ if (outlining) {
+ wordMl.endOutlineSubSection();
+ }
+ processedArtifacts.add(artifact);
}
} else {
nonTemplateArtifacts.add(artifact);

Back to the top