Fix the image size when attributes heigth and width aren�t defined

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114610 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
evenisse
2004-01-26 08:27:41 +00:00
parent 455537e3af
commit a97cb6471a

View File

@@ -310,15 +310,35 @@
<xsl:variable name="height">
<xsl:value-of select="substring-before(concat(normalize-space(@height),'p'),'p') div $imageDpi"/>
</xsl:variable>
<xsl:variable name="realwidth">
<xsl:choose>
<xsl:when test="normalize-space($width) = 'NaN'">
<xsl:value-of select="'auto'"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$width"/>in
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="realheight">
<xsl:choose>
<xsl:when test="normalize-space($height) = 'NaN'">
<xsl:value-of select="'auto'"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$height"/>in
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Enclose image in a block if parent is a section or subsection element -->
<xsl:choose>
<xsl:when test="parent::section | parent::subsection">
<fo:block>
<fo:external-graphic src="{normalize-space($source)}" height="{$height}in" width="{$width}in" content-height="auto" content-width="auto"/>
<fo:external-graphic src="{normalize-space($source)}" height="{$realheight}" width="{$realwidth}" content-height="auto" content-width="auto"/>
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:external-graphic src="{normalize-space($source)}" height="{$height}in" width="{$width}in" content-height="auto" content-width="auto"/>
<fo:external-graphic src="{normalize-space($source)}" height="{$realheight}" width="{$realwidth}" content-height="auto" content-width="auto"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>