Paragraph * texrowpar = 0;
if (tmpid == -1) {
- texrowpar = text->firstParagraph();
+ texrowpar = text->ownerParagraph();
tmppos = 0;
} else {
texrowpar = buffer()->getParFromID(tmpid);
Paragraph * texrowpar;
if (tmpid == -1) {
- texrowpar = text->firstParagraph();
+ texrowpar = text->ownerParagraph();
tmppos = 0;
} else {
texrowpar = buffer()->getParFromID(tmpid);
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;
+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
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();
+ }
}
} 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
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);
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()
}
-// 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)
{
// check every paragraph
- Paragraph * par = firstParagraph();
+ Paragraph * par = ownerParagraph();
do {
pos = par->getPositionOfInset(inset);
if (pos != -1) {
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);
}
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);