From 3ad0efe2f0970405f4c050c64424e2f6e46211ed Mon Sep 17 00:00:00 2001 From: Sergey Vladimirov Date: Sat, 16 Jul 2011 16:20:45 +0000 Subject: [PATCH] processImage() is moved to converter, remove setImageProperties from Utils git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1147451 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/hwpf/converter/WordToHtmlUtils.java | 50 ------------------- 1 file changed, 50 deletions(-) diff --git a/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlUtils.java b/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlUtils.java index ad2d6e9326..1642b46ac4 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlUtils.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlUtils.java @@ -20,10 +20,8 @@ import org.apache.poi.hwpf.usermodel.BorderCode; import org.apache.poi.hwpf.usermodel.CharacterProperties; import org.apache.poi.hwpf.usermodel.CharacterRun; import org.apache.poi.hwpf.usermodel.Paragraph; -import org.apache.poi.hwpf.usermodel.Picture; import org.apache.poi.hwpf.usermodel.TableCell; import org.apache.poi.hwpf.usermodel.TableRow; -import org.w3c.dom.Element; public class WordToHtmlUtils extends AbstractWordUtils { @@ -226,52 +224,4 @@ public class WordToHtmlUtils extends AbstractWordUtils } } - public static void setPictureProperties( Picture picture, - Element graphicElement ) - { - final int aspectRatioX = picture.getAspectRatioX(); - final int aspectRatioY = picture.getAspectRatioY(); - - StringBuilder style = new StringBuilder(); - - if ( aspectRatioX > 0 ) - { - style.append( "width:" - + ( ( picture.getDxaGoal() * aspectRatioX / 1000 ) / TWIPS_PER_INCH ) - + "in;" ); - } - else - style.append( "width:" + ( picture.getDxaGoal() / TWIPS_PER_INCH ) - + "in;" ); - - if ( aspectRatioY > 0 ) - { - style.append( "height:" - + ( ( picture.getDyaGoal() * aspectRatioY / 1000 ) / TWIPS_PER_INCH ) - + "in;" ); - } - else - style.append( "height:" + ( picture.getDyaGoal() / TWIPS_PER_INCH ) - + "in;" ); - - graphicElement.setAttribute( "vertical-align", "text-bottom" ); - - if ( picture.getDyaCropTop() != 0 || picture.getDxaCropRight() != 0 - || picture.getDyaCropBottom() != 0 - || picture.getDxaCropLeft() != 0 ) - { - float rectTop = picture.getDyaCropTop() / TWIPS_PER_INCH; - float rectRight = picture.getDxaCropRight() / TWIPS_PER_INCH; - float rectBottom = picture.getDyaCropBottom() / TWIPS_PER_INCH; - float rectLeft = picture.getDxaCropLeft() / TWIPS_PER_INCH; - - style.append( "clip:rect(" + rectTop + "in," + rectRight + "in, " - + rectBottom + "in, " + rectLeft + "in);" ); - style.append( "overflow:hidden;" ); - } - - graphicElement.setAttribute( "style", style.toString() ); - - } - } -- 2.39.5