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

(-)src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java (+29 lines)
Lines 445-450 Link Here
445
        return workbook.getSheetName(sheet);
445
        return workbook.getSheetName(sheet);
446
    }
446
    }
447
447
448
    /**
449
     * check whether a sheet is hidden
450
     * @param sheet Number
451
     * @return True if sheet is hidden
452
     */
453
454
    public boolean isSheetHidden(int sheet) {
455
        if (sheet > (sheets.size() - 1))
456
        {
457
            throw new RuntimeException("Sheet out of bounds");
458
        }
459
        return workbook.isSheetHidden(sheet);
460
    }
461
462
    /**
463
     * Hide or unhide a sheet
464
     * 
465
     * @param sheetnum The sheet number
466
     * @param hidden True to mark the sheet as hidden, false otherwise
467
     */
468
469
    public void setSheetHidden(int sheet, boolean hidden) {
470
        if (sheet > (sheets.size() - 1))
471
        {
472
            throw new RuntimeException("Sheet out of bounds");
473
        }
474
        workbook.setSheetHidden(sheet,hidden);
475
    }
476
    
448
    /*
477
    /*
449
     * get the sheet's index
478
     * get the sheet's index
450
     * @param name  sheet name
479
     * @param name  sheet name
(-)src/java/org/apache/poi/hssf/model/Workbook.java (+23 lines)
Lines 543-548 Link Here
543
    }
543
    }
544
544
545
    /**
545
    /**
546
     * gets the hidden flag for a given sheet.
547
     *
548
     * @param sheetnum the sheet number (0 based)
549
     * @return True if sheet is hidden
550
     */
551
552
    public boolean isSheetHidden(int sheetnum) {
553
        BoundSheetRecord bsr = ( BoundSheetRecord ) boundsheets.get(sheetnum);
554
        return bsr.isHidden();
555
    }
556
557
    /**
558
     * Hide or unhide a sheet
559
     * 
560
     * @param sheetnum The sheet number
561
     * @param hidden True to mark the sheet as hidden, false otherwise
562
     */
563
    
564
    public void setSheetHidden(int sheetnum, boolean hidden) {
565
        BoundSheetRecord bsr = ( BoundSheetRecord ) boundsheets.get(sheetnum);
566
        bsr.setHidden(hidden);
567
    }
568
    /**
546
     * get the sheet's index
569
     * get the sheet's index
547
     * @param name  sheet name
570
     * @param name  sheet name
548
     * @return sheet index or -1 if it was not found.
571
     * @return sheet index or -1 if it was not found.
(-)src/java/org/apache/poi/hssf/record/BoundSheetRecord.java (+10 lines)
Lines 19-24 Link Here
19
19
20
package org.apache.poi.hssf.record;
20
package org.apache.poi.hssf.record;
21
21
22
import org.apache.poi.util.BitFieldFactory;
22
import org.apache.poi.util.LittleEndian;
23
import org.apache.poi.util.LittleEndian;
23
import org.apache.poi.util.StringUtil;
24
import org.apache.poi.util.StringUtil;
24
25
Lines 36-41 Link Here
36
public class BoundSheetRecord
37
public class BoundSheetRecord
37
        extends Record
38
        extends Record
38
{
39
{
40
    private static final short HIDDEN_FLAG_MASK = 0x01;
39
    public final static short sid = 0x85;
41
    public final static short sid = 0x85;
40
    private int field_1_position_of_BOF;
42
    private int field_1_position_of_BOF;
41
    private short field_2_option_flags;
43
    private short field_2_option_flags;
Lines 301-304 Link Here
301
    {
303
    {
302
        return sid;
304
        return sid;
303
    }
305
    }
306
307
    public boolean isHidden() {
308
	    return BitFieldFactory.getInstance(HIDDEN_FLAG_MASK).isSet(field_2_option_flags);
309
    }
310
311
    public void setHidden(boolean hidden) {
312
	    field_2_option_flags = BitFieldFactory.getInstance(HIDDEN_FLAG_MASK).setShortBoolean(field_2_option_flags, hidden);
313
    }
304
}
314
}
(-)src/scratchpad/ooxml-src/org/apache/poi/hssf/usermodel/HSSFXMLWorkbook.java (+4 lines)
Lines 36-39 Link Here
36
	public HSSFXML _getHSSFXML() {
36
	public HSSFXML _getHSSFXML() {
37
		return hssfXML;
37
		return hssfXML;
38
	}
38
	}
39
	
40
	public String getSharedString(int index) {
41
		return hssfXML.getSharedString(index);
42
	}
39
}
43
}
(-)src/scratchpad/ooxml-src/org/apache/poi/hssf/usermodel/HSSFXMLCell.java (-23 / +31 lines)
Lines 17-48 Link Here
17
package org.apache.poi.hssf.usermodel;
17
package org.apache.poi.hssf.usermodel;
18
18
19
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCell;
19
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCell;
20
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STCellType;
20
21
21
/**
22
/**
22
 * User facing wrapper around an underlying cell object
23
 * User facing wrapper around an underlying cell object
23
 */
