From 36dd48e1f18bffd73f37f7d3c4aae72566b6a71f Mon Sep 17 00:00:00 2001 From: Yegor Kozlov Date: Tue, 5 Aug 2008 08:06:50 +0000 Subject: [PATCH] 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 --- src/documentation/content/xdocs/changes.xml | 2 ++ .../content/xdocs/hslf/how-to-shapes.xml | 2 +- src/documentation/content/xdocs/status.xml | 2 ++ src/java/org/apache/poi/hssf/usermodel/HSSFRow.java | 11 +++++++++-- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/documentation/content/xdocs/changes.xml b/src/documentation/content/xdocs/changes.xml index 80b3d0406..76d4b0e6e 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 40ef32aa7..37bf18373 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 71e0ea2b5..8edb88bd1 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 e7de1df5d..2a2d3635c 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); } /**