Author: vsiveton
Date: Fri Aug 21 21:33:22 2009
New Revision: 806727

URL: http://svn.apache.org/viewvc?rev=806727&view=rev
Log:
o reset the state correctly

Modified:
    
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.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=806727&r1=806726&r2=806727&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
 Fri Aug 21 21:33:22 2009
@@ -252,12 +252,17 @@
     protected void resetState()
     {
         resetTextBuffer();
-        headFlag = false;
-        verbatimFlag = false;
-        cellJustifStack.clear();
-        isCellJustifStack.clear();
-        cellCountStack.clear();
-        evenTableRow = true;
+
+        this.headFlag = false;
+        this.verbatimFlag = false;
+        this.evenTableRow = true;
+        this.cellJustifStack.clear();
+        this.isCellJustifStack.clear();
+        this.cellCountStack.clear();
+        this.tableContentWriterStack.clear();
+        this.tableCaptionWriterStack.clear();
+        this.tableCaptionXMLWriterStack.clear();
+        this.tableCaptionStack.clear();
     }
 
     /**
@@ -1139,6 +1144,11 @@
 
         writeEndTag( HtmlMarkup.TABLE );
 
+        if ( !this.cellCountStack.isEmpty() )
+        {
+            this.cellCountStack.removeLast().toString();
+        }
+
         if ( this.tableContentWriterStack.isEmpty() )
         {
             if ( getLog().isWarnEnabled() )
@@ -1170,11 +1180,6 @@
         {
             write( tableContent );
         }
-
-        if ( !this.cellCountStack.isEmpty() )
-        {
-            this.cellCountStack.removeLast().toString();
-        }
     }
 
     /**
@@ -1358,7 +1363,7 @@
             justif = attributes.getAttribute( Attribute.ALIGN.toString() 
).toString();
         }
 
-        if ( !this.cellCountStack.isEmpty() )
+        if ( !this.cellCountStack.isEmpty() && !this.cellJustifStack.isEmpty() 
)
         {
             int cellCount = Integer.parseInt( 
this.cellCountStack.getLast().toString() );
             int[] cellJustif = (int[]) this.cellJustifStack.getLast();
@@ -1931,6 +1936,8 @@
 
             this.warnMessages = null;
         }
+
+        resetState();
     }
 
     // ----------------------------------------------------------------------


Reply via email to