Re: hub - r33076 - abiword/branches/ABI-3-0-0-STABLE/src/text/fmt/xp

From: Simon Larochelle <larochelle.simon.1_at_gmail.com>
Date: Sun May 26 2013 - 03:46:23 CEST

Hi Joe,

When a cell is broken between two pages, a container with y =
YBottom() appears in the following broken table (see function
fp_TableContainer::isInBrokenTable). I think that this was needed to
get the breaking of nested tables to work smoothly. Thus y = YBottom()
-1 is really the last y value inside a broken table. Note that the
goal of the function mapXYToPosition is to find where the cursor is
pointing in the text and getYBottom()-1 should be below the last line
of one of the cells in the bottom row of the table in any case.

Simon

On Thu, May 23, 2013 at 12:11 PM, joe joe <joegsoc2013@gmail.com> wrote:
>
> Hi,
>
> a simple question, why should we "-1", just for interface?
>
>
>> + if (y >= getYBottom())
>> + {
>> + y = getYBottom() - 1;
>> + }
>
>> + if (getFirstBrokenTable() && y >= getFirstBrokenTable()->getYBottom())
>> + {
>> + y = getFirstBrokenTable()->getYBottom() - 1;
>> + }
>
>
> thanks,
> Joe
>
> On Wed, May 22, 2013 at 8:37 AM, <cvs@abisource.com> wrote:
>>
>> Author: hub
>> Date: 2013-05-22 02:37:05 +0200 (Wed, 22 May 2013)
>> New Revision: 33076
>>
>> Modified:
>> abiword/branches/ABI-3-0-0-STABLE/src/text/fmt/xp/fp_TableContainer.cpp
>> Log:
>> Fix bug: fp_TableContainer::mapXYToPosition should return a position in the cell above when the cursor is in the bottom margin area. Please backport.
>>
>> Cherry-pick from trunk@33072. From slaroche
>>
>> Modified: abiword/branches/ABI-3-0-0-STABLE/src/text/fmt/xp/fp_TableContainer.cpp
>> ===================================================================
>> --- abiword/branches/ABI-3-0-0-STABLE/src/text/fmt/xp/fp_TableContainer.cpp 2013-05-22 00:36:57 UTC (rev 33075)
>> +++ abiword/branches/ABI-3-0-0-STABLE/src/text/fmt/xp/fp_TableContainer.cpp 2013-05-22 00:37:05 UTC (rev 33076)
>> @@ -3698,24 +3698,24 @@
>> y = 1;
>> bAboveTable = true;
>> }
>> - if (isThisBroken() && y >= getYBottom())
>> - {
>> - y = getYBottom() - 1;
>> - }
>> - else if (!isThisBroken() && getFirstBrokenTable() && y >= getFirstBrokenTable()->getYBottom())
>> - {
>> - y = getFirstBrokenTable()->getYBottom() - 1;
>> - }
>>
>> fp_TableContainer * pMaster = NULL;
>> if(isThisBroken())
>> {
>> + pMaster = getMasterTable();
>> y = y + getYBreak();
>> - pMaster = getMasterTable();
>> + if (y >= getYBottom())
>> + {
>> + y = getYBottom() - 1;
>> + }
>> }
>> else
>> {
>> pMaster = this;
>> + if (getFirstBrokenTable() && y >= getFirstBrokenTable()->getYBottom())
>> + {
>> + y = getFirstBrokenTable()->getYBottom() - 1;
>> + }
>> }
>>
>> if(!pMaster->countCons())
>>
>> -----------------------------------------------
>> To unsubscribe from this list, send a message to
>> abisource-cvs-commit-request@abisource.com with the word
>> unsubscribe in the message body.
Received on Sun May 26 03:46:59 2013

This archive was generated by hypermail 2.1.8 : Sun May 26 2013 - 03:47:00 CEST