View | Details | Raw Unified | Return to bug 20060
Collapse All | Expand All

(-)scratchpad/src/org/apache/poi/hdf/extractor/Utils.java (-4 / +12 lines)
Line 59 Link Here
59
 * Comment me
59
 * Byte to other signed/unsigned type static conversions methods.
60
--
Line 62 Link Here
62
 * @author Serge Huber
63
 * @author Guerin Thierry
Line 83 Link Here
83
        return convertBytesToShort(array[offset + 1], array[offset]);
85
		if (array == null) {
84
--
86
			return 0;
87
        }
88
     	if (offset + 1 < array.length)
89
 			return convertBytesToShort(array[offset + 1], array[offset]);
90
 		else if (offset < array.length)
91
 			return convertBytesToShort((byte) 0, array[offset]);
92
 		else
93
 			return (short) 0;
(-)scratchpad/src/org/apache/poi/hdf/extractor/WordDocument.java (-12 / +48 lines)
Line 63 Link Here
63
import javax.swing.*;
Line 65 Link Here
65
import java.awt.*;
Line 68 Link Here
68
import org.apache.poi.poifs.filesystem.POIFSDocument;
Line 79 Link Here
76
 * @author Serge Huber
77
 * @author Guerin Thierry
Line 186 Link Here
185
186
    if (textPieces.size() == 0) {
187
        // fall-back to full text extraction, hoping it won't be too messy...
188
        TextPiece fullText = new TextPiece(textStart, textEnd - textStart, false);
189
        textPieces.add(fullText);
190
    }
191
Line 208 Link Here
208
	String sText = new String(_header, start, end-start);
214
	String sText = new String(_header, start, end-start, "Cp1252");
209
--
Line 267 Link Here
267
      filesystem.createDocumentInputStream("WordDocument").read(_header);
273
	  int bytesRead = filesystem.createDocumentInputStream("WordDocument").read(_header);
268
--
274
275
	  int fibVersion = LittleEndian.getShort(_header, 0x2) & 0xFFFF;
276
      int productVersion = LittleEndian.getShort(_header, 0x4) & 0xFFFF;
Line 273 Link Here
282
	  int _fcMax = LittleEndian.getInt(_header, 0x1C);
Line 275 Link Here
285
	  int _ccpHdd = LittleEndian.getInt(_header, 0x54);
286
Line 280 Link Here
292
      
293
	  int lcbClx = LittleEndian.getInt(_header, 0x1A6);
294
Line 281 Link Here
296
      boolean isComplex = (info & 0x4) != 0;
Lines 282-283 Link Here
282
      //process the text and formatting properties
298
      if (isComplex) {
283
      processComplexFile(useTable1, charPLC, charPlcSize, parPLC, parPlcSize);
299
          // now let's verify the existence of a table stream
284
--
300
          String tablename=null;
301
          DocumentEntry tableEntry = null;
302
          if (useTable1) {
303
              tablename="1Table";
304
          } else {
305
              tablename="0Table";
306
          }
307
          try {
308
              tableEntry = (DocumentEntry) filesystem.getRoot().getEntry(
309
                  tablename);
310
          } catch (FileNotFoundException fnfe) {
311
              isComplex = false;
312
          }
313
      }
314
315
      if ((isComplex)) {
316
          //process the text and formatting properties
317
          processComplexFile(useTable1, charPLC, charPlcSize, parPLC,
318
                             parPlcSize);
319
      } else {
320
          TextPiece piece = new TextPiece(_fcMin, _fcMax - _fcMin, false);
321
          _text.add(piece);
322
      }
Line 1826 Link Here
1826
          rowBuffer.append((String)cells.get(y));
1865
          if (cells != null)
1827
--
1866
          	rowBuffer.append((String)cells.get(y));
(-)scratchpad/src/org/apache/poi/hdf/extractor/data/ListTables.java (-5 / +4 lines)
Lines 204-205 Link Here
204
    int chpxSize = data[offset + 24];
204
	int chpxSize = Utils.convertUnsignedByteToInt( data[offset + 24] );
205
    int papxSize = data[offset + 25];
205
    int papxSize = Utils.convertUnsignedByteToInt( data[offset + 25] );
206
--
206
Line 211 Link Here
211
    int xstSize = Utils.convertBytesToShort(data, offset);
212
	int xstSize = Utils.convertBytesToShort(data, offset) & 0xFFFF
212
--

Return to bug 20060