[planner] Fixed crash when exporting a HTML version of an empty project
- From: Maurice van der Pot <mvdpot src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [planner] Fixed crash when exporting a HTML version of an empty project
- Date: Tue, 17 Nov 2009 20:56:43 +0000 (UTC)
commit 6c7062375b113c31fe8f37b0ff848ea84d25dea3
Author: Maurice van der Pot <griffon26 kfk4ever com>
Date: Thu Oct 29 22:03:16 2009 +0100
Fixed crash when exporting a HTML version of an empty project
data/stylesheets/planner2html.xsl | 47 +++++++++++++++++++++---------------
1 files changed, 27 insertions(+), 20 deletions(-)
---
diff --git a/data/stylesheets/planner2html.xsl b/data/stylesheets/planner2html.xsl
index b932544..6909b30 100644
--- a/data/stylesheets/planner2html.xsl
+++ b/data/stylesheets/planner2html.xsl
@@ -70,26 +70,33 @@
<!-- Determine project length in seconds -->
<xsl:variable name="projlength">
- <xsl:for-each select="//project//task">
- <xsl:sort data-type="number"
- select="date:seconds(date:add (date:date (concat (substring (@end, 1, 4),
- '-', substring (@end, 5, 2),
- '-', substring (@end, 7, 2))),
- date:duration ((3600 * substring (@end, 10, 2))+
- (60 * substring (@end, 12, 2))+
- substring (@end, 14, 2))))"
- order="descending"/>
- <xsl:if test="position()=1">
- <xsl:copy-of
- select="-(date:seconds ($projstart) - date:seconds (
- date:add (date:date (concat (substring (@end, 1, 4),
- '-', substring (@end, 5, 2),
- '-', substring (@end, 7, 2))),
- date:duration ((3600 * substring (@end, 10, 2))+
- (60 * substring (@end, 12, 2))+
- substring (@end, 14, 2)))))"/>
- </xsl:if>
- </xsl:for-each>
+ <xsl:choose>
+ <xsl:when test="//project//task">
+ <xsl:for-each select="//project//task">
+ <xsl:sort data-type="number"
+ select="date:seconds(date:add (date:date (concat (substring (@end, 1, 4),
+ '-', substring (@end, 5, 2),
+ '-', substring (@end, 7, 2))),
+ date:duration ((3600 * substring (@end, 10, 2))+
+ (60 * substring (@end, 12, 2))+
+ substring (@end, 14, 2))))"
+ order="descending"/>
+ <xsl:if test="position()=1">
+ <xsl:copy-of
+ select="-(date:seconds ($projstart) - date:seconds (
+ date:add (date:date (concat (substring (@end, 1, 4),
+ '-', substring (@end, 5, 2),
+ '-', substring (@end, 7, 2))),
+ date:duration ((3600 * substring (@end, 10, 2))+
+ (60 * substring (@end, 12, 2))+
+ substring (@end, 14, 2)))))"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ 0
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:variable>
<xsl:variable name="projend" select="date:add($projstart, date:duration($projlength))"/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]