Re: IP and Fields (and another Field problem)


Subject: Re: IP and Fields (and another Field problem)
From: Martin Sevior (msevior@mccubbin.ph.unimelb.edu.au)
Date: Mon May 29 2000 - 10:04:24 CDT


On Mon, 29 May 2000, Jesper Skov wrote:

>
> Martin Sevior pointed out a problem with the findPointCoords function
> when dealing with Fields:
>
> Martin>
> Martin> and the cursor is positioned before the field instead of after
> Martin> the field.
>
> I cannot reproduce the assertion, but the position problem I can -
> both with the old and new findPointCoords implementations. I believe
> the below is a suitable fix.
>
>
> Somewhat related; using sub/super script on fields cause their font to
> reduce in sice, but there are no means for the code to adjust the
> vertical position of the text. Is there any reason not to add
> fp_TextRun::m_fPosition functionality to fp_FieldRun?
>
Hi Jesper,
          I'll check this code out tomorrow. I have no objection to you
adding m_fPosition to fp_FieldRun. I can't think of any reason why anyone
would want a superscripted field but Hey you never know!

Feel free to submit an updated patch :-)

Cheers

Martin

PS. This work is almost enough to make me have another look at Luke
Jordan's Lists patch. Maybe we shouldn't wait for the New Fields
implementation before fixing his code :-)

>
> 2000-05-29 Jesper Skov <jskov@redhat.com>
> * fp_Run.cpp (fp_FieldRun::findPointCoords): Return point position
> past field when necessary.
>
> Index: fp_Run.cpp
> ===================================================================
> RCS file: /cvsroot/abi/src/text/fmt/xp/fp_Run.cpp,v
> retrieving revision 1.95
> diff -u -5 -r1.95 fp_Run.cpp
> --- fp_Run.cpp 2000/05/18 06:10:05 1.95
> +++ fp_Run.cpp 2000/05/29 10:24:38
> @@ -1003,10 +1003,20 @@
> UT_sint32 yoff;
>
> UT_ASSERT(m_pLine);
>
> m_pLine->getOffsets(this, xoff, yoff);
> +
> + // Assuming there is only one offset in this Run, the point
> + // can be either before or after this offset. Return X
> + // position accordingly.
> + UT_ASSERT(1 == m_iLen);
> + if (iOffset > m_iOffsetFirst)
> + {
> + xoff += m_iWidth;
> + }
> +
> x = xoff;
> y = yoff;
> height = m_iHeight;
> }
>
>
>



This archive was generated by hypermail 2b25 : Mon May 29 2000 - 10:04:34 CDT