003-04-30 Lars Gullik Bj�nnes <larsbj@gullik.net>

* text3.C (dispatch): do not convert iterator -> pointer
        * undo_funcs.C (setCursorParUndo): ditto
        * text_funcs.C (transposeChars): ditto

        * text2.C (setLayout): ws changes only

        * text.C (breakParagraph): do not convert iterator -> pointer
        (insertChar): ditto
        (acceptChange): ditto
        (rejectChange): ditto
        (changeCase): ditto
        (Delete): ditto
        (backspace): ditto

        * BufferView.C (lockedInsetStoreUndo): do not convert iterator ->
        pointer


2003-04-30  Lars Gullik Bj�nnes  <larsbj@gullik.net>

        * insettext.C (setFont): do not convert iterator -> pointer

        * insettabular.C (localDispatch): do not convert iterator -> pointer
        (setFont): ditto
        (tabularFeatures): ditto


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6889 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2003-04-29 23:59:39 +00:00
parent 0a94135c65
commit b7ba81d387
10 changed files with 61 additions and 35 deletions

View File

@ -812,8 +812,8 @@ void BufferView::lockedInsetStoreUndo(Undo::undo_kind kind)
if (kind == Undo::EDIT) // in this case insets would not be stored!
kind = Undo::FINISH;
setUndo(this, kind,
&*text->cursor.par(),
text->cursor.par()->next());
text->cursor.par(),
boost::next(text->cursor.par()));
}

View File

@ -1,3 +1,22 @@
2003-04-30 Lars Gullik Bjønnes <larsbj@gullik.net>
* text3.C (dispatch): do not convert iterator -> pointer
* undo_funcs.C (setCursorParUndo): ditto
* text_funcs.C (transposeChars): ditto
* text2.C (setLayout): ws changes only
* text.C (breakParagraph): do not convert iterator -> pointer
(insertChar): ditto
(acceptChange): ditto
(rejectChange): ditto
(changeCase): ditto
(Delete): ditto
(backspace): ditto
* BufferView.C (lockedInsetStoreUndo): do not convert iterator ->
pointer
2003-04-29 Alfredo Braunstein <abraunst@libero.it>
* text3.C (gotoInset): YABG (yet another bad getChar)
@ -24,7 +43,7 @@
* paragraph.[Ch] (erase):
* paragraph_pimpl.[Ch] (erase): change return type and value
* text2.C (cutSelection): some rework
2003-04-28 John Levon <levon@movementarian.org>
* bufferlist.C: changes for unsaved changes dialog

View File

@ -1,3 +1,10 @@
2003-04-30 Lars Gullik Bjønnes <larsbj@gullik.net>
* insettext.C (setFont): do not convert iterator -> pointer
* insettabular.C (localDispatch): do not convert iterator -> pointer
(setFont): ditto
(tabularFeatures): ditto
2003-04-29 André Pönitz <poenitz@gmx.net>

View File

