+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2002 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ * if any, must include the following acknowledgment:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Apache" and "Apache Software Foundation" and
+ * "Apache POI" must not be used to endorse or promote products
+ * derived from this software without prior written permission. For
+ * written permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ * "Apache POI", nor may "Apache" appear in their name, without
+ * prior written permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
/*
* HDFObjectFactory.java
*
initFormattingProperties();
}
-
+
public static List getTypes(InputStream istream) throws IOException
{
List results = new ArrayList(1);
-
+
//do Ole stuff
POIFSFileSystem filesystem = new POIFSFileSystem(istream);
-
+
DocumentEntry headerProps =
(DocumentEntry)filesystem.getRoot().getEntry("WordDocument");
// initTableStream();
// initTextPieces();
// initFormattingProperties();
-
+
results.add(fib);
return results;
}
-
+
/**
* Initializes the table stream
*
private void initTableStream() throws IOException
{
String tablename = null;
- if(_fib.isTabletype())
+ if(!_fib.isFWhichTblStm())
{
tablename="1Table";
}
*/
private void initTextPieces() throws IOException
{
- int pos = _fib.getTextPieceTableOffset();
+ int pos = _fib.getFcClx();
//skips through the prms before we reach the piece table. These contain data
//for actual fast saved files
*/
private void initCharacterProperties()
{
- int charOffset = _fib.getChp_bin_table_offset();
- int charPlcSize = _fib.getChp_bin_table_size();
+ int charOffset = _fib.getFcPlcfbteChpx();
+ int charPlcSize = _fib.getLcbPlcfbteChpx();
int arraySize = (charPlcSize - 4)/8;
private void initParagraphProperties()
{
//find paragraphs
- int parOffset = _fib.getPap_bin_table_offset();
- int parPlcSize = _fib.getPap_bin_table_size();
+ int parOffset = _fib.getFcPlcfbtePapx();
+ int parPlcSize = _fib.getLcbPlcfbtePapx();
int arraySize = (parPlcSize - 4)/8;
//first we must go through the bin table and find the fkps
private void initSectionProperties()
{
//find sections
- int fcMin = _fib.getOffsetFirstChar();
- int plcfsedFC = _fib.getSectionPlcOffset();
- int plcfsedSize = _fib.getSectionPlcSize();
+ int fcMin = _fib.getFcMin();
+ int plcfsedFC = _fib.getFcPlcfsed();
+ int plcfsedSize = _fib.getLcbPlcfsed();
byte[] plcfsed = new byte[plcfsedSize];
System.arraycopy(_tableBuffer, plcfsedFC, plcfsed, 0, plcfsedSize);
*/
private void initDocumentProperties()
{
- int pos = _fib.getDOPOffset();
- int size = _fib.getDOPSize();
+ int pos = _fib.getFcDop();
+ int size = _fib.getLcbDop();
byte[] dopArray = new byte[size];
System.arraycopy(_tableBuffer, pos, dopArray, 0, size);
*/
private void createStyleSheet()
{
- int stshIndex = _fib.getStylesheetOffset();
- int stshSize = _fib.getStylesheetSize();
+ int stshIndex = _fib.getFcStshf();
+ int stshSize = _fib.getLcbStshf();
byte[] stsh = new byte[stshSize];
System.arraycopy(_tableBuffer, stshIndex, stsh, 0, stshSize);
*/
private void createFontTable()
{
- int fontTableIndex = _fib.getFonts_bin_table_offset();
- int fontTableSize = _fib.getFonts_bin_table_size();
+ int fontTableIndex = _fib.getFcSttbfffn();
+ int fontTableSize = _fib.getLcbSttbfffn();
byte[] fontTable = new byte[fontTableSize];
System.arraycopy(_tableBuffer, fontTableIndex, fontTable, 0, fontTableSize);
_fonts = new FontTable(fontTable);