Re: bidi methods in LyXText

2003-03-21 Thread Alfredo Braunstein
Lars Gullik Bjønnes wrote:

> | It seems OK.
> 
> Ok, Alfredo if you send me an updated patch I'll apply it.

Okey dokey, here it is.

Alfredo
Index: ChangeLog
===
RCS file: /cvs/lyx/lyx-devel/src/ChangeLog,v
retrieving revision 1.1140
diff -u -p -u -r1.1140 ChangeLog
--- ChangeLog	2003/03/21 14:20:44	1.1140
+++ ChangeLog	2003/03/21 22:50:00
@@ -1,4 +1,8 @@
+2003-03-21  Alfredo Braunstein  <[EMAIL PROTECTED]>
 
+	* lyxtext.h:
+	* text.C: take the rtl methods out of line
+	
 2003-03-21 André Pönitz <[EMAIL PROTECTED]>
 
 	* metricsinfo.[Ch]: new files containing structures to be passed around
Index: lyxtext.h
===
RCS file: /cvs/lyx/lyx-devel/src/lyxtext.h,v
retrieving revision 1.147
diff -u -p -u -r1.147 lyxtext.h
--- lyxtext.h	2003/03/19 14:45:12	1.147
+++ lyxtext.h	2003/03/21 22:50:01
@@ -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];
-	}
-	///
-	inline
-	lyx::pos_type bidi_level(lyx::pos_type pos) const {
-		if (bidi_start == -1)
-			return 0;
-		else
-			return bidi_levels[pos-bidi_start];
-	}
-	///
-	inline
-	bool bidi_InRange(lyx::pos_type pos) const {
-		return bidi_start == -1 ||
-			(bidi_start <= pos && pos <= bidi_end);
-	}
+	lyx::pos_type vis2log(lyx::pos_type pos) const;
+	///
+	lyx::pos_type bidi_level(lyx::pos_type pos) const;
+	///
+	bool bidi_InRange(lyx::pos_type pos) const;
 private:
 	///
 	Row * firstrow;
@@ -655,16 +632,12 @@ private:
 
 	///
 	mutable std::vector log2vis_list;
-
 	///
 	mutable std::vector vis2log_list;
-
 	///
 	mutable std::vector bidi_levels;
-
 	///
 	mutable lyx::pos_type bidi_start;
-
 	///
 	mutable lyx::pos_type bidi_end;
 
Index: text.C
===
RCS file: /cvs/lyx/lyx-devel/src/text.C,v
retrieving revision 1.323
diff -u -p -u -r1.323 text.C
--- text.C	2003/03/20 14:13:46	1.323
+++ text.C	2003/03/21 22:50:05
@@ -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;


Re: bidi methods in LyXText

2003-03-21 Thread Lars Gullik Bjønnes
Dekel Tsur <[EMAIL PROTECTED]> writes:

| On Tue, Mar 18, 2003 at 11:58:08PM +0100, Alfredo Braunstein wrote:
| > Alfredo Braunstein wrote:
| > 
| > > Is there any good reason why all those bidi/rtl methods are inlined in
| > 
| > Here is a patch.
| 
| It seems OK.

Ok, Alfredo if you send me an updated patch I'll apply it. 

-- 
Lgb



Re: bidi methods in LyXText

2003-03-21 Thread Dekel Tsur
On Tue, Mar 18, 2003 at 11:58:08PM +0100, Alfredo Braunstein wrote:
> Alfredo Braunstein wrote:
> 
> > Is there any good reason why all those bidi/rtl methods are inlined in
> 
> Here is a patch.

It seems OK.


Re: bidi methods in LyXText

2003-03-18 Thread Lars Gullik Bjønnes
Alfredo Braunstein <[EMAIL PROTECTED]> writes:

| Alfredo Braunstein wrote:
| 
| > Is there any good reason why all those bidi/rtl methods are inlined in
| 
| Here is a patch.

Please make Dekel have a look at this.

-- 
Lgb


Re: bidi methods in LyXText

2003-03-18 Thread Alfredo Braunstein
Alfredo Braunstein wrote:

> Is there any good reason why all those bidi/rtl methods are inlined in

Here is a patch.

Regards, Alfredo
Index: ChangeLog
===
RCS file: /cvs/lyx/lyx-devel/src/ChangeLog,v
retrieving revision 1.1133
diff -u -p -u -r1.1133 ChangeLog
--- ChangeLog	2003/03/18 20:53:59	1.1133
+++ ChangeLog	2003/03/18 22:57:37
@@ -1,3 +1,8 @@
+2003-03-18  Alfredo Braunstein  <[EMAIL PROTECTED]>
+
+	* lyxtext.h:
+	* text.C: Take the bidi methods out of line
+
 2003-03-18  John Levon  <[EMAIL PROTECTED]>
 
 	* BufferView_pimpl.C (scrollDocView): add updateLayoutChoice(),
Index: lyxtext.h
===
RCS file: /cvs/lyx/lyx-devel/src/lyxtext.h,v
retrieving revision 1.146
diff -u -p -u -r1.146 lyxtext.h
--- lyxtext.h	2003/03/18 16:47:18	1.146
+++ lyxtext.h	2003/03/18 22:57:38
@@ -489,38 +489,15 @@ public:
 	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;
Index: text.C
===
RCS file: /cvs/lyx/lyx-devel/src/text.C,v
retrieving revision 1.319
diff -u -p -u -r1.319 text.C
--- text.C	2003/03/18 17:12:49	1.319
+++ text.C	2003/03/18 22:57:42
@@ -2838,3 +2838,34 @@ int LyXText::getDepth() const
 {
 	return cursor.par()->getDepth();
 }
+
+
+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);
+}


bidi methods in LyXText

2003-03-18 Thread Alfredo Braunstein
Is there any good reason why all those bidi/rtl methods are inlined in
LyXText? Given also that lyxtext.h is a pig and is included all around, I
think that it would be a good idea to take them offline.

Alfredo