@ -1070,8 +1070,8 @@ Inset::RESULT InsetTabular::localDispatch(FuncRequest const & cmd)
// no break here!
case LFUN_DELETE:
setUndo(bv, Undo::DELETE,
&*bv->text->cursor.par(),
&*boost::next(bv->text->cursor.par()));
bv->text->cursor.par(),
boost::next(bv->text->cursor.par()));
cutSelection(bv->buffer()->params);
updateLocal(bv, INIT);
break;
@ -1155,8 +1155,8 @@ Inset::RESULT InsetTabular::localDispatch(FuncRequest const & cmd)
case LFUN_PASTE:
if (hasPasteBuffer()) {
setUndo(bv, Undo::INSERT,
&*bv->text->cursor.par(),
&*boost::next(bv->text->cursor.par()));
bv->text->cursor.par(),
boost::next(bv->text->cursor.par()));
pasteSelection(bv);
updateLocal(bv, INIT);
break;
@ -1684,8 +1684,8 @@ void InsetTabular::setFont(BufferView * bv, LyXFont const & font, bool tall,
}
if (hasSelection()) {
setUndo(bv, Undo::EDIT,
&*bv->text->cursor.par(),
&*boost::next(bv->text->cursor.par()));
bv->text->cursor.par(),
boost::next(bv->text->cursor.par()));
bool const frozen = undo_frozen;
if (!frozen)
freezeUndo();
@ -1808,8 +1808,8 @@ void InsetTabular::tabularFeatures(BufferView * bv,
sel_row_start = sel_row_end = tabular->row_of_cell(actcell);
}
setUndo(bv, Undo::FINISH,
&*bv->text->cursor.par(),
&*boost::next(bv->text->cursor.par()));
bv->text->cursor.par(),
boost::next(bv->text->cursor.par()));
int row = tabular->row_of_cell(actcell);
int column = tabular->column_of_cell(actcell);
@ -2930,7 +2930,7 @@ int InsetTabularMailer::string2params(string const & in, InsetTabular & inset)
#warning CHECK verify that this is a sane value to return.
if (in.empty())
return -1;
if (lex.isOK()) {
lex.next();
string const token = lex.getString();

View File

@ -1189,7 +1189,7 @@ Inset::RESULT InsetText::localDispatch(FuncRequest const & ev)
#if 0
// This should not be needed here and is also WRONG!
setUndo(bv, Undo::INSERT,
lt->cursor.par(), lt->cursor.par()->next());
lt->cursor.par(), boost::next(lt->cursor.par()));
#endif
bv->switchKeyMap();
if (lyxrc.auto_region_delete) {
@ -1951,7 +1951,7 @@ void InsetText::setFont(BufferView * bv, LyXFont const & font, bool toggleall,
clear = true;
}
if (lt->selection.set()) {
setUndo(bv, Undo::EDIT, &*lt->cursor.par(), &*boost::next(lt->cursor.par()));
setUndo(bv, Undo::EDIT, lt->cursor.par(), boost::next(lt->cursor.par()));
}
if (selectall)
selectAll(bv);

View File

@ -1457,7 +1457,7 @@ void LyXText::breakParagraph(ParagraphList & paragraphs, char keep_layout)
&& !layout->keepempty)
return;
setUndo(bv(), Undo::FINISH, &*cursor.par(), &*boost::next(cursor.par()));
setUndo(bv(), Undo::FINISH, cursor.par(), boost::next(cursor.par()));
// Always break behind a space
//
@ -1562,7 +1562,7 @@ void LyXText::redoParagraph()
// same Paragraph one to the right and make a rebreak
void LyXText::insertChar(char c)
{
setUndo(bv(), Undo::INSERT, &*cursor.par(), &*boost::next(cursor.par()));
setUndo(bv(), Undo::INSERT, cursor.par(), boost::next(cursor.par()));
// When the free-spacing option is set for the current layout,
// disable the double-space checking
@ -2114,7 +2114,7 @@ void LyXText::acceptChange()
if (selection.start.par() == selection.end.par()) {
LyXCursor & startc = selection.start;
LyXCursor & endc = selection.end;
setUndo(bv(), Undo::INSERT, &*startc.par(), &*boost::next(startc.par()));
setUndo(bv(), Undo::INSERT, startc.par(), boost::next(startc.par()));
startc.par()->acceptChange(startc.pos(), endc.pos());
finishUndo();
clearSelection();
@ -2135,8 +2135,8 @@ void LyXText::rejectChange()
if (selection.start.par() == selection.end.par()) {
LyXCursor & startc = selection.start;
LyXCursor & endc = selection.end;
setUndo(bv(), Undo::INSERT, &*startc.par(),
&*boost::next(startc.par()));
setUndo(bv(), Undo::INSERT, startc.par(),
boost::next(startc.par()));
startc.par()->rejectChange(startc.pos(), endc.pos());
finishUndo();
clearSelection();
@ -2352,7 +2352,7 @@ void LyXText::changeCase(LyXText::TextCase action)
lyx::Assert(from <= to);
setUndo(bv(), Undo::FINISH, &*from.par(), &*boost::next(to.par()));
setUndo(bv(), Undo::FINISH, from.par(), boost::next(to.par()));
pos_type pos = from.pos();
ParagraphList::iterator pit = from.par();
@ -2423,7 +2423,7 @@ void LyXText::Delete()
// to make sure undo gets the right cursor position
cursor = old_cursor;
setUndo(bv(), Undo::DELETE,
&*cursor.par(), &*boost::next(cursor.par()));
cursor.par(), boost::next(cursor.par()));
cursor = tmpcursor;
backspace();
}
@ -2481,8 +2481,8 @@ void LyXText::backspace()
if (cursor.par() != ownerParagraphs().begin()) {
setUndo(bv(), Undo::DELETE,
&*boost::prior(cursor.par()),
&*boost::next(cursor.par()));
boost::prior(cursor.par()),
boost::next(cursor.par()));
}
ParagraphList::iterator tmppit = cursor.par();
@ -2549,7 +2549,7 @@ void LyXText::backspace()
// this is the code for a normal backspace, not pasting
// any paragraphs
setUndo(bv(), Undo::DELETE,
&*cursor.par(), &*boost::next(cursor.par()));
cursor.par(), boost::next(cursor.par()));
// We used to do cursorLeftIntern() here, but it is
// not a good idea since it triggers the auto-delete
// mechanism. So we do a cursorLeftIntern()-lite,

View File

@ -1314,7 +1314,7 @@ void LyXText::cutSelection(bool doclear, bool realcut)
endpit = selection.end.par();
int endpos = selection.end.pos();
boost::tie(endpit, endpos) = realcut ?
boost::tie(endpit, endpos) = realcut ?
CutAndPaste::cutSelection(ownerParagraphs(),
selection.start.par(), endpit,
selection.start.pos(), endpos,
@ -1626,10 +1626,10 @@ void LyXText::setCursor(LyXCursor & cur, ParagraphList::iterator pit,
// same paragraph and there is a previous row then put the cursor on
// the end of the previous row
cur.iy(y + row->baseline());
if (row != beg &&
pos &&
boost::prior(row)->par() == row->par() &&
pos < pit->size() &&
if (row != beg &&
pos &&
boost::prior(row)->par() == row->par() &&
pos < pit->size() &&
pit->getChar(pos) == Paragraph::META_INSET) {
Inset * ins = pit->getInset(pos);
if (ins && (ins->needFullRow() || ins->display())) {
@ -1637,7 +1637,7 @@ void LyXText::setCursor(LyXCursor & cur, ParagraphList::iterator pit,
y -= row->height();
}
}
cur.row(row);
// y is now the beginning of the cursor row
y += row->baseline();

View File

@ -419,7 +419,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
for (; tmp != end; ++tmp) {
if (tmp->params().startOfAppendix()) {
setUndo(bv, Undo::EDIT, &*tmp, &*boost::next(tmp));
setUndo(bv, Undo::EDIT, tmp, boost::next(tmp));
tmp->params().startOfAppendix(false);
int tmpy;
setHeightOfRow(getRow(tmp, 0, tmpy));
@ -427,7 +427,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
}
}
setUndo(bv, Undo::EDIT, &*pit, &*boost::next(pit));
setUndo(bv, Undo::EDIT, pit, boost::next(pit));
pit->params().startOfAppendix(start);
// we can set the refreshing parameters now

View File

@ -27,7 +27,7 @@ void transposeChars(LyXText & text, LyXCursor const & cursor)
{
ParagraphList::iterator tmppit = cursor.par();
setUndo(text.bv(), Undo::FINISH, &*tmppit, &*boost::next(tmppit));
setUndo(text.bv(), Undo::FINISH, tmppit, boost::next(tmppit));
pos_type tmppos = cursor.pos();

View File

@ -466,6 +466,6 @@ void setRedo(BufferView * bv, Undo::undo_kind kind,
void setCursorParUndo(BufferView * bv)
{
setUndo(bv, Undo::FINISH, &*bv->text->cursor.par(),
bv->text->cursor.par()->next());
setUndo(bv, Undo::FINISH, bv->text->cursor.par(),
boost::next(bv->text->cursor.par()));
}