pbwest      2002/10/02 00:26:01

  Modified:    src/org/apache/fop/fo/pagination Tag: FOP_0-20-0_Alt-Design
                        FoSimplePageMaster.java
  Log:
  Access master-name through propertySets.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.4   +12 -7     
xml-fop/src/org/apache/fop/fo/pagination/Attic/FoSimplePageMaster.java
  
  Index: FoSimplePageMaster.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Attic/FoSimplePageMaster.java,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- FoSimplePageMaster.java   2 Oct 2002 01:30:59 -0000       1.1.2.3
  +++ FoSimplePageMaster.java   2 Oct 2002 07:26:01 -0000       1.1.2.4
  @@ -11,6 +11,7 @@
   
   // FOP
   import org.apache.fop.fo.FOAttributes;
  +import org.apache.fop.fo.PropNames;
   import org.apache.fop.xml.XMLEvent;
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.fo.FObjects;
  @@ -19,6 +20,8 @@
   import org.apache.fop.fo.FOTree;
   import org.apache.fop.fo.expr.PropertyException;
   import org.apache.fop.datastructs.Tree;
  +import org.apache.fop.datatypes.PropertyValue;
  +import org.apache.fop.datatypes.NCName;
   
   /**
    * Implements the fo:simple-page-master flow object
  @@ -42,11 +45,13 @@
           super(foTree, FObjectNames.SIMPLE_PAGE_MASTER, parent, event,
                 FObjects.LAYOUT_SET);
           System.out.println("FOAttributes: " + event);
  -        try {
  -            masterName = foAttributes.getFoAttrValue("master-name");
  -        } catch (PropertyException e) {
  -            throw new FOPException(e.getMessage());
  -        }
  +        // Check that the property has been set
  +        PropertyValue name = propertySet[PropNames.MASTER_NAME];
  +        if (name == null)
  +            throw new PropertyException("master-name property not set");
  +        if (name.getType() != PropertyValue.NCNAME)
  +            throw new PropertyException("master-name property not an NCName.");
  +        masterName = ((NCName)name).getNCName();
           // Process regions here
           XMLEvent ev = xmlevents.getEndElement(event);
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to