Allow comma separated CSV files

The separator selector in the CSV import dialog was unused. This passes
the value into the xslt and adds ',' as possible value.

I'm sure this could be done much better (pass the actual character instead
of the index), but I couldn't get that to work and this does seem to do
the trick.

Also added a test dive to test this feature.

Fixes #321

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-12-04 15:19:28 -08:00
parent 5fc50b2aab
commit b5d3476b0b
5 changed files with 43 additions and 4 deletions

View file

@ -11,11 +11,17 @@
<xsl:param name="stopdepthField" select="stopdepthField"/>
<xsl:param name="date" select="date"/>
<xsl:param name="time" select="time"/>
<xsl:param name="separatorIndex" select="separatorIndex"/>
<xsl:output method="xml" indent="yes"/>
<xsl:variable name="lf"><xsl:text>
</xsl:text></xsl:variable>
<xsl:variable name="fs"><xsl:text> </xsl:text></xsl:variable>
<xsl:variable name="fs">
<xsl:choose>
<xsl:when test="$separatorIndex = 0"><xsl:text> </xsl:text></xsl:when>
<xsl:otherwise><xsl:text>,</xsl:text></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:template match="/">
<divelog program="subsurface-import" version="2">