patch: Proposed patch for gr_Graphics.cpp

From: Jordi Mas (jmas_at_softcatala.org)
Date: Tue Dec 30 2003 - 04:09:02 EST

  • Next message: msevior_at_physics.unimelb.edu.au: "commit: Enable Table line widths to be set via the Dialog."

    Hello,

    I propose the following patch for gr_Graphics.cpp

    ;-------------------------------------------------------------------

    --- xp/gr_Graphics.cpp 10 Oct 2003 13:34:37 -0000 1.89.2.1
    +++ xp/gr_Graphics.cpp 30 Dec 2003 09:02:51 -0000
    @@ -233,7 +233,7 @@
                      {
                              charWidth = measureUnRemappedChar(currentChar);

    - if(charWidth == GR_CW_UNKNOWN)
    + if(charWidth == GR_CW_UNKNOWN ||charWidth ==GR_CW_ABSENT
    )
                                      charWidth = 0;
                              else if(UT_isOverstrikingChar(currentChar) != UT_NOT_OVE
    RSTRIKING && charWidth > 0)
                                      charWidth = -charWidth;
    ;-------------------------------------------------------------------

    Under Win32 measureUnRemappedChar can return GR_CW_ABSENT (0x80808081).
    Because we only test for GR_CW_UNKNOWN, charWidth can get the value
    0x80808081 that is wrong is taken as a real witdh. I have not seen any bad
    behaviour because of this, but for is clearly wrong. If you agree, I apply the
    patch. I prefer to ask, since I'm not familiar with this code.

    Thanks,

    -- 
    

    Jordi Mas i Hernāndez (homepage http://www.softcatala.org/~jmas) http://www.softcatala.org

    ? patch.txt
    ? win/diff.txt
    Index: xp/gr_Graphics.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/af/gr/xp/gr_Graphics.cpp,v
    retrieving revision 1.89.2.1
    diff -u -r1.89.2.1 gr_Graphics.cpp
    --- xp/gr_Graphics.cpp 10 Oct 2003 13:34:37 -0000 1.89.2.1
    +++ xp/gr_Graphics.cpp 30 Dec 2003 09:02:51 -0000
    @@ -233,7 +233,7 @@
                     {
                             charWidth = measureUnRemappedChar(currentChar);
     
    - if(charWidth == GR_CW_UNKNOWN)
    + if(charWidth == GR_CW_UNKNOWN ||charWidth ==GR_CW_ABSENT)
                                     charWidth = 0;
                             else if(UT_isOverstrikingChar(currentChar) != UT_NOT_OVERSTRIKING && charWidth > 0)
                                     charWidth = -charWidth;



    This archive was generated by hypermail 2.1.4 : Tue Dec 30 2003 - 04:07:50 EST