package org.apache.poi.hdf.extractor;
-import org.apache.poi.hdf.extractor.util.*;
-import org.apache.poi.hdf.extractor.data.*;
-import java.util.*;
-import java.io.*;
-
-import org.apache.poi.poifs.filesystem.POIFSFileSystem;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+
+import org.apache.poi.hdf.extractor.data.DOP;
+import org.apache.poi.hdf.extractor.data.LVL;
+import org.apache.poi.hdf.extractor.data.ListTables;
+import org.apache.poi.hdf.extractor.util.BTreeSet;
+import org.apache.poi.hdf.extractor.util.ChpxNode;
+import org.apache.poi.hdf.extractor.util.NumberFormatter;
+import org.apache.poi.hdf.extractor.util.PapxNode;
+import org.apache.poi.hdf.extractor.util.PropertyNode;
+import org.apache.poi.hdf.extractor.util.SepxNode;
import org.apache.poi.poifs.filesystem.DocumentEntry;
-
+import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.util.LittleEndian;
/**
/** used for XSL-FO table conversion*/
StringBuffer _cellBuffer;
/** used for XSL-FO table conversion*/
- ArrayList _cells;
+ ArrayList<String> _cells;
/** used for XSL-FO table conversion*/
- ArrayList _table;
+ ArrayList<TableRow> _table;
/** document's header and footer information*/
byte[] _plcfHdd;
{
int textStart = Utils.convertBytesToInt(_header, 0x18);
int textEnd = Utils.convertBytesToInt(_header, 0x1c);
- ArrayList textPieces = findProperties(textStart, textEnd, _text.root);
+ ArrayList<PropertyNode> textPieces = findProperties(textStart, textEnd, _text.root);
int size = textPieces.size();
for(int x = 0; x < size; x++)
readFIB();
//get the SEPS for the main document text
- ArrayList sections = findProperties(_fcMin, _fcMin + _ccpText, _sectionTable.root);
+ ArrayList<PropertyNode> sections = findProperties(_fcMin, _fcMin + _ccpText, _sectionTable.root);
//iterate through sections, paragraphs, and character runs doing what
//you will with the data.
_sectionCounter++;
}
+ @SuppressWarnings("unused")
private int calculateHeaderHeight(int start, int end, int pageWidth)
{
- ArrayList paragraphs = findProperties(start, end, _paragraphTable.root);
+ ArrayList<PropertyNode> paragraphs = findProperties(start, end, _paragraphTable.root);
int size = paragraphs.size();
- ArrayList lineHeights = new ArrayList();
+ ArrayList<Integer> lineHeights = new ArrayList<Integer>();
//StyleContext context = StyleContext.getDefaultStyleContext();
for(int x = 0; x < size; x++)
int lineWidth = 0;
int maxHeight = 0;
- ArrayList textRuns = findProperties(parStart, parEnd, _characterTable.root);
+ ArrayList<PropertyNode> textRuns = findProperties(parStart, parEnd, _characterTable.root);
int charSize = textRuns.size();
//StringBuffer lineBuffer = new StringBuffer();
int charStart = Math.max(parStart, charNode.getStart());
int charEnd = Math.min(parEnd, charNode.getEnd());
- ArrayList text = findProperties(charStart, charEnd, _text.root);
+ ArrayList<PropertyNode> text = findProperties(charStart, charEnd, _text.root);
int textSize = text.size();
StringBuffer buf = new StringBuffer();
return context.getFontMetrics(font);
}*/
+ @SuppressWarnings("unused")
private String createRegion(boolean before, HeaderFooter header, SEP sep, String name)
{
if(header.isEmpty())
// marginBottom + "pt\" " + region + "/>";
}
+ @SuppressWarnings("unused")
private String createRegion(String where, String name)
{
return "<fo:region-" + where + " overflow=\"scroll\" region-name=\"" + name + "\"/>";
{
BTreeSet.BTreeNode root = paragraphTable.root;
- ArrayList pars = findProperties(start, end, root);
+ ArrayList<PropertyNode> pars = findProperties(start, end, root);
//root = characterTable.root;
int size = pars.size();
{
if(_table == null)
{
- _table = new ArrayList();
+ _table = new ArrayList<TableRow>();
}
TAP tap = (TAP)StyleSheet.uncompressProperty(papx, new TAP(), _styleSheet);
TableRow nextRow = new TableRow(_cells, tap);
}
+ @SuppressWarnings("unused")
private void addListParagraphContent(LVL lvl, StringBuffer blockBuffer, PAP pap,
PapxNode currentNode, int start, int end,
StyleDescription std)
addParagraphProperties(pap, blockBuffer);
- ArrayList charRuns = findProperties(Math.max(currentNode.getStart(), start),
+ ArrayList<PropertyNode> charRuns = findProperties(Math.max(currentNode.getStart(), start),
Math.min(currentNode.getEnd(), end),
_characterTable.root);
int len = charRuns.size();
int charStart = Math.max(charNode.getStart(), currentNode.getStart());
int charEnd = Math.min(charNode.getEnd(), currentNode.getEnd());
- ArrayList textRuns = findProperties(charStart, charEnd, _text.root);
+ ArrayList<PropertyNode> textRuns = findProperties(charStart, charEnd, _text.root);
int textRunLen = textRuns.size();
for(int y = 0; y < textRunLen; y++)
{
{
addParagraphProperties(pap, blockBuffer);
- ArrayList charRuns = findProperties(Math.max(currentNode.getStart(), start),
+ ArrayList<PropertyNode> charRuns = findProperties(Math.max(currentNode.getStart(), start),
Math.min(currentNode.getEnd(), end),
_characterTable.root);
int len = charRuns.size();
int charStart = Math.max(charNode.getStart(), currentNode.getStart());
int charEnd = Math.min(charNode.getEnd(), currentNode.getEnd());
- ArrayList textRuns = findProperties(charStart, charEnd, _text.root);
+ ArrayList<PropertyNode> textRuns = findProperties(charStart, charEnd, _text.root);
int textRunLen = textRuns.size();
for(int y = 0; y < textRunLen; y++)
{
if(_cells == null)
{
- _cells = new ArrayList();
+ _cells = new ArrayList<String>();
}
closeLine(_cellBuffer);
closeBlock(_cellBuffer);
/**
* finds all chpx's that are between start and end
*/
- private ArrayList findProperties(int start, int end, BTreeSet.BTreeNode root)
+ private ArrayList<PropertyNode> findProperties(int start, int end, BTreeSet.BTreeNode root)
{
- ArrayList results = new ArrayList();
+ ArrayList<PropertyNode> results = new ArrayList<PropertyNode>();
BTreeSet.Entry[] entries = root._entries;
for(int x = 0; x < entries.length; x++)
{
if(child != null)
{
- ArrayList beforeItems = findProperties(start, end, child);
+ ArrayList<PropertyNode> beforeItems = findProperties(start, end, child);
results.addAll(beforeItems);
}
results.add(xNode);
{
if(child != null)
{
- ArrayList beforeItems = findProperties(start, end, child);
+ ArrayList<PropertyNode> beforeItems = findProperties(start, end, child);
results.addAll(beforeItems);
}
break;
}
else if(child != null)
{
- ArrayList afterItems = findProperties(start, end, child);
+ ArrayList<PropertyNode> afterItems = findProperties(start, end, child);
results.addAll(afterItems);
}
}
{
buf.append("</fo:block>\r\n");
}
- private ArrayList findPAPProperties(int start, int end, BTreeSet.BTreeNode root)
+ @SuppressWarnings("unused")
+ private ArrayList<PropertyNode> findPAPProperties(int start, int end, BTreeSet.BTreeNode root)
{
- ArrayList results = new ArrayList();
+ ArrayList<PropertyNode> results = new ArrayList<PropertyNode>();
BTreeSet.Entry[] entries = root._entries;
for(int x = 0; x < entries.length; x++)
{
if(child != null)
{
- ArrayList beforeItems = findPAPProperties(start, end, child);
+ ArrayList<PropertyNode> beforeItems = findPAPProperties(start, end, child);
results.addAll(beforeItems);
}
results.add(papxNode);
{
if(child != null)
{
- ArrayList beforeItems = findPAPProperties(start, end, child);
+ ArrayList<PropertyNode> beforeItems = findPAPProperties(start, end, child);
results.addAll(beforeItems);
}
break;
}
else if(child != null)
{
- ArrayList afterItems = findPAPProperties(start, end, child);
+ ArrayList<PropertyNode> afterItems = findPAPProperties(start, end, child);
results.addAll(afterItems);
}
}
_headerBuffer.append("</fo:simple-page-master>\r\n");
return thisPage;
}
+ @SuppressWarnings("unused")
private void addBorder(StringBuffer buf, short[] brc, String where)
{
if((brc[0] & 0xff00) != 0 && brc[0] != -1)
test.flush();
test.close();
}
- catch(Throwable t)
+ catch(Exception t)
{
t.printStackTrace();
}
StringBuffer rowBuffer = tableBodyBuffer;
TableRow row = (TableRow)_table.get(x);
TAP tap = row.getTAP();
- ArrayList cells = row.getCells();
+ ArrayList<String> cells = row.getCells();
if(tap._fTableHeader)
{