You are viewing a plain text version of this content. The canonical link for it is here.
Posted to doxia-commits@maven.apache.org by lt...@apache.org on 2010/03/22 13:40:16 UTC
svn commit: r926049 - in /maven/doxia/doxia/trunk/doxia-core/src:
main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java
test/java/org/apache/maven/doxia/sink/XhtmlBaseSinkTest.java
Author: ltheussl
Date: Mon Mar 22 12:40:16 2010
New Revision: 926049
URL: http://svn.apache.org/viewvc?rev=926049&view=rev
Log:
[DOXIA-385] Xdoc: tables without "align" attribute is center aligned
Modified:
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/XhtmlBaseSinkTest.java
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java?rev=926049&r1=926048&r2=926049&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java Mon Mar 22 12:40:16 2010
@@ -1225,11 +1225,6 @@ public class XhtmlBaseSink
}
MutableAttributeSet att = new SinkEventAttributeSet();
- if ( !this.tableAttributes.isDefined( Attribute.ALIGN.toString() ) )
- {
- att.addAttribute( Attribute.ALIGN, "center" );
- }
-
if ( !this.tableAttributes.isDefined( Attribute.BORDER.toString() ) )
{
att.addAttribute( Attribute.BORDER, ( grid ? "1" : "0" ) );
@@ -1376,44 +1371,11 @@ public class XhtmlBaseSink
MutableAttributeSet att = new SinkEventAttributeSet();
- String justif = null;
if ( attributes == null )
{
attributes = new SinkEventAttributeSet( 0 );
}
- if ( attributes.isDefined( Attribute.ALIGN.toString() ) )
- {
- justif = attributes.getAttribute( Attribute.ALIGN.toString() ).toString();
- }
-
- if ( !this.cellCountStack.isEmpty() && !this.cellJustifStack.isEmpty() )
- {
- int cellCount = Integer.parseInt( this.cellCountStack.getLast().toString() );
- int[] cellJustif = (int[]) this.cellJustifStack.getLast();
- if ( justif == null && cellJustif != null && cellJustif.length > 0
- && this.isCellJustifStack.getLast().equals( Boolean.TRUE ) )
- {
- switch ( cellJustif[Math.min( cellCount, cellJustif.length - 1 )] )
- {
- case JUSTIFY_LEFT:
- justif = "left";
- break;
- case JUSTIFY_RIGHT:
- justif = "right";
- break;
- case JUSTIFY_CENTER:
- default:
- justif = "center";
- }
- }
- }
-
- if ( justif != null )
- {
- att.addAttribute( Attribute.ALIGN, justif );
- }
-
att.addAttributes( SinkUtils.filterAttributes(
attributes, SinkUtils.SINK_TD_ATTRIBUTES ) );
Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/XhtmlBaseSinkTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/XhtmlBaseSinkTest.java?rev=926049&r1=926048&r2=926049&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/XhtmlBaseSinkTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/XhtmlBaseSinkTest.java Mon Mar 22 12:40:16 2010
@@ -629,7 +629,7 @@ public class XhtmlBaseSinkTest
sink.close();
}
- assertEquals( "<table align=\"center\" border=\"0\" class=\"bodyTable\">", writer.toString() );
+ assertEquals( "<table border=\"0\" class=\"bodyTable\">", writer.toString() );
}
/**
@@ -714,7 +714,7 @@ public class XhtmlBaseSinkTest
sink.close();
}
- assertEquals( "<table align=\"center\" border=\"0\" class=\"bodyTable\">" +
+ assertEquals( "<table border=\"0\" class=\"bodyTable\">" +
"<caption style=\"bold\">caption</caption></table>", writer.toString() );
}