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

(-)BoundSheetRecord.java (-7 / +19 lines)
Lines 57-62 Link Here
57
import org.apache.poi.util.LittleEndian;
57
import org.apache.poi.util.LittleEndian;
58
import org.apache.poi.util.StringUtil;
58
import org.apache.poi.util.StringUtil;
59
59
60
import java.io.UnsupportedEncodingException;
61
60
/**
62
/**
61
 * Title:        Bound Sheet Record (aka BundleSheet) <P>
63
 * Title:        Bound Sheet Record (aka BundleSheet) <P>
62
 * Description:  Defines a sheet within a workbook.  Basically stores the sheetname
64
 * Description:  Defines a sheet within a workbook.  Basically stores the sheetname
Lines 299-311 Link Here
299
        data[10 + offset] = (byte) ( getSheetnameLength() );
301
        data[10 + offset] = (byte) ( getSheetnameLength() );
300
        data[11 + offset] = getCompressedUnicodeFlag();
302
        data[11 + offset] = getCompressedUnicodeFlag();
301
303
302
		String unicodeString = new String(getSheetname().getBytes("Unicode"),"Unicode");
304
        try {
303
305
            String unicodeString = new String(getSheetname().getBytes("Unicode"),"Unicode");
304
        if ( ( field_4_compressed_unicode_flag & 0x01 ) == 1 )
306
            if ( ( field_4_compressed_unicode_flag & 0x01 ) == 1 ) {
305
            StringUtil.putUncompressedUnicode( unicodeString, data, 12 + offset );
307
                StringUtil.putUncompressedUnicode( unicodeString, data, 12 + offset );
306
        else
308
			}
307
            StringUtil.putCompressedUnicode( unicodeString, data, 12 + offset );
309
            else {
308
310
                StringUtil.putCompressedUnicode( unicodeString, data, 12 + offset );
311
			}
312
	    } catch (UnsupportedEncodingException e) {
313
            if (getOptionFlags() == 0) {
314
                StringUtil.putCompressedUnicode(getSheetname(), data, 12 + offset);
315
            }
316
            else {
317
                StringUtil.putUncompressedUnicode(getSheetname(), data, 12 + offset);
318
            }
319
        }
309
320
310
        return getRecordSize();
321
        return getRecordSize();
311
322
Lines 342-344 Link Here
342
        return this.sid;
353
        return this.sid;
343
    }
354
    }
344
}
355
}
356

Return to bug 15008