X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6c9a19aabab3a878b565e6c2a5f2a3824277c4dc..b5435dccd098ae153c3b7b3b8fca8dd0d763986c:/src/msw/regconf.cpp diff --git a/src/msw/regconf.cpp b/src/msw/regconf.cpp index 050ef4646f..2a5325bc15 100644 --- a/src/msw/regconf.cpp +++ b/src/msw/regconf.cpp @@ -124,7 +124,7 @@ wxRegConfig::wxRegConfig(const wxString& appName, const wxString& vendorName, m_keyLocal.ReserveMemoryForName(MEMORY_PREALLOC); m_keyLocalRoot.SetName(wxRegKey::HKCU, SOFTWARE_KEY + str); - m_keyLocal.SetName(m_keyLocalRoot, _T("")); + m_keyLocal.SetName(m_keyLocalRoot, wxEmptyString); if ( bDoUseGlobal ) { @@ -134,7 +134,7 @@ wxRegConfig::wxRegConfig(const wxString& appName, const wxString& vendorName, m_keyGlobal.ReserveMemoryForName(MEMORY_PREALLOC); m_keyGlobalRoot.SetName(wxRegKey::HKLM, SOFTWARE_KEY + str); - m_keyGlobal.SetName(m_keyGlobalRoot, _T("")); + m_keyGlobal.SetName(m_keyGlobalRoot, wxEmptyString); } // Create() will Open() if key already exists @@ -245,7 +245,8 @@ void wxRegConfig::SetPath(const wxString& strPath) size_t len = strFullPath.length(); const wxChar *end = src + len; - wxChar *dst = m_strPath.GetWriteBuf(len); + wxStringBufferLength buf(m_strPath, len); + wxChar *dst = buf; wxChar *start = dst; for ( ; src < end; src++, dst++ ) @@ -337,8 +338,7 @@ void wxRegConfig::SetPath(const wxString& strPath) } *dst = _T('\0'); - - m_strPath.UngetWriteBuf(dst - start); + buf.SetLength(dst - start); } #ifdef WX_DEBUG_SET_PATH @@ -355,7 +355,8 @@ void wxRegConfig::SetPath(const wxString& strPath) size_t len = m_strPath.length(); const wxChar *src = m_strPath.c_str(); - wxChar *dst = strRegPath.GetWriteBuf(len); + wxStringBufferLength buf(strRegPath, len); + wxChar *dst = buf; const wxChar *end = src + len; for ( ; src < end; src++, dst++ ) @@ -366,7 +367,7 @@ void wxRegConfig::SetPath(const wxString& strPath) *dst = *src; } - strRegPath.UngetWriteBuf(len); + buf.SetLength(len); } // this is not needed any longer as we don't create keys unnecessarily any