Skip to content

Commit

Permalink
Merge pull request #287 from liaochong/Hotfix/3.9.10
Browse files Browse the repository at this point in the history
Hotfix/3.9.10
  • Loading branch information
liaochong authored Nov 21, 2020
2 parents b4a7d53 + 47a46c2 commit f870109
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>com.github.liaochong</groupId>
<artifactId>myexcel</artifactId>
<version>3.9.9</version>
<version>3.9.10</version>
<packaging>jar</packaging>

<name>myexcel</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public abstract class AbstractExcelBuilder implements ExcelBuilder {

protected HtmlToExcelFactory htmlToExcelFactory = new HtmlToExcelFactory();

AbstractExcelBuilder(Class<? extends TemplateHandler> templateHandlerClass) {
protected AbstractExcelBuilder(Class<? extends TemplateHandler> templateHandlerClass) {
widthStrategy(WidthStrategy.COMPUTE_AUTO_WIDTH);
this.templateHandler = ReflectUtil.newInstance(templateHandlerClass);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.poi.util.Units;
import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFDataValidation;
Expand Down Expand Up @@ -353,8 +354,12 @@ private void setImage(Td td, Sheet sheet) {
int pictureIdx = workbook.addPicture(bytes, format);
Drawing drawing = sheet.createDrawingPatriarch();
ClientAnchor anchor = createHelper.createClientAnchor();
anchor.setDx1(isHssf ? 2 : Units.EMU_PER_PIXEL);
anchor.setDy1(isHssf ? 2 : Units.EMU_PER_PIXEL);
anchor.setCol1(td.getCol());
anchor.setRow1(td.getRow());
anchor.setCol2(td.getColBound());
anchor.setRow2(td.getRowBound());
Picture pict = drawing.createPicture(anchor, pictureIdx);
pict.resize(1, 1);
} catch (IOException e) {
Expand Down

0 comments on commit f870109

Please sign in to comment.