[Uml-devel] kdesdk/umbrello/umbrello

Sebastian Stein seb.kde at hpfsc.de
Wed Jul 21 03:27:02 UTC 2004


CVS commit by sstein: 

patch by Heiko Nardmann: fixing more things about the reserved keywords handling


  M +19 -1     codegenerator.cpp   1.52
  M +8 -1      codegenerator.h   1.27


--- kdesdk/umbrello/umbrello/codegenerator.h  #1.26:1.27
@@ -328,8 +328,13 @@ public:
   virtual bool isReservedKeyword(const QString & rPossiblyReservedKeyword);
 
+  /**
+   * get list of reserved keywords
+   */
+  virtual const char **getReservedKeywords() { return NULL; }
+
 protected:
 
         /**
-         * Remove (and possibly delete) all AutoGenerted content type CodeDocuments but leave 
+         * Remove (and possibly delete) all AutoGenerated content type CodeDocuments but leave 
          * the UserGenerated (and any other type) documents in this generator alone.
          */

--- kdesdk/umbrello/umbrello/codegenerator.cpp  #1.51:1.52
@@ -781,5 +781,22 @@ void CodeGenerator::createDefaultDatatyp
  *
  */
-bool CodeGenerator::isReservedKeyword(const QString & /* rPossiblyReservedKeyword*/) {
+bool CodeGenerator::isReservedKeyword(const QString & rPossiblyReservedKeyword) {
+  const char **tmpReservedWords = getReservedKeywords();
+
+  if (tmpReservedWords == NULL)
+  {
+    return false;
+  }
+
+  while (tmpReservedWords[0] != NULL) {
+                QString keyword(tmpReservedWords[0]);
+
+                if (keyword == rPossiblyReservedKeyword) {
+                        return true;
+                }
+
+    tmpReservedWords++;
+        }
+
         return false;
 }






More information about the umbrello-devel mailing list