Skip to content

Commit

Permalink
fixed #2 - update column width if automatic filter is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
musketyr committed Nov 24, 2017
1 parent a71deb7 commit 9967447
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public String toString() {

@Override
public void resolve() {
processAutoColumns();
processAutomaticFilter();
processAutoColumns();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

class PoiSheetDefinition extends AbstractSheetDefinition implements SheetDefinition {

private static final int WIDTH_ARROW_BUTTON = 2 * 255;

private final XSSFSheet xssfSheet;

PoiSheetDefinition(PoiWorkbookDefinition workbook, XSSFSheet xssfSheet) {
Expand Down Expand Up @@ -91,6 +93,9 @@ protected XSSFSheet getSheet() {
protected void processAutoColumns() {
for (Integer index : autoColumns) {
xssfSheet.autoSizeColumn(index);
if (automaticFilter) {
xssfSheet.setColumnWidth(index, xssfSheet.getColumnWidth(index) + WIDTH_ARROW_BUTTON);
}
}
}

Expand Down

0 comments on commit 9967447

Please sign in to comment.