Use wxStringBuffer[Length] instead of explicit calls to
wxString::get/UngetWriteBuffer. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22191 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -872,14 +872,12 @@ bool wxRegKey::QueryValue(const wxChar *szValue,
|
||||
strValue.Empty();
|
||||
}
|
||||
else {
|
||||
RegString pBuf = (RegString)strValue.GetWriteBuf(dwSize);
|
||||
m_dwLastError = RegQueryValueEx((HKEY) m_hKey,
|
||||
WXSTRINGCAST szValue,
|
||||
RESERVED,
|
||||
&dwType,
|
||||
pBuf,
|
||||
(RegString)(wxChar*)wxStringBuffer(strValue, dwSize),
|
||||
&dwSize);
|
||||
strValue.UngetWriteBuf();
|
||||
|
||||
// expand the var expansions in the string unless disabled
|
||||
#ifndef __WXWINCE__
|
||||
@@ -893,10 +891,9 @@ bool wxRegKey::QueryValue(const wxChar *szValue,
|
||||
ok = ::ExpandEnvironmentStrings
|
||||
(
|
||||
strValue,
|
||||
strExpValue.GetWriteBuf(dwExpSize),
|
||||
wxStringBuffer(strExpValue, dwExpSize),
|
||||
dwExpSize
|
||||
) != 0;
|
||||
strExpValue.UngetWriteBuf();
|
||||
strValue = strExpValue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user