Return-Path: X-Original-To: apmail-poi-commits-archive@minotaur.apache.org Delivered-To: apmail-poi-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7A9A77716 for ; Sat, 16 Jul 2011 16:21:07 +0000 (UTC) Received: (qmail 76901 invoked by uid 500); 16 Jul 2011 16:21:07 -0000 Delivered-To: apmail-poi-commits-archive@poi.apache.org Received: (qmail 76866 invoked by uid 500); 16 Jul 2011 16:21:07 -0000 Mailing-List: contact commits-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@poi.apache.org Delivered-To: mailing list commits@poi.apache.org Received: (qmail 76858 invoked by uid 99); 16 Jul 2011 16:21:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Jul 2011 16:21:06 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Jul 2011 16:21:05 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D157A23888C2 for ; Sat, 16 Jul 2011 16:20:45 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1147451 - /poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlUtils.java Date: Sat, 16 Jul 2011 16:20:45 -0000 To: commits@poi.apache.org From: sergey@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110716162045.D157A23888C2@eris.apache.org> Author: sergey Date: Sat Jul 16 16:20:45 2011 New Revision: 1147451 URL: http://svn.apache.org/viewvc?rev=1147451&view=rev Log: processImage() is moved to converter, remove setImageProperties from Utils Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlUtils.java Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlUtils.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlUtils.java?rev=1147451&r1=1147450&r2=1147451&view=diff ============================================================================== --- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlUtils.java (original) +++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlUtils.java Sat Jul 16 16:20:45 2011 @@ -20,10 +20,8 @@ import org.apache.poi.hwpf.usermodel.Bor 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 Abs } } - 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() ); - - } - } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org For additional commands, e-mail: commits-help@poi.apache.org