zhihongzzh / flying-saucer

Automatically exported from code.google.com/p/flying-saucer
0 stars 0 forks source link

NullPointerException with border styles on a table #240

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Export the followinf HTML code to a PDF file :

<table border="1" style="border-collapse:collapse;border:none;">
    <tbody>
        <tr>
            <td>XXXX</td>
        </tr>       
        <tr>
            <td style="border:none;">ZZZZ</td>
        </tr>
    </tbody>
</table>

What is the expected output? What do you see instead?
I expect to see my table, but a nullpointerException occured:

Exception java.lang.NullPointerException
--- at 
org.xhtmlrenderer.css.style.derived.BorderPropertySet.lighten(BorderPropertySet.
java:118)
--- at 
org.xhtmlrenderer.render.BorderPainter.paintBorderSide(BorderPainter.java:111)
--- at org.xhtmlrenderer.render.BorderPainter.paint(BorderPainter.java:61)
--- at 
org.xhtmlrenderer.render.AbstractOutputDevice.paintCollapsedBorder(AbstractOutpu
tDevice.java:149)
--- at 
org.xhtmlrenderer.newtable.TableCellBox.paintCollapsedBorder(TableCellBox.java:3
28)
--- at org.xhtmlrenderer.layout.Layer.paintCollapsedTableBorders(Layer.java:451)
--- at org.xhtmlrenderer.layout.Layer.paintBackgroundsAndBorders(Layer.java:254)
--- at org.xhtmlrenderer.layout.Layer.paint(Layer.java:329)
--- at org.xhtmlrenderer.pdf.ITextRenderer.paintPage(ITextRenderer.java:384)
--- at org.xhtmlrenderer.pdf.ITextRenderer.writePDF(ITextRenderer.java:348)
--- at org.xhtmlrenderer.pdf.ITextRenderer.createPDF(ITextRenderer.java:315)
--- at org.xhtmlrenderer.pdf.ITextRenderer.createPDF(ITextRenderer.java:246)

What version of the product are you using? On what operating system?
FlyingSaucer R8.

Original issue reported on code.google.com by clement21.vasseur@gmail.com on 9 Jul 2014 at 8:01

GoogleCodeExporter commented 8 years ago
It looks the bug only happens when :
- There is a table with both property "border-collapse:collapse" and 
"border:none".
- There is at least two lines in the table.
- One of the cell has the style "border:none"

Original comment by clement21.vasseur@gmail.com on 9 Jul 2014 at 8:34