From: Yegor Kozlov Date: Tue, 5 Aug 2008 08:06:50 +0000 (+0000) Subject: fixed bug #44692: HSSFPicture.resize() stretched image when there was a text next... X-Git-Tag: REL_3_2_FINAL~210 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3e0d12d7995769e8d598f27a89d05e3c6cec7776;p=poi.git fixed bug #44692: HSSFPicture.resize() stretched image when there was a text next to it git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@682621 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/documentation/content/xdocs/changes.xml b/src/documentation/content/xdocs/changes.xml index 80b3d0406d..76d4b0e6e8 100644 --- a/src/documentation/content/xdocs/changes.xml +++ b/src/documentation/content/xdocs/changes.xml @@ -37,6 +37,8 @@ + 45472 - Fixed incorrect default row height in OpenOffice 2.3 + 44692 - HSSFPicture.resize() stretched image when there was a text next to it 45543 - Optionally extract comment text with PowerPointExtractor, and initial hslf model support for comments 45538 - Include excel headers and footers in the output of ExcelExtractor 44894 - refactor duplicate logic from EventRecordFactory to RecordFactory diff --git a/src/documentation/content/xdocs/hslf/how-to-shapes.xml b/src/documentation/content/xdocs/hslf/how-to-shapes.xml index 40ef32aa75..37bf183738 100644 --- a/src/documentation/content/xdocs/hslf/how-to-shapes.xml +++ b/src/documentation/content/xdocs/hslf/how-to-shapes.xml @@ -620,7 +620,6 @@ -
How to extract Headers / Footers from an existing presentation @@ -663,6 +662,7 @@ hdd.setFootersText("Created by POI-HSLF");
+ diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index 71e0ea2b59..8edb88bd1b 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,8 @@ + 45472 - Fixed incorrect default row height in OpenOffice 2.3 + 44692 - HSSFPicture.resize() stretched image when there was a text next to it 45543 - Optionally extract comment text with PowerPointExtractor, and initial hslf model support for comments 45538 - Include excel headers and footers in the output of ExcelExtractor 44894 - refactor duplicate logic from EventRecordFactory to RecordFactory diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java b/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java index e7de1df5d6..2a2d3635c6 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java @@ -465,7 +465,14 @@ public final class HSSFRow implements Comparable { public short getHeight() { - return row.getHeight(); + short height = row.getHeight(); + + //The low-order 15 bits contain the row height. + //The 0x8000 bit indicates that the row is standard height (optional) + if ((height & 0x8000) != 0) height = sheet.getDefaultRowHeight(); + else height &= 0x7FFF; + + return height; } /** @@ -475,7 +482,7 @@ public final class HSSFRow implements Comparable { public float getHeightInPoints() { - return (row.getHeight() / 20); + return ((float)getHeight() / 20); } /**