]> Git trees. - libqmvoc.git/commitdiff
Deal with value as attrib
authorEgon Willighagen <egon.willighagen@gmail.com>
Sun, 3 Sep 2006 09:42:09 +0000 (09:42 +0000)
committerEgon Willighagen <egon.willighagen@gmail.com>
Sun, 3 Sep 2006 09:42:09 +0000 (09:42 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=580326

libscience/elementparser.cpp

index 45443a856ca45cfbb7a220e0ce99ff381744b106..5c1d4e9b3166fc7e05dbcf587ed29135414a9ee8 100644 (file)
@@ -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;