From 1e340fbce8f5f52dede70cd70cb1d1455ad48261 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Sat, 3 Jan 2015 09:34:07 +0000 Subject: [PATCH] Bug 53453: Apply patch to add methods to set margins in sections of HWPF documents git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1649176 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/hwpf/usermodel/Section.java | 60 ++ .../apache/poi/hwpf/usermodel/TestBugs.java | 579 +++++++++++------- test-data/document/Bug53453Section.doc | Bin 0 -> 26112 bytes 3 files changed, 415 insertions(+), 224 deletions(-) create mode 100644 test-data/document/Bug53453Section.doc diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Section.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Section.java index 4c902ee5ee..4488457f87 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Section.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Section.java @@ -95,6 +95,66 @@ public final class Section extends Range return _props.getXaPage(); } + /** + * Set the height of the bottom margin in twips. In the AbstractWordUtils class, a constant + * is defined that indicates how many twips there are per inch and it can be used in setting + * the margins width a little like this; + * + * section.setMarginBottom( (int) 1.5 * AbstractWordUtils.TWIPS_PER_INCH ); + * + * @param marginWidth A primitive int whose value will indciate how high the margin should + * be - in twips. + */ + public void setMarginBottom(int marginWidth) + { + this._props.setDyaBottom(marginWidth); + } + + /** + * Set the width of the left hand margin in twips. In the AbstractWordUtils class, a constant + * is defined that indicates how many twips there are per inch and it can be used in setting + * the margins width a little like this; + * + * section.setMarginLeft( (int) 1.5 * AbstractWordUtils.TWIPS_PER_INCH ); + * + * @param marginWidth A primitive int whose value will indciate how high the margin should + * be - in twips. + */ + public void setMarginLeft(int marginWidth) + { + this._props.setDxaLeft(marginWidth); + } + + /** + * Set the width of the right hand margin in twips. In the AbstractWordUtils class, a constant + * is defined that indicates how many twips there are per inch and it can be used in setting + * the margins width a little like this; + * + * section.setMarginRight( (int) 1.5 * AbstractWordUtils.TWIPS_PER_INCH ); + * + * @param marginWidth A primitive int whose value will indciate how high the margin should + * be - in twips. + */ + public void setMarginRight(int marginWidth) + { + this._props.setDxaRight(marginWidth); + } + + /** + * Set the height of the top margin in twips. In the AbstractWordUtils class, a constant + * is defined that indicates how many twips there are per inch and it can be used in setting + * the margins width a little like this; + * + * section.setMarginTop( (int) 1.5 * AbstractWordUtils.TWIPS_PER_INCH ); + * + * @param marginWidth A primitive int whose value will indciate how high the margin should + * be - in twips. + */ + public void setMarginTop(int marginWidth) + { + this._props.setDyaTop(marginWidth); + } + public boolean isColumnsEvenlySpaced() { return _props.getFEvenlySpaced(); diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java index 5f0a7ee288..3aebf1401f 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java @@ -31,6 +31,7 @@ import org.apache.poi.POIDataSamples; import org.apache.poi.hwpf.HWPFDocument; import org.apache.poi.hwpf.HWPFOldDocument; import org.apache.poi.hwpf.HWPFTestDataSamples; +import org.apache.poi.hwpf.converter.AbstractWordUtils; import org.apache.poi.hwpf.converter.WordToTextConverter; import org.apache.poi.hwpf.extractor.Word6Extractor; import org.apache.poi.hwpf.extractor.WordExtractor; @@ -53,80 +54,97 @@ import org.apache.poi.util.POILogger; public class TestBugs extends TestCase { private static final POILogger logger = POILogFactory - .getLogger( TestBugs.class ); + .getLogger(TestBugs.class); - public static void assertEquals( String expected, String actual ) + public static void assertEqualsIgnoreNewline(String expected, String actual ) { - String newExpected = expected.replaceAll( "\r\n", "\n" ) - .replaceAll( "\r", "\n" ).trim(); - String newActual = actual.replaceAll( "\r\n", "\n" ) - .replaceAll( "\r", "\n" ).trim(); - TestCase.assertEquals( newExpected, newActual ); + String newExpected = expected.replaceAll("\r\n", "\n" ) + .replaceAll("\r", "\n").trim(); + String newActual = actual.replaceAll("\r\n", "\n" ) + .replaceAll("\r", "\n").trim(); + TestCase.assertEquals(newExpected, newActual); } - private static void assertTableStructures( Range expected, Range actual ) + private static void assertTableStructures(Range expected, Range actual ) { - assertEquals( expected.numParagraphs(), actual.numParagraphs() ); - for ( int p = 0; p < expected.numParagraphs(); p++ ) + assertEquals(expected.numParagraphs(), actual.numParagraphs()); + for (int p = 0; p < expected.numParagraphs(); p++ ) { - Paragraph expParagraph = expected.getParagraph( p ); - Paragraph actParagraph = actual.getParagraph( p ); + Paragraph expParagraph = expected.getParagraph(p); + Paragraph actParagraph = actual.getParagraph(p); - assertEquals( expParagraph.text(), actParagraph.text() ); - assertEquals( "Diffent isInTable flags for paragraphs #" + p + assertEqualsIgnoreNewline(expParagraph.text(), actParagraph.text()); + assertEquals("Diffent isInTable flags for paragraphs #" + p + " -- " + expParagraph + " -- " + actParagraph + ".", - expParagraph.isInTable(), actParagraph.isInTable() ); - assertEquals( expParagraph.isTableRowEnd(), - actParagraph.isTableRowEnd() ); + expParagraph.isInTable(), actParagraph.isInTable()); + assertEquals(expParagraph.isTableRowEnd(), + actParagraph.isTableRowEnd()); - if ( expParagraph.isInTable() && actParagraph.isInTable() ) + if (expParagraph.isInTable() && actParagraph.isInTable() ) { Table expTable, actTable; try { - expTable = expected.getTable( expParagraph ); - actTable = actual.getTable( actParagraph ); + expTable = expected.getTable(expParagraph); + actTable = actual.getTable(actParagraph); } - catch ( Exception exc ) + catch (Exception exc ) { continue; } - assertEquals( expTable.numRows(), actTable.numRows() ); - assertEquals( expTable.numParagraphs(), - actTable.numParagraphs() ); + assertEquals(expTable.numRows(), actTable.numRows()); + assertEquals(expTable.numParagraphs(), + actTable.numParagraphs()); } } } - static void fixed( String bugzillaId ) + private static void fixed(String bugzillaId ) { throw new Error( "Bug " + bugzillaId + " seems to be fixed. " - + "Please resolve the issue in Bugzilla and remove fail() from the test" ); + + "Please resolve the issue in Bugzilla and remove fail() from the test"); + } + + private String getText(String samplefile) throws IOException { + HWPFDocument doc = HWPFTestDataSamples.openSampleFile(samplefile); + WordExtractor extractor = new WordExtractor(doc); + try { + return extractor.getText(); + } finally { + extractor.close(); + } + } + + private String getTextOldFile(String samplefile) throws IOException { + HWPFOldDocument doc = HWPFTestDataSamples.openOldSampleFile(samplefile); + Word6Extractor extractor = new Word6Extractor(doc); + try { + return extractor.getText(); + } finally { + extractor.close(); + } } /** * Bug 33519 - HWPF fails to read a file + * @throws IOException */ - public void test33519() + public void test33519() throws IOException { - HWPFDocument doc = HWPFTestDataSamples.openSampleFile( "Bug33519.doc" ); - WordExtractor extractor = new WordExtractor( doc ); - extractor.getText(); + assertNotNull(getText("Bug33519.doc")); } /** * Bug 34898 - WordExtractor doesn't read the whole string from the file + * @throws IOException */ - public void test34898() + public void test34898() throws IOException { - HWPFDocument doc = HWPFTestDataSamples.openSampleFile( "Bug34898.doc" ); - WordExtractor extractor = new WordExtractor( doc ); - assertEquals( "\u30c7\u30a3\u30ec\u30af\u30c8\u30ea", extractor - .getText().trim() ); + assertEqualsIgnoreNewline("\u30c7\u30a3\u30ec\u30af\u30c8\u30ea", getText("Bug34898.doc").trim()); } /** @@ -134,18 +152,18 @@ public class TestBugs extends TestCase */ public void test41898() { - HWPFDocument doc = HWPFTestDataSamples.openSampleFile( "Bug41898.doc" ); + HWPFDocument doc = HWPFTestDataSamples.openSampleFile("Bug41898.doc"); List pics = doc.getPicturesTable().getAllPictures(); - assertNotNull( pics ); - assertEquals( 1, pics.size() ); + assertNotNull(pics); + assertEquals(1, pics.size()); - Picture pic = pics.get( 0 ); - assertNotNull( pic.suggestFileExtension() ); - assertNotNull( pic.suggestFullFileName() ); + Picture pic = pics.get(0); + assertNotNull(pic.suggestFileExtension()); + assertNotNull(pic.suggestFullFileName()); - assertNotNull( pic.getContent() ); - assertNotNull( pic.getRawContent() ); + assertNotNull(pic.getContent()); + assertNotNull(pic.getRawContent()); /* * This is a file with empty EMF image, but present Office Drawing @@ -153,42 +171,49 @@ public class TestBugs extends TestCase */ final Collection officeDrawings = doc .getOfficeDrawingsMain().getOfficeDrawings(); - assertNotNull( officeDrawings ); - assertEquals( 1, officeDrawings.size() ); + assertNotNull(officeDrawings); + assertEquals(1, officeDrawings.size()); OfficeDrawing officeDrawing = officeDrawings.iterator().next(); - assertNotNull( officeDrawing ); - assertEquals( 1044, officeDrawing.getShapeId() ); + assertNotNull(officeDrawing); + assertEquals(1044, officeDrawing.getShapeId()); } /** * Bug 44331 - HWPFDocument.write destroys fields + * @throws IOException */ - public void test44431() + public void test44431() throws IOException { - HWPFDocument doc1 = HWPFTestDataSamples.openSampleFile( "Bug44431.doc" ); - WordExtractor extractor1 = new WordExtractor( doc1 ); + HWPFDocument doc1 = HWPFTestDataSamples.openSampleFile("Bug44431.doc"); - HWPFDocument doc2 = HWPFTestDataSamples.writeOutAndReadBack( doc1 ); - WordExtractor extractor2 = new WordExtractor( doc2 ); - - assertEquals( extractor1.getFooterText(), extractor2.getFooterText() ); - assertEquals( extractor1.getHeaderText(), extractor2.getHeaderText() ); - assertEquals( Arrays.toString( extractor1.getParagraphText() ), - Arrays.toString( extractor2.getParagraphText() ) ); - - assertEquals( extractor1.getText(), extractor2.getText() ); + WordExtractor extractor1 = new WordExtractor(doc1); + try { + HWPFDocument doc2 = HWPFTestDataSamples.writeOutAndReadBack(doc1); + + WordExtractor extractor2 = new WordExtractor(doc2); + try { + assertEqualsIgnoreNewline(extractor1.getFooterText(), extractor2.getFooterText()); + assertEqualsIgnoreNewline(extractor1.getHeaderText(), extractor2.getHeaderText()); + assertEqualsIgnoreNewline(Arrays.toString(extractor1.getParagraphText() ), + Arrays.toString(extractor2.getParagraphText())); + + assertEqualsIgnoreNewline(extractor1.getText(), extractor2.getText()); + } finally { + extractor2.close(); + } + } finally { + extractor1.close(); + } } /** * Bug 44331 - HWPFDocument.write destroys fields + * @throws IOException */ - public void test44431_2() + public void test44431_2() throws IOException { - HWPFDocument doc1 = HWPFTestDataSamples.openSampleFile( "Bug44431.doc" ); - WordExtractor extractor1 = new WordExtractor( doc1 ); - - assertEquals( "File name=FieldsTest.doc\n" + + assertEqualsIgnoreNewline("File name=FieldsTest.doc\n" + "\n" + "\n" + "STYLEREF test\n" + @@ -207,23 +232,36 @@ public class TestBugs extends TestCase "\n" + "\n" + "\n" + - "Page 3 of 3", extractor1.getText() ); + "Page 3 of 3", getText("Bug44431.doc")); } /** * Bug 45473 - HWPF cannot read file after save + * @throws IOException */ - public void test45473() + public void test45473() throws IOException { - HWPFDocument doc1 = HWPFTestDataSamples.openSampleFile( "Bug45473.doc" ); - String text1 = new WordExtractor( doc1 ).getText().trim(); + HWPFDocument doc1 = HWPFTestDataSamples.openSampleFile("Bug45473.doc"); + WordExtractor wordExtractor = new WordExtractor(doc1); + final String text1; + try { + text1 = wordExtractor.getText().trim(); + } finally { + wordExtractor.close(); + } - HWPFDocument doc2 = HWPFTestDataSamples.writeOutAndReadBack( doc1 ); - String text2 = new WordExtractor( doc2 ).getText().trim(); + HWPFDocument doc2 = HWPFTestDataSamples.writeOutAndReadBack(doc1); + WordExtractor wordExtractor2 = new WordExtractor(doc2); + final String text2; + try { + text2 = wordExtractor2.getText().trim(); + } finally { + wordExtractor2.close(); + } // the text in the saved document has some differences in line // separators but we tolerate that - assertEquals( text1.replaceAll( "\n", "" ), text2.replaceAll( "\n", "" ) ); + assertEqualsIgnoreNewline(text1.replaceAll("\n", "" ), text2.replaceAll("\n", "")); } /** @@ -231,36 +269,35 @@ public class TestBugs extends TestCase */ public void test46220() { - HWPFDocument doc = HWPFTestDataSamples.openSampleFile( "Bug46220.doc" ); + HWPFDocument doc = HWPFTestDataSamples.openSampleFile("Bug46220.doc"); // reference checksums as in Bugzilla String[] md5 = { "851be142bce6d01848e730cb6903f39e", "7fc6d8fb58b09ababd036d10a0e8c039", "a7dc644c40bc2fbf17b2b62d07f99248", "72d07b8db5fad7099d90bc4c304b4666" }; List pics = doc.getPicturesTable().getAllPictures(); - assertEquals( 4, pics.size() ); - for ( int i = 0; i < pics.size(); i++ ) + assertEquals(4, pics.size()); + for (int i = 0; i < pics.size(); i++ ) { - Picture pic = pics.get( i ); + Picture pic = pics.get(i); byte[] data = pic.getRawContent(); // use Apache Commons Codec utils to compute md5 - assertEquals( md5[i], DigestUtils.md5Hex( data ) ); + assertEqualsIgnoreNewline(md5[i], DigestUtils.md5Hex(data)); } } /** * [RESOLVED FIXED] Bug 46817 - Regression: Text from some table cells * missing + * @throws IOException */ - public void test46817() + public void test46817() throws IOException { - HWPFDocument doc = HWPFTestDataSamples.openSampleFile( "Bug46817.doc" ); - WordExtractor extractor = new WordExtractor( doc ); - String text = extractor.getText().trim(); + String text = getText("Bug46817.doc").trim(); - assertTrue( text.contains( "Nazwa wykonawcy" ) ); - assertTrue( text.contains( "kujawsko-pomorskie" ) ); - assertTrue( text.contains( "ekomel@ekomel.com.pl" ) ); + assertTrue(text.contains("Nazwa wykonawcy")); + assertTrue(text.contains("kujawsko-pomorskie")); + assertTrue(text.contains("ekomel@ekomel.com.pl")); } /** @@ -271,26 +308,38 @@ public class TestBugs extends TestCase */ public void test47286() throws IOException { - HWPFDocument doc1 = HWPFTestDataSamples.openSampleFile( "Bug47286.doc" ); - String text1 = new WordExtractor( doc1 ).getText().trim(); + HWPFDocument doc1 = HWPFTestDataSamples.openSampleFile("Bug47286.doc"); + WordExtractor wordExtractor = new WordExtractor(doc1); + final String text1; + try { + text1 = wordExtractor.getText().trim(); + } finally { + wordExtractor.close(); + } - HWPFDocument doc2 = HWPFTestDataSamples.writeOutAndReadBack( doc1 ); - String text2 = new WordExtractor( doc2 ).getText().trim(); + HWPFDocument doc2 = HWPFTestDataSamples.writeOutAndReadBack(doc1); + WordExtractor wordExtractor2 = new WordExtractor(doc2); + final String text2; + try { + text2 = wordExtractor2.getText().trim(); + } finally { + wordExtractor2.close(); + } // the text in the saved document has some differences in line // separators but we tolerate that - assertEquals( text1.replaceAll( "\n", "" ), text2.replaceAll( "\n", "" ) ); + assertEqualsIgnoreNewline(text1.replaceAll("\n", "" ), text2.replaceAll("\n", "")); - assertEquals( doc1.getCharacterTable().getTextRuns().size(), doc2 - .getCharacterTable().getTextRuns().size() ); + assertEquals(doc1.getCharacterTable().getTextRuns().size(), doc2 + .getCharacterTable().getTextRuns().size()); List expectedFields = doc1.getFieldsTables() - .getFieldsPLCF( FieldsDocumentPart.MAIN ); + .getFieldsPLCF(FieldsDocumentPart.MAIN); List actualFields = doc2.getFieldsTables().getFieldsPLCF( - FieldsDocumentPart.MAIN ); - assertEquals( expectedFields.size(), actualFields.size() ); + FieldsDocumentPart.MAIN); + assertEquals(expectedFields.size(), actualFields.size()); - assertTableStructures( doc1.getRange(), doc2.getRange() ); + assertTableStructures(doc1.getRange(), doc2.getRange()); } /** @@ -299,60 +348,60 @@ public class TestBugs extends TestCase */ public void test47287() { - HWPFDocument doc = HWPFTestDataSamples.openSampleFile( "Bug47287.doc" ); + HWPFDocument doc = HWPFTestDataSamples.openSampleFile("Bug47287.doc"); String[] values = { "1-1", "1-2", "1-3", "1-4", "1-5", "1-6", "1-7", "1-8", "1-9", "1-10", "1-11", "1-12", "1-13", "1-14", "1-15", }; int usedVal = 0; String PLACEHOLDER = "\u2002\u2002\u2002\u2002\u2002"; Range r = doc.getRange(); - for ( int x = 0; x < r.numSections(); x++ ) + for (int x = 0; x < r.numSections(); x++ ) { - Section s = r.getSection( x ); - for ( int y = 0; y < s.numParagraphs(); y++ ) + Section s = r.getSection(x); + for (int y = 0; y < s.numParagraphs(); y++ ) { - Paragraph p = s.getParagraph( y ); + Paragraph p = s.getParagraph(y); - for ( int z = 0; z < p.numCharacterRuns(); z++ ) + for (int z = 0; z < p.numCharacterRuns(); z++ ) { boolean isFound = false; // character run - CharacterRun run = p.getCharacterRun( z ); + CharacterRun run = p.getCharacterRun(z); // character run text String text = run.text(); String oldText = text; - int c = text.indexOf( "FORMTEXT " ); - if ( c < 0 ) + int c = text.indexOf("FORMTEXT "); + if (c < 0 ) { - int k = text.indexOf( PLACEHOLDER ); - if ( k >= 0 ) + int k = text.indexOf(PLACEHOLDER); + if (k >= 0 ) { - text = text.substring( 0, k ) + values[usedVal] - + text.substring( k + PLACEHOLDER.length() ); + text = text.substring(0, k ) + values[usedVal] + + text.substring(k + PLACEHOLDER.length()); usedVal++; isFound = true; } } else { - for ( ; c >= 0; c = text.indexOf( "FORMTEXT ", c + for (; c >= 0; c = text.indexOf("FORMTEXT ", c + "FORMTEXT ".length() ) ) { - int k = text.indexOf( PLACEHOLDER, c ); - if ( k >= 0 ) + int k = text.indexOf(PLACEHOLDER, c); + if (k >= 0 ) { - text = text.substring( 0, k ) + text = text.substring(0, k ) + values[usedVal] - + text.substring( k - + PLACEHOLDER.length() ); + + text.substring(k + + PLACEHOLDER.length()); usedVal++; isFound = true; } } } - if ( isFound ) + if (isFound ) { - run.replaceText( oldText, text, 0 ); + run.replaceText(oldText, text, 0); } } @@ -361,11 +410,11 @@ public class TestBugs extends TestCase String docText = r.text(); - assertTrue( docText.contains( "1-1" ) ); - assertTrue( docText.contains( "1-12" ) ); + assertTrue(docText.contains("1-1")); + assertTrue(docText.contains("1-12")); - assertFalse( docText.contains( "1-13" ) ); - assertFalse( docText.contains( "1-15" ) ); + assertFalse(docText.contains("1-13")); + assertFalse(docText.contains("1-15")); } /** @@ -374,11 +423,10 @@ public class TestBugs extends TestCase */ public void test47731() throws Exception { - HWPFDocument doc = HWPFTestDataSamples.openSampleFile( "Bug47731.doc" ); - String foundText = new WordExtractor( doc ).getText(); + String foundText = getText("Bug47731.doc"); - assertTrue( foundText - .contains( "Soak the rice in water for three to four hours" ) ); + assertTrue(foundText + .contains("Soak the rice in water for three to four hours")); } /** @@ -386,21 +434,19 @@ public class TestBugs extends TestCase */ public void test47742() throws Exception { - // (1) extract text from MS Word document via POI - HWPFDocument doc = HWPFTestDataSamples.openSampleFile( "Bug47742.doc" ); - String foundText = new WordExtractor( doc ).getText(); + String foundText = getText("Bug47742.doc"); // (2) read text from text document (retrieved by saving the word // document as text file using encoding UTF-8) InputStream is = POIDataSamples.getDocumentInstance() - .openResourceAsStream( "Bug47742-text.txt" ); + .openResourceAsStream("Bug47742-text.txt"); try { - byte[] expectedBytes = IOUtils.toByteArray( is ); - String expectedText = new String( expectedBytes, "utf-8" ) - .substring( 1 ); // strip-off the unicode marker + byte[] expectedBytes = IOUtils.toByteArray(is); + String expectedText = new String(expectedBytes, "utf-8" ) + .substring(1); // strip-off the unicode marker - assertEquals( expectedText, foundText ); + assertEqualsIgnoreNewline(expectedText, foundText); } finally { is.close(); } @@ -411,7 +457,7 @@ public class TestBugs extends TestCase */ public void test47958() { - HWPFDocument doc = HWPFTestDataSamples.openSampleFile( "Bug47958.doc" ); + HWPFDocument doc = HWPFTestDataSamples.openSampleFile("Bug47958.doc"); doc.getPicturesTable().getAllPictures(); } @@ -421,26 +467,22 @@ public class TestBugs extends TestCase */ public void test48065() { - HWPFDocument doc1 = HWPFTestDataSamples.openSampleFile( "Bug48065.doc" ); - HWPFDocument doc2 = HWPFTestDataSamples.writeOutAndReadBack( doc1 ); + HWPFDocument doc1 = HWPFTestDataSamples.openSampleFile("Bug48065.doc"); + HWPFDocument doc2 = HWPFTestDataSamples.writeOutAndReadBack(doc1); Range expected = doc1.getRange(); Range actual = doc2.getRange(); - assertEquals( - expected.text().replace( "\r", "\n" ).replaceAll( "\n\n", "\n" ), - actual.text().replace( "\r", "\n" ).replaceAll( "\n\n", "\n" ) ); + assertEqualsIgnoreNewline( + expected.text().replace("\r", "\n").replaceAll("\n\n", "\n" ), + actual.text().replace("\r", "\n").replaceAll("\n\n", "\n")); - assertTableStructures( expected, actual ); + assertTableStructures(expected, actual); } - public void test49933() + public void test49933() throws IOException { - HWPFOldDocument document = HWPFTestDataSamples - .openOldSampleFile( "Bug49933.doc" ); - - Word6Extractor word6Extractor = new Word6Extractor( document ); - String text = word6Extractor.getText(); + String text = getTextOldFile("Bug49933.doc"); assertTrue( text.contains( "best.wine.jump.ru" ) ); } @@ -451,7 +493,7 @@ public class TestBugs extends TestCase public void test50936_1() { HWPFDocument hwpfDocument = HWPFTestDataSamples - .openSampleFile( "Bug50936_1.doc" ); + .openSampleFile("Bug50936_1.doc"); hwpfDocument.getPicturesTable().getAllPictures(); } @@ -461,7 +503,7 @@ public class TestBugs extends TestCase public void test50936_2() { HWPFDocument hwpfDocument = HWPFTestDataSamples - .openSampleFile( "Bug50936_2.doc" ); + .openSampleFile("Bug50936_2.doc"); hwpfDocument.getPicturesTable().getAllPictures(); } @@ -471,61 +513,56 @@ public class TestBugs extends TestCase public void test50936_3() { HWPFDocument hwpfDocument = HWPFTestDataSamples - .openSampleFile( "Bug50936_3.doc" ); + .openSampleFile("Bug50936_3.doc"); hwpfDocument.getPicturesTable().getAllPictures(); } /** * [FAILING] Bug 50955 - error while retrieving the text file + * @throws IOException */ - public void test50955() + public void test50955() throws IOException { - try - { - HWPFOldDocument doc = HWPFTestDataSamples - .openOldSampleFile( "Bug50955.doc" ); - Word6Extractor extractor = new Word6Extractor( doc ); - extractor.getText(); + try { + getTextOldFile("Bug50955.doc"); - fixed( "50955" ); - } - catch ( Exception e ) - { - // expected exception + fixed("50955"); + } catch (IllegalStateException e) { + // expected here } } /** - * [RESOLVED FIXED] Bug 51604 - replace text fails for doc ( poi 3.8 beta + * [RESOLVED FIXED] Bug 51604 - replace text fails for doc (poi 3.8 beta * release from download site ) */ public void test51604() { HWPFDocument document = HWPFTestDataSamples - .openSampleFile( "Bug51604.doc" ); + .openSampleFile("Bug51604.doc"); Range range = document.getRange(); int numParagraph = range.numParagraphs(); int counter = 0; - for ( int i = 0; i < numParagraph; i++ ) + for (int i = 0; i < numParagraph; i++ ) { - Paragraph paragraph = range.getParagraph( i ); + Paragraph paragraph = range.getParagraph(i); int numCharRuns = paragraph.numCharacterRuns(); - for ( int j = 0; j < numCharRuns; j++ ) + for (int j = 0; j < numCharRuns; j++ ) { - CharacterRun charRun = paragraph.getCharacterRun( j ); + CharacterRun charRun = paragraph.getCharacterRun(j); String text = charRun.text(); - charRun.replaceText( text, "+" + ( ++counter ) ); + charRun.replaceText(text, "+" + (++counter)); } } - document = HWPFTestDataSamples.writeOutAndReadBack( document ); + document = HWPFTestDataSamples.writeOutAndReadBack(document); String text = document.getDocumentText(); - assertEquals( "+1+2+3+4+5+6+7+8+9+10+11+12", text ); + assertEqualsIgnoreNewline("+1+2+3+4+5+6+7+8+9+10+11+12", text); } /** - * [RESOLVED FIXED] Bug 51604 - replace text fails for doc ( poi 3.8 beta + * [RESOLVED FIXED] Bug 51604 - replace text fails for doc (poi 3.8 beta * release from download site ) * * @throws IOException @@ -533,81 +570,81 @@ public class TestBugs extends TestCase */ public void test51604p2() throws Exception { - HWPFDocument doc = HWPFTestDataSamples.openSampleFile( "Bug51604.doc" ); + HWPFDocument doc = HWPFTestDataSamples.openSampleFile("Bug51604.doc"); Range range = doc.getRange(); int numParagraph = range.numParagraphs(); - for ( int i = 0; i < numParagraph; i++ ) + for (int i = 0; i < numParagraph; i++ ) { - Paragraph paragraph = range.getParagraph( i ); + Paragraph paragraph = range.getParagraph(i); int numCharRuns = paragraph.numCharacterRuns(); - for ( int j = 0; j < numCharRuns; j++ ) + for (int j = 0; j < numCharRuns; j++ ) { - CharacterRun charRun = paragraph.getCharacterRun( j ); + CharacterRun charRun = paragraph.getCharacterRun(j); String text = charRun.text(); - if ( text.contains( "Header" ) ) - charRun.replaceText( text, "added" ); + if (text.contains("Header" ) ) + charRun.replaceText(text, "added"); } } - doc = HWPFTestDataSamples.writeOutAndReadBack( doc ); + doc = HWPFTestDataSamples.writeOutAndReadBack(doc); final FileInformationBlock fileInformationBlock = doc .getFileInformationBlock(); int totalLength = 0; - for ( SubdocumentType type : SubdocumentType.values() ) + for (SubdocumentType type : SubdocumentType.values() ) { final int partLength = fileInformationBlock - .getSubdocumentTextStreamLength( type ); - assert ( partLength >= 0 ); + .getSubdocumentTextStreamLength(type); + assert (partLength >= 0); totalLength += partLength; } - assertEquals( doc.getText().length(), totalLength ); + assertEquals(doc.getText().length(), totalLength); } /** - * [RESOLVED FIXED] Bug 51604 - replace text fails for doc ( poi 3.8 beta + * [RESOLVED FIXED] Bug 51604 - replace text fails for doc (poi 3.8 beta * release from download site ) */ public void test51604p3() throws Exception { - HWPFDocument doc = HWPFTestDataSamples.openSampleFile( "Bug51604.doc" ); + HWPFDocument doc = HWPFTestDataSamples.openSampleFile("Bug51604.doc"); byte[] originalData = new byte[doc.getFileInformationBlock() .getLcbDop()]; - System.arraycopy( doc.getTableStream(), doc.getFileInformationBlock() - .getFcDop(), originalData, 0, originalData.length ); + System.arraycopy(doc.getTableStream(), doc.getFileInformationBlock() + .getFcDop(), originalData, 0, originalData.length); HWPFOutputStream outputStream = new HWPFOutputStream(); - doc.getDocProperties().writeTo( outputStream ); + doc.getDocProperties().writeTo(outputStream); final byte[] oldData = outputStream.toByteArray(); - assertEquals( Arrays.toString( originalData ), - Arrays.toString( oldData ) ); + assertEqualsIgnoreNewline(Arrays.toString(originalData ), + Arrays.toString(oldData)); Range range = doc.getRange(); int numParagraph = range.numParagraphs(); - for ( int i = 0; i < numParagraph; i++ ) + for (int i = 0; i < numParagraph; i++ ) { - Paragraph paragraph = range.getParagraph( i ); + Paragraph paragraph = range.getParagraph(i); int numCharRuns = paragraph.numCharacterRuns(); - for ( int j = 0; j < numCharRuns; j++ ) + for (int j = 0; j < numCharRuns; j++ ) { - CharacterRun charRun = paragraph.getCharacterRun( j ); + CharacterRun charRun = paragraph.getCharacterRun(j); String text = charRun.text(); - if ( text.contains( "Header" ) ) - charRun.replaceText( text, "added" ); + if (text.contains("Header" ) ) + charRun.replaceText(text, "added"); } } - doc = HWPFTestDataSamples.writeOutAndReadBack( doc ); + doc = HWPFTestDataSamples.writeOutAndReadBack(doc); outputStream = new HWPFOutputStream(); - doc.getDocProperties().writeTo( outputStream ); + doc.getDocProperties().writeTo(outputStream); final byte[] newData = outputStream.toByteArray(); - assertEquals( Arrays.toString( oldData ), Arrays.toString( newData ) ); + assertEqualsIgnoreNewline(Arrays.toString(oldData ), Arrays.toString(newData)); } /** @@ -617,30 +654,39 @@ public class TestBugs extends TestCase public void test51671() throws Exception { InputStream is = POIDataSamples.getDocumentInstance() - .openResourceAsStream( "empty.doc" ); - NPOIFSFileSystem npoifsFileSystem = new NPOIFSFileSystem( is ); - HWPFDocument hwpfDocument = new HWPFDocument( - npoifsFileSystem.getRoot() ); - hwpfDocument.write( new ByteArrayOutputStream() ); + .openResourceAsStream("empty.doc"); + NPOIFSFileSystem npoifsFileSystem = new NPOIFSFileSystem(is); + try { + HWPFDocument hwpfDocument = new HWPFDocument( + npoifsFileSystem.getRoot()); + hwpfDocument.write(new ByteArrayOutputStream()); + } finally { + npoifsFileSystem.close(); + } } /** * Bug 51678 - Extracting text from Bug51524.zip is slow Bug 51524 - * PapBinTable constructor is slow + * @throws IOException */ - public void test51678And51524() + public void test51678And51524() throws IOException { // YK: the test will run only if the poi.test.remote system property is // set. // TODO: refactor into something nicer! - if ( System.getProperty( "poi.test.remote" ) != null ) + if (System.getProperty("poi.test.remote" ) != null ) { String href = "http://domex.nps.edu/corp/files/govdocs1/007/007488.doc"; HWPFDocument hwpfDocument = HWPFTestDataSamples - .openRemoteFile( href ); + .openRemoteFile(href); - WordExtractor wordExtractor = new WordExtractor( hwpfDocument ); - wordExtractor.getText(); + WordExtractor wordExtractor = new WordExtractor(hwpfDocument); + try { + wordExtractor.getText(); + } finally { + wordExtractor.close(); + } } } @@ -650,13 +696,13 @@ public class TestBugs extends TestCase */ public void testBug51890() { - HWPFDocument doc = HWPFTestDataSamples.openSampleFile( "Bug51890.doc" ); - for ( Picture picture : doc.getPicturesTable().getAllPictures() ) + HWPFDocument doc = HWPFTestDataSamples.openSampleFile("Bug51890.doc"); + for (Picture picture : doc.getPicturesTable().getAllPictures() ) { PictureType pictureType = picture.suggestPictureType(); - logger.log( POILogger.DEBUG, + logger.log(POILogger.DEBUG, "Picture at offset " + picture.getStartOffset() - + " has type " + pictureType ); + + " has type " + pictureType); } } @@ -670,9 +716,9 @@ public class TestBugs extends TestCase * we don't have Java test for this file - it should be checked using * Microsoft BFF Validator. But check read-write-read anyway. -- sergey */ - HWPFTestDataSamples.openSampleFile( "Bug51834.doc" ); - HWPFTestDataSamples.writeOutAndReadBack( HWPFTestDataSamples - .openSampleFile( "Bug51834.doc" ) ); + HWPFTestDataSamples.openSampleFile("Bug51834.doc"); + HWPFTestDataSamples.writeOutAndReadBack(HWPFTestDataSamples + .openSampleFile("Bug51834.doc")); } /** @@ -680,8 +726,8 @@ public class TestBugs extends TestCase */ public void testBug51944() throws Exception { - HWPFOldDocument doc = HWPFTestDataSamples.openOldSampleFile( "Bug51944.doc" ); - WordToTextConverter.getText( doc ); + HWPFOldDocument doc = HWPFTestDataSamples.openOldSampleFile("Bug51944.doc"); + assertNotNull(WordToTextConverter.getText(doc)); } /** @@ -690,7 +736,7 @@ public class TestBugs extends TestCase */ public void testBug52032_1() throws Exception { - HWPFTestDataSamples.openSampleFile( "Bug52032_1.doc" ); + assertNotNull(getText("Bug52032_1.doc")); } /** @@ -699,7 +745,7 @@ public class TestBugs extends TestCase */ public void testBug52032_2() throws Exception { - HWPFTestDataSamples.openSampleFile( "Bug52032_2.doc" ); + assertNotNull(getText("Bug52032_2.doc")); } /** @@ -708,7 +754,7 @@ public class TestBugs extends TestCase */ public void testBug52032_3() throws Exception { - HWPFTestDataSamples.openSampleFile( "Bug52032_3.doc" ); + assertNotNull(getText("Bug52032_3.doc")); } /** @@ -716,7 +762,7 @@ public class TestBugs extends TestCase */ public void testBug53380_1() throws Exception { - HWPFTestDataSamples.openSampleFile( "Bug53380_1.doc" ); + assertNotNull(getText("Bug53380_1.doc")); } /** @@ -724,7 +770,7 @@ public class TestBugs extends TestCase */ public void testBug53380_2() throws Exception { - HWPFTestDataSamples.openSampleFile( "Bug53380_2.doc" ); + assertNotNull(getText("Bug53380_2.doc")); } /** @@ -732,7 +778,7 @@ public class TestBugs extends TestCase */ public void testBug53380_3() throws Exception { - HWPFTestDataSamples.openSampleFile( "Bug53380_3.doc" ); + assertNotNull(getText("Bug53380_3.doc")); } /** @@ -740,7 +786,7 @@ public class TestBugs extends TestCase */ public void testBug53380_4() throws Exception { - HWPFTestDataSamples.openSampleFile( "Bug53380_4.doc" ); + assertNotNull(getText("Bug53380_4.doc")); } /** @@ -752,6 +798,91 @@ public class TestBugs extends TestCase public void DISABLEDtest56880() throws Exception { HWPFDocument doc = HWPFTestDataSamples.openSampleFile("56880.doc"); - assertEquals("Check Request", doc.getRange().text()); + assertEqualsIgnoreNewline("Check Request", doc.getRange().text()); + } + + + // These are the values the are explected to be read when the file + // is checked. + private int section1LeftMargin = 1440; + private int section1RightMargin = 1440; + private int section1TopMargin = 1440; + private int section1BottomMargin = 1440; + private int section1NumColumns = 1; + private int section2LeftMargin = 1440; + private int section2RightMargin = 1440; + private int section2TopMargin = 1440; + private int section2BottomMargin = 1440; + private int section2NumColumns = 3; + + public void testHWPFSections() { + HWPFDocument document = null; + Paragraph para = null; + Section section = null; + Range overallRange = null; + int numParas = 0; + int numSections = 0; + document = HWPFTestDataSamples.openSampleFile("Bug53453Section.doc"); + overallRange = document.getOverallRange(); + numParas = overallRange.numParagraphs(); + for(int i = 0; i < numParas; i++) { + para = overallRange.getParagraph(i); + numSections = para.numSections(); + for(int j = 0; j < numSections; j++) { + section = para.getSection(j); + if(para.text().trim().equals("Section1")) { + assertEquals(section1BottomMargin, section.getMarginBottom()); + assertEquals(section1LeftMargin, section.getMarginLeft()); + assertEquals(section1RightMargin, section.getMarginRight()); + assertEquals(section1TopMargin, section.getMarginTop()); + assertEquals(section1NumColumns, section.getNumColumns()); + } + else if(para.text().trim().equals("Section2")) { + assertEquals(section2BottomMargin, section.getMarginBottom()); + assertEquals(section2LeftMargin, section.getMarginLeft()); + assertEquals(section2RightMargin, section.getMarginRight()); + assertEquals(section2TopMargin, section.getMarginTop()); + assertEquals(section2NumColumns, section.getNumColumns()); + + // Change the margin widths + this.section2BottomMargin = (int)(1.5 * AbstractWordUtils.TWIPS_PER_INCH); + this.section2TopMargin = (int)(1.75 * AbstractWordUtils.TWIPS_PER_INCH); + this.section2LeftMargin = (int)(0.5 * AbstractWordUtils.TWIPS_PER_INCH); + this.section2RightMargin = (int)(0.75 * AbstractWordUtils.TWIPS_PER_INCH); + section.setMarginBottom(this.section2BottomMargin); + section.setMarginLeft(this.section2LeftMargin); + section.setMarginRight(this.section2RightMargin); + section.setMarginTop(this.section2TopMargin); + } + } + } + + // Save away and re-read the document to prove the chages are permanent + document = HWPFTestDataSamples.writeOutAndReadBack(document); + overallRange = document.getOverallRange(); + numParas = overallRange.numParagraphs(); + for(int i = 0; i < numParas; i++) { + para = overallRange.getParagraph(i); + numSections = para.numSections(); + for(int j = 0; j < numSections; j++) { + section = para.getSection(j); + if(para.text().trim().equals("Section1")) { + // No changes to the margins in Section1 + assertEquals(section1BottomMargin, section.getMarginBottom()); + assertEquals(section1LeftMargin, section.getMarginLeft()); + assertEquals(section1RightMargin, section.getMarginRight()); + assertEquals(section1TopMargin, section.getMarginTop()); + assertEquals(section1NumColumns, section.getNumColumns()); + } + else if(para.text().trim().equals("Section2")) { + // The margins in Section2 have kept the new settings. + assertEquals(section2BottomMargin, section.getMarginBottom()); + assertEquals(section2LeftMargin, section.getMarginLeft()); + assertEquals(section2RightMargin, section.getMarginRight()); + assertEquals(section2TopMargin, section.getMarginTop()); + assertEquals(section2NumColumns, section.getNumColumns()); + } + } + } } } diff --git a/test-data/document/Bug53453Section.doc b/test-data/document/Bug53453Section.doc new file mode 100644 index 0000000000000000000000000000000000000000..23275b6d878fac7d28f6fc631b2595778b240646 GIT binary patch literal 26112 zcmeHP2UJu?_a7FPjx30XfVvc=S3!y*AgB}(RKy-#VCgJv5s0Eh!~!v54JuK@MpO`c z1Qihl8;T@Ki;5_g1PxXomi_MC z!%idwdKQ8#A$@`Rkidw*2+a=74x#in7da_)64Qr};^q(BC+Y#7w1?X=8M}APa{4(17)YD>{H^@{r!=>ziPj?Hc<8`oT%~E9&GB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