* paragraph.h: make operator= private unimplemented as long as it is

unusable

  * ParagraphList.C: whitespace

  * paragraph.[Ch]:
    paragraph_pimpl.[Ch]:
    paragraph_funcs.C:
    CutAndPaste.C:
    undo_funcs.C: whitespace + Paragraph *  -> Paragraph (const) &

  * text2.C:
    undo_funcs.[Ch]: Paragraph * -> ParagraphList::iterator


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6881 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2003-04-29 14:05:54 +00:00
parent ee9e6fc377
commit 653eaace76
7 changed files with 46 additions and 30 deletions

View File

@ -1,16 +1,24 @@
2003-04-29 Alfredo Braunstein <abraunst@libero.it>
* CutAndPaste.C (cutSelection): big rework, some bugs fixed
2003-04-29 André Pönitz <poenitz@gmx.net>
* paragraph.h: make operator= private unimplemented as long as
it is unusable
* ParagraphList.C: whitespace
* paragraph.[Ch]:
paragraph_pimpl.[Ch]:
paragraph_funcs.C:
undo_funcs.C: Paragraph * -> Paragraph (const) &
CutAndPaste.C:
undo_funcs.C: whitespace + Paragraph * -> Paragraph (const) &
* text2.C:
undo_funcs.[Ch]: Paragraph * -> ParagraphList::iterator
2003-04-29 Alfredo Braunstein <abraunst@libero.it>
* CutAndPaste.C (cutSelection): big rework, some bugs fixed
2003-04-28 John Levon <levon@movementarian.org>
* bufferlist.C: changes for unsaved changes dialog

View File

