[Uml-devel] branches/KDE/3.5/kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Wed Sep 21 12:17:39 UTC 2005


SVN commit 462698 by okellogg:

parseOperation(): Commit #460377 was bad. The search pattern for delimiting the
op name now includes everything up to (and excluding) the opening parenthesis.
CCBUG:110843 - This fixes Comment #24 From Emil Karlen.


 M  +5 -6      model_utils.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/model_utils.cpp #462697:462698
@@ -344,21 +344,20 @@
     if (m.isEmpty())
         return PS_Empty;
     /**
-     * We don't apply programming-language style syntax checking on the name
+     * The search pattern includes everything until the opening parenthesis
      * because UML also permits non programming-language oriented designs
      * using narrative names, for example "check water temperature".
-    QRegExp pat( "^(\\w+)" );
+     */
+    QRegExp pat( "^([^\\(]+)" );
     int pos = pat.search(m);
     if (pos == -1)
         return PS_Illegal_MethodName;
     desc.m_name = pat.cap(1);
-     */
     // Remove possible empty parentheses ()
     m.remove( QRegExp("\\s*\\(\\s*\\)") );
-    desc.m_name = m;
     desc.m_pReturnType = NULL;
-    QRegExp pat( ":\\s*(\\w[\\w\\. ]*)$" );
-    int pos = pat.search(m);
+    pat = QRegExp( ":\\s*(\\w[\\w\\. ]*)$" );
+    pos = pat.search(m);
     if (pos != -1) {  // return type is optional
         QString retType = pat.cap(1);
         if (retType != "void") {




More information about the umbrello-devel mailing list