24
 */
24
public class HSSFXMLCell {
25
public class HSSFXMLCell {
25
	private CTCell cell;
26
    private CTCell cell;
26
	public HSSFXMLCell(CTCell rawCell) {
27
27
		this.cell = rawCell;
28
    /** The workbook to which this cell belongs */
28
	}
29
    private final HSSFXMLWorkbook workbook;
29
	
30
30
	/**
31
    public HSSFXMLCell(CTCell rawCell, HSSFXMLWorkbook workbook) {
31
	 * Formats the cell's contents, based on its type,
32
        this.cell = rawCell;
32
	 *  and returns it as a string.
33
        this.workbook = workbook;
33
	 */
34
    }
34
	public String getStringValue() {
35
35
		if(cell.getV() != null) {
36
    /**
36
			return cell.getV();
37
     * Formats the cell's contents, based on its type,
37
		}
38
     *  and returns it as a string.
38
		if(cell.getIs() != null) {
39
     */
39
			return cell.getIs().getT();
40
    public String getStringValue() {
40
		}
41
41
		// TODO: Formatting
42
        switch (cell.getT().intValue()) {
42
		return Long.toString(cell.getS());
43
        case STCellType.INT_S:
43
	}
44
            return this.workbook.getSharedString(Integer.valueOf(cell.getV()));
44
	
45
        case STCellType.INT_N:
45
	public String toString() {
46
            return cell.getV();
46
		return cell.getR() + " - " + getStringValue(); 
47
        // TODO: support other types
47
	}
48
        default:
49
            return "UNSUPPORTED CELL TYPE: '" + cell.getT() + "'";
50
        }
51
    }
52
53
    public String toString() {
54
        return cell.getR() + " - " + getStringValue(); 
55
    }
48
}
56
}
(-)src/scratchpad/ooxml-src/org/apache/poi/hssf/model/SharedStringsTable.java (+81 lines)
Line 0 Link Here
1
/* ====================================================================
2
   Licensed to the Apache Software Foundation (ASF) under one or more
3
   contributor license agreements.  See the NOTICE file distributed with
4
   this work for additional information regarding copyright ownership.
5
   The ASF licenses this file to You under the Apache License, Version 2.0
6
   (the "License"); you may not use this file except in compliance with
7
   the License.  You may obtain a copy of the License at
8
9
       http://www.apache.org/licenses/LICENSE-2.0
10
11
   Unless required by applicable law or agreed to in writing, software
12
   distributed under the License is distributed on an "AS IS" BASIS,
13
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
   See the License for the specific language governing permissions and
15
   limitations under the License.
16
==================================================================== */
17
18
package org.apache.poi.hssf.model;
19
20
import java.io.IOException;
21
import java.io.InputStream;
22
import java.util.LinkedList;
23
24
import javax.xml.parsers.DocumentBuilder;
25
import javax.xml.parsers.DocumentBuilderFactory;
26
import javax.xml.parsers.ParserConfigurationException;
27
28
import org.openxml4j.opc.PackagePart;
29
import org.w3c.dom.Document;
30
import org.w3c.dom.Element;
31
import org.w3c.dom.NodeList;
32
import org.xml.sax.SAXException;
33
34
35
public class SharedStringsTable extends LinkedList<String> {
36
37
    private static final String MAIN_SML_NS_URI = "http://schemas.openxmlformats.org/spreadsheetml/2006/main";
38
39
    /** XXX: should have been using an XMLBeans object, but it cannot parse the sharedStrings schema, so we'll use DOM temporarily.
40
    CTSst sst;
41
    */
42
43
    private PackagePart part;
44
45
    private DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
46
    
47
    private DocumentBuilder parser;
48
    
49
    public SharedStringsTable(PackagePart part) throws IOException {
50
        this.part = part;
51
        InputStream is = part.getInputStream();
52
        try {
53
            builderFactory.setNamespaceAware(true);
54
            this.parser = builderFactory.newDocumentBuilder();
55
            readFrom(is);
56
        } catch (ParserConfigurationException e) {
57
            throw new RuntimeException(e);
58
        } catch (SAXException e) {
59
            throw new RuntimeException(e);
60
        } finally {
61
            if (is != null) is.close();
62
        }
63
64
65
    }
66
67
    public void readFrom(InputStream is) throws IOException, SAXException {
68
        Document doc = parser.parse(is);
69
        Element root = doc.getDocumentElement();
70
        NodeList sis = root.getElementsByTagNameNS(MAIN_SML_NS_URI, "si");
71
        for (int i = 0 ; i < sis.getLength() ; ++i) {
72
            Element si = (Element) sis.item(i);
73
            NodeList ts = si.getElementsByTagNameNS(MAIN_SML_NS_URI, "t");
74
            String t = "";
75
            if (ts.getLength() > 0 && ts.item(0).getFirstChild() != null) {
76
                t = ts.item(0).getFirstChild().getNodeValue();
77
                add(t);
78
            }
79
        }
80
    }
81
}
0
  + text/plain
