You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2004/11/01 16:04:04 UTC

cvs commit: xml-fop/src/java/org/apache/fop/render/rtf RTFHandler.java

jeremias    2004/11/01 07:04:03

  Modified:    src/java/org/apache/fop/render/rtf RTFHandler.java
  Log:
  Logging a warning for a current limitation.
  Style
  
  Revision  Changes    Path
  1.38      +23 -21    xml-fop/src/java/org/apache/fop/render/rtf/RTFHandler.java
  
  Index: RTFHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/RTFHandler.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- RTFHandler.java	20 Oct 2004 17:53:35 -0000	1.37
  +++ RTFHandler.java	1 Nov 2004 15:04:03 -0000	1.38
  @@ -53,7 +53,6 @@
   import org.apache.fop.fo.pagination.Flow;
   import org.apache.fop.fo.pagination.PageSequence;
   import org.apache.fop.fo.pagination.SimplePageMaster;
  -import org.apache.fop.fo.properties.Property;
   import org.apache.fop.fo.Constants;
   import org.apache.fop.fo.FOText;
   import org.apache.fop.render.rtf.rtflib.rtfdoc.ITableAttributes;
  @@ -105,10 +104,10 @@
       private boolean bDeferredExecution;  //true, if currently called handler was not
                                            //called while SAX parsing, but was called
                                            //by invokeDeferredEvent.
  -    private boolean bPrevHeaderSpecified = false;//true, if there has been a
  -                                                 //header in any page-sequence
  -    private boolean bPrevFooterSpecified = false;//true, if there has been a
  -                                                 //footer in any page-sequence
  +    private boolean bPrevHeaderSpecified = false; //true, if there has been a
  +                                                  //header in any page-sequence
  +    private boolean bPrevFooterSpecified = false; //true, if there has been a
  +                                                  //footer in any page-sequence
       private boolean bHeaderSpecified = false;  //true, if there is a header
                                                  //in current page-sequence
       private boolean bFooterSpecified = false;  //true, if there is a footer
  @@ -128,7 +127,7 @@
           this.os = os;
           bDefer = false;
           bDeferredExecution = false;
  -        iNestCount=0;
  +        iNestCount = 0;
           FontSetup.setup(fontInfo, null);
           log.warn(ALPHA_WARNING);
       }
  @@ -169,7 +168,7 @@
               }
   
               sect = docArea.newSection();
  -
  +            
               //read page size and margins, if specified
               
               String reference = pageSeq.getMasterReference();
  @@ -182,6 +181,8 @@
                   sect.getRtfAttributes().set(
                       PageAttributesConverter.convertPageAttributes(
                               pagemaster));
  +            } else {
  +                log.warn("Only simple-page-masters are supported on page-sequences: " + reference);
               }
   
               builderContext.pushContainer(sect);
  @@ -215,6 +216,7 @@
           }
   
           try {
  +            log.debug("starting flow: " + fl.getFlowName());
               if (fl.getFlowName().equals("xsl-region-body")) {
                   // if there is no header in current page-sequence but there has been
                   // a header in a previous page-sequence, insert an empty header.
  @@ -354,22 +356,22 @@
       public void endBlock(Block bl) {
           --iNestCount;
           
  -        if (!bDeferredExecution && iNestCount==0) {
  +        if (!bDeferredExecution && iNestCount == 0) {
               //If endBlock was called while SAX parsing, and the passed FO is Block
               //nested within another Block, stop deferring.
               //Now process all deferred FOs.
               bDefer = false;
               
  -            bDeferredExecution=true;
  +            bDeferredExecution = true;
               recurseFONode(bl);
  -            bDeferredExecution=false;
  +            bDeferredExecution = false;
               
               //exit function, because the code has already beed executed while 
               //deferred execution.   
               return;
           }
           
  -        if(bDefer) {
  +        if (bDefer) {
               return;
           }
           
  @@ -428,7 +430,7 @@
        * @see org.apache.fop.fo.FOEventHandler#endBlockContainer(BlockContainer)
        */
       public void endBlockContainer(BlockContainer bl) {
  -        if(bDefer) {
  +        if (bDefer) {
               return;
           }
           
  @@ -903,9 +905,9 @@
                   = (IRtfTextrunContainer)builderContext.getContainer(
                       IRtfTextrunContainer.class, true, this);
               
  -            RtfTextrun textrun=container.getTextrun();
  +            RtfTextrun textrun = container.getTextrun();
               
  -            RtfHyperLink link=textrun.addHyperlink(new RtfAttributes());
  +            RtfHyperLink link = textrun.addHyperlink(new RtfAttributes());
               
               if (basicLink.getExternalDestination() != null) {
                   link.setExternalURL(basicLink.getExternalDestination());
  @@ -952,7 +954,7 @@
               
               final RtfExternalGraphic newGraphic = c.getTextrun().newImage();
          
  -            Property p = null; 
  +            //Property p = null; 
                  
               //get source file
               newGraphic.setURL(eg.getSrc());
  @@ -1099,8 +1101,8 @@
           }
           
           try {
  -            RtfAttributes rtfAttr= 
  -                    TextAttributesConverter.convertCharacterAttributes(c);
  +            RtfAttributes rtfAttr 
  +                    = TextAttributesConverter.convertCharacterAttributes(c);
   
               IRtfTextrunContainer container
                   = (IRtfTextrunContainer)builderContext.getContainer(
  @@ -1109,7 +1111,7 @@
               RtfTextrun textrun = container.getTextrun();
               
               textrun.pushAttributes(rtfAttr);            
  -            textrun.addString(new String(new char[] { c.getCharacter() }));
  +            textrun.addString(new String(new char[] {c.getCharacter()}));
               textrun.popAttributes();
            } catch (IOException ioe) {
               // FIXME could we throw Exception in all FOEventHandler events?
  @@ -1135,7 +1137,7 @@
                       IRtfTextrunContainer.class, true, this);
                       
               RtfTextrun textrun = container.getTextrun();
  -            textrun.addString(new String(data, start, length-start));
  +            textrun.addString(new String(data, start, length - start));
            } catch (IOException ioe) {
               // FIXME could we throw Exception in all FOEventHandler events?
               log.error("characters: " + ioe.getMessage());
  @@ -1292,7 +1294,7 @@
           invokeDeferredEvent(foNode, true);
           
           if (foNode.getChildNodes() != null) {
  -            for(Iterator it = foNode.getChildNodes(); it.hasNext() ; ) {
  +            for (Iterator it = foNode.getChildNodes(); it.hasNext();) {
                   recurseFONode( (FONode) it.next() );
               }
           }
  
  
  

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