ASF Bugzilla – Attachment 6629 Details for
Bug 20060
[PATCH] HDF text extraction patch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
The new CVS diff, including Serge's modifications
POI CVS Diff.txt (text/plain), 4.30 KB, created by
Thierry Guerin
on 2003-06-04 15:08:33 UTC
(
hide
)
Description:
The new CVS diff, including Serge's modifications
Filename:
MIME Type:
Creator:
Thierry Guerin
Created:
2003-06-04 15:08:33 UTC
Size:
4.30 KB
patch
obsolete
>cvs server: Diffing scratchpad/src/org/apache/poi/hdf/extractor >Index: scratchpad/src/org/apache/poi/hdf/extractor/Utils.java >=================================================================== >RCS file: /home/cvspublic/jakarta-poi/src/scratchpad/src/org/apache/poi/hdf/extractor/Utils.java,v >retrieving revision 1.2 >diff -r1.2 Utils.java >59c59 >< * Comment me >--- >> * Byte to other signed/unsigned type static conversions methods. >61a62,63 >> * @author Serge Huber >> * @author Guerin Thierry >83c85,93 >< return convertBytesToShort(array[offset + 1], array[offset]); >--- >> if (array == null) { >> return 0; >> } >> if (offset + 1 < array.length) >> return convertBytesToShort(array[offset + 1], array[offset]); >> else if (offset < array.length) >> return convertBytesToShort((byte) 0, array[offset]); >> else >> return (short) 0; >Index: scratchpad/src/org/apache/poi/hdf/extractor/WordDocument.java >=================================================================== >RCS file: /home/cvspublic/jakarta-poi/src/scratchpad/src/org/apache/poi/hdf/extractor/WordDocument.java,v >retrieving revision 1.7 >diff -r1.7 WordDocument.java >63d62 >< import javax.swing.*; >65d63 >< import java.awt.*; >68d65 >< import org.apache.poi.poifs.filesystem.POIFSDocument; >78a76,77 >> * @author Serge Huber >> * @author Guerin Thierry >185a185,191 >> >> if (textPieces.size() == 0) { >> // fall-back to full text extraction, hoping it won't be too messy... >> TextPiece fullText = new TextPiece(textStart, textEnd - textStart, false); >> textPieces.add(fullText); >> } >> >208c214 >< String sText = new String(_header, start, end-start); >--- >> String sText = new String(_header, start, end-start, "Cp1252"); >267c273,276 >< filesystem.createDocumentInputStream("WordDocument").read(_header); >--- >> int bytesRead = filesystem.createDocumentInputStream("WordDocument").read(_header); >> >> int fibVersion = LittleEndian.getShort(_header, 0x2) & 0xFFFF; >> int productVersion = LittleEndian.getShort(_header, 0x4) & 0xFFFF; >272a282 >> int _fcMax = LittleEndian.getInt(_header, 0x1C); >274a285,286 >> int _ccpHdd = LittleEndian.getInt(_header, 0x54); >> >279a292,294 >> >> int lcbClx = LittleEndian.getInt(_header, 0x1A6); >> >280a296 >> boolean isComplex = (info & 0x4) != 0; >282,283c298,322 >< //process the text and formatting properties >< processComplexFile(useTable1, charPLC, charPlcSize, parPLC, parPlcSize); >--- >> if (isComplex) { >> // now let's verify the existence of a table stream >> String tablename=null; >> DocumentEntry tableEntry = null; >> if (useTable1) { >> tablename="1Table"; >> } else { >> tablename="0Table"; >> } >> try { >> tableEntry = (DocumentEntry) filesystem.getRoot().getEntry( >> tablename); >> } catch (FileNotFoundException fnfe) { >> isComplex = false; >> } >> } >> >> if ((isComplex)) { >> //process the text and formatting properties >> processComplexFile(useTable1, charPLC, charPlcSize, parPLC, >> parPlcSize); >> } else { >> TextPiece piece = new TextPiece(_fcMin, _fcMax - _fcMin, false); >> _text.add(piece); >> } >1826c1865,1866 >< rowBuffer.append((String)cells.get(y)); >--- >> if (cells != null) >> rowBuffer.append((String)cells.get(y)); >cvs server: Diffing scratchpad/src/org/apache/poi/hdf/extractor/data >Index: scratchpad/src/org/apache/poi/hdf/extractor/data/ListTables.java >=================================================================== >RCS file: /home/cvspublic/jakarta-poi/src/scratchpad/src/org/apache/poi/hdf/extractor/data/ListTables.java,v >retrieving revision 1.2 >diff -r1.2 ListTables.java >204,205c204,206 >< int chpxSize = data[offset + 24]; >< int papxSize = data[offset + 25]; >--- >> int chpxSize = Utils.convertUnsignedByteToInt( data[offset + 24] ); >> int papxSize = Utils.convertUnsignedByteToInt( data[offset + 25] ); >> >211c212 >< int xstSize = Utils.convertBytesToShort(data, offset); >--- >> int xstSize = Utils.convertBytesToShort(data, offset) & 0xFFFF
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 20060
:
6423
| 6629