https://bz.apache.org/bugzilla/show_bug.cgi?id=66173

--- Comment #2 from Axel Richter <[email protected]> ---
Your fixes for HSSF might be wrong as the binary PaneTypes *are* 0-based.
See:
https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-xls/016387b9-9dac-43df-b226-34800b3c2198.

But the pane in SelectionRecord seems always be 3 (PANE_UPPER_LEFT) when split
pane is set. Actually InternalSheet.createSplitPane always sets
PANE_LOWER_RIGHT. That seems to be wrong.

Code to check:

import java.io.FileInputStream;
import org.apache.poi.hssf.usermodel.*;

class ReadHSSFSplitPane {

 public static void main(String[] args) throws Exception {
  try (
       HSSFWorkbook workbook = new HSSFWorkbook(new
FileInputStream("./Excel.xls")) ) {

   HSSFSheet sheet = workbook.getSheetAt(0);

   org.apache.poi.hssf.model.InternalSheet internalSheet = sheet.getSheet();
   org.apache.poi.hssf.record.PaneRecord pane =
(org.apache.poi.hssf.record.PaneRecord)internalSheet.findFirstRecordBySid(org.apache.poi.hssf.record.PaneRecord.sid);
   System.out.println(pane);  
   org.apache.poi.hssf.record.SelectionRecord sel = 
(org.apache.poi.hssf.record.SelectionRecord)internalSheet.findFirstRecordBySid(org.apache.poi.hssf.record.SelectionRecord.sid);
   System.out.println(sel);

  }
 }
}

Pane in sel is always 3, independent of what split panes are set.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to