Quellcode durchsuchen

Support for changing sheet order submitted by Ruel Loehr. Probably should also add access to this in usermodel?


git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353018 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_2_0_PRE1
Avik Sengupta vor 21 Jahren
Ursprung
Commit
3d3bafb7a6
1 geänderte Dateien mit 13 neuen und 0 gelöschten Zeilen
  1. 13
    0
      src/java/org/apache/poi/hssf/model/Workbook.java

+ 13
- 0
src/java/org/apache/poi/hssf/model/Workbook.java Datei anzeigen

@@ -437,6 +437,19 @@ public class Workbook implements Model {
sheet.setSheetnameLength( (byte)sheetname.length() );
sheet.setCompressedUnicodeFlag( (byte)encoding );
}
/**
* sets the order of appearance for a given sheet.
*
* @param sheetname the name of the sheet to reorder
* @param pos the position that we want to insert the sheet into (0 based)
*/
public void setSheetOrder(String sheetname, int pos ) {
int sheetNumber = getSheetIndex(sheetname);
//remove the sheet that needs to be reordered and place it in the spot we want
boundsheets.add(pos, boundsheets.remove(sheetNumber));
}

/**
* gets the name for a given sheet.

Laden…
Abbrechen
Speichern