- if (inset_owner)
- return 0;
-
- int before_number = -1;
- int behind_number = -1;
- if (before)
- before_number = before->id();
- if (behind)
- behind_number = behind->id();
- // Undo::EDIT and Undo::FINISH are
- // always finished. (no overlapping there)
- // overlapping only with insert and delete inside one paragraph:
- // Nobody wants all removed character
- // appear one by one when undoing.
- // EDIT is special since only layout information, not the
- // contents of a paragaph are stored.
- if (!undo_finished && (kind != Undo::EDIT) && (kind != Undo::FINISH)){
- // check wether storing is needed
- if (!buf->undostack.empty() &&
- buf->undostack.top()->kind == kind &&
- buf->undostack.top()->number_of_before_par == before_number &&
- buf->undostack.top()->number_of_behind_par == behind_number ){
- // no undo needed
- return 0;
- }
- }
- // create a new Undo
- LyXParagraph * undopar;
-
- LyXParagraph * start = 0;
- LyXParagraph * end = 0;
-
- if (before)
- start = const_cast<LyXParagraph*>(before->next());
- else
- start = FirstParagraph();
- if (behind)
- end = const_cast<LyXParagraph*>(behind->previous());
- else {
- end = FirstParagraph();
- while (end->next())
- end = end->next();
- }
- if (start && end && (start != end->next()) &&
- ((before != behind) || (!before && !behind))) {
- LyXParagraph * tmppar = start;
- LyXParagraph * tmppar2 = new LyXParagraph(*tmppar);
- tmppar2->id(tmppar->id());
-
- // a memory optimization: Just store the layout information
- // when only edit
- if (kind == Undo::EDIT){
- //tmppar2->text.clear();
- tmppar2->clearContents();
- }
+ // well as much as I know && binds more then || so the above and the
+ // below are identical (this for your known use of parentesis!)
+ // Now some explanation:
+ // We should only go up with refreshing code so this means that if
+ // we have a MORE refresh we should never set it to LITTLE if we still
+ // didn't handle it (and then it will be UNCHANGED. Now as long as
+ // we stay inside one LyXText this may work but we need to tell the
+ // outermost LyXText that it should REALLY draw us if there is some
+ // change in a Inset::LyXText. So you see that when we are inside a
+ // inset's LyXText we give the LITTLE to the outermost LyXText to
+ // tell'em that it should redraw the actual row (where the inset
+ // resides! Capito?!