From 4a0b9802c41bd497ffb98c2a4ebfb3590b8e8eb8 Mon Sep 17 00:00:00 2001 From: Dekel Tsur Date: Sun, 18 Aug 2002 17:15:24 +0000 Subject: [PATCH] RTL fixes git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5019 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView_pimpl.C | 5 ++++- src/ChangeLog | 7 +++++++ src/text.C | 24 ++++++++++-------------- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index 0ccdb69ecb..713575480e 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -40,6 +40,7 @@ #include "ParagraphParameters.h" #include "undo_funcs.h" #include "funcrequest.h" +#include "language.h" #include "insets/insetbib.h" #include "insets/insettext.h" @@ -3239,7 +3240,9 @@ void BufferView::Pimpl::smartQuote() LyXLayout_ptr const & style = par->layout(); if (style->pass_thru || - (!insertInset(new InsetQuotes(c, bv_->buffer()->params)))) + par->getFontSettings(buffer_->params, + pos).language()->lang() == "hebrew" || + (!insertInset(new InsetQuotes(c, buffer_->params)))) bv_->owner()->dispatch(FuncRequest(LFUN_SELFINSERT, "\"")); } diff --git a/src/ChangeLog b/src/ChangeLog index b38cb9012b..2b3820c394 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2002-08-18 Dekel Tsur + + * text.C (paintRowSelection): Fix code for rows with both RTL & LTR text. + + * BufferView_pimpl.C (smartQuote): Insert typewriter quotes in + Hebrew text. + 2002-08-16 Jean-Marc Lasgouttes * Makefile.am: use $(variables) instead of @substitutions@ diff --git a/src/text.C b/src/text.C index ec90880c58..e29788c31c 100644 --- a/src/text.C +++ b/src/text.C @@ -3130,26 +3130,22 @@ void LyXText::paintRowSelection(DrawRowParams & p) } return; } else if (startrow != row && endrow != row) { - int w = p.width; - int h = row->height(); if (p.y > starty && p.y < endy) { + int w = p.width; + int h = row->height(); p.pain->fillRectangle(p.xo, p.yo, w, h, LColor::selection); } return; } - if (!((startrow != row && !is_rtl) || (endrow != row && is_rtl))) { - return; - } - - float tmpx = p.x; - - p.pain->fillRectangle(p.xo, p.yo, int(p.x), row->height(), LColor::selection); + if ((startrow != row && !is_rtl) || (endrow != row && is_rtl)) + p.pain->fillRectangle(p.xo, p.yo, int(p.x), row->height(), LColor::selection); Buffer const * buffer = p.bv->buffer(); Paragraph * par = row->par(); pos_type main_body = beginningOfMainBody(buffer, par); pos_type const last = rowLastPrintable(row); + float tmpx = p.x; for (pos_type vpos = row->pos(); vpos <= last; ++vpos) { pos_type pos = vis2log(vpos); @@ -3187,12 +3183,12 @@ void LyXText::paintRowSelection(DrawRowParams & p) int(tmpx - old_tmpx + 1), row->height(), LColor::selection); } + } - if ((startrow != row && is_rtl) || (endrow != row && !is_rtl)) { - p.pain->fillRectangle(p.xo + int(tmpx), - p.yo, int(p.bv->workWidth() - tmpx), - row->height(), LColor::selection); - } + if ((startrow != row && is_rtl) || (endrow != row && !is_rtl)) { + p.pain->fillRectangle(p.xo + int(tmpx), + p.yo, int(p.bv->workWidth() - tmpx), + row->height(), LColor::selection); } } -- 2.39.2