Author: adelmelle
Date: Wed Apr 6 18:39:15 2011
New Revision: 1089559
URL: http://svn.apache.org/viewvc?rev=1089559&view=rev
Log:
Bugzilla 51032: Fixed regression due to oversight in refactoring
text-decoration.
Invalid values properly reported as errors again, instead of causing a NPE.
Added:
xmlgraphics/fop/trunk/test/fotree/testcases/text-decoration_invalid_bug51032.fo
(with props)
Modified:
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/TextDecorationMaker.java
Modified:
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/TextDecorationMaker.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/TextDecorationMaker.java?rev=1089559&r1=1089558&r2=1089559&view=diff
==============================================================================
---
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/TextDecorationMaker.java
(original)
+++
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/TextDecorationMaker.java
Wed Apr 6 18:39:15 2011
@@ -59,14 +59,16 @@ public class TextDecorationMaker extends
boolean over = false;
boolean through = false;
boolean blink = false;
- int enumValue;
+ int enumValue = -1;
for (int i = lst.size(); --i >= 0;) {
Property prop = (Property)lst.get(i);
if (prop instanceof NCnameProperty) {
prop = checkEnumValues(prop.getString());
lst.set(i, prop);
}
- enumValue = prop.getEnum();
+ if (prop != null) {
+ enumValue = prop.getEnum();
+ }
switch (enumValue) {
case Constants.EN_NONE:
if (under | over | through | blink) {
@@ -115,7 +117,7 @@ public class TextDecorationMaker extends
throw new PropertyException("Invalid combination
of values");
}
default:
- throw new PropertyException("Invalid value specified: " +
prop);
+ throw new PropertyException("Invalid value specified: " +
p);
}
}
return listProp;
Added:
xmlgraphics/fop/trunk/test/fotree/testcases/text-decoration_invalid_bug51032.fo
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/fotree/testcases/text-decoration_invalid_bug51032.fo?rev=1089559&view=auto
==============================================================================
---
xmlgraphics/fop/trunk/test/fotree/testcases/text-decoration_invalid_bug51032.fo
(added)
+++
xmlgraphics/fop/trunk/test/fotree/testcases/text-decoration_invalid_bug51032.fo
Wed Apr 6 18:39:15 2011
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="simple" page-height="5in"
page-width="3in">
+ <fo:region-body />
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="simple">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block>
+ <fo:inline text-decoration="italic">bap</fo:inline>
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+</fo:root>
Propchange:
xmlgraphics/fop/trunk/test/fotree/testcases/text-decoration_invalid_bug51032.fo
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
xmlgraphics/fop/trunk/test/fotree/testcases/text-decoration_invalid_bug51032.fo
------------------------------------------------------------------------------
svn:keywords = Id
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]