]> git.saurik.com Git - wxWidgets.git/commitdiff
Revert MSW window classes uniquification patch.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 10 Aug 2010 18:57:51 +0000 (18:57 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 10 Aug 2010 18:57:51 +0000 (18:57 +0000)
Making the class names unique doesn't seem to be necessary so revert the patch
which appended unique pointer value to their names (r57030).

See #9031.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65233 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/app.cpp

index 037032c870aa4c9ef432c1f1e66baa2f542507ad..f1e9f0416579a513db97224c38e407296b3a359d 100644 (file)
@@ -121,13 +121,17 @@ extern void wxSetKeyboardHook(bool doIt);
 // see http://article.gmane.org/gmane.comp.lib.wxwidgets.devel/110282
 struct ClassRegInfo
 {
 // see http://article.gmane.org/gmane.comp.lib.wxwidgets.devel/110282
 struct ClassRegInfo
 {
-    // the base name of the class: this is used to construct the unique name in
-    // wxApp::GetRegisteredClassName()
-    wxString basename;
+    ClassRegInfo(const wxChar *name)
+        : regname(name),
+          regnameNR(regname + wxApp::GetNoRedrawClassSuffix())
+    {
+    }
 
     // the name of the registered class with and without CS_[HV]REDRAW styles
 
     // the name of the registered class with and without CS_[HV]REDRAW styles
-    wxString regname,
-             regnameNR;
+    const wxString regname;
+    const wxString regnameNR;
+
+    wxDECLARE_NO_ASSIGN_CLASS(ClassRegInfo);
 };
 
 namespace
 };
 
 namespace
@@ -650,7 +654,7 @@ const wxChar *wxApp::GetRegisteredClassName(const wxChar *name,
     const size_t count = gs_regClassesInfo.size();
     for ( size_t n = 0; n < count; n++ )
     {
     const size_t count = gs_regClassesInfo.size();
     for ( size_t n = 0; n < count; n++ )
     {
-        if ( gs_regClassesInfo[n].basename == name )
+        if ( gs_regClassesInfo[n].regname == name )
             return gs_regClassesInfo[n].regname.c_str();
     }
 
             return gs_regClassesInfo[n].regname.c_str();
     }
 
@@ -665,16 +669,7 @@ const wxChar *wxApp::GetRegisteredClassName(const wxChar *name,
     wndclass.style         = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | extraStyles;
 
 
     wndclass.style         = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | extraStyles;
 
 
-    ClassRegInfo regClass;
-    regClass.basename = name;
-
-    // constuct a unique suffix to allow registering the class with the same
-    // base name in a main application using wxWidgets and a DLL using
-    // wxWidgets loaded into its address space: as gs_regClassesInfo variable
-    // is different in them, we're going to obtain a unique prefix by using its
-    // address here
-    regClass.regname = regClass.basename +
-                            wxString::Format(wxT("@%p"), &gs_regClassesInfo);
+    ClassRegInfo regClass(name);
     wndclass.lpszClassName = regClass.regname.wx_str();
     if ( !::RegisterClass(&wndclass) )
     {
     wndclass.lpszClassName = regClass.regname.wx_str();
     if ( !::RegisterClass(&wndclass) )
     {
@@ -683,10 +678,6 @@ const wxChar *wxApp::GetRegisteredClassName(const wxChar *name,
         return NULL;
     }
 
         return NULL;
     }
 
-    // NB: remember that code elsewhere supposes that no redraw class names
-    //     use the same names as normal classes with "NR" suffix so we must put
-    //     "NR" at the end instead of using more natural basename+"NR"+suffix
-    regClass.regnameNR = regClass.regname + GetNoRedrawClassSuffix();
     wndclass.style &= ~(CS_HREDRAW | CS_VREDRAW);
     wndclass.lpszClassName = regClass.regnameNR.wx_str();
     if ( !::RegisterClass(&wndclass) )
     wndclass.style &= ~(CS_HREDRAW | CS_VREDRAW);
     wndclass.lpszClassName = regClass.regnameNR.wx_str();
     if ( !::RegisterClass(&wndclass) )