#2946 custom code as String or integer

Branch_+_Trunk
closed-accepted
nobody
GUI (476)
5
2011-01-03
2010-06-03
Matthias
No

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.

Discussion

  • Matthias

    Matthias - 2010-06-04

    removed a memory leek

     
  • Kimmo Varis

    Kimmo Varis - 2010-06-06

    > + 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.

     
  • Matthias

    Matthias - 2010-06-20

    I can not find a way. It is always called OnEnKillfocusCustomCpNumber.
    The dialog member has been changed to string already.

     
  • Kimmo Varis

    Kimmo Varis - 2010-06-20

    > 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).

     
  • Matthias

    Matthias - 2010-06-20

    allways called, Enter, ESC.
    I use a new Cstring value m_cCustomCodepageValue for GUI.
    OnEnKillfocusCustomCpNumber() converts the string to integer for m_nCustomCodepageValue only .

     
  • Kimmo Varis

    Kimmo Varis - 2010-06-20

    > 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.

     
  • Matthias

    Matthias - 2010-06-20

    ???
    who is arguing with you?
    I can not follow you.
    Does it mean you don't want to use the m_nCustomCodepageValue anymore?

     
  • Matthias

    Matthias - 2010-06-20

    or is that what you expect?
    Doing the convert just before writing.

     
  • Kimmo Varis

    Kimmo Varis - 2010-09-12

    > + 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'

     
  • Matthias

    Matthias - 2010-09-12

    PropCodepage as string or integer

     
  • Matthias

    Matthias - 2010-09-12

    done
    created new patch against 7247

     
  • Kimmo Varis

    Kimmo Varis - 2010-09-13

    The (PropCodepagee7247.patch) looks good and seems to work after quick testing. So committed to SVN trunk:
    Completed: At revision: 7252

     
  • Kimmo Varis

    Kimmo Varis - 2010-09-13
    • status: open --> closed-accepted
     
  • Tim Gerundt

    Tim Gerundt - 2011-01-03

    Backported to branch R2_14 (In Revision 7502)...

     
  • Tim Gerundt

    Tim Gerundt - 2011-01-03
    • milestone: 438013 --> Branch_+_Trunk
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks