]> Git trees. - libqmvoc.git/commitdiff
Pino: This adds the reading of the bo:periodTableBlock
authorCarsten Niehaus <cniehaus@gmx.de>
Sat, 22 Oct 2005 10:30:28 +0000 (10:30 +0000)
committerCarsten Niehaus <cniehaus@gmx.de>
Sat, 22 Oct 2005 10:30:28 +0000 (10:30 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=472979

libscience/chemicaldataobject.cpp
libscience/chemicaldataobject.h
libscience/elementparser.cpp
libscience/elementparser.h

index fb79b40a6aa65da76cc48a736df96a34bbaae6f4..e9aded52251e19688afdb89982024ebf494e9ad9 100644 (file)
@@ -115,6 +115,9 @@ QString ChemicalDataObject::dictRef()
                case boilingpoint:
                        botype = "boilingpoint";
                        break;
+               case periodTableBlock:
+                       botype = "periodTableBlock";
+                       break;
        }
        
        botype = botype.prepend( "bo:" );
index 04d5a1b51f89bb7ebcf13695bf62a7a82051b1aa..7177879d622cfbd801bb067d5fb2f8fa42bea31a 100644 (file)
@@ -53,7 +53,8 @@ class ChemicalDataObject
                        radiusCovalent/**< the covalent radius */,
                        radiusVDW/**< the van der Waals radius */,
                        meltingpoint,
-                       boilingpoint
+                       boilingpoint,
+                       periodTableBlock
                };
 
                /**
index f9370ff9cf829f424cfc619ba7a77b7984f0e22f..aea08b3af1d60ac33d64846f3ba5308eee2f95ea 100644 (file)
@@ -33,7 +33,8 @@ ElementSaxParser::ElementSaxParser()
        inRadiusCovalent_(false),
        inRadiusVDW_(false),
        inBoilingPoint_(false),
-       inMeltingPoint_(false)
+       inMeltingPoint_(false),
+       inPeriodTableBlock_(false)
 {
 }
 
@@ -69,6 +70,8 @@ bool ElementSaxParser::startElement(const QString&, const QString &localName, co
                                inMeltingPoint_ = true;
                        else if (attrs.value(i) == "bo:boilingpoint")
                                inBoilingPoint_ = true;
+                       else if (attrs.value(i) == "bo:periodTableBlock")
+                               inPeriodTableBlock_ = true;
                }
        }
        return true;
@@ -152,6 +155,11 @@ bool ElementSaxParser::characters(const QString &ch)
                type = ChemicalDataObject::boilingpoint; 
                inBoilingPoint_ = false;
        }
+       else if (inPeriodTableBlock_) {
+               value = ch;
+               type = ChemicalDataObject::periodTableBlock; 
+               inPeriodTableBlock_ = false;
+       }
        else//it is a non known value. Do not create a wrong object but return
                return true;
 
index 8c388e9db210ea2b3e446c73b186d2149c8d2703..74602a230d86cecab81a5c0cbc3dfbb50e1ed070 100644 (file)
@@ -46,6 +46,7 @@ class ElementSaxParser : public QXmlDefaultHandler
                         inRadiusCovalent_,
                         inRadiusVDW_,
                         inBoilingPoint_,
-                        inMeltingPoint_;
+                        inMeltingPoint_,
+                        inPeriodTableBlock_;
 };
 #endif // ELEMENTPARSER_H