xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerem...@apache.org
Subject svn commit: r374425 - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/fo/properties/CommonTextDecoration.java status.xml test/layoutengine/standard-testcases/text-decoration_2.xml
Date Thu, 02 Feb 2006 16:20:30 GMT
Author: jeremias
Date: Thu Feb  2 08:20:22 2006
New Revision: 374425

URL: http://svn.apache.org/viewcvs?rev=374425&view=rev
Log:
Bugzilla #38453:
Bugfix: Text-decoration was not promoted if no text-decoration attribute was specified on
a nested element.
Nice side-effect: more efficient evaluation of text-decoration.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/CommonTextDecoration.java
    xmlgraphics/fop/trunk/status.xml
    xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/text-decoration_2.xml

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/CommonTextDecoration.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/CommonTextDecoration.java?rev=374425&r1=374424&r2=374425&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/CommonTextDecoration.java
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/CommonTextDecoration.java
Thu Feb  2 08:20:22 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 The Apache Software Foundation.
+ * Copyright 2005-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -68,60 +68,63 @@
             deco = calcTextDecoration(parentList);
         }
         //For rules, see XSL 1.0, chapters 5.5.6 and 7.16.4
-        List list = pList.get(Constants.PR_TEXT_DECORATION).getList();
-        Iterator i = list.iterator();
-        while (i.hasNext()) {
-            Property prop = (Property)i.next(); 
-            int prop_enum = prop.getEnum();
-            if (prop_enum == Constants.EN_NONE) {
-                if (deco != null) {
-                    deco.decoration = 0;
-                }
-                return deco;
-            } else if (prop_enum == Constants.EN_UNDERLINE) {
-                if (deco == null) {
-                    deco = new CommonTextDecoration();
-                }
-                deco.decoration |= UNDERLINE;
-                deco.underColor = pList.get(Constants.PR_COLOR).getColorType();
-            } else if (prop_enum == Constants.EN_NO_UNDERLINE) {
-                if (deco != null) {
-                    deco.decoration &= OVERLINE | LINE_THROUGH | BLINK;
+        Property textDecoProp = pList.getExplicit(Constants.PR_TEXT_DECORATION);
+        if (textDecoProp != null) {
+            List list = textDecoProp.getList();
+            Iterator i = list.iterator();
+            while (i.hasNext()) {
+                Property prop = (Property)i.next(); 
+                int propEnum = prop.getEnum();
+                if (propEnum == Constants.EN_NONE) {
+                    if (deco != null) {
+                        deco.decoration = 0;
+                    }
+                    return deco;
+                } else if (propEnum == Constants.EN_UNDERLINE) {
+                    if (deco == null) {
+                        deco = new CommonTextDecoration();
+                    }
+                    deco.decoration |= UNDERLINE;
                     deco.underColor = pList.get(Constants.PR_COLOR).getColorType();
-                }
-            } else if (prop_enum == Constants.EN_OVERLINE) {
-                if (deco == null) {
-                    deco = new CommonTextDecoration();
-                }
-                deco.decoration |= OVERLINE;
-                deco.overColor = pList.get(Constants.PR_COLOR).getColorType();
-            } else if (prop_enum == Constants.EN_NO_OVERLINE) {
-                if (deco != null) {
-                    deco.decoration &= UNDERLINE | LINE_THROUGH | BLINK;
+                } else if (propEnum == Constants.EN_NO_UNDERLINE) {
+                    if (deco != null) {
+                        deco.decoration &= OVERLINE | LINE_THROUGH | BLINK;
+                        deco.underColor = pList.get(Constants.PR_COLOR).getColorType();
+                    }
+                } else if (propEnum == Constants.EN_OVERLINE) {
+                    if (deco == null) {
+                        deco = new CommonTextDecoration();
+                    }
+                    deco.decoration |= OVERLINE;
                     deco.overColor = pList.get(Constants.PR_COLOR).getColorType();
-                }
-            } else if (prop_enum == Constants.EN_LINE_THROUGH) {
-                if (deco == null) {
-                    deco = new CommonTextDecoration();
-                }
-                deco.decoration |= LINE_THROUGH;
-                deco.throughColor = pList.get(Constants.PR_COLOR).getColorType();
-            } else if (prop_enum == Constants.EN_NO_LINE_THROUGH) {
-                if (deco != null) {
-                    deco.decoration &= UNDERLINE | OVERLINE | BLINK;
+                } else if (propEnum == Constants.EN_NO_OVERLINE) {
+                    if (deco != null) {
+                        deco.decoration &= UNDERLINE | LINE_THROUGH | BLINK;
+                        deco.overColor = pList.get(Constants.PR_COLOR).getColorType();
+                    }
+                } else if (propEnum == Constants.EN_LINE_THROUGH) {
+                    if (deco == null) {
+                        deco = new CommonTextDecoration();
+                    }
+                    deco.decoration |= LINE_THROUGH;
                     deco.throughColor = pList.get(Constants.PR_COLOR).getColorType();
+                } else if (propEnum == Constants.EN_NO_LINE_THROUGH) {
+                    if (deco != null) {
+                        deco.decoration &= UNDERLINE | OVERLINE | BLINK;
+                        deco.throughColor = pList.get(Constants.PR_COLOR).getColorType();
+                    }
+                } else if (propEnum == Constants.EN_BLINK) {
+                    if (deco == null) {
+                        deco = new CommonTextDecoration();
+                    }
+                    deco.decoration |= BLINK;
+                } else if (propEnum == Constants.EN_NO_BLINK) {
+                    if (deco != null) {
+                        deco.decoration &= UNDERLINE | OVERLINE | LINE_THROUGH;
+                    }
+                } else {
+                    throw new PropertyException("Illegal value encountered: " + prop.getString());
                 }
-            } else if (prop_enum == Constants.EN_BLINK) {
-                if (deco == null) {
-                    deco = new CommonTextDecoration();
-                }
-                deco.decoration |= BLINK;
-            } else if (prop_enum == Constants.EN_NO_BLINK) {
-                if (deco != null) {
-                    deco.decoration &= UNDERLINE | OVERLINE | LINE_THROUGH;
-                }
-            } else {
-                throw new PropertyException("Illegal value encountered: " + prop.getString());
             }
         }
         return deco;

Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/status.xml?rev=374425&r1=374424&r2=374425&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Thu Feb  2 08:20:22 2006
@@ -27,6 +27,10 @@
 
   <changes>
     <release version="FOP Trunk">
+      <action context="Code" dev="JM" type="fix" fixes-bug="38453">
+        Bugfix: Text-decoration was not promoted if no text-decoration attribute was
+        specified on a nested element.
+      </action>
       <action context="Code" dev="AD" type="add">
         Added support for the from-table-column() function.
         (Thanks to gerhard.oettl.at.oesoft.at for the inspiration.)

Modified: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/text-decoration_2.xml
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/text-decoration_2.xml?rev=374425&r1=374424&r2=374425&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/text-decoration_2.xml (original)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/text-decoration_2.xml Thu Feb
 2 08:20:22 2006
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-  Copyright 2005 The Apache Software Foundation
+  Copyright 2005-2006 The Apache Software Foundation
 
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
@@ -32,6 +32,7 @@
         <fo:flow flow-name="xsl-region-body">
           <!-- nested inlines -->
           <fo:block>normal <fo:inline color="blue" text-decoration="underline">under
<fo:inline color="red" font-size="14pt" text-decoration="line-through">through</fo:inline>
<fo:inline text-decoration="none">none</fo:inline> under</fo:inline> normal</fo:block>
+          <fo:block color="blue" text-decoration="underline">Everything in this paragraph
including this <fo:basic-link external-destination="http://xmlgraphics.apache.org/fop/">link</fo:basic-link>
must be underlined.</fo:block>
         </fo:flow>
       </fo:page-sequence>
     </fo:root>
@@ -83,6 +84,10 @@
     <true xpath="not(//flow/block[1]/lineArea/*[3]/@through-score)"/>
     <eval xpath="name(//flow/block[1]/lineArea/*[3])" expected="text"/>
     <eval xpath="//flow/block[1]/lineArea/*[3]/@color" expected="#000000"/>
+    
+    <true xpath="//flow/block[2]/lineArea/text[1]/@underline-score"/>
+    <true xpath="//flow/block[2]/lineArea/inlineparent/text[1]/@underline-score"/>
+    <true xpath="//flow/block[2]/lineArea/text[2]/@underline-score"/>
     
   </checks>
 </testcase>



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


Mime
View raw message