Bug 12659

Summary: Problem with documents with many text pieces
Product: POI Reporter: Staffan Friberg <d99-stf>
Component: HDFAssignee: POI Developers List <dev>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: other   

Description Staffan Friberg 2002-09-15 11:31:59 UTC
When trying to parse a document with more then one text pieces, for example the 
text encoding is different for different parts in the text, only the first piece 
is stored in the BTreeSet. After some digging I saw that TextPiece.compare 
always returned 0 which cause the BTree to think that it was the same piece 
again. A simple change would be to call the super.compare method in 
util.PropertyNode.

//staffan
Comment 1 Andy Oliver 2002-09-15 20:19:08 UTC
can you submit a patch?  http://jakarta.apache.org/poi/getinvolved/index.html

It would be easier that way.
Comment 2 Staffan Friberg 2002-09-16 16:48:53 UTC
Here is a patch, hope it works.  //staffan



Index: TextPiece.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-poi/src/scratchpad/src/org/apache/poi/hdf/extractor/Text
Piece.java,v
retrieving revision 1.1
diff -r1.1 TextPiece.java
85c85
<        return 0;
---
>       return super.compareTo(obj);

Comment 3 Avik Sengupta 2003-02-03 15:21:38 UTC
Anybody have a unit test for this? dont want to mess the code without one. 
Comment 4 Andy Oliver 2003-02-04 02:09:07 UTC
agreed.  Also follow the directions on "getinvolved"  Patches pasted are patches
wasted (and wrapped)
Comment 5 Andy Oliver 2003-07-24 13:24:39 UTC
see HWPF..