]> git.saurik.com Git - wxWidgets.git/commitdiff
fix an important bug: ifacecheck was parsing only <sectiondef> with kind==public...
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sat, 10 Jan 2009 22:07:05 +0000 (22:07 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sat, 10 Jan 2009 22:07:05 +0000 (22:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57990 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

utils/ifacecheck/src/ifacecheck.cpp
utils/ifacecheck/src/xmlparser.cpp

index e2db7071443e558fb8dca9c75be89c4e26128aaa..19a0971e9f75c9143c503645775de2167a0b71d9 100644 (file)
@@ -156,16 +156,12 @@ int IfaceCheckApp::OnRun()
             // in any case set basic std preprocessor #defines:
             m_doxyInterface.AddPreprocessorValue("NULL", "0");
 
-            //g_bLogEnabled = false;
-
             // parse the two XML files which contain the real and the doxygen interfaces
             // for wxWidgets API:
             if (!m_gccInterface.Parse(parser.GetParam(0)) ||
                 !m_doxyInterface.Parse(parser.GetParam(1)))
                 return 1;
 
-//            g_bLogEnabled = true;
-
             if (parser.Found(DUMP_SWITCH))
             {
                 wxLogMessage("Dumping real API to '%s'...", API_DUMP_FILE);
index 825d3fdddf6a0e0a03a971ab817d8daafce9d40c..aed036afb3210e478c1141b9bbcacdf9b262d424 100644 (file)
@@ -1495,18 +1495,23 @@ bool wxXmlDoxygenInterface::ParseCompoundDefinition(const wxString& filename)
             wxXmlNode *subchild = child->GetChildren();
             while (subchild)
             {
-                wxString kind = subchild->GetAttribute("kind");
-
-                // parse only public&protected functions:
-                if (subchild->GetName() == "sectiondef" &&
-                    (kind == "public-func" || kind == "protected-func"))
+                // NOTE: when documenting functions using the //@{ and //@}
+                //       tags to create function groups, doxygen puts the
+                //       contained methods into a "user-defined" section
+                //       so we _must_ use the "prot" attribute to distinguish
+                //       public/protected methods from private ones and cannot
+                //       rely on the kind="public" attribute of <sectiondef>
+                if (subchild->GetName() == "sectiondef")
                 {
-
                     wxXmlNode *membernode = subchild->GetChildren();
                     while (membernode)
                     {
+                        const wxString& accessSpec = membernode->GetAttribute("prot");
+
+                        // parse only public&protected functions:
                         if (membernode->GetName() == "memberdef" &&
-                            membernode->GetAttribute("kind") == "function")
+                            membernode->GetAttribute("kind") == "function" &&
+                            (accessSpec == "public" || accessSpec == "protected"))
                         {
 
                             wxMethod m;
@@ -1516,11 +1521,11 @@ bool wxXmlDoxygenInterface::ParseCompoundDefinition(const wxString& filename)
                                 return false;
                             }
 
-                            if (kind == "public-func")
+                            if (accessSpec == "public")
                                 m.SetAccessSpecifier(wxMAS_PUBLIC);
-                            else if (kind == "protected-func")
+                            else if (accessSpec == "protected")
                                 m.SetAccessSpecifier(wxMAS_PROTECTED);
-                            else if (kind == "private-func")
+                            else if (accessSpec == "private")
                                 m.SetAccessSpecifier(wxMAS_PRIVATE);
 
                             if (absoluteFile.IsEmpty())