solves bugreport Bug in custom codepage - ID: 2813825
with this patch user can give the codepage as integer or as a string.
If the String is found, it will be replaced by the equal integer value.
removed a memory leek
> + ON_EN_KILLFOCUS(IDC_CUSTOM_CP_NUMBER, &PropCodepage::OnEnKillfocusCustomCpNumber)
This does not work. Try all the ways to close the dialog and you'll see. Been there tried that.
If you want to accept strings then you need to change the dialog member to string and handle it as a string.
I can not find a way. It is always called OnEnKillfocusCustomCpNumber.
The dialog member has been changed to string already.
> It is always called OnEnKillfocusCustomCpNumber.
Use the keyboard.
> The dialog member has been changed to string already
Really? Code in SVN trunk has:
> int m_nCustomCodepageValue;
that is not a string.
So just change m_nCustomCodepageValue to a CString and do the conversion where it is always guaranteed to work (after MFC mapping magic).
allways called, Enter, ESC.
I use a new Cstring value m_cCustomCodepageValue for GUI.
OnEnKillfocusCustomCpNumber() converts the string to integer for m_nCustomCodepageValue only .
> allways called, Enter, ESC
Interesting. Perhaps MS has fixed that in later Windows/MFC versions then. Earlier it didn't work. And I still don't trust it always works.
Stop the arguing and do what I want if you want to get the patch in. It is much simpler and reliable that way.
who is arguing with you?
I can not follow you.
Does it mean you don't want to use the m_nCustomCodepageValue anymore?
or is that what you expect?
Doing the convert just before writing.
> + int nCustomCodepageValue = 0;
> + nCustomCodepageValue = _ttol(m_cCustomCodepageValue);
This should be one line.
> + long len = wcslen (m_cCustomCodepageValue);
No space between function name and parenthesis.
> + long len = (m_cCustomCodepageValue.GetLength());
Remove unneeded parenthesis
> + Result[len] = '\0'; //don't forget to put the caracter of terminated string
Variable names don't start with capital letter
> + if(nCustomCodepageValue)
Add space after 'if'
PropCodepage as string or integer
created new patch against 7247
The (PropCodepagee7247.patch) looks good and seems to work after quick testing. So committed to SVN trunk:
Completed: At revision: 7252
Backported to branch R2_14 (In Revision 7502)...
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.