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 2009/12/04 04:20:12 UTC

DO NOT REPLY [Bug 48325] bad text 'Page &P of &N' and similar errors when reading in spreadsheets

https://issues.apache.org/bugzilla/show_bug.cgi?id=48325

--- Comment #1 from Trejkaz <tr...@trypticon.org> 2009-12-03 19:20:09 UTC ---
Created an attachment (id=24668)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24668)
Sample file

Sample file attached, was created using an XLS file output from POI but then
mangling the footer to have the problem described.

Test case would look something like this (though there is a small amount of our
own utility method calls up the top):

    @Test
    public void testIllegalFooterText() throws Exception
    {
        HSSFWorkbook wb =
loadWorkbook(getDataFile("office/illegal-footer-text.xls"));
        HSSFSheet sh = wb.getSheetAt(0);
        HSSFFooter f = sh.getFooter();

        // The legal form of the footer would have been "&CBlahBlah Blah Blah 
" but something
        // left the &C off.  In this case it was me and a hex editor.  In the
cases we have seen
        // in the wild it's probably some idiot who thought they knew how to
add a footer but didn't.

        assertEquals("Left text should be empty", "", f.getLeft());
        assertEquals("Right text should be empty", "", f.getRight());
        assertEquals("Center text should contain the illegal value", "BlahBlah
blah blah  ", f.getCenter());
    }

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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