From 034f4c5cf5c233567c328682084101a9c770aa7a Mon Sep 17 00:00:00 2001 From: Yegor Kozlov Date: Fri, 27 May 2011 18:46:04 +0000 Subject: [PATCH] Bug 51098 - Error in calculating image width/height, if image fits into one cell git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1128422 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/xssf/usermodel/XSSFPicture.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPicture.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPicture.java index 728a8dd93..37bede4ca 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPicture.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPicture.java @@ -215,10 +215,6 @@ public final class XSSFPicture extends XSSFShape implements Picture { float w = 0; int col2 = anchor.getCol1(); int dx2 = 0; - if(anchor.getDx1() > 0){ - w += getColumnWidthInPixels(col2) - anchor.getDx1(); - col2++; - } for (;;) { w += getColumnWidthInPixels(col2); @@ -227,7 +223,7 @@ public final class XSSFPicture extends XSSFShape implements Picture { } if(w > scaledWidth) { - double cw = getColumnWidthInPixels(col2 + 1); + double cw = getColumnWidthInPixels(col2 ); double delta = w - scaledWidth; dx2 = (int)(EMU_PER_PIXEL*(cw-delta)); } @@ -238,11 +234,6 @@ public final class XSSFPicture extends XSSFShape implements Picture { int row2 = anchor.getRow1(); int dy2 = 0; - if(anchor.getDy1() > 0){ - h += getRowHeightInPixels(row2) - anchor.getDy1()/EMU_PER_PIXEL; - row2++; - } - for (;;) { h += getRowHeightInPixels(row2); if(h > scaledHeight) break;