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
// 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);
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();
}
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) )
{
- // 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) )