@ -86,7 +86,7 @@ namespace {
MathInset::mode_type asMode(MathInset::mode_type oldmode, string const & str)
{
lyxerr << "handling mode: '" << str << "'\n";
//lyxerr << "handling mode: '" << str << "'\n";
if (str == "mathmode")
return MathInset::MATH_MODE;
if (str == "textmode" || str == "forcetext")

View File

@ -335,6 +335,9 @@ private:
friend struct Paragraph::Pimpl;
///
Pimpl * pimpl_;
/// unimplemented
void operator=(Paragraph const &);
};

View File

@ -151,8 +151,8 @@ void breakParagraphConservative(BufferParams const & bparams,
new Paragraph);
tmp->makeSameLayout(*par);
// When can pos > Last()?
// I guess pos == Last() is possible.
// When can pos > size()?
// I guess pos == size() is possible.
if (par->size() > pos) {
// copy everything behind the break-position to the new
// paragraph
@ -292,7 +292,8 @@ TeXDeeper(Buffer const * buf,
lyxerr[Debug::LATEX] << "TeXDeeper... " << &*pit << endl;
ParagraphList::iterator par = pit;
while (par != paragraphs.end()&& par->params().depth() == pit->params().depth()) {
while (par != paragraphs.end() &&
par->params().depth() == pit->params().depth()) {
if (par->layout()->isEnvironment()) {
par = TeXEnvironment(buf, paragraphs, par,
os, texrow);
@ -477,7 +478,9 @@ TeXOnePar(Buffer const * buf,
}
if (pit->params().lineTop()) {
os << "\\lyxline{\\" << pit->getFont(bparams, 0, outerFont(pit, paragraphs)).latexSize() << '}'
os << "\\lyxline{\\"
<< pit->getFont(bparams, 0, outerFont(pit, paragraphs)).latexSize()
<< '}'
<< "\\vspace{-1\\parskip}";
further_blank_line = true;
}

View File

@ -389,7 +389,7 @@ LyXText::setLayout(LyXCursor & cur, LyXCursor & sstart_cur,
++endpit;
}
setUndo(bv(), Undo::EDIT, &*sstart_cur.par(), &*undoendpit);
setUndo(bv(), Undo::EDIT, sstart_cur.par(), undoendpit);
// ok we have a selection. This is always between sstart_cur
// and sel_end cursor
@ -463,7 +463,7 @@ bool LyXText::changeDepth(bv_funcs::DEPTH_CHANGE type, bool test_only)
ParagraphList::iterator pastend = boost::next(end);
if (!test_only)
setUndo(bv(), Undo::EDIT, &(*start), &(*pastend));
setUndo(bv(), Undo::EDIT, start, pastend);
bool changed = false;
@ -566,7 +566,7 @@ void LyXText::setFont(LyXFont const & font, bool toggleall)
// and sel_end cursor
setUndo(bv(), Undo::EDIT,
&*selection.start.par(), &*boost::next(selection.end.par()));
selection.start.par(), boost::next(selection.end.par()));
freezeUndo();
cursor = selection.start;
while (cursor.par() != selection.end.par() ||
@ -968,7 +968,7 @@ void LyXText::setParagraph(bool line_top, bool line_bottom,
++endpit;
}
setUndo(bv(), Undo::EDIT, &*selection.start.par(), &*undoendpit);
setUndo(bv(), Undo::EDIT, selection.start.par(), undoendpit);
ParagraphList::iterator tmppit = selection.end.par();
@ -1255,8 +1255,8 @@ void LyXText::insertInset(Inset * inset)
{
if (!cursor.par()->insetAllowed(inset->lyxCode()))
return;
setUndo(bv(), Undo::FINISH, &*cursor.par(),
&*boost::next(cursor.par()));
setUndo(bv(), Undo::FINISH, cursor.par(),
boost::next(cursor.par()));
freezeUndo();
cursor.par()->insertInset(cursor.pos(), inset);
// Just to rebreak and refresh correctly.
@ -1308,7 +1308,7 @@ void LyXText::cutSelection(bool doclear, bool realcut)
++endpit;
}
setUndo(bv(), Undo::DELETE, &*selection.start.par(), &*undoendpit);
setUndo(bv(), Undo::DELETE, selection.start.par(), undoendpit);
endpit = selection.end.par();
@ -1381,7 +1381,7 @@ void LyXText::pasteSelection()
return;
setUndo(bv(), Undo::INSERT,
&*cursor.par(), &*boost::next(cursor.par()));
cursor.par(), boost::next(cursor.par()));
Paragraph * endpar;
ParagraphList::iterator actpit = cursor.par();
@ -2236,7 +2236,7 @@ bool LyXText::deleteEmptyParagraphMechanism(LyXCursor const & old_cursor)
++endpit;
}
setUndo(bv(), Undo::DELETE, &*old_cursor.par(), &*endpit);
setUndo(bv(), Undo::DELETE, old_cursor.par(), endpit);
cursor = tmpcursor;
// delete old row
@ -2267,7 +2267,7 @@ bool LyXText::deleteEmptyParagraphMechanism(LyXCursor const & old_cursor)
++endpit;
}
setUndo(bv(), Undo::DELETE, &*old_cursor.par(), &*endpit);
setUndo(bv(), Undo::DELETE, old_cursor.par(), endpit);
cursor = tmpcursor;
// delete old row

View File

@ -77,10 +77,8 @@ bool textHandleUndo(BufferView * bv, Undo & undo)
{
Buffer * b = bv->buffer();
Paragraph * before =
&*b->getParFromID(undo.number_of_before_par);
Paragraph * behind =
&*b->getParFromID(undo.number_of_behind_par);
Paragraph * before = &*b->getParFromID(undo.number_of_before_par);
Paragraph * behind = &*b->getParFromID(undo.number_of_behind_par);
Paragraph * tmppar;
Paragraph * tmppar2;
@ -284,8 +282,11 @@ bool textHandleUndo(BufferView * bv, Undo & undo)
bool createUndo(BufferView * bv, Undo::undo_kind kind,
Paragraph const * first, Paragraph const * behind, shared_ptr<Undo> & u)
ParagraphList::iterator itfirst, ParagraphList::iterator itbehind,
shared_ptr<Undo> & u)
{
Paragraph * first = &*itfirst;
Paragraph * behind = &*itbehind;
lyx::Assert(first);
int before_number = -1;
@ -476,11 +477,11 @@ bool textRedo(BufferView * bv)
void setUndo(BufferView * bv, Undo::undo_kind kind,
Paragraph const * first, Paragraph const * behind)
ParagraphList::iterator first, ParagraphList::iterator behind)
{
if (!undo_frozen) {
shared_ptr<Undo> u;
if (createUndo(bv, kind, first, behind, u))
if (createUndo(bv, kind, &*first, &*behind, u))
bv->buffer()->undostack.push(u);
bv->buffer()->redostack.clear();
}
@ -488,10 +489,10 @@ void setUndo(BufferView * bv, Undo::undo_kind kind,
void setRedo(BufferView * bv, Undo::undo_kind kind,
Paragraph const * first, Paragraph const * behind)
ParagraphList::iterator first, ParagraphList::iterator behind)
{
shared_ptr<Undo> u;
if (createUndo(bv, kind, first, behind, u))
if (createUndo(bv, kind, &*first, &*behind, u))
bv->buffer()->redostack.push(u);
}

View File

@ -12,6 +12,7 @@
#define UNDO_FUNCS_H
#include "undo.h"
#include "ParagraphList.h"
class BufferView;
class Paragraph;
@ -29,10 +30,10 @@ extern void freezeUndo();
extern void unFreezeUndo();
/// FIXME
extern void setUndo(BufferView *, Undo::undo_kind kind,
Paragraph const * first, Paragraph const * behind);
ParagraphList::iterator first, ParagraphList::iterator behind);
/// FIXME
extern void setRedo(BufferView *, Undo::undo_kind kind,
Paragraph const * first, Paragraph const * behind);
ParagraphList::iterator first, ParagraphList::iterator behind);
/// FIXME
extern void setCursorParUndo(BufferView *);