On 5/9/07, Bo Peng <[EMAIL PROTECTED]> wrote:
1. create a lyx file 2. layout LyX-code 3. enter something with leading blanks. a b 4. select, change layout to standard, the leading blanks of b are not removed. 5. select all, insert ERT. crash.
The problem is that after step 4, the paragraph is defective in that endpos() is 4 (' b') but text_ only has 'b'. Then, eraseSelectionHelper will fail when it tries to remove 4 characters from 'b'. To see what exactly is happening: 1. lyx-code 2. enter aaaaa 123456 (there are four leading spaces) 3. change environment to standard 4. select aaaaa and 1 5. cut aaaaa, 12345 are removed. It is pretty easy to avoid the crash by adding something like right = min(right, par[pit].size() + 1) after line 304 of CutAndPaste.cpp, but I believe that a better treatment is required. Any idea? Cheers, Bo