bidi out of line patch from Alfredo

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6557 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2003-03-21 23:53:26 +00:00
parent 47fe3ce6c8
commit 6477ad2616
3 changed files with 50 additions and 39 deletions

View File

@ -1,3 +1,7 @@
2003-03-21 Alfredo Braunstein <abraunst@libero.it>
* lyxtext.h:
* text.C: take the rtl methods out of line
2003-03-21 André Pönitz <poenitz@gmx.net>
@ -9,8 +13,8 @@
* lyxtextclass.C: read 'environment' tag.
2003-03-20 Alfredo Braunstein <abraunst@libero.it>
* text2.C (removeRow): fix bug 964
* text2.C (removeRow): fix bug 964
2003-03-20 John Levon <levon@movementarian.org>
@ -73,11 +77,11 @@
* text2.C: anchor row on setCursor
2003-03-18 Alfredo Braunstein <abraunst@libero.it>
* lyxtext.h: remove almost all mutable keywords
* text.C:
* text2.C:
* text3.C: remove const keywords accordingly
* lyxtext.h: remove almost all mutable keywords
* text.C:
* text2.C:
* text3.C: remove const keywords accordingly
2003-03-17 Lars Gullik Bjønnes <larsbj@gullik.net>

View File

@ -487,40 +487,17 @@ public:
int workWidth() const;
///
int workWidth(Inset * inset) const;
///
void computeBidiTables(Buffer const *, Row * row) const;
/// Maps positions in the visual string to positions in logical string.
inline
lyx::pos_type log2vis(lyx::pos_type pos) const {
if (bidi_start == -1)
return pos;
else
return log2vis_list[pos-bidi_start];
}
lyx::pos_type log2vis(lyx::pos_type pos) const;
/// Maps positions in the logical string to positions in visual string.
inline
lyx::pos_type vis2log(lyx::pos_type pos) const {
if (bidi_start == -1)
return pos;
else
return vis2log_list[pos-bidi_start];
}
lyx::pos_type vis2log(lyx::pos_type pos) const;
///
inline
lyx::pos_type bidi_level(lyx::pos_type pos) const {
if (bidi_start == -1)
return 0;
else
return bidi_levels[pos-bidi_start];
}
lyx::pos_type bidi_level(lyx::pos_type pos) const;
///
inline
bool bidi_InRange(lyx::pos_type pos) const {
return bidi_start == -1 ||
(bidi_start <= pos && pos <= bidi_end);
}
bool bidi_InRange(lyx::pos_type pos) const;
private:
///
Row * firstrow;
@ -655,16 +632,12 @@ private:
///
mutable std::vector<lyx::pos_type> log2vis_list;
///
mutable std::vector<lyx::pos_type> vis2log_list;
///
mutable std::vector<lyx::pos_type> bidi_levels;
///
mutable lyx::pos_type bidi_start;
///
mutable lyx::pos_type bidi_end;

View File

@ -300,6 +300,40 @@ int LyXText::singleWidth(Paragraph * par,
}
lyx::pos_type LyXText::log2vis(lyx::pos_type pos) const
{
if (bidi_start == -1)
return pos;
else
return log2vis_list[pos-bidi_start];
}
lyx::pos_type LyXText::vis2log(lyx::pos_type pos) const
{
if (bidi_start == -1)
return pos;
else
return vis2log_list[pos-bidi_start];
}
lyx::pos_type LyXText::bidi_level(lyx::pos_type pos) const
{
if (bidi_start == -1)
return 0;
else
return bidi_levels[pos-bidi_start];
}
bool LyXText::bidi_InRange(lyx::pos_type pos) const
{
return bidi_start == -1 ||
(bidi_start <= pos && pos <= bidi_end);
}
void LyXText::computeBidiTables(Buffer const * buf, Row * row) const
{
bidi_same_direction = true;