Revision: 7875
http://svn.sourceforge.net/foray/?rev=7875&view=rev
Author: victormote
Date: 2006-09-03 15:03:10 -0700 (Sun, 03 Sep 2006)
Log Message:
-----------
1. Add warning if a conditional-page-master-reference refers to a non-existent page.
2. Don't include null items in the returned Set of page masters.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequence.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMAlternatives.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java 2006-09-03 21:32:08 UTC (rev 7874)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java 2006-09-03 22:03:10 UTC (rev 7875)
@@ -51,7 +51,6 @@
* {@inheritDoc}
*/
protected void validateAncestry() throws FOTreeException {
- /* Validate ancestry. */
if (! (this.getParent() instanceof RepeatablePMAlternatives)) {
throwException(getFullName() + " must be child of "
+ "fo:repeatable-page-master-alternatives.");
@@ -62,11 +61,18 @@
* {@inheritDoc}
*/
protected void validateProperties() throws FOTreeException {
- /* Validate properties. */
if (traitMasterReference() == null) {
logWarning(getFullName() + " has no master-reference, and "
+ "will be ignored.");
}
+ final LayoutMasterSet layoutMasterSet = repeatablePMAlternatives()
+ .pageSequenceMaster().layoutMasterSet();
+ if (layoutMasterSet.getSimplePageMaster(this.traitMasterReference())
+ == null) {
+ logWarning(getFullName() + "'" + this.traitMasterReference()
+ + "' has master-reference which matches \n"
+ + " no page definitions. It will be ignored.");
+ }
}
/**
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequence.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequence.java 2006-09-03 21:32:08 UTC (rev 7874)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequence.java 2006-09-03 22:03:10 UTC (rev 7875)
@@ -254,8 +254,8 @@
pageMasters = this.pageSequenceTemplate.getPages();
final Iterator iterator = pageMasters.iterator();
while (iterator.hasNext()) {
- final AbstractPageMaster pageMaster = (AbstractPageMaster)
- iterator.next();
+ final Object object = iterator.next();
+ final AbstractPageMaster pageMaster = (AbstractPageMaster) object;
if (! pageMaster.hasRegion(flow.traitFlowName())) {
return pageMaster;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMAlternatives.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMAlternatives.java 2006-09-03 21:32:08 UTC (rev 7874)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMAlternatives.java 2006-09-03 22:03:10 UTC (rev 7875)
@@ -120,7 +120,9 @@
(ConditionalPageMasterReference) this.children.get(i);
final AbstractPageMaster pageMaster = layoutSet.getSimplePageMaster(
conditional.traitMasterReference());
- returnSet.add(pageMaster);
+ if (pageMaster != null) {
+ returnSet.add(pageMaster);
+ }
}
return returnSet;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|