small stupid stuff

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3348 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2002-01-13 00:33:21 +00:00
parent 17e8d4dfd8
commit 33c5d408fa
7 changed files with 40 additions and 28 deletions

View File

@ -235,7 +235,7 @@ void BufferView::insertErrors(TeXErrors & terr)
Paragraph * texrowpar = 0;
if (tmpid == -1) {
texrowpar = text->firstParagraph();
texrowpar = text->ownerParagraph();
tmppos = 0;
} else {
texrowpar = buffer()->getParFromID(tmpid);
@ -264,7 +264,7 @@ void BufferView::setCursorFromRow(int row)
Paragraph * texrowpar;
if (tmpid == -1) {
texrowpar = text->firstParagraph();
texrowpar = text->ownerParagraph();
tmppos = 0;
} else {
texrowpar = buffer()->getParFromID(tmpid);

View File

@ -3465,9 +3465,9 @@ void BufferView::Pimpl::gotoInset(vector<Inset::Code> const & codes,
if (!bv_->text->gotoNextInset(bv_, codes, contents)) {
if (bv_->text->cursor.pos()
|| bv_->text->cursor.par() != bv_->text->firstParagraph()) {
|| bv_->text->cursor.par() != bv_->text->ownerParagraph()) {
LyXCursor tmp = bv_->text->cursor;
bv_->text->cursor.par(bv_->text->firstParagraph());
bv_->text->cursor.par(bv_->text->ownerParagraph());
bv_->text->cursor.pos(0);
if (!bv_->text->gotoNextInset(bv_, codes, contents)) {
bv_->text->cursor = tmp;

View File

@ -1,3 +1,13 @@
2002-01-13 Lars Gullik Bjønnes <larsbj@birdstep.com>
* text2.C (firstParagraph): removed member function, all uses
replaces with ownerParagraph
(redoParagraphs): here
(updateInset): here
(toggleAppendix): here
* BufferView2.C (insertErrors): here
(setCursorFromRow): here
2002-01-13 Allan Rae <rae@lyx.org>
* BufferView2.C (removeAutoInsets): ensure we have a valid cursor if

View File

@ -148,21 +148,26 @@ extern int tex_code_break_column;
Buffer::Buffer(string const & file, bool ronly)
: paragraph(0), lyx_clean(true), bak_clean(true),
unnamed(false), dep_clean(0), read_only(ronly),
filename(file), users(0)
{
lyxerr[Debug::INFO] << "Buffer::Buffer()" << endl;
filename = file;
// filename = file;
filepath = OnlyPath(file);
paragraph = 0;
lyx_clean = true;
bak_clean = true;
dep_clean = 0;
read_only = ronly;
unnamed = false;
users = 0;
// paragraph = 0;
// lyx_clean = true;
// bak_clean = true;
// dep_clean = 0;
// read_only = ronly;
// unnamed = false;
// users = 0;
lyxvc.buffer(this);
if (read_only || (lyxrc.use_tempdir)) {
if (read_only || lyxrc.use_tempdir) {
tmppath = CreateBufferTmpDir();
} else tmppath.erase();
} else {
tmppath.erase();
}
}
@ -332,7 +337,7 @@ bool Buffer::readLyXformat2(LyXLex & lex, Paragraph * par)
} else {
// We are inserting into an existing document
users->text->breakParagraph(users);
first_par = users->text->firstParagraph();
first_par = users->text->ownerParagraph();
pos = 0;
markDirty();
// We don't want to adopt the parameters from the

View File

@ -107,8 +107,6 @@ public:
lyx::pos_type pos, LyXFont const & font);
void setCharFont(BufferView *, Paragraph * par,
lyx::pos_type pos, LyXFont const & font, bool toggleall);
/// returns a pointer to the very first Paragraph
Paragraph * firstParagraph() const;
/// what you expect when pressing <enter> at cursor position
void breakParagraph(BufferView *, char keep_layout = 0);

View File

@ -863,9 +863,9 @@ void LyXText::redoParagraphs(BufferView * bview, LyXCursor const & cur,
if (!tmprow->previous()) {
// a trick/hack for UNDO
// This is needed because in an UNDO/REDO we could have changed
// the firstParagrah() so the paragraph inside the row is NOT
// the ownerParagrah() so the paragraph inside the row is NOT
// my really first par anymore. Got it Lars ;) (Jug 20011206)
first_phys_par = firstParagraph();
first_phys_par = ownerParagraph();
} else {
first_phys_par = tmprow->par();
while (tmprow->previous()
@ -1852,13 +1852,6 @@ void LyXText::pasteSelection(BufferView * bview)
}
// returns a pointer to the very first Paragraph
Paragraph * LyXText::firstParagraph() const
{
return ownerParagraph();
}
// sets the selection over the number of characters of string, no check!!
void LyXText::setSelectionOverString(BufferView * bview, string const & str)
{
@ -2076,7 +2069,7 @@ bool LyXText::updateInset(BufferView * bview, Inset * inset)
// check every paragraph
Paragraph * par = firstParagraph();
Paragraph * par = ownerParagraph();
do {
pos = par->getPositionOfInset(inset);
if (pos != -1) {
@ -2564,7 +2557,7 @@ void LyXText::toggleAppendix(BufferView * bview)
bool start = !par->params().startOfAppendix();
// ensure that we have only one start_of_appendix in this document
Paragraph * tmp = firstParagraph();
Paragraph * tmp = ownerParagraph();
for (; tmp; tmp = tmp->next()) {
tmp->params().startOfAppendix(false);
}

View File

@ -388,13 +388,19 @@ Undo * createUndo(BufferView * bv, Undo::undo_kind kind,
while (tmppar != end && tmppar->next()) {
tmppar = tmppar->next();
#if 0
tmppar2->next(new Paragraph(*tmppar, true));
#else
Paragraph * ptmp = new Paragraph(*tmppar, true);
tmppar2->next(ptmp);
#endif
// a memory optimization: Just store the layout
// information when only edit
if (kind == Undo::EDIT) {
tmppar2->clearContents();
}
tmppar2->next()->previous(tmppar2);
tmppar2 = tmppar2->next();
}
tmppar2->next(0);