You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2016/01/13 12:02:49 UTC

[Bug 58850] New: XWPFTable adds border while just opening and saving

https://bz.apache.org/bugzilla/show_bug.cgi?id=58850

            Bug ID: 58850
           Summary: XWPFTable adds border while just opening and saving
           Product: POI
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XWPF
          Assignee: dev@poi.apache.org
          Reporter: luk-ry@web.de

I just opened and saved a docx file like this:

File infile = new File("test.docx");
XWPFDocument xdoc = null;
FileInputStream fis = new FileInputStream(infile);
xdoc = new XWPFDocument(OPCPackage.open(fis));

FileOutputStream outstr = new FileOutputStream(new File("bug.docx"));
xdoc.write(outstr);
outstr.close();

This document contained a table, which was set to borderless. After opening the
exported bug.docx, i noticed, that the above code added a border to the table.

I looked into the document.xml, which contained the following:

test.docx

<w:tbl>
    <w:tblPr>
        <w:tblStyle w:val="Basic"/>
        <w:tblpPr w:horzAnchor="page" w:leftFromText="142"
w:rightFromText="142" w:tblpX="1702" w:tblpY="937" w:vertAnchor="page"/>
        <w:tblW w:type="auto" w:w="0"/>
        <w:tblLayout w:type="fixed"/>
        <w:tblLook w:firstColumn="1" w:firstRow="1" w:lastColumn="0"
w:lastRow="0" w:noHBand="0" w:noVBand="1" w:val="04A0"/>
    </w:tblPr>
    <w:tblGrid>
        <w:gridCol w:w="6804"/>
    </w:tblGrid>
    ...
</w:tbl>

There were some standard values added:
bug.docx

<w:tbl>
    <w:tblPr>
        <w:tblStyle w:val="Basic"/>
        <w:tblpPr w:horzAnchor="page" w:leftFromText="142"
w:rightFromText="142" w:tblpX="1702" w:tblpY="937" w:vertAnchor="page"/>
        <w:tblW w:type="auto" w:w="0"/>
        <w:tblLayout w:type="fixed"/>
        <w:tblLook w:firstColumn="1" w:firstRow="1" w:lastColumn="0"
w:lastRow="0" w:noHBand="0" w:noVBand="1" w:val="04A0"/>
    </w:tblPr>
    <w:tblPr>
        <w:tblW w:type="auto" w:w="0"/>
        <w:tblBorders>
            <w:top w:val="single"/>
            <w:left w:val="single"/>
            <w:bottom w:val="single"/>
            <w:right w:val="single"/>
            <w:insideH w:val="single"/>
            <w:insideV w:val="single"/>
        </w:tblBorders>
    </w:tblPr>
    <w:tblGrid>
        <w:gridCol w:w="6804"/>
    </w:tblGrid>
    ...
</w:tbl>

This problem is caused by the createEmptyTable method inside the XWPFTable. I
think this method shouldnt be called in this case.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 58850] XWPFTable adds border while just opening and saving

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58850

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Dominik Stadler <do...@gmx.at> ---
Can you attach the original and the failing document?
XWPFTable.createEmptyTable() is only called if there are no rows in the table,
is this the case here?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 58850] XWPFTable adds border while just opening and saving

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58850

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|---                         |LATER

--- Comment #2 from Dominik Stadler <do...@gmx.at> ---
We did not get the sample file for a long time and so cannot easily fix
anything here, thus I am closing this for now, please reopen with more
information if this is still a problem for you.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org