poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From max...@apache.org
Subject svn commit: r1065535 - in /poi/trunk: src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractorBugs.java test-data/document/parentinvguid.doc
Date Mon, 31 Jan 2011 09:27:45 GMT
Author: maxcom
Date: Mon Jan 31 09:27:44 2011
New Revision: 1065535

URL: http://svn.apache.org/viewvc?rev=1065535&view=rev
Log:
hwpf: ignore null-reference to parent stylesheet (bug#50688)

Added:
    poi/trunk/test-data/document/parentinvguid.doc   (with props)
Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractorBugs.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java?rev=1065535&r1=1065534&r2=1065535&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/StyleSheet.java Mon Jan 31 09:27:44
2011
@@ -238,6 +238,10 @@ public final class StyleSheet implements
 
           }
 
+          if (parentPAP == null) {
+              parentPAP = new ParagraphProperties();
+          }
+
           pap = ParagraphSprmUncompressor.uncompressPAP(parentPAP, papx, 2);
           sd.setPAP(pap);
       }

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractorBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractorBugs.java?rev=1065535&r1=1065534&r2=1065535&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractorBugs.java
(original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractorBugs.java
Mon Jan 31 09:27:44 2011
@@ -38,4 +38,13 @@ public final class TestWordExtractorBugs
 		extractor.getParagraphText();
 		extractor.getTextFromPieces();
 	}
+
+    public void testBug50688() throws Exception {
+        WordExtractor extractor =
+            new WordExtractor(POIDataSamples.getDocumentInstance().openResourceAsStream("parentinvguid.doc"));
+
+        // Check it gives text without error
+        extractor.getText();
+    }
+    
 }

Added: poi/trunk/test-data/document/parentinvguid.doc
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/document/parentinvguid.doc?rev=1065535&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/test-data/document/parentinvguid.doc
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



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


Mime
View raw message