Re: LyX unit testing

2013-09-19 Thread Hashini Senaratne
Hello Vincent,

 But in general, I would like to introduce unit testing, yes.
 

Currently, is there any guide that I can follow, how the suggested testframe
work can be set to the LyX environment?

Thanks
Hashini






Re: Key board based horizontal scrolling

2013-09-19 Thread Hashini Senaratne
Hello Jean-Marc,

 - create a nice and tidy scroll/master repo with a few commits, or maybe 
 one for where we are now and one for removing insettabulat special code 
 once you got it right in testing.

Did you mean deleting current scroll/master and recreate one?

 I prefer the later option. The code for scrolling was very difficult to 
 get right, but the fact is that current changes are not that large:
 
 fantomas (scroll/testing): git diff  origin/master src |diffstat
   BufferView.cpp|   66 
 +++--
   Cursor.cpp|   58 +++-
   Cursor.h  |   67 
 --
   CursorSlice.h |2 +
   TextMetrics.cpp   |   22 +++--
   frontends/qt4/GuiWorkArea.cpp |9 +
   mathed/InsetMathHull.cpp  |2 -
   7 files changed, 174 insertions(+), 52 deletions(-)
 
 In the count above there are a few changes that are wrong, probably 
 because we forget to rebase some stuff, I am not sure actually.
 
 You should first review this diff and understand what should be fixed. 
 For example, there is in origin/master a chunk of comments in Cursor.h 
 coming from a description I did which is not in gsoc/scroll/master. You 
 should re-add it I am not sure what happened. Also the changes in 
 mathed/InsetMathHull.cpp should not be there. There are a couple (one) 
 other example that does not look correct.

I am working on this.

I was trying to figure out what has happened with vertical scrolling. This
problem has remained for a long time as I can see. The first point this
introduced was when using,
if (cur.textRow() == row)
What happens is what is doing inside cur.textRow() affects the vertical
scrolling. Will you be able to give me some hints? I think this bug make the
implementation of horrizontal scrolling worthless.

Thank you.
Hashini



Re: Key board based horizontal scrolling

2013-09-19 Thread Jean-Marc Lasgouttes

Le 19/09/2013 08:49, Hashini Senaratne a écrit :

Hello Jean-Marc,


- create a nice and tidy scroll/master repo with a few commits, or maybe
one for where we are now and one for removing insettabulat special code
once you got it right in testing.


Did you mean deleting current scroll/master and recreate one?


Yes, resetting all the changes that are there for now.


I was trying to figure out what has happened with vertical scrolling. This
problem has remained for a long time as I can see. The first point this
introduced was when using,
if (cur.textRow() == row)
What happens is what is doing inside cur.textRow() affects the vertical
scrolling. Will you be able to give me some hints? I think this bug make the
implementation of horrizontal scrolling worthless.


Good catch! I'll have a look.

JMarc



Re: Key board based horizontal scrolling

2013-09-19 Thread Hashini Senaratne
Hello Jean-Marc,

 Yes, resetting all the changes that are there for now.

In this commit:
http://git.lyx.org/?p=gsoc.git;a=commitdiff;h=72ae4610ffabf6b8c974b3af3b8d19c39de9e6c6
I tried to resolve the differences compared to origin/master. Now the
statistics are as follows.

 BufferView.cpp|   68 +-
 Cursor.cpp|   57 +--
 Cursor.h  |   24 ++
 CursorSlice.h |2 +
 TextMetrics.cpp   |   20 ++--
 frontends/qt4/GuiWorkArea.cpp |7 
 6 files changed, 172 insertions(+), 6 deletions(-)

Then I hope to deal with the master. I will send you a log and will ask for
review.

Regarding the disabling half-back solution in table scrolling, do not we
also have to remove the variable 'scx_' from InsetTabular.cpp and
InsetTabular.h?
I think we have to as it seems like this mutable variable is introduced for
that purpose.

Thank you
Hashini



Re: Key board based horizontal scrolling

2013-09-19 Thread Jean-Marc Lasgouttes

Le 19/09/2013 12:31, Hashini Senaratne a écrit :

In this commit:
http://git.lyx.org/?p=gsoc.git;a=commitdiff;h=72ae4610ffabf6b8c974b3af3b8d19c39de9e6c6
I tried to resolve the differences compared to origin/master. Now the
statistics are as follows.


This looks very good now.


Then I hope to deal with the master. I will send you a log and will ask for
review.


Fine. Do you know how to use git commit --amend (for updating commit) 
and git format-patch (to send commit via e-mail)? Send it tomorrow if 
you can, I cannot be sure I will have time this week end (family 
pressure...).



Regarding the disabling half-back solution in table scrolling, do not we
also have to remove the variable 'scx_' from InsetTabular.cpp and
InsetTabular.h?
I think we have to as it seems like this mutable variable is introduced for
that purpose.


Yes, it seems that you are right. This would be nice in a second patch. 
Or all in the same patch if you prefer.


JMarc


Re: Key board based horizontal scrolling

2013-09-19 Thread Jean-Marc Lasgouttes

Le 19/09/2013 08:49, Hashini Senaratne a écrit :

I was trying to figure out what has happened with vertical scrolling. This
problem has remained for a long time as I can see. The first point this
introduced was when using,
if (cur.textRow() == row)
What happens is what is doing inside cur.textRow() affects the vertical
scrolling. Will you be able to give me some hints? I think this bug make the
implementation of horrizontal scrolling worthless.


It turns out that this calls TextMetrics::parMetrics, which calls 
redoParagraph if the row is not already computed. I do not know exactly 
why this causes problems with the vertical scrollbar. Presumably the 
height of the rows changes...


JMarc



Re: LyX unit testing

2013-09-19 Thread Hashini Senaratne
Hello Vincent,

> But in general, I would like to introduce unit testing, yes.
> 

Currently, is there any guide that I can follow, how the suggested testframe
work can be set to the LyX environment?

Thanks
Hashini






Re: Key board based horizontal scrolling

2013-09-19 Thread Hashini Senaratne
Hello Jean-Marc,

> - create a nice and tidy scroll/master repo with a few commits, or maybe 
> one for where we are now and one for removing insettabulat special code 
> once you got it right in testing.

Did you mean deleting current scroll/master and recreate one?

> I prefer the later option. The code for scrolling was very difficult to 
> get right, but the fact is that current changes are not that large:
> 
> fantomas (scroll/testing): git diff  origin/master src |diffstat
>   BufferView.cpp|   66 
> +++--
>   Cursor.cpp|   58 +++-
>   Cursor.h  |   67 
> --
>   CursorSlice.h |2 +
>   TextMetrics.cpp   |   22 +++--
>   frontends/qt4/GuiWorkArea.cpp |9 +
>   mathed/InsetMathHull.cpp  |2 -
>   7 files changed, 174 insertions(+), 52 deletions(-)
> 
> In the count above there are a few changes that are wrong, probably 
> because we forget to rebase some stuff, I am not sure actually.
> 
> You should first review this diff and understand what should be fixed. 
> For example, there is in origin/master a chunk of comments in Cursor.h 
> coming from a description I did which is not in gsoc/scroll/master. You 
> should re-add it I am not sure what happened. Also the changes in 
> mathed/InsetMathHull.cpp should not be there. There are a couple (one) 
> other example that does not look correct.

I am working on this.

I was trying to figure out what has happened with vertical scrolling. This
problem has remained for a long time as I can see. The first point this
introduced was when using,
if (() == )
What happens is what is doing inside cur.textRow() affects the vertical
scrolling. Will you be able to give me some hints? I think this bug make the
implementation of horrizontal scrolling worthless.

Thank you.
Hashini



Re: Key board based horizontal scrolling

2013-09-19 Thread Jean-Marc Lasgouttes

Le 19/09/2013 08:49, Hashini Senaratne a écrit :

Hello Jean-Marc,


- create a nice and tidy scroll/master repo with a few commits, or maybe
one for where we are now and one for removing insettabulat special code
once you got it right in testing.


Did you mean deleting current scroll/master and recreate one?


Yes, resetting all the changes that are there for now.


I was trying to figure out what has happened with vertical scrolling. This
problem has remained for a long time as I can see. The first point this
introduced was when using,
if (() == )
What happens is what is doing inside cur.textRow() affects the vertical
scrolling. Will you be able to give me some hints? I think this bug make the
implementation of horrizontal scrolling worthless.


Good catch! I'll have a look.

JMarc



Re: Key board based horizontal scrolling

2013-09-19 Thread Hashini Senaratne
Hello Jean-Marc,

> Yes, resetting all the changes that are there for now.

In this commit:
http://git.lyx.org/?p=gsoc.git;a=commitdiff;h=72ae4610ffabf6b8c974b3af3b8d19c39de9e6c6
I tried to resolve the differences compared to origin/master. Now the
statistics are as follows.

 BufferView.cpp|   68 +-
 Cursor.cpp|   57 +--
 Cursor.h  |   24 ++
 CursorSlice.h |2 +
 TextMetrics.cpp   |   20 ++--
 frontends/qt4/GuiWorkArea.cpp |7 
 6 files changed, 172 insertions(+), 6 deletions(-)

Then I hope to deal with the master. I will send you a log and will ask for
review.

Regarding the disabling half-back solution in table scrolling, do not we
also have to remove the variable 'scx_' from InsetTabular.cpp and
InsetTabular.h?
I think we have to as it seems like this mutable variable is introduced for
that purpose.

Thank you
Hashini



Re: Key board based horizontal scrolling

2013-09-19 Thread Jean-Marc Lasgouttes

Le 19/09/2013 12:31, Hashini Senaratne a écrit :

In this commit:
http://git.lyx.org/?p=gsoc.git;a=commitdiff;h=72ae4610ffabf6b8c974b3af3b8d19c39de9e6c6
I tried to resolve the differences compared to origin/master. Now the
statistics are as follows.


This looks very good now.


Then I hope to deal with the master. I will send you a log and will ask for
review.


Fine. Do you know how to use "git commit --amend" (for updating commit) 
and "git format-patch" (to send commit via e-mail)? Send it tomorrow if 
you can, I cannot be sure I will have time this week end (family 
pressure...).



Regarding the disabling half-back solution in table scrolling, do not we
also have to remove the variable 'scx_' from InsetTabular.cpp and
InsetTabular.h?
I think we have to as it seems like this mutable variable is introduced for
that purpose.


Yes, it seems that you are right. This would be nice in a second patch. 
Or all in the same patch if you prefer.


JMarc


Re: Key board based horizontal scrolling

2013-09-19 Thread Jean-Marc Lasgouttes

Le 19/09/2013 08:49, Hashini Senaratne a écrit :

I was trying to figure out what has happened with vertical scrolling. This
problem has remained for a long time as I can see. The first point this
introduced was when using,
if (() == )
What happens is what is doing inside cur.textRow() affects the vertical
scrolling. Will you be able to give me some hints? I think this bug make the
implementation of horrizontal scrolling worthless.


It turns out that this calls TextMetrics::parMetrics, which calls 
redoParagraph if the row is not already computed. I do not know exactly 
why this causes problems with the vertical scrollbar. Presumably the 
height of the rows changes...


JMarc