Re: cvs commit: xml-fop/src/java/org/apache/fop/render/rtf TableAttributesConverter.java
[Jeremias Maerki] Finn, it seems to me that you probably forgot the check in all your changes. FOP doesn't compile ATM. The method makeBorder is missing. Yes, I forgot. I'm sorry for the inconvenience. Glen, Thank You for temporarily fixing my mistake. regards, finn
Re: cvs commit: xml-fop/src/java/org/apache/fop/render/rtf TableAttributesConverter.java
Finn, it seems to me that you probably forgot the check in all your changes. FOP doesn't compile ATM. The method makeBorder is missing. On 01.10.2004 11:46:36 bckfnn wrote: bckfnn 2004/10/01 02:46:36 Modified:src/java/org/apache/fop/render/rtf TableAttributesConverter.java Log: Simplified the handling of length attributes. Attempt at setting borders correctly. Revision ChangesPath 1.16 +49 -140 xml-fop/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java Index: TableAttributesConverter.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- TableAttributesConverter.java 23 May 2004 17:00:00 - 1.15 +++ TableAttributesConverter.java 1 Oct 2004 09:46:36 - 1.16 snip/ +BorderAttributesConverter.makeBorder(propList, attrib, ITableAttributes.CELL_BORDER_TOP, +Constants.PR_BORDER_TOP_COLOR, +Constants.PR_BORDER_TOP_STYLE, +Constants.PR_BORDER_TOP_WIDTH); +BorderAttributesConverter.makeBorder(propList, attrib, ITableAttributes.CELL_BORDER_BOTTOM, +Constants.PR_BORDER_BOTTOM_COLOR, +Constants.PR_BORDER_BOTTOM_STYLE, +Constants.PR_BORDER_BOTTOM_WIDTH); +BorderAttributesConverter.makeBorder(propList, attrib, ITableAttributes.CELL_BORDER_LEFT, +Constants.PR_BORDER_LEFT_COLOR, +Constants.PR_BORDER_LEFT_STYLE, +Constants.PR_BORDER_LEFT_WIDTH); +BorderAttributesConverter.makeBorder(propList, attrib, ITableAttributes.CELL_BORDER_RIGHT, +Constants.PR_BORDER_RIGHT_COLOR, +Constants.PR_BORDER_RIGHT_STYLE, +Constants.PR_BORDER_RIGHT_WIDTH); Jeremias Maerki
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf TableAttributesConverter.java
pherweg 2004/01/30 02:51:53 Modified:src/java/org/apache/fop/render/rtf TableAttributesConverter.java Log: fixed runtime error while reading PR_BORDER_WIDTH or PR_BORDER_STYLE Revision ChangesPath 1.9 +29 -38 xml-fop/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java Index: TableAttributesConverter.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- TableAttributesConverter.java 18 Jan 2004 21:21:41 - 1.8 +++ TableAttributesConverter.java 30 Jan 2004 10:51:53 - 1.9 @@ -218,17 +218,7 @@ } // Border styles do not inherit from parent -if ((p = props.get(Constants.PR_BORDER_STYLE)) != null) { -log.warn(border-style not implemented. Please use border-style-left, - + ...-right, ...-top or ...-bottom); -/* -attrib.set(ITableAttributes.CELL_BORDER_LEFT, \\+convertAttributetoRtf(e.getEnum())); -attrib.set(ITableAttributes.CELL_BORDER_RIGHT, \\+convertAttributetoRtf(e.getEnum())); - attrib.set(ITableAttributes.CELL_BORDER_BOTTOM,\\+convertAttributetoRtf(e.getEnum())); -attrib.set(ITableAttributes.CELL_BORDER_TOP, \\+convertAttributetoRtf(e.getEnum())); -isBorderPresent=true; -*/ -} + ep = (EnumProperty)props.get(Constants.PR_BORDER_TOP_STYLE); if (ep != null ep.getEnum() != Constants.NONE) { attrib.set(ITableAttributes.CELL_BORDER_TOP, \\ @@ -254,9 +244,19 @@ isBorderPresent = true; } -if ((p = props.get(Constants.PR_BORDER_WIDTH)) != null) { -ListProperty listprop = (ListProperty)p; -LengthProperty lengthprop = (LengthProperty)listprop.getList().get(0); +//Currently there is only one border width supported in each cell. +p = props.get(Constants.PR_BORDER_LEFT_WIDTH); +if(p == null) { +p = props.get(Constants.PR_BORDER_RIGHT_WIDTH); +} +if(p == null) { +p = props.get(Constants.PR_BORDER_TOP_WIDTH); +} +if(p == null) { +p = props.get(Constants.PR_BORDER_BOTTOM_WIDTH); +} +if (p != null) { +LengthProperty lengthprop = (LengthProperty)p; Float f = new Float(lengthprop.getLength().getValue() / 1000f); String sValue = f.toString() + pt; @@ -351,26 +351,7 @@ * it is implemented that the border type is the value of the border * place. */ -if ((p = props.get(Constants.PR_BORDER_STYLE)) != null) { -log.warn(border-style not implemented. Please use border-style-left, - + ...-right, ...-top or ...-bottom); -/* -attrValue = new String(AbstractBuilder.getValue( attrs, border-style, defAttrs )); -attrib.set(ITableAttributes.ROW_BORDER_LEFT,\\ - + BorderAttributesConverter.convertAttributetoRtf(attrValue)); -attrib.set(ITableAttributes.ROW_BORDER_RIGHT,\\ - + BorderAttributesConverter.convertAttributetoRtf(attrValue)); -attrib.set(ITableAttributes.ROW_BORDER_HORIZONTAL,\\ - + BorderAttributesConverter.convertAttributetoRtf(attrValue)); -attrib.set(ITableAttributes.ROW_BORDER_VERTICAL,\\ - + BorderAttributesConverter.convertAttributetoRtf(attrValue)); -attrib.set(ITableAttributes.ROW_BORDER_BOTTOM,\\ - + BorderAttributesConverter.convertAttributetoRtf(attrValue)); -attrib.set(ITableAttributes.ROW_BORDER_TOP,\\ - + BorderAttributesConverter.convertAttributetoRtf(attrValue)); -isBorderPresent=true; -*/ -} + ep = (EnumProperty)props.get(Constants.PR_BORDER_TOP_STYLE); if (ep != null ep.getEnum() != Constants.NONE) { attrib.set(ITableAttributes.ROW_BORDER_TOP, \\ @@ -424,9 +405,19 @@ isBorderPresent = true; } -if ((p = props.get(Constants.PR_BORDER_WIDTH)) != null) { -ListProperty listprop = (ListProperty)p; -LengthProperty lengthprop = (LengthProperty)listprop.getList().get(0); +//Currently there is only one border width supported in each cell. +p = props.get(Constants.PR_BORDER_LEFT_WIDTH); +if(p == null) { +p = props.get(Constants.PR_BORDER_RIGHT_WIDTH); +} +if(p == null) { +p =
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf TableAttributesConverter.java TextAttributesConverter.java
pherweg 2004/01/18 13:21:41 Modified:src/java/org/apache/fop/render/rtf TableAttributesConverter.java TextAttributesConverter.java Log: replaced string constants with int constants Revision ChangesPath 1.8 +10 -10 xml-fop/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java Index: TableAttributesConverter.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- TableAttributesConverter.java 5 Jan 2004 00:44:59 - 1.7 +++ TableAttributesConverter.java 18 Jan 2004 21:21:41 - 1.8 @@ -229,25 +229,25 @@ isBorderPresent=true; */ } -ep = (EnumProperty)props.get(border-top-style); +ep = (EnumProperty)props.get(Constants.PR_BORDER_TOP_STYLE); if (ep != null ep.getEnum() != Constants.NONE) { attrib.set(ITableAttributes.CELL_BORDER_TOP, \\ + convertAttributetoRtf(ep.getEnum())); isBorderPresent = true; } -ep = (EnumProperty)props.get(border-bottom-style); +ep = (EnumProperty)props.get(Constants.PR_BORDER_BOTTOM_STYLE); if (ep != null ep.getEnum() != Constants.NONE) { attrib.set(ITableAttributes.CELL_BORDER_BOTTOM, \\ + convertAttributetoRtf(ep.getEnum())); isBorderPresent = true; } -ep = (EnumProperty)props.get(border-left-style); +ep = (EnumProperty)props.get(Constants.PR_BORDER_LEFT_STYLE); if (ep != null ep.getEnum() != Constants.NONE) { attrib.set(ITableAttributes.CELL_BORDER_LEFT, \\ + convertAttributetoRtf(ep.getEnum())); isBorderPresent = true; } -ep = (EnumProperty)props.get(border-right-style); +ep = (EnumProperty)props.get(Constants.PR_BORDER_RIGHT_STYLE); if (ep != null ep.getEnum() != Constants.NONE) { attrib.set(ITableAttributes.CELL_BORDER_RIGHT, \\ + convertAttributetoRtf(ep.getEnum())); @@ -272,7 +272,7 @@ // Column spanning : -NumberProperty n = (NumberProperty)props.get(number-columns-spanned); +NumberProperty n = (NumberProperty)props.get(Constants.PR_NUMBER_COLUMNS_SPANNED); if (n != null n.getNumber().intValue() 1) { attrib.set(ITableAttributes.COLUMN_SPAN, n.getNumber().intValue()); } @@ -371,7 +371,7 @@ isBorderPresent=true; */ } -ep = (EnumProperty)props.get(border-top-style); +ep = (EnumProperty)props.get(Constants.PR_BORDER_TOP_STYLE); if (ep != null ep.getEnum() != Constants.NONE) { attrib.set(ITableAttributes.ROW_BORDER_TOP, \\ + convertAttributetoRtf(ep.getEnum())); @@ -379,7 +379,7 @@ + convertAttributetoRtf(ep.getEnum())); isBorderPresent = true; } -ep = (EnumProperty)props.get(border-bottom-style); +ep = (EnumProperty)props.get(Constants.PR_BORDER_BOTTOM_STYLE); if (ep != null ep.getEnum() != Constants.NONE) { attrib.set(ITableAttributes.ROW_BORDER_BOTTOM,\\ + convertAttributetoRtf(ep.getEnum())); @@ -387,7 +387,7 @@ + convertAttributetoRtf(ep.getEnum())); isBorderPresent = true; } -ep = (EnumProperty)props.get(border-left-style); +ep = (EnumProperty)props.get(Constants.PR_BORDER_LEFT_STYLE); if (ep != null ep.getEnum() != Constants.NONE) { attrib.set(ITableAttributes.ROW_BORDER_LEFT, \\ + convertAttributetoRtf(ep.getEnum())); @@ -395,7 +395,7 @@ + convertAttributetoRtf(ep.getEnum())); isBorderPresent = true; } -ep = (EnumProperty)props.get(border-right-style); +ep = (EnumProperty)props.get(Constants.PR_BORDER_RIGHT_STYLE); if (ep != null ep.getEnum() != Constants.NONE) { attrib.set(ITableAttributes.ROW_BORDER_RIGHT,\\ + convertAttributetoRtf(ep.getEnum())); 1.8 +4 -4 xml-fop/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java Index: TextAttributesConverter.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- TextAttributesConverter.java 29 Dec
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf TableAttributesConverter.java
gmazza 2004/01/04 16:44:59 Modified:src/codegen properties.xsl src/java/org/apache/fop/fo Property.java PropertyList.java src/java/org/apache/fop/fo/expr LabelEndFunction.java NearestSpecPropFunction.java src/java/org/apache/fop/render/rtf TableAttributesConverter.java Log: More String--int conversions. Work primarily from Finn Bock's patch. Revision ChangesPath 1.26 +146 -22 xml-fop/src/codegen/properties.xsl Index: properties.xsl === RCS file: /home/cvs/xml-fop/src/codegen/properties.xsl,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- properties.xsl4 Jan 2004 05:42:03 - 1.25 +++ properties.xsl5 Jan 2004 00:44:59 - 1.26 @@ -563,9 +563,10 @@ return super.getSubpropMaker(subprop); } -protected Property setSubprop(Property baseProp, String subpropName, +protected Property setSubprop(Property baseProp, int subpropId, Property subProp) { /xsl:text +String subpropName = FOPropertyMapping.getPropertyName(subpropId); xsl:value-of select=datatype/ xsl:text val = baseProp.get/xsl:text xsl:value-of select=datatype/ @@ -769,14 +770,12 @@ xsl:if test=.//corresponding/@use-if-specified='true' xsl:text public boolean isCorrespondingForced(PropertyList propertyList) { -FObj parentFO = propertyList.getParentFObj(); -StringBuffer sbExpr=new StringBuffer();/xsl:text +FObj parentFO = propertyList.getParentFObj();/xsl:text xsl:for-each select=.//corresponding/propval xsl:text -sbExpr.setLength(0);/xsl:text +if (propertyList.getExplicit(/xsl:text xsl:apply-templates select=./ -xsl:text -if (propertyList.getExplicit(sbExpr.toString()) != null) +xsl:text) != null) return true;/xsl:text /xsl:for-each xsl:text @@ -788,24 +787,26 @@ public Property compute(PropertyList propertyList) throws FOPException { FObj parentFO = propertyList.getParentFObj(); -StringBuffer sbExpr=new StringBuffer(); Property p=null;/xsl:text xsl:choose xsl:when test=corresponding/propexpr - xsl:apply-templates select=corresponding/propval/ xsl:text // Make sure the property is set before calculating it! -if (propertyList.getExplicitOrShorthand(sbExpr.toString()) == null) +if (propertyList.getExplicitOrShorthand(/xsl:text + xsl:apply-templates select=corresponding/propval/ + xsl:text) == null) return p; +StringBuffer sbExpr=new StringBuffer(); sbExpr.setLength(0);/xsl:text xsl:apply-templates select=corresponding/propexpr/ xsl:text p = make(propertyList, sbExpr.toString(), propertyList.getParentFObj());/xsl:text /xsl:when xsl:otherwise - xsl:apply-templates select=corresponding/propval/ xsl:text -p= propertyList.getExplicitOrShorthand(sbExpr.toString());/xsl:text +p= propertyList.getExplicitOrShorthand(/xsl:text + xsl:apply-templates select=corresponding/propval/ + xsl:text);/xsl:text /xsl:otherwise /xsl:choose xsl:text @@ -818,8 +819,6 @@ Property subprop;/xsl:text xsl:for-each select=compound/subproperty/corresponding - xsl:text -sbExpr.setLength(0);/xsl:text xsl:choose xsl:when test=propexpr xsl:apply-templates select=propexpr/ @@ -830,16 +829,19 @@ make(propertyList, sbExpr.toString(), parentFO);/xsl:text /xsl:when xsl:otherwise -xsl:apply-templates select=propval/ xsl:text -subprop = propertyList.getExplicitOrShorthand(sbExpr.toString());/xsl:text +subprop = propertyList.getExplicitOrShorthand(/xsl:text + xsl:apply-templates select=propval/ + xsl:text);/xsl:text /xsl:otherwise /xsl:choose xsl:text if (subprop != null) { -setSubprop(p, /xsl:text -xsl:value-of select='../name'/ -xsl:text, subprop); +setSubprop(p, Constants.CP_/xsl:text +xsl:call-template name=makeEnumConstant + xsl:with-param name=propstr select=../name/ +/xsl:call-template +xsl:text, subprop); }/xsl:text /xsl:for-each /xsl:if @@ -860,9 +862,11 @@ xsl:text if (p == null) {