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

(-)src/scratchpad/src/org/apache/poi/hwpf/model/Sttb.java (-6 / +17 lines)
Lines 16-26 Link Here
16
==================================================================== */
16
==================================================================== */
17
package org.apache.poi.hwpf.model;
17
package org.apache.poi.hwpf.model;
18
18
19
import java.util.Arrays;
20
19
import org.apache.poi.util.LittleEndian;
21
import org.apache.poi.util.LittleEndian;
22
import org.apache.poi.util.POILogFactory;
23
import org.apache.poi.util.POILogger;
20
import org.apache.poi.util.StringUtil;
24
import org.apache.poi.util.StringUtil;
21
25
22
import java.util.Arrays;
23
24
/**
26
/**
25
 * The STTB is a string table that is made up of a header that is followed by an
27
 * The STTB is a string table that is made up of a header that is followed by an
26
 * array of elements. The cData value specifies the number of elements that are
28
 * array of elements. The cData value specifies the number of elements that are
Lines 75-87 Link Here
75
    {
77
    {
76
        short ffff = LittleEndian.getShort( buffer, startOffset );
78
        short ffff = LittleEndian.getShort( buffer, startOffset );
77
        int offset = startOffset + LittleEndian.SHORT_SIZE;
79
        int offset = startOffset + LittleEndian.SHORT_SIZE;
78
80
        for (int i = startOffset; i < buffer.length; i++) {
81
            System.out.println(buffer[i]);
82
        }
79
        if ( ffff != (short) 0xffff )
83
        if ( ffff != (short) 0xffff )
80
        {
84
        {
81
            // Non-extended character Pascal strings
85
            POILogFactory.getLogger(Sttb.class).log(
82
            throw new UnsupportedOperationException(
86
                    POILogger.WARN,
83
                    "Non-extended character Pascal strings are not supported right now. "
87
                    "Non-extended character Pascal strings are not supported right now. "
84
                            + "Please, contact POI developers for update." );
88
                            + "Creating empty values in the RevisionMarkAuthorTable for now.  " +
89
                    "Please, contact POI developers for update.");
90
            //set data and extraData to empty values to avoid
91
            //downstream NPE in case someone calls getEntries on RevisionMarkAuthorTable
92
            _data = new String[0];
93
            _extraData = new byte[0][];
94
95
            return;
85
        }
96
        }
86
        // strings are extended character strings
97
        // strings are extended character strings
87
98

Return to bug 56880