82
  + text/plain
1
  + Date Revision Author HeadURL Id
83
  + Date Revision Author HeadURL Id
2
  + native
84
  + native
(-)src/scratchpad/ooxml-src/org/apache/poi/hssf/HSSFXML.java (+15 lines)
Lines 18-23 Link Here
18
18
19
import java.io.IOException;
19
import java.io.IOException;
20
20
21
import org.apache.poi.hssf.model.SharedStringsTable;
21
import org.apache.poi.hxf.HXFDocument;
22
import org.apache.poi.hxf.HXFDocument;
22
import org.apache.xmlbeans.XmlException;
23
import org.apache.xmlbeans.XmlException;
23
import org.openxml4j.exceptions.OpenXML4JException;
24
import org.openxml4j.exceptions.OpenXML4JException;
Lines 45-58 Link Here
45
	public static final String MAIN_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml";
46
	public static final String MAIN_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml";
46
	public static final String SHEET_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml";
47
	public static final String SHEET_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml";
47
	public static final String SHARED_STRINGS_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml";
48
	public static final String SHARED_STRINGS_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml";
49
	public static final String SHARED_STRINGS_RELATION_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings";
48
	
50
	
49
	private WorkbookDocument workbookDoc;
51
	private WorkbookDocument workbookDoc;
50
	
52
	
53
	private SharedStringsTable sharedStrings;
54
51
	public HSSFXML(Package container) throws OpenXML4JException, IOException, XmlException {
55
	public HSSFXML(Package container) throws OpenXML4JException, IOException, XmlException {
52
		super(container, MAIN_CONTENT_TYPE);
56
		super(container, MAIN_CONTENT_TYPE);
53
		
57
		
54
		workbookDoc =
58
		workbookDoc =
55
			WorkbookDocument.Factory.parse(basePart.getInputStream());
59
			WorkbookDocument.Factory.parse(basePart.getInputStream());
60
		
61
		PackagePart ssPart = getSinglePartByRelationType(SHARED_STRINGS_RELATION_TYPE, basePart);
62
		if (ssPart != null) {
63
			sharedStrings = new SharedStringsTable(ssPart);
64
		} else {
65
			
66
		}
56
	}
67
	}
57
	
68
	
