-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a17179
commit 56ab48e
Showing
4 changed files
with
52 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/org/apache/poi/hssf/usermodel/PoiHssfUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.apache.poi.hssf.usermodel; | ||
|
||
import org.apache.poi.ss.usermodel.Row; | ||
import org.apache.poi.util.BitField; | ||
import org.apache.poi.util.BitFieldFactory; | ||
import org.apache.poi.xssf.usermodel.XSSFRow; | ||
|
||
/** | ||
* utils | ||
* | ||
* @author Jiaju Zhuang | ||
*/ | ||
public class PoiHssfUtils { | ||
|
||
/** | ||
* Whether to customize the height | ||
*/ | ||
public static final BitField CUSTOM_HEIGHT = BitFieldFactory.getInstance(0x640); | ||
|
||
/** | ||
* Whether to customize the height | ||
* | ||
* @param row | ||
* @return | ||
*/ | ||
public static boolean customHeight(Row row) { | ||
if (row instanceof XSSFRow) { | ||
XSSFRow xssfRow = (XSSFRow)row; | ||
return xssfRow.getCTRow().getCustomHeight(); | ||
} | ||
if (row instanceof HSSFRow) { | ||
HSSFRow hssfRow = (HSSFRow)row; | ||
return CUSTOM_HEIGHT.getValue(hssfRow.getRowRecord().getOptionFlags()) == 1; | ||
} | ||
return false; | ||
} | ||
} |
12 changes: 7 additions & 5 deletions
12
src/test/java/com/alibaba/easyexcel/test/temp/issue1662/Issue1662Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters