Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331333 - In DOC format, table cells inherit margin/padding properties of the parent table when they shouldn't
Summary: In DOC format, table cells inherit margin/padding properties of the parent ta...
Status: VERIFIED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.6.0   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: 2.6.2   Edit
Assignee: Yu Chen CLA
QA Contact: Xiaodan Wang CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-29 08:02 EST by Dmitry Balzer CLA
Modified: 2011-02-08 23:40 EST (History)
2 users (show)

See Also:


Attachments
Bug demonstration (52.04 KB, image/png)
2010-11-29 08:03 EST, Dmitry Balzer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Balzer CLA 2010-11-29 08:02:30 EST
Build Identifier: 20100617-1415

Table cells in reports, when exported to DOC format, inherit parent table's margin/padding properties, even when these properties are redefined for these cells.

We have take a look at startTable* methods in AbstractWordXmlWriter class and there are no references to padding in table cells.

This problem exists only in DOC exporter and not in PDF.

Please see attached screenshot for an example.

Reproducible: Always

Steps to Reproduce:
1. Create a table with multiple columns/rows.
2. Change padding properties of one cell.
3. Export this report into DOC format - the cell has parent table's properties.
Comment 1 Dmitry Balzer CLA 2010-11-29 08:03:14 EST
Created attachment 184032 [details]
Bug demonstration
Comment 2 Dmitry Balzer CLA 2010-11-29 08:24:03 EST
The problem might be in the following code chunk:
===
protected void writeBorders( IStyle style, int bottomMargin, int topMargin,
			int leftMargin, int rightMargin )
	{
		String borderStyle = style.getBorderBottomStyle( );
		if ( hasBorder( borderStyle ) )
		{
			writeSingleBorder( BOTTOM, borderStyle, style
					.getBorderBottomColor( ), style
					.getProperty( StyleConstants.STYLE_BORDER_BOTTOM_WIDTH ),
					bottomMargin );
		}
......
===

As one can see, margin properties will only be written if a table or a cell has a respective border enabled:

===
private boolean hasBorder( String borderStyle )
	{
		return !( borderStyle == null || "none".equalsIgnoreCase( borderStyle ) );
	}
===

===
private void writeCellBorders( IStyle style )
	{
		writer.openTag( "w:tcBorders" );
		writeBorders( style, 0, 0, 0, 0 );
		writer.closeTag( "w:tcBorders" );
	}
===
Comment 3 Dmitry Balzer CLA 2010-11-29 10:20:12 EST
Or in this one :

===
private void writeCellBorders( IStyle style )
    {
        writer.openTag( "w:tcBorders" );
        writeBorders( style, 0, 0, 0, 0 );
        writer.closeTag( "w:tcBorders" );
    }
===


Where all cell margins are set to 0, ignoring their actual values in the report template.
Comment 4 Dmitry Balzer CLA 2010-11-30 06:05:19 EST
Hi Xiaoying, 
could you please provide an update on this?
Any chance this fix can make it into 2.6.2?

Thank you very much,
Dmitry
Comment 5 Jun Ouyang CLA 2010-11-30 06:07:33 EST
Dmitry,

We will fix this problem ASAP. 2.6.2 will definitely be ok.
Comment 6 Yu Chen CLA 2011-01-11 02:34:14 EST
Fixed.
Comment 7 Xiaodan Wang CLA 2011-01-11 02:51:11 EST
Verified in build (2.6.2.v20110111-0630).
Comment 8 Dmitry Balzer CLA 2011-02-04 08:26:29 EST
I have just tested BIRT 2.6.2RC2 and the bug is *fixed*. 
Why was the "Target Milestone" tag cleared? Will the bugfix be included in 2.6.2Final ?
Comment 9 Xiaoying Gu CLA 2011-02-08 23:40:51 EST
Add the target milestone.