Re: Fixing bug 1532


Subject: Re: Fixing bug 1532
From: Martin Sevior (msevior@mccubbin.ph.unimelb.edu.au)
Date: Wed Jul 18 2001 - 22:25:34 CDT


On Wed, 18 Jul 2001, Nathan Thompson-Amato wrote:

> Hi all!
>
> I'm trying to get my feet wet in the AbiWord source code by fixing bug
> 1532 ("cursor jumps down from superscript position after first
> character"). I'm having some trouble finding the path between the user
> clicking the "Superscript" button and the insertion point changing size.
> Can anybody give me a hint about where I should be looking? It seems
> like most of the relevant action happens in fv_View.cpp, but I've yet to
> see any of its functions resize the insertion point...
>
> I appreciate any help you can give me. Thanks,
>

Hi Nathan,
          This is likely to be a bug somewhere in fp_TextRun.cpp.

However in answer to your question. Changing the state of the superscript
button does the following things.

Event > ev_UnixToolbar -> ap_EditMethods.cpp (function toggleSuperscript
is called) This calls _toggleSpan also in ap_EditMethods. This makes
several calls to fv_View to read the properties at the current insertion
point (fv_View()->getCharFormat()), find the property requested (in this
case superscript) and change it from it's current state to the other
state.

The new set of properties with the altered superscript state are then
written back into the document via fvView()->setCharFormat(). The document
then updates it's self and updates all the windows looking at the
document. At this point the effect of changing the "superscript ness" of
the selected text or insertion is shown.

The code that deals with displaying super/sub scripted text is in
fp_TextRun.cpp. The code that deals with determining the cursor
size/location is in fv_View().cpp::_findPositionCoords()

This in turn calls fl_BlockLayout.cpp::findPointCoords()

Which in turn calls fp_TextRun.cpp::findPointCoords()

I suggest you place lots of UT_DEBUGMSG() calls through these functions to
determine what is going wrong. It might be something as simple as an
incorrect return value in fp_TextRun.cpp:findPointCoords().

Good Luck!

Martin



This archive was generated by hypermail 2b25 : Wed Jul 18 2001 - 22:25:44 CDT