58
	/**
69
	/**
Lines 81-84 Link Here
81
			WorksheetDocument.Factory.parse(sheetPart.getInputStream());
92
			WorksheetDocument.Factory.parse(sheetPart.getInputStream());
82
		return sheetDoc.getWorksheet();
93
		return sheetDoc.getWorksheet();
83
	}
94
	}
95
	
96
	public String getSharedString(int index) {
97
		return this.sharedStrings.get(index);
98
	}
84
}
99
}
(-)src/scratchpad/ooxml-src/org/apache/poi/hssf/extractor/HXFExcelExtractor.java (-1 / +1 lines)
Lines 117-123 Link Here
117
							}
117
							}
118
						}
118
						}
119
						if(!done) {
119
						if(!done) {
120
							HSSFXMLCell uCell = new HSSFXMLCell(cell);
120
							HSSFXMLCell uCell = new HSSFXMLCell(cell, workbook);
121
							text.append(uCell.getStringValue());
121
							text.append(uCell.getStringValue());
122
						}
122
						}
123
					}
123
					}
(-)src/scratchpad/ooxml-src/org/apache/poi/hxf/HXFDocument.java (-1 / +22 lines)
Lines 104-115 Link Here
104
104
105
	/**
105
	/**
106
	 * Fetches the (single) PackagePart which is defined as
106
	 * Fetches the (single) PackagePart which is defined as
107
	 *  the supplied relation content type of the specified part, 
108
	 *  or null if none found.
109
	 * @param relationType The relation content type to search for
110
	 * @throws IllegalArgumentException If we find more than one part of that type
111
	 * TODO: this sucks! Make Package and PackagePart implement common intf that defines getRelationshipsByType & friends
112
	 */
113
	protected PackagePart getSinglePartByRelationType(String relationType, PackagePart part) throws IllegalArgumentException, OpenXML4JException {
114
		PackageRelationshipCollection rels =
115
			part.getRelationshipsByType(relationType);
116
		if(rels.size() == 0) {
117
			return null;
118
		}
119
		if(rels.size() > 1) {
120
			throw new IllegalArgumentException("Found " + rels.size() + " relations for the type " + relationType + ", should only ever be one!");
121
		}
122
		PackageRelationship rel = rels.getRelationship(0);
123
		return getPackagePart(rel);
124
	}
125
	
126
	/**
127
	 * Fetches the (single) PackagePart which is defined as
107
	 *  the supplied relation content type of the base
128
	 *  the supplied relation content type of the base
108
	 *  container, or null if none found.
129
	 *  container, or null if none found.
109
	 * @param relationType The relation content type to search for
130
	 * @param relationType The relation content type to search for
110
	 * @throws IllegalArgumentException If we find more than one part of that type
131
	 * @throws IllegalArgumentException If we find more than one part of that type
111
	 */
132
	 */
112
	private PackagePart getSinglePartByRelationType(String relationType) throws IllegalArgumentException, OpenXML4JException {
133
	protected PackagePart getSinglePartByRelationType(String relationType) throws IllegalArgumentException, OpenXML4JException {
113
		PackageRelationshipCollection rels =
134
		PackageRelationshipCollection rels =
114
			container.getRelationshipsByType(relationType);
135
			container.getRelationshipsByType(relationType);
115
		if(rels.size() == 0) {
136
		if(rels.size() == 0) {
(-)src/scratchpad/ooxml-testcases/org/apache/poi/hssf/extractor/TestHXFExcelExtractor.java (-7 / +8 lines)
Lines 18-23 Link Here
18
18
19
import java.io.File;
19
import java.io.File;
20
import java.io.FileInputStream;
20
import java.io.FileInputStream;
21
import java.util.regex.Matcher;
22
import java.util.regex.Pattern;
21
23
22
import junit.framework.TestCase;
24
import junit.framework.TestCase;
23
25
Lines 170-176 Link Here
170
	 *  ExcelExtractor does, when we're both passed
172
	 *  ExcelExtractor does, when we're both passed
171
	 *  the same file, just saved as xls and xlsx
173
	 *  the same file, just saved as xls and xlsx
172
	 */
174
	 */
173
	public void BROKENtestComparedToOLE2() throws Exception {
175
	public void testComparedToOLE2() throws Exception {
174
		HXFExcelExtractor ooxmlExtractor =
176
		HXFExcelExtractor ooxmlExtractor =
175
			new HXFExcelExtractor(simpleXLSX.getPackage());
177
			new HXFExcelExtractor(simpleXLSX.getPackage());
176
		ExcelExtractor ole2Extractor =
178
		ExcelExtractor ole2Extractor =
Lines 181-194 Link Here
181
		for (int i = 0; i < extractors.length; i++) {
183
		for (int i = 0; i < extractors.length; i++) {
182
			POITextExtractor extractor = extractors[i];
184
			POITextExtractor extractor = extractors[i];
183
			
185
			
184
			String text = extractor.getText().replace("\r", "");
186
			String text = extractor.getText().replaceAll("[\r\t]", "");
185
			System.out.println(text.length());
187
			System.out.println(text.length());
186
			System.out.println(text);
188
			System.out.println(text);
187
			assertTrue(text.startsWith("First Sheet\nTest spreadsheet\t\n2nd row\t2nd row 2nd column\n"));
189
			assertTrue(text.startsWith("First Sheet\nTest spreadsheet\n2nd row2nd row 2nd column\n"));
188
			assertTrue(text.endsWith("13.0\nSheet3\n"));
190
			Pattern pattern = Pattern.compile(".*13(\\.0+)?\\s+Sheet3.*", Pattern.DOTALL);
189
			
191
			Matcher m = pattern.matcher(text);
190
			assertTrue(text.length() >= 214);
192
			assertTrue(m.matches());			
191
			assertTrue(text.length() <= 214);
192
		}
193
		}
193
	}
194
	}
194
}
195
}
(-)src/testcases/org/apache/poi/hssf/usermodel/TestSheetHiding.java (-21 / +40 lines)
Lines 19-30 Link Here
19
import java.io.ByteArrayInputStream;
19
import java.io.ByteArrayInputStream;
20
import java.io.ByteArrayOutputStream;
20
import java.io.ByteArrayOutputStream;
21
import java.io.FileInputStream;
21
import java.io.FileInputStream;
22
import java.io.FileNotFoundException;
23
22
23
import junit.framework.TestCase;
24
24
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
25
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
25
26
26
import junit.framework.TestCase;
27
28
/**
27
/**
29
 * Tests for how HSSFWorkbook behaves with XLS files
28
 * Tests for how HSSFWorkbook behaves with XLS files
30
 *  with a WORKBOOK directory entry (instead of the more
29
 *  with a WORKBOOK directory entry (instead of the more
Lines 34-44 Link Here
34
	private String dirPath;
33
	private String dirPath;
35
	private String xlsHidden = "TwoSheetsOneHidden.xls";
34
	private String xlsHidden = "TwoSheetsOneHidden.xls";
36
	private String xlsShown  = "TwoSheetsNoneHidden.xls";
35
	private String xlsShown  = "TwoSheetsNoneHidden.xls";
36
	private HSSFWorkbook wbH;
37
	private HSSFWorkbook wbU;
37
38
38
	protected void setUp() throws Exception {
39
	protected void setUp() throws Exception {
39
		super.setUp();
40
		super.setUp();
40
		
41
		
41
        dirPath = System.getProperty("HSSF.testdata.path");
42
                dirPath = System.getProperty("HSSF.testdata.path");
43
                FileInputStream isH = new FileInputStream(dirPath + "/" + xlsHidden);
44
                POIFSFileSystem fsH = new POIFSFileSystem(isH);
45
                
46
                FileInputStream isU = new FileInputStream(dirPath + "/" + xlsShown);
47
                POIFSFileSystem fsU = new POIFSFileSystem(isU);
48
        
49
                wbH = new HSSFWorkbook(fsH);
50
                wbU = new HSSFWorkbook(fsU);
42
	}
51
	}
43
52
44
	/**
53
	/**
Lines 47-62 Link Here
47
	 *  the hidden flags are
56
	 *  the hidden flags are
48
	 */
57
	 */
49
	public void testTextSheets() throws Exception {
58
	public void testTextSheets() throws Exception {
50
		FileInputStream isH = new FileInputStream(dirPath + "/" + xlsHidden);
59
                // Both should have two sheets
51
		POIFSFileSystem fsH = new POIFSFileSystem(isH);
52
		
53
		FileInputStream isU = new FileInputStream(dirPath + "/" + xlsShown);
54
		POIFSFileSystem fsU = new POIFSFileSystem(isU);
55
56
		HSSFWorkbook wbH = new HSSFWorkbook(fsH);
57
		HSSFWorkbook wbU = new HSSFWorkbook(fsU);
58
		
59
		// Both should have two sheets
60
		assertEquals(2, wbH.sheets.size());
60
		assertEquals(2, wbH.sheets.size());
61
		assertEquals(2, wbU.sheets.size());
61
		assertEquals(2, wbU.sheets.size());
62
		
62
		
Lines 73-82 Link Here
73
		assertEquals(1, wbU.getSheetAt(1).getRow(0).getLastCellNum());
73
		assertEquals(1, wbU.getSheetAt(1).getRow(0).getLastCellNum());
74
		
74
		
75
		// Text should be sheet based
75
		// Text should be sheet based
76
		assertEquals("Sheet1A1", wbH.getSheetAt(0).getRow(0).getCell((short)0).getStringCellValue());
76
		assertEquals("Sheet1A1", wbH.getSheetAt(0).getRow(0).getCell((short)0).getRichStringCellValue().getString());
77
		assertEquals("Sheet2A1", wbH.getSheetAt(1).getRow(0).getCell((short)0).getStringCellValue());
77
		assertEquals("Sheet2A1", wbH.getSheetAt(1).getRow(0).getCell((short)0).getRichStringCellValue().getString());
78
		assertEquals("Sheet1A1", wbU.getSheetAt(0).getRow(0).getCell((short)0).getStringCellValue());
78
		assertEquals("Sheet1A1", wbU.getSheetAt(0).getRow(0).getCell((short)0).getRichStringCellValue().getString());
79
		assertEquals("Sheet2A1", wbU.getSheetAt(1).getRow(0).getCell((short)0).getStringCellValue());
79
		assertEquals("Sheet2A1", wbU.getSheetAt(1).getRow(0).getCell((short)0).getRichStringCellValue().getString());
80
	}
80
	}
81
81
82
	/**
82
	/**
Lines 84-90 Link Here
84
	 *  as expected
84
	 *  as expected
85
	 */
85
	 */
86
	public void testHideUnHideFlags() throws Exception {
86
	public void testHideUnHideFlags() throws Exception {
87
		// TODO
87
                assertTrue(wbH.isSheetHidden(0));
88
                assertFalse(wbH.isSheetHidden(1));
89
                assertFalse(wbU.isSheetHidden(0));
90
                assertFalse(wbU.isSheetHidden(1));
88
	}
91
	}
89
92
90
	/**
93
	/**
Lines 92-98 Link Here
92
	 *  one hidden
95
	 *  one hidden
93
	 */
96
	 */
94
	public void testHide() throws Exception {
97
	public void testHide() throws Exception {
95
		// TODO
98
	        wbU.setSheetHidden(0, true);
99
                assertTrue(wbU.isSheetHidden(0));
100
                assertFalse(wbU.isSheetHidden(1));
101
                ByteArrayOutputStream out = new ByteArrayOutputStream();
102
                wbU.write(out);
103
                out.close();
104
                HSSFWorkbook wb2 = new HSSFWorkbook(new ByteArrayInputStream(out.toByteArray()));
105
                assertTrue(wb2.isSheetHidden(0));
106
                assertFalse(wb2.isSheetHidden(1));
96
	}
107
	}
97
108
98
	/**
109
	/**
Lines 100-105 Link Here
100
	 *  none hidden
111
	 *  none hidden
101
	 */
112
	 */
102
	public void testUnHide() throws Exception {
113
	public void testUnHide() throws Exception {
103
		// TODO
114
                wbH.setSheetHidden(0, false);
115
                assertFalse(wbH.isSheetHidden(0));
116
                assertFalse(wbH.isSheetHidden(1));
117
                ByteArrayOutputStream out = new ByteArrayOutputStream();
118
                wbH.write(out);
119
                out.close();
120
                HSSFWorkbook wb2 = new HSSFWorkbook(new ByteArrayInputStream(out.toByteArray()));
121
                assertFalse(wb2.isSheetHidden(0));
122
                assertFalse(wb2.isSheetHidden(1));
104
	}
123
	}
105
}
124
}

Return to bug 44185