CVS: jfor/src/org/jfor/jfor/converter TextAttributesConverter.java,1.10,1.11 TableAttributesConverter.java,1.10,1.11

Peter Herweg <[email protected]> Sun, 12 Oct 2003 06:45:53 -0700
Newsgroups gmane.text.xml.jfor.cvs
Message-ID <[email protected]>
Update of /cvsroot/jfor/jfor/src/org/jfor/jfor/converter
In directory sc8-pr-cvs1:/tmp/cvs-serv11588/converter

Modified Files:
	TextAttributesConverter.java TableAttributesConverter.java 
Log Message:
support for margin-left attribute added to fo:block and fo:table

Index: TextAttributesConverter.java
===================================================================
RCS file: /cvsroot/jfor/jfor/src/org/jfor/jfor/converter/TextAttributesConverter.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** TextAttributesConverter.java	18 Feb 2003 16:10:49 -0000	1.10
--- TextAttributesConverter.java	12 Oct 2003 13:45:51 -0000	1.11
***************
*** 63,66 ****
--- 63,69 ----
  // $Id$
  // $Log$
+ // Revision 1.11  2003/10/12 13:45:51  pherweg
+ // support for margin-left attribute added to fo:block and fo:table
+ //
  // Revision 1.10  2003/02/18 16:10:49  rmarra
  // Contributions Normand Massé

***************
*** 200,205 ****
          }
  
  
! 
          if (AbstractBuilder.hasAttributeValue (attrs, "text-align", "center", defAttrs ))
          {
--- 203,233 ----
          }
  
+         /**
+          * Added by Peter Herweg, 2003-10-12
+          */
+         // margin left
+         final String marginLeft = AbstractBuilder.getAttribute(attrs,null,"margin-left", false, defAttrs );
+         if (marginLeft != null) {
+             if (result == null) result = new RtfAttributes();
+             result.set(RtfText.LEFT_INDENT_BODY, (int)FoUnitsConverter.getInstance().convertToTwips(marginLeft));
+         }
+         else
+         {
+             if (result == null) result = new RtfAttributes();
+             result.set(RtfText.LEFT_INDENT_BODY, 0);
+         }
+         //margin right
+         final String marginRight = AbstractBuilder.getAttribute(attrs,null,"margin-right", false, defAttrs );
+         if (marginRight != null) {
+             if (result == null) result = new RtfAttributes();
+             result.set(RtfText.RIGHT_INDENT_BODY, (int)FoUnitsConverter.getInstance().convertToTwips(marginRight));
+         }
+         else
+         {
+             if (result == null) result = new RtfAttributes();
+             result.set(RtfText.RIGHT_INDENT_BODY, 0);
+         }
  
!         //Alignment
          if (AbstractBuilder.hasAttributeValue (attrs, "text-align", "center", defAttrs ))
          {

Index: TableAttributesConverter.java
===================================================================
RCS file: /cvsroot/jfor/jfor/src/org/jfor/jfor/converter/TableAttributesConverter.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** TableAttributesConverter.java	3 Jul 2003 17:51:52 -0000	1.10
--- TableAttributesConverter.java	12 Oct 2003 13:45:51 -0000	1.11
***************
*** 64,67 ****
--- 64,70 ----
  // $Id$
  // $Log$
+ // Revision 1.11  2003/10/12 13:45:51  pherweg
+ // support for margin-left attribute added to fo:block and fo:table
+ //
  // Revision 1.10  2003/07/03 17:51:52  pherweg
  // support for height attribute at table-row tag added
***************
*** 378,381 ****
--- 381,390 ----
              (int)FoUnitsConverter.getInstance().convertToTwips("1pt"));
          }
+ 
+          // margin left
+          final String marginLeft = AbstractBuilder.getAttribute(attrs,null,"margin-left", false, defAttrs );
+          if (marginLeft != null) {
+              attrib.set(ITableAttributes.ATTR_ROW_LEFT_INDENT, (int)FoUnitsConverter.getInstance().convertToTwips(marginLeft));
+          }
  
          return convertAttributes(attrs, attrib,false);



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php