summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktop-widgets/divelogimportdialog.cpp6
-rw-r--r--xslt/csv2xml.xslt9
2 files changed, 13 insertions, 2 deletions
diff --git a/desktop-widgets/divelogimportdialog.cpp b/desktop-widgets/divelogimportdialog.cpp
index 90a466c9a..af1f26e2c 100644
--- a/desktop-widgets/divelogimportdialog.cpp
+++ b/desktop-widgets/divelogimportdialog.cpp
@@ -724,6 +724,8 @@ int DiveLogImportDialog::setup_csv_params(QStringList r, char **params, int pnr)
params[pnr++] = intdup(ui->DateFormat->currentIndex());
params[pnr++] = strdup("starttimeField");
params[pnr++] = intdup(r.indexOf(tr("Time")));
+ params[pnr++] = strdup("numberField");
+ params[pnr++] = intdup(r.indexOf(tr("Dive #")));
params[pnr++] = strdup("timeField");
params[pnr++] = intdup(r.indexOf(tr("Sample time")));
params[pnr++] = strdup("depthField");
@@ -825,7 +827,7 @@ void DiveLogImportDialog::on_buttonBox_accepted()
sample->tts.seconds *= 60;
}
} else {
- char *params[45];
+ char *params[47];
int pnr = 0;
pnr = setup_csv_params(r, params, pnr);
@@ -892,7 +894,7 @@ void DiveLogImportDialog::on_buttonBox_accepted()
parse_manual_file(fileNames[i].toUtf8().data(), params, pnr - 1);
} else {
- char *params[45];
+ char *params[47];
int pnr = 0;
pnr = setup_csv_params(r, params, pnr);
diff --git a/xslt/csv2xml.xslt b/xslt/csv2xml.xslt
index b196ae054..3d998850c 100644
--- a/xslt/csv2xml.xslt
+++ b/xslt/csv2xml.xslt
@@ -101,6 +101,15 @@
</xsl:choose>
</xsl:attribute>
+ <xsl:if test="$numberField >= 0">
+ <xsl:attribute name="number">
+ <xsl:call-template name="getFieldByIndex">
+ <xsl:with-param name="index" select="$numberField"/>
+ <xsl:with-param name="line" select="substring-after(substring-after(., $lf), $lf)"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:if>
+
<!-- If the dive is CCR, create oxygen and diluent cylinders -->
<xsl:if test="$po2Field >= 0 or $setpointField >= 0 or $o2sensor1Field >= 0 or $o2sensor2Field >= 0 or $o2sensor3Field >= 0">