]> git.saurik.com Git - wxWidgets.git/commitdiff
fix for wxRegConfig::GetNextGroup
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 20 Dec 2000 14:41:17 +0000 (14:41 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 20 Dec 2000 14:41:17 +0000 (14:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8962 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/regconf.cpp

index 404fb0d2d24772d8ab48ed01f21f4776054f3b28..9853728ea5af1bbc822f70d899df5f10b548d710 100644 (file)
@@ -217,13 +217,15 @@ bool wxRegConfig::GetNextGroup(wxString& str, long& lIndex) const
   // are we already enumerating local entries?
   if ( m_keyGlobal.IsOpened() && !IS_LOCAL_INDEX(lIndex) ) {
     // try to find a global entry which doesn't appear locally
-    do {
-      if ( !m_keyGlobal.GetNextKey(str, lIndex) ) {
-        // no more global entries
-        lIndex |= LOCAL_MASK;
-        break;
+    while ( m_keyGlobal.GetNextKey(str, lIndex) ) {
+      if ( !m_keyLocal.HasSubKey(str) ) {
+        // ok, found one - return it
+        return TRUE;
       }
-    } while( m_keyLocal.HasSubKey(str) );
+    }
+
+    // no more global entries
+    lIndex |= LOCAL_MASK;
   }
 
   // much easier with local entries: get the next one we find