On Mon, 2008-10-13 at 09:01 +0200, Abdelrazak Younes wrote: > On 12/10/2008 21:24, Vincent van Ravesteijn wrote: > > Vincent van Ravesteijn wrote: > > > >> This patch solves some problems with painting selections in Insets. > >> These are: > >> - multiline selections paint in left margin of the main text > >> (bug 5270), > >> - the margins to the left and right side of the inset are not > correct, > >> - wrong painting of e.g. a multiline selection of a caption in a > >> float. > >> > >> I renamed the Row::left_margin_sel back to Row::begin_margin_sel > >> because > >> of RTL text. > >> > >> > > > > Is there yet a verdict for this patch ? > > > > + if (row.end_margin_sel) { > if (text_->isRTL(buffer, beg.paragraph())) { > - int rm = bv_->rightMargin(); > - pi.pain.fillRectangle(x + rm, y1, x2 - rm, y2 > - y1, Color_selection); > + pi.pain.fillRectangle(x + lm, y1, x2 - lm, y2 > - y1, > + Color_selection); > } else { > - int lm = bv_->leftMargin(); > - pi.pain.fillRectangle(x + x2, y1, width() - lm > - x2, y2 - y1, Color_selection); > + pi.pain.fillRectangle(x + x2, y1, width() - rm > - x2, y2 - y1, > + Color_selection); > > > Are you sure? You just replaced left with right and right with left > here... > > Otherwise the patch is just renaming and cosmetics so, provided that > you > explain the above, I am OK with the patch. Putting Dov in copy so that > he is aware of your activity. > > Abdel >
The piece of code you showed is indeed just renaming, but I think this makes more sense than the way it was before: if the end margin is selected, only the left margin is important for RTL text and the right margin for LTR text. By the way, bv_->leftMargin() and bv_->rightMargin() are defined exactly the same. However, when I played with these functions I saw that altering one of these does something different for RTL text as it does for LTR text. That's why I added the FIXME's last time (which lead to doubts from your side). The patch is not only cosmetics as it always does some 'important' things: it sets lm and rm to zero, when we are not in the main buffer (i.e. Insets don't have margins). Second, the other block for row.begin_margin_sel differ in a number of terms. Vincent