Andreas Vox <[EMAIL PROTECTED]> writes:

| Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:
>
>> 
>> This is making life hard for me.
>
| < bool LyXText::cursorUp(LCursor & cur)
| < {
| <         Paragraph const & par = cur.paragraph();
| <         int const row = par.pos2row(cur.pos());
| <         int const x = cur.targetX();
| < 
| <         if (!cur.selection()) {
| <                 lyxerr << BOOST_CURRENT_FUNCTION
| <                        << "Cursor up, no selection" << endl;
| < 
| <                 int const y = bv_funcs::getPos(cur).y_;
| <                 LCursor old = cur;
| <                 editXY(cur, x, y - par.rows()[row].ascent() - 1);
| <                 if (cur == old)
|                     {
| <                         lyxerr << BOOST_CURRENT_FUNCTION
| <                                << " cur and old ARE EQUAL!\n"
| <                                << "old: " << old <<'\n'
| <                                << "cur: " << cur << endl;
|                     }
| < 
| <                         return deleteEmptyParagraphMechanism(cur, old);
| <         }
| ...
| < an extra space between to words and press 'up'. The cursor now moves
| < out of the inset and into the line above. Fine and dandy. This is done
| < by hte editXY in the code above. However, what is not so fine is that
| < old == cur even after this, so DEPM ends up doing nothing and we are
| < left with a double-space.
>
| But if everything is fine and dandy, cur MUST have changed, no?

I have a feeling that the cursor used afterwards is a different
cursor.

| Maybe old changed as well?

Easy enought to check.

| I'm not an expert in C++ copy semantics, so
| I don't know what "LCursor old = cur;" really does. I think the assignment 
| operators are inherited via DocIterator from std::vector<CursorSlice>
| which would give me a headache ... :-)

Yes. this is inherited from std::vector.

(I have another patch that removes that inheritance...)

-- 
        Lgb

Reply via email to