From 0c3222b69ea760a0cad7353fc9c0b126c3994f55 Mon Sep 17 00:00:00 2001 From: Carsten Niehaus Date: Sat, 16 Jun 2007 21:06:42 +0000 Subject: [PATCH] Part II of II of the 'ancient' bug: If the discovery country equals 'ancient' that means that the element was know since forever. Therefore set the date of the discovery to the magic number -1. '0' means 'Unknown', '-1' ancient and every other numbers means the name of the discovery svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=676418 --- libscience/elementparser.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libscience/elementparser.cpp b/libscience/elementparser.cpp index e18cf41..6da22c6 100644 --- a/libscience/elementparser.cpp +++ b/libscience/elementparser.cpp @@ -354,8 +354,13 @@ bool ElementSaxParser::characters(const QString &ch) d->inSPhrase = false; } else if (d->inCountry){ - value = ch; - type = ChemicalDataObject::discoveryCountry; + if ( ch == "ancient" ) { + value = -1; + type = ChemicalDataObject::date; + } else { + value = ch; + type = ChemicalDataObject::discoveryCountry; + } d->inCountry = false; } else//it is a non known value. Do not create a wrong object but return -- 2.47.3