Possible bug fix for Win32 bug 1750

From: Kenneth J.Davis (jeremyd@computer.org)
Date: Thu Mar 14 2002 - 12:10:43 GMT

  • Next message: Hubert Figuiere: "Commit: fix bug 2854"

    Possible bug fix for Win32 bug 1750
    ZoomType in AbiWord.Profile only takes 100, Width and Page
    [although I believe the bug probably applies to all platforms,
     this fix is only for Win32]

    xap_Frame.cpp has a switch statement [if/else] that handles the zoom value
    specified in the profile file (AbiWord.Profile). It will set
    the Frame's zoomType and I believe it should also set the
    zoom percentage if zoomType would be z_PERCENT. See attached diff.
    However this effects all platforms, so while I believe without the
    Ap_OS Frame specific patch things will continue to work, and do so the
    same way (ie 100% unless page or width is specified in profile),
    I can not guarentee this.

    Also included is the Win32 specific patches that allows Windows to
    support arbitrary (within set limits) zoom percents. Assuming calling
    the Frame's setZoomPercentage(...) method is the proper way to store
    the specified zoom value (which I believe it is) then there are two
    obvious possible fixes. Currently this function calls _showDocument(iZoom),
    which if there is a valid document, creates a GR_Graphics objects and
    stores the zoom information within it, (the GR_Graphics object is also
    queried by getZoomPercentage()); the problem is if there isn't a
    valid document, such as when setZoomPercentage would be called by
    xap_Frame in the above switch, the set will be ignored. There
    are also several calls that simply call _showDocument(iZoom) with
    iZoom == 100%. The accompaning patches take the easier, but perhaps
    not as good approach of adding another variable m_iZoom to the
    ap_Win32Frame object. This value is initialized (defaults) to 100%,
    and is set whenever setZoomPercentage is called (along with still
    calling _showDocument); and when getZoomPercentage is called, m_iZoom
    will be used when no GR_Graphics is available to forward the query
    to. _showDocument is also changed, so instead of defaulting to 100%,
    a value of 0 is passed in [zoom currently appears limited to range 10-500].
    When iZoom is 0, getZoomPercentage is called to determine what should
    be used, otherwise the specified iZoom is used. This has no side
    effects that I noticed, but doesn't seem as elegant as rearranging when the
    GR_Graphics object is created so it is still the only place storing
    the zoom information.

    Tested on Windows 2000 and Windows 95

    Please feel free to comment on this, suggest alternate methods
    I overlooked, the prefered way it should be done, ignore it, ...

    Jeremy Davis
    jeremyd@computer.org





    This archive was generated by hypermail 2.1.4 : Thu Mar 14 2002 - 07:23:37 GMT