[liblouis-liblouisxml] Re: Calculation of cursorPos

  • From: James Teh <jamie@xxxxxxxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Wed, 30 Jan 2013 01:06:53 +1000

outputPos maps input positions to output positions. At the beginning of the call, cursorPos is the cursor position in the input. Therefore, unless I'm missing something, the output cursorPos should just be outputPos[cursorPos]. Is there a reason this isn't the case? This would simplify the code a great deal and thereby eliminate existing bugs.


Jamie

On 30/01/2013 1:03 AM, John J. Boyer wrote:
I don't understand this question. outputPos is an array. cursorPos is a
single value. What would be the ideal value of cursorPos? There may be
differing opinions on this.

John

On Tue, Jan 29, 2013 at 05:53:28PM +1000, James Teh wrote:
Hi all, especially John,

Currently, there are still some bugs in the calculation of the output
cursor position in lou_translate. I can detail these in a separate email
if necessary. However, I'm wondering whether it is simpler to just set
cursorPos based on outputPos just before returning the translation,
rather than having separate code for it. Is there any reason cursorPos
is currently determined separately from outputPos? To put it another
way, is there any reason that cursorPos should ever be different to
outputPos[inputCursorPos], where inputCursorPos is the value of
cursorPos when the function was called?

Thanks,
Jamie

--
James Teh
Director, NV Access Limited
Email: jamie@xxxxxxxxxxxx
Web site: http://www.nvaccess.org/
Phone: +61 7 5667 8372
For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com


--
James Teh
Director, NV Access Limited
Email: jamie@xxxxxxxxxxxx
Web site: http://www.nvaccess.org/
Phone: +61 7 5667 8372
For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts: