Re: hub - r33076 - abiword/branches/ABI-3-0-0-STABLE/src/text/fmt/xp
Simon Larochelle <[email protected]> Sat, 25 May 2013 21:46:23 -0400
| Newsgroups | gmane.editors.abiword.devel |
|---|---|
| Message-ID | <CAF8-HjE7Vk1Mu3ZQMAhyAmB8SCAHhtk_eDK8aSWzRVL9z-AYSw@mail.gmail.com> |
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 <[email protected]> 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, <[email protected]> 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 >> [email protected] with the word >> unsubscribe in the message body.