]> Git trees. - libqmvoc.git/commitdiff
tricky way to adapt to the new blueobelisk changes
authorPino Toscano <pino@kde.org>
Tue, 14 Feb 2006 11:34:29 +0000 (11:34 +0000)
committerPino Toscano <pino@kde.org>
Tue, 14 Feb 2006 11:34:29 +0000 (11:34 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=509337

libscience/elementparser.cpp

index f23033b0259a5ac914122fa76984313e565863aa..6c37e1f19192bb941af0140565c3c4279315c54b 100644 (file)
@@ -111,10 +111,6 @@ bool ElementSaxParser::startElement(const QString&, const QString &localName, co
 
                        if (attrs.value(i) == "bo:atomicNumber")
                                d->inAtomicNumber = true;
-                       else 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:mass")
                                d->inMass = true;
                        else if (attrs.value(i) == "bo:exactMass")
@@ -156,6 +152,19 @@ bool ElementSaxParser::startElement(const QString&, const QString &localName, co
                        else if (attrs.value(i) == "bo:density")
                                d->inDensity = true;
                }
+       } else if (d->inElement && localName == "label")
+       {
+               for (int i = 0; i < attrs.length(); ++i) 
+               {
+                       // FIXME
+                       if ( attrs.localName( i ) != "dictRef" )
+                               continue;
+
+                       if (attrs.value(i) == "bo:symbol")
+                               d->inSymbol = true;
+                       else if (attrs.value(i) == "bo:name")
+                               d->inName = true;
+               }
        }
        return true;
 }
@@ -171,7 +180,7 @@ bool ElementSaxParser::endElement( const QString &, const QString& localName, co
                d->currentDataObject = 0;
                d->inElement = false;
        }
-       else if ( localName == "scalar" )
+       else if ( localName == "scalar" || localName == "label" )
        {
                if ( d->currentUnit != ChemicalDataObject::noUnit )
                        d->currentDataObject->setUnit( d->currentUnit );