From: Egon Willighagen Date: Sun, 3 Sep 2006 09:42:09 +0000 (+0000) Subject: Deal with value as attrib X-Git-Tag: v3.80.2~48 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=bc86371eefecf73c38f565f7d676e640dd57679b;p=libqmvoc.git Deal with value as attrib svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=580326 --- diff --git a/libscience/elementparser.cpp b/libscience/elementparser.cpp index 45443a8..5c1d4e9 100644 --- a/libscience/elementparser.cpp +++ b/libscience/elementparser.cpp @@ -174,8 +174,15 @@ bool ElementSaxParser::startElement(const QString&, const QString &localName, co if (attrs.value(i) == "bo:symbol") d->inSymbol = true; - else if (attrs.value(i) == "bo:name") - d->inName = true; + else if (attrs.value(i) == "bo:name") { + for (int i = 0; i < attrs.length(); ++i) + { + if (attrs.localName(i) == "value") { + d->currentDataObject->setData( attrs.value(i) ); + d->currentDataObject->setType( ChemicalDataObject::name ); + } + } + } } } return true; @@ -208,11 +215,6 @@ bool ElementSaxParser::characters(const QString &ch) ChemicalDataObject::BlueObelisk type; QVariant value; - if (d->inName) { - value = ch; - type = ChemicalDataObject::name; - d->inName = false; - } else if (d->inMass){ value = ch.toDouble(); type = ChemicalDataObject::mass;