src/frontends/qt2/tabularcreatedlgimpl.C
src/frontends/xforms/FileDialog.C
src/frontends/xforms/FormBase.h
-src/frontends/xforms/FormBibitem.C
src/frontends/xforms/form_bibitem.C
-src/frontends/xforms/FormBibtex.C
+src/frontends/xforms/FormBibitem.C
src/frontends/xforms/form_bibtex.C
+src/frontends/xforms/FormBibtex.C
src/frontends/xforms/form_browser.C
-src/frontends/xforms/FormCharacter.C
src/frontends/xforms/form_character.C
-src/frontends/xforms/FormCitation.C
+src/frontends/xforms/FormCharacter.C
src/frontends/xforms/form_citation.C
-src/frontends/xforms/FormCopyright.C
+src/frontends/xforms/FormCitation.C
src/frontends/xforms/form_copyright.C
-src/frontends/xforms/FormCredits.C
+src/frontends/xforms/FormCopyright.C
src/frontends/xforms/form_credits.C
-src/frontends/xforms/FormDocument.C
+src/frontends/xforms/FormCredits.C
src/frontends/xforms/form_document.C
-src/frontends/xforms/FormError.C
+src/frontends/xforms/FormDocument.C
src/frontends/xforms/form_error.C
-src/frontends/xforms/FormFiledialog.C
+src/frontends/xforms/FormError.C
src/frontends/xforms/form_filedialog.C
-src/frontends/xforms/FormGraphics.C
+src/frontends/xforms/FormFiledialog.C
src/frontends/xforms/form_graphics.C
-src/frontends/xforms/FormInclude.C
+src/frontends/xforms/FormGraphics.C
src/frontends/xforms/form_include.C
-src/frontends/xforms/FormIndex.C
+src/frontends/xforms/FormInclude.C
src/frontends/xforms/form_index.C
+src/frontends/xforms/FormIndex.C
src/frontends/xforms/FormInset.h
src/frontends/xforms/FormLog.C
-src/frontends/xforms/FormParagraph.C
src/frontends/xforms/form_paragraph.C
-src/frontends/xforms/FormPreamble.C
+src/frontends/xforms/FormParagraph.C
src/frontends/xforms/form_preamble.C
-src/frontends/xforms/FormPreferences.C
+src/frontends/xforms/FormPreamble.C
src/frontends/xforms/form_preferences.C
-src/frontends/xforms/FormPrint.C
+src/frontends/xforms/FormPreferences.C
src/frontends/xforms/form_print.C
-src/frontends/xforms/FormRef.C
+src/frontends/xforms/FormPrint.C
src/frontends/xforms/form_ref.C
-src/frontends/xforms/FormSearch.C
+src/frontends/xforms/FormRef.C
src/frontends/xforms/form_search.C
+src/frontends/xforms/FormSearch.C
src/frontends/xforms/FormSplash.C
-src/frontends/xforms/FormTabular.C
src/frontends/xforms/form_tabular.C
-src/frontends/xforms/FormTabularCreate.C
+src/frontends/xforms/FormTabular.C
src/frontends/xforms/form_tabular_create.C
-src/frontends/xforms/FormToc.C
+src/frontends/xforms/FormTabularCreate.C
src/frontends/xforms/form_toc.C
-src/frontends/xforms/FormUrl.C
+src/frontends/xforms/FormToc.C
src/frontends/xforms/form_url.C
+src/frontends/xforms/FormUrl.C
src/frontends/xforms/FormVCLog.C
src/frontends/xforms/input_validators.C
src/frontends/xforms/Menubar_pimpl.C
LyXCursor cursor;
bool a = false;
+#ifndef NEW_INSETS
while (par) {
// this has to be done before the delete
-#ifndef NEW_INSETS
if (par->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE)
-#endif
text->SetCursor(this, cursor, par, 0);
if (par->AutoDeleteInsets()){
a = true;
-#ifndef NEW_INSETS
if (par->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE){
-#endif
text->RedoParagraphs(this, cursor,
- cursor.par()->Next());
+ cursor.par()->next());
text->FullRebreak(this);
-#ifndef NEW_INSETS
}
-#endif
}
- par = par->next;
+ par = par->next_;
}
+#else
+ while (par) {
+ // this has to be done before the delete
+ text->SetCursor(this, cursor, par, 0);
+ if (par->AutoDeleteInsets()){
+ a = true;
+ text->RedoParagraphs(this, cursor,
+ cursor.par()->next());
+ text->FullRebreak(this);
+ }
+ par = par->next();
+ }
+#endif
+
// avoid forbidden cursor positions caused by error removing
if (tmpcursor.pos() > tmpcursor.par()->Last())
tmpcursor.pos(tmpcursor.par()->Last());
)
)
) {
- if (par->previous
- && par->previous->footnoteflag !=
+ if (par->previous_
+ && par->previous_->footnoteflag !=
LyXParagraph::CLOSED_FOOTNOTE){ /* should be */
text->SetCursorIntern(this,
- par->previous,
+ par->previous_,
0);
text->OpenFootnote(this);
}
text->CloseFootnote(this);
}
}
- par = par->next;
+ par = par->next_;
}
text->SetCursorIntern(this, cursor.par(), cursor.pos());
return; // shouldn't happen
if (kind == Undo::EDIT) // in this case insets would not be stored!
kind = Undo::FINISH;
- text->SetUndo(buffer(), kind,
#ifndef NEW_INSETS
+ text->SetUndo(buffer(), kind,
text->cursor.par()->
- ParFromPos(text->cursor.pos())->previous,
+ ParFromPos(text->cursor.pos())->previous_,
text->cursor.par()->
- ParFromPos(text->cursor.pos())->next
+ ParFromPos(text->cursor.pos())->next_);
#else
- text->cursor.par()->previous,
- text->cursor.par()->next
+ text->SetUndo(buffer(), kind,
+ text->cursor.par()->previous(),
+ text->cursor.par()->next());
#endif
- );
}
}
}
}
+#ifndef NEW_INSETS
if (flag2) {
flag = true;
-#ifndef NEW_INSETS
if (par->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE){
-#endif
// this is possible now, since SetCursor takes
// care about footnotes
text->SetCursorIntern(this, par, 0);
text->RedoParagraphs(this, text->cursor,
- text->cursor.par()->Next());
+ text->cursor.par()->next());
text->FullRebreak(this);
-#ifndef NEW_INSETS
}
-#endif
}
- par = par->next;
+ par = par->next_;
+#else
+ if (flag2) {
+ flag = true;
+ // this is possible now, since SetCursor takes
+ // care about footnotes
+ text->SetCursorIntern(this, par, 0);
+ text->RedoParagraphs(this, text->cursor,
+ text->cursor.par()->next());
+ text->FullRebreak(this);
+ }
+ par = par->next();
+#endif
}
text->SetCursorIntern(this, cursor.par(), cursor.pos());
return flag;
+2001-03-09 Lars Gullik Bjønnes <larsbj@trylle.birdstep.com>
+
+ * lyxparagraph.h: rename next to next_, previous to previous_,
+ make them private for NEW_INSETS. Rename Next() to next(),
+ Previous() to previous().
+
+ * other files: changes because of the above.
+
2001-03-08 Dekel Tsur <dekelts@tau.ac.il>
* BufferView.h:
while (buf) {
tmppar = buf;
- buf = buf->next;
+#ifndef NEW_INSETS
+ buf = buf->next_;
+#else
+ buf = buf->next();
+#endif
delete tmppar;
}
buf = 0;
// more than one paragraph
(*endpar)->BreakParagraphConservative(current_view->buffer()->params,
end);
- *endpar = (*endpar)->Next();
+ *endpar = (*endpar)->next();
end = 0;
startpar->BreakParagraphConservative(current_view->buffer()->params,
// store the selection
#ifndef NEW_INSETS
- buf = startpar->ParFromPos(start)->next;
+ buf = startpar->ParFromPos(start)->next_;
#else
- buf = startpar->next;
+ buf = startpar->next();
#endif
- buf->previous = 0;
- (*endpar)->previous->next = 0;
+ buf->previous(0);
+ (*endpar)->previous()->next(0);
// cut the selection
#ifndef NEW_INSETS
- startpar->ParFromPos(start)->next = (*endpar);
+ startpar->ParFromPos(start)->next(*endpar);
- (*endpar)->previous = startpar->ParFromPos(start);
+ (*endpar)->previous(startpar->ParFromPos(start));
#else
- startpar->next = (*endpar);
+ startpar->next(*endpar);
- (*endpar)->previous = startpar;
+ (*endpar)->previous(startpar);
#endif
#ifndef NEW_INSETS
LyXParagraph * tmppar = buf;
while (tmppar){
tmppar->footnoteflag = LyXParagraph::NO_FOOTNOTE;
- tmppar = tmppar->next;
+ tmppar = tmppar->next_;
}
}
#endif
// paste the paragraphs again, if possible
if (doclear)
- startpar->Next()->StripLeadingSpaces(textclass);
+ startpar->next()->StripLeadingSpaces(textclass);
#ifndef NEW_INSETS
- if (startpar->FirstPhysicalPar()->HasSameLayout(startpar->Next()) ||
+ if (startpar->FirstPhysicalPar()->HasSameLayout(startpar->next()) ||
#else
- if (startpar->HasSameLayout(startpar->Next()) ||
+ if (startpar->HasSameLayout(startpar->next()) ||
#endif
- !startpar->Next()->Last()) {
+ !startpar->next()->Last()) {
#ifndef NEW_INSETS
startpar->ParFromPos(start)->PasteParagraph(current_view->buffer()->params);
#else
buf = tmppar->Clone();
LyXParagraph * tmppar2 = buf;
- while (
#ifndef NEW_INSETS
- tmppar != endpar->ParFromPos(end)
+ while (tmppar != endpar->ParFromPos(end)
+ && tmppar->next_) {
+ tmppar = tmppar->next_;
+ tmppar2->next(tmppar->Clone());
+ tmppar2->next_->previous(tmppar2);
+ tmppar2 = tmppar2->next_;
+ }
+ tmppar2->next(0);
#else
- tmppar != endpar
-#endif
- && tmppar->next) {
- tmppar = tmppar->next;
- tmppar2->next = tmppar->Clone();
- tmppar2->next->previous = tmppar2;
- tmppar2 = tmppar2->next;
+ while (tmppar != endpar
+ && tmppar->next()) {
+ tmppar = tmppar->next();
+ tmppar2->next(tmppar->Clone());
+ tmppar2->next()->previous(tmppar2);
+ tmppar2 = tmppar2->next();
}
- tmppar2->next = 0;
+ tmppar2->next(0);
+#endif
#ifndef NEW_INSETS
// care about footnotes
tmppar = buf;
while (tmppar) {
tmppar->footnoteflag = LyXParagraph::NO_FOOTNOTE;
- tmppar = tmppar->next;
+ tmppar = tmppar->next_;
}
}
#endif
int tmppos = pos;
// There are two cases: cutbuffer only one paragraph or many
- if (!buf->next) {
+#ifndef NEW_INSETS
+ if (!buf->next_) {
+#else
+ if (!buf->next()) {
+#endif
// only within a paragraph
tmpbuf = buf->Clone();
// Some provisions should be done here for checking
}
delete buf;
buf = tmpbuf;
- *endpar = tmppar->Next();
+ *endpar = tmppar->next();
pos = tmppos;
} else {
// many paragraphs
LyXParagraph * simple_cut_clone = tmpbuf->Clone();
LyXParagraph * tmpbuf2 = simple_cut_clone;
#ifndef NEW_INSETS
- if ((*par)->footnoteflag){
- tmpbuf->footnoteflag = (*par)->footnoteflag;
- tmpbuf->footnotekind = (*par)->footnotekind;
- }
-#endif
- while (tmpbuf->next) {
- tmpbuf = tmpbuf->next;
- tmpbuf2->next = tmpbuf->Clone();
- tmpbuf2->next->previous = tmpbuf2;
- tmpbuf2 = tmpbuf2->next;
-#ifndef NEW_INSETS
- if ((*par)->footnoteflag){
+ if ((*par)->footnoteflag) {
tmpbuf->footnoteflag = (*par)->footnoteflag;
tmpbuf->footnotekind = (*par)->footnotekind;
- }
-#endif
}
+ while (tmpbuf->next_) {
+ tmpbuf = tmpbuf->next_;
+ tmpbuf2->next(tmpbuf->Clone());
+ tmpbuf2->next_->previous(tmpbuf2);
+ tmpbuf2 = tmpbuf2->next_;
+ if ((*par)->footnoteflag){
+ tmpbuf->footnoteflag = (*par)->footnoteflag;
+ tmpbuf->footnotekind = (*par)->footnotekind;
+ }
+ }
+#else
+ while (tmpbuf->next()) {
+ tmpbuf = tmpbuf->next();
+ tmpbuf2->next(tmpbuf->Clone());
+ tmpbuf2->next()->previous(tmpbuf2);
+ tmpbuf2 = tmpbuf2->next();
+ }
+#endif
// make sure there is no class difference
SwitchLayoutsBetweenClasses(textclass, tc, buf);
// find the end of the buffer
LyXParagraph * lastbuffer = buf;
- while (lastbuffer->Next())
- lastbuffer = lastbuffer->Next();
+ while (lastbuffer->next())
+ lastbuffer = lastbuffer->next();
bool paste_the_end = false;
// open the paragraph for inserting the buf
// if necessary
- if (((*par)->Last() > pos) || !(*par)->Next()) {
+ if (((*par)->Last() > pos) || !(*par)->next()) {
(*par)->BreakParagraphConservative(current_view->buffer()->params,
pos);
paste_the_end = true;
// set the end for redoing later
#ifndef NEW_INSETS
- *endpar = (*par)->ParFromPos(pos)->next->Next();
+ *endpar = (*par)->ParFromPos(pos)->next_->next();
// paste it!
- lastbuffer->ParFromPos(lastbuffer->Last())->next =
- (*par)->ParFromPos(pos)->next;
- (*par)->ParFromPos(pos)->next->previous =
- lastbuffer->ParFromPos(lastbuffer->Last());
+ lastbuffer->ParFromPos(lastbuffer->Last())->next(
+ (*par)->ParFromPos(pos)->next_);
+ (*par)->ParFromPos(pos)->next()->previous(
+ lastbuffer->ParFromPos(lastbuffer->Last()));
- (*par)->ParFromPos(pos)->next = buf;
- buf->previous = (*par)->ParFromPos(pos);
+ (*par)->ParFromPos(pos)->next(buf);
+ buf->previous((*par)->ParFromPos(pos));
- if ((*par)->ParFromPos(pos)->Next() == lastbuffer)
+ if ((*par)->ParFromPos(pos)->next() == lastbuffer)
lastbuffer = *par;
(*par)->ParFromPos(pos)->PasteParagraph(current_view->buffer()->params);
#else
- *endpar = (*par)->next->Next();
+ *endpar = (*par)->next()->next();
// paste it!
- lastbuffer->next = (*par)->next;
- (*par)->next->previous = lastbuffer;
+ lastbuffer->next((*par)->next());
+ (*par)->next()->previous(lastbuffer);
- (*par)->next = buf;
- buf->previous = (*par);
+ (*par)->next(buf);
+ buf->previous(*par);
- if ((*par)->Next() == lastbuffer)
+ if ((*par)->next() == lastbuffer)
lastbuffer = *par;
(*par)->PasteParagraph(current_view->buffer()->params);
pos = lastbuffer->Last();
// maybe some pasting
- if (lastbuffer->Next() && paste_the_end) {
+ if (lastbuffer->next() && paste_the_end) {
#ifndef NEW_INSETS
- if (lastbuffer->Next()->HasSameLayout(lastbuffer)) {
+ if (lastbuffer->next()->HasSameLayout(lastbuffer)) {
lastbuffer->ParFromPos(lastbuffer->Last())->PasteParagraph(current_view->buffer()->params);
- } else if (!lastbuffer->Next()->Last()) {
- lastbuffer->Next()->MakeSameLayout(lastbuffer);
+ } else if (!lastbuffer->next()->Last()) {
+ lastbuffer->next()->MakeSameLayout(lastbuffer);
lastbuffer->ParFromPos(lastbuffer->Last())->PasteParagraph(current_view->buffer()->params);
} else if (!lastbuffer->Last()) {
- lastbuffer->MakeSameLayout(lastbuffer->next);
+ lastbuffer->MakeSameLayout(lastbuffer->next_);
lastbuffer->ParFromPos(lastbuffer->Last())->PasteParagraph(current_view->buffer()->params);
#else
- if (lastbuffer->Next()->HasSameLayout(lastbuffer)) {
+ if (lastbuffer->next()->HasSameLayout(lastbuffer)) {
lastbuffer->PasteParagraph(current_view->buffer()->params);
- } else if (!lastbuffer->Next()->Last()) {
- lastbuffer->Next()->MakeSameLayout(lastbuffer);
+ } else if (!lastbuffer->next()->Last()) {
+ lastbuffer->next()->MakeSameLayout(lastbuffer);
lastbuffer->PasteParagraph(current_view->buffer()->params);
} else if (!lastbuffer->Last()) {
- lastbuffer->MakeSameLayout(lastbuffer->next);
+ lastbuffer->MakeSameLayout(lastbuffer->next());
lastbuffer->PasteParagraph(current_view->buffer()->params);
#endif
} else
- lastbuffer->Next()->StripLeadingSpaces(tc);
+ lastbuffer->next()->StripLeadingSpaces(tc);
}
// restore the simple cut buffer
buf = simple_cut_clone;
int n = 1;
LyXParagraph * tmppar = buf;
- while(tmppar->next) {
+#ifndef NEW_INSETS
+ while(tmppar->next_) {
+ ++n;
+ tmppar = tmppar->next_;
+ }
+#else
+ while(tmppar->next()) {
++n;
- tmppar = tmppar->next;
+ tmppar = tmppar->next();
}
+#endif
return n;
}
InsetError * new_inset = new InsetError(s);
par->InsertInset(0, new_inset);
}
-
- par = par->next;
+#ifndef NEW_INSETS
+ par = par->next_;
+#else
+ par = par->next();
+#endif
}
return ret;
}
// check whether the cut_buffer includes a footnote
LyXParagraph * tmppar = buf;
while (tmppar && tmppar->footnoteflag == LyXParagraph::NO_FOOTNOTE)
- tmppar = tmppar->next;
+ tmppar = tmppar->next_;
if (tmppar) {
WriteAlert(_("Impossible operation"),
LyXParagraph * par = paragraph;
LyXParagraph * tmppar;
+#ifndef NEW_INSETS
+ while (par) {
+ tmppar = par->next_;
+ delete par;
+ par = tmppar;
+ }
+#else
while (par) {
- tmppar = par->next;
+ tmppar = par->next();
delete par;
par = tmppar;
}
+#endif
paragraph = 0;
}
int noparbreak = 0;
int islatex = 0;
- if (
-#ifndef NEW_INSETS
- par->footnoteflag != LyXParagraph::NO_FOOTNOTE ||
-#endif
- !par->previous
-#ifndef NEW_INSETS
- || par->previous->footnoteflag == LyXParagraph::NO_FOOTNOTE
-#endif
- ){
#ifndef NEW_INSETS
+ if (par->footnoteflag != LyXParagraph::NO_FOOTNOTE ||
+ !par->previous_
+ || par->previous()->footnoteflag == LyXParagraph::NO_FOOTNOTE) {
/* begins a footnote environment ? */
if (footnoteflag != par->footnoteflag) {
footnoteflag = par->footnoteflag;
currlinelen += j;
}
}
+#else
+ if (!par->previous()) {
#endif
/* begins or ends a deeper area ?*/
if (depth != par->params.depth()) {
string const tmp = textclasslist.NameOfLayout(params.textclass, par->layout);
if (tmp == "Itemize") {
ltype = 1;
- ltype_depth = depth+1;
+ ltype_depth = depth + 1;
} else if (tmp == "Enumerate") {
ltype = 2;
- ltype_depth = depth+1;
+ ltype_depth = depth + 1;
} else if (strstr(tmp.c_str(), "ection")) {
ltype = 3;
- ltype_depth = depth+1;
+ ltype_depth = depth + 1;
} else if (strstr(tmp.c_str(), "aragraph")) {
ltype = 4;
- ltype_depth = depth+1;
+ ltype_depth = depth + 1;
} else if (tmp == "Description") {
ltype = 5;
- ltype_depth = depth+1;
+ ltype_depth = depth + 1;
} else if (tmp == "Abstract") {
ltype = 6;
ltype_depth = 0;
LyXParagraph * par = paragraph;
while (par) {
ofs << asciiParagraph(par, linelen);
- par = par->next;
+ par = par->next();
}
ofs << "\n";
}
string const temp = "toc";
sgmlOpenTag(ofs, depth, temp);
- par = par->next;
#ifndef NEW_INSETS
+ par = par->next_;
linuxDocHandleFootnote(ofs, par, depth);
+#else
+ par = par->next();
#endif
continue;
}
#ifndef NEW_INSETS
do {
-#endif
SimpleLinuxDocOnePar(ofs, par, desc_on, depth);
-
- par = par->next;
-#ifndef NEW_INSETS
+
+ par = par->next_;
linuxDocHandleFootnote(ofs, par, depth);
}
while(par && par->IsDummy());
+#else
+ SimpleLinuxDocOnePar(ofs, par, desc_on, depth);
+
+ par = par->next();
#endif
ofs << "\n";
sgmlOpenTag(os, depth + 1, tag);
SimpleLinuxDocOnePar(os, par, 0, depth + 1);
sgmlCloseTag(os, depth + 1, tag);
- par = par->next;
+ par = par->next_;
}
}
#endif
LyXParagraph * & par)
{
LyXParagraph * tpar = par;
- while (tpar
#ifndef NEW_INSETS
+ while (tpar
&& (tpar->footnoteflag != LyXParagraph::NO_FOOTNOTE)
-#endif
&& (tpar->layout != textclasslist.NumberOfLayout(params.textclass,
"Caption").second))
- tpar = tpar->next;
+ tpar = tpar->next_;
+#else
+ while (tpar
+ && (tpar->layout != textclasslist.NumberOfLayout(params.textclass,
+ "Caption").second))
+ tpar = tpar->next();
+#endif
if (tpar &&
tpar->layout == textclasslist.NumberOfLayout(params.textclass,
"Caption").second) {
tmp_par = frontStrip(strip(tmp_par));
last = present;
- par = par->next;
+ par = par->next_;
}
os << tmp_par;
if (!inner_tag.empty()) sgmlCloseTag(os, depth + 1, inner_tag);
#ifndef NEW_INSETS
do {
-#endif
string extra_par;
SimpleDocBookOnePar(ofs, extra_par, par, desc_on,
depth + 1 + command_depth);
- par = par->next;
-#ifndef NEW_INSETS
+ par = par->next_;
DocBookHandleFootnote(ofs, par,
depth + 1 + command_depth);
- }
- while(par && par->IsDummy());
+ } while(par && par->IsDummy());
+#else
+ string extra_par;
+ SimpleDocBookOnePar(ofs, extra_par, par, desc_on,
+ depth + 1 + command_depth);
+ par = par->next();
#endif
string end_tag;
// write closing SGML tags
par->validate(features);
// and then the next paragraph
- par = par->next;
+#ifndef NEW_INSETS
+ par = par->next_;
+#else
+ par = par->next();
+#endif
}
// the bullet shapes are buffer level not paragraph level
}
#ifndef NEW_INSETS
}
+ par = par->next_;
+#else
+ par = par->next();
#endif
- par = par->next;
}
return l;
}
if (par->bibkey)
keys.push_back(pair<string, string>(par->bibkey->getContents(),
par->String(this, false)));
- par = par->next;
+#ifndef NEW_INSETS
+ par = par->next_;
+#else
+ par = par->next();
+#endif
}
// Might be either using bibtex or a child has bibliography
{
/// then remove all LyXText in text-insets
LyXParagraph * par = paragraph;
- for (; par; par = par->next) {
+#ifndef NEW_INSETS
+ for (; par; par = par->next_) {
+ par->resizeInsetsLyXText(bv);
+ }
+#else
+ for (; par; par = par->next()) {
par->resizeInsetsLyXText(bv);
}
+#endif
}
+
void Buffer::ChangeLanguage(Language const * from, Language const * to)
{
LyXParagraph * par = paragraph;
while (par) {
par->ChangeLanguage(params, from, to);
- par = par->next;
+#ifndef NEW_INSETS
+ par = par->next_;
+#else
+ par = par->next();
+#endif
}
}
while (par) {
if (par->isMultiLingual(params))
return true;
- par = par->next;
+#ifndef NEW_INSETS
+ par = par->next_;
+#else
+ par = par->next();
+#endif
}
return false;
}
{
it = par->InsetIterator(pos);
if (it == par->inset_iterator_end()) {
- par = par->next;
+#ifndef NEW_INSETS
+ par = par->next_;
+#else
+ par = par->next();
+#endif
SetParagraph();
}
}
it = par->inset_iterator_begin();
if (it != par->inset_iterator_end())
return;
- par = par->next;
+#ifndef NEW_INSETS
+ par = par->next_;
+#else
+ par = par->next();
+#endif
}
//it = 0;
// We maintain an invariant that whenever par = 0 then it = 0
if (par) {
++it;
if (it == par->inset_iterator_end()) {
- par = par->next;
+#ifndef NEW_INSETS
+ par = par->next_;
+#else
+ par = par->next();
+#endif
SetParagraph();
}
}
if (par) {
++it;
if (it == par->inset_iterator_end()) {
- par = par->next;
+#ifndef NEW_INSETS
+ par = par->next_;
+#else
+ par = par->next();
+#endif
SetParagraph();
}
}
int const wx = par->bibkey->width(bv, font);
if (wx > w) w = wx;
}
- par = par->next;
+#ifndef NEW_INSETS
+ par = par->next_;
+#else
+ par = par->next();
+#endif
}
return w;
}
bkey = par->bibkey;
}
}
- par = par->next;
+#ifndef NEW_INSETS#
+ par = par->next_;
+#else
+ par = par->next();
+#endif
}
if (bkey && !bkey->getBibLabel().empty())
break;
bv->text->SetUndo(bv->buffer(), Undo::DELETE,
#ifndef NEW_INSETS
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_,
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_
#else
- bv->text->cursor.par()->previous,
- bv->text->cursor.par()->next
+ bv->text->cursor.par()->previous(),
+ bv->text->cursor.par()->next()
#endif
);
cutSelection();
if (hasPasteBuffer()) {
bv->text->SetUndo(bv->buffer(), Undo::INSERT,
#ifndef NEW_INSETS
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_,
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_
#else
- bv->text->cursor.par()->previous,
- bv->text->cursor.par()->next
+ bv->text->cursor.par()->previous(),
+ bv->text->cursor.par()->next()
#endif
);
pasteSelection(bv);
}
bv->text->SetUndo(bv->buffer(), Undo::FINISH,
#ifndef NEW_INSETS
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_,
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_
#else
- bv->text->cursor.par()->previous,
- bv->text->cursor.par()->next
+ bv->text->cursor.par()->previous(),
+ bv->text->cursor.par()->next()
#endif
);
delete (*cit).second;
(*cit).second = 0;
}
- LyXParagraph * p = par->next;
+#ifndef NEW_INSETS
+ LyXParagraph * p = par->next_;
+ delete par;
+ while(p) {
+ par = p;
+ p = p->next_;
+ delete par;
+ }
+#else
+ LyXParagraph * p = par->next();
delete par;
while(p) {
par = p;
- p = p->next;
+ p = p->next();
delete par;
}
+#endif
}
delete (*cit).second;
(*cit).second = 0;
}
- LyXParagraph * p = par->next;
+#ifndef NEW_INSETS
+ LyXParagraph * p = par->next_;
+ delete par;
+ while(p) {
+ par = p;
+ p = p->next_;
+ delete par;
+ }
+#else
+ LyXParagraph * p = par->next();
delete par;
while(p) {
par = p;
- p = p->next;
+ p = p->next();
delete par;
}
+#endif
par = new LyXParagraph();
}
(*cit).second = 0;
}
- LyXParagraph * p = par->next;
+#ifndef NEW_INSETS
+ LyXParagraph * p = par->next_;
delete par;
while(p) {
par = p;
- p = p->next;
+ p = p->next_;
delete par;
}
+#else
+ LyXParagraph * p = par->next();
+ delete par;
+ while(p) {
+ par = p;
+ p = p->next();
+ delete par;
+ }
+#endif
par = new LyXParagraph;
while (lex.IsOK()) {
lex.nextToken();
par = return_par;
while(return_par) {
return_par->SetInsetOwner(this);
- return_par = return_par->next;
+#ifndef NEW_INSETS
+ return_par = return_par->next_;
+#else
+ return_par = return_par->next();
+#endif
}
if (token != "\\end_inset") {
// If the inset is empty set the language of the current font to the
// language to the surronding text.
- if (par->Last() == 0 && !par->next) {
+#ifndef NEW_INSETS
+ if (par->Last() == 0 && !par->next_) {
+#else#
+ if (par->Last() == 0 && !par->next()) {
+#endif
LyXFont font(LyXFont::ALL_IGNORE);
font.setLanguage(bv->getParentLanguage(this));
SetFont(bv, font, false);
bv->text->SetUndo(bv->buffer(), Undo::INSERT,
#ifndef NEW_INSETS
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_,
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_
#else
- bv->text->cursor.par()->previous,
- bv->text->cursor.par()->next
+ bv->text->cursor.par()->previous(),
+ bv->text->cursor.par()->next()
#endif
);
bv->setState();
case LFUN_BACKSPACE:
bv->text->SetUndo(bv->buffer(), Undo::DELETE,
#ifndef NEW_INSETS
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_,
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_
#else
- bv->text->cursor.par()->previous,
- bv->text->cursor.par()->next
+ bv->text->cursor.par()->previous(),
+ bv->text->cursor.par()->next()
#endif
);
if (TEXT(bv)->selection)
case LFUN_DELETE:
bv->text->SetUndo(bv->buffer(), Undo::DELETE,
#ifndef NEW_INSETS
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_,
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_
#else
- bv->text->cursor.par()->previous,
- bv->text->cursor.par()->next
+ bv->text->cursor.par()->previous(),
+ bv->text->cursor.par()->next()
#endif
);
if (TEXT(bv)->selection)
case LFUN_CUT:
bv->text->SetUndo(bv->buffer(), Undo::DELETE,
#ifndef NEW_INSETS
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_,
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_
#else
- bv->text->cursor.par()->previous,
- bv->text->cursor.par()->next
+ bv->text->cursor.par()->previous(),
+ bv->text->cursor.par()->next()
#endif
);
TEXT(bv)->CutSelection(bv);
}
bv->text->SetUndo(bv->buffer(), Undo::INSERT,
#ifndef NEW_INSETS
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_,
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_
#else
- bv->text->cursor.par()->previous,
- bv->text->cursor.par()->next
+ bv->text->cursor.par()->previous(),
+ bv->text->cursor.par()->next()
#endif
);
TEXT(bv)->PasteSelection(bv);
return DISPATCHED;
bv->text->SetUndo(bv->buffer(), Undo::INSERT,
#ifndef NEW_INSETS
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_,
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_
#else
- bv->text->cursor.par()->previous,
- bv->text->cursor.par()->next
+ bv->text->cursor.par()->previous(),
+ bv->text->cursor.par()->next()
#endif
);
TEXT(bv)->InsertChar(bv, LyXParagraph::META_NEWLINE);
/// If the action has deleted all text in the inset, we need to change the
// language to the language to the surronding text.
- if (par->Last() == 0 && !par->next) {
+#ifndef NEW_INSETS
+ if (par->Last() == 0 && !par->next_) {
+#else
+ if (par->Last() == 0 && !par->next()) {
+#endif
LyXFont font(LyXFont::ALL_IGNORE);
font.setLanguage(bv->getParentLanguage(this));
SetFont(bv, font, false);
tmp = buf->asciiParagraph(p, linelen);
lines += countChar(tmp, '\n');
os << tmp;
- p = p->next;
+#ifndef NEW_INSETS
+ p = p->next();
+#else
+ p = p->next();
+#endif
}
return lines;
}
string tmp;
while (p) {
buf->SimpleDocBookOnePar(os,tmp,p,desc,0);
- p = p->next;
+#ifndef NEW_INSETS
+ p = p->next_;
+#else
+ p = p->next();
+#endif
}
return lines;
LyXParagraph * p = par;
while(p) {
p->validate(features);
- p = p->next;
+#ifndef NEW_INSETS
+ p = p->next_;
+#else
+ p = p->next();
+#endif
}
}
InsetText::moveRightIntern(BufferView * bv, bool behind,
bool activate_inset, bool selecting)
{
- if (!cpar(bv)->next && (cpos(bv) >= cpar(bv)->Last()))
+#ifndef NEW_INSETS
+ if (!cpar(bv)->next_ && (cpos(bv) >= cpar(bv)->Last()))
+#else
+ if (!cpar(bv)->next() && (cpos(bv) >= cpar(bv)->Last()))
+#endif
return FINISHED;
if (activate_inset && checkAndActivateInset(bv, behind))
return DISPATCHED;
InsetText::moveLeftIntern(BufferView * bv, bool behind,
bool activate_inset, bool selecting)
{
- if (!cpar(bv)->previous && (cpos(bv) <= 0))
+#ifndef NEW_INSETS
+ if (!cpar(bv)->previous_ && (cpos(bv) <= 0))
+#else
+ if (!cpar(bv)->previous() && (cpos(bv) <= 0))
+#endif
return FINISHED;
TEXT(bv)->CursorLeft(bv);
if (!selecting)
}
bv->text->SetUndo(bv->buffer(), Undo::INSERT,
#ifndef NEW_INSETS
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_,
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_
#else
- bv->text->cursor.par()->previous,
- bv->text->cursor.par()->next
+ bv->text->cursor.par()->previous(),
+ bv->text->cursor.par()->next()
#endif
);
inset->setOwner(this);
if (TEXT(bv)->selection) {
bv->text->SetUndo(bv->buffer(), Undo::EDIT,
#ifndef NEW_INSETS
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
- bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous_,
+ bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next_
#else
- bv->text->cursor.par()->previous,
- bv->text->cursor.par()->next
+ bv->text->cursor.par()->previous(),
+ bv->text->cursor.par()->next()
#endif
);
}
}
-void InsetText::SetParagraphData(LyXParagraph *p)
+void InsetText::SetParagraphData(LyXParagraph * p)
{
// delete all instances of LyXText before deleting the paragraps used
// by it.
(*cit).second = 0;
}
+#ifndef NEW_INSETS
LyXParagraph * np;
if (par) {
- np = par->next;
+ np = par->next_;
+ delete par;
+ while (np) {
+ par = np;
+ np = np->next_;
+ delete par;
+ }
+ }
+ par = p->Clone();
+ par->SetInsetOwner(this);
+ np = par;
+ while (p->next_) {
+ p = p->next_;
+ np->next(p->Clone());
+ np->next_->previous(np);
+ np = np->next_;
+ np->SetInsetOwner(this);
+ }
+#else
+ LyXParagraph * np;
+ if (par) {
+ np = par->next();
delete par;
while(np) {
par = np;
- np = np->next;
+ np = np->next();
delete par;
}
}
par = p->Clone();
par->SetInsetOwner(this);
np = par;
- while(p->next) {
- p = p->next;
- np->next = p->Clone();
- np->next->previous = np;
- np = np->next;
+ while(p->next()) {
+ p = p->next();
+ np->next(p->Clone());
+ np->next()->previous(np);
+ np = np->next();
np->SetInsetOwner(this);
}
+#endif
need_update = INIT;
}
if (recursive) {
/// then remove all LyXText in text-insets
LyXParagraph * p = par;
- for (;p;p = p->next) {
+#ifndef NEW_INSETS
+ for (; p; p = p->next_) {
+ p->deleteInsetsLyXText(bv);
+ }
+#else
+ for (; p; p = p->next()) {
p->deleteInsetsLyXText(bv);
}
+#endif
}
}
void InsetText::resizeLyXText(BufferView * bv) const
{
- if (!par->next && !par->size()) // resize not neccessary!
+#ifndef NEW_INSETS
+ if (!par->next_ && !par->size()) // resize not neccessary!
+#else
+ if (!par->next() && !par->size()) // resize not neccessary!
+#endif
return;
if ((cache.find(bv) == cache.end()) || !cache[bv])
return;
/// then resize all LyXText in text-insets
inset_x = cx(bv) - top_x + drawTextXOffset;
inset_y = cy(bv) + drawTextYOffset;
- for (LyXParagraph * p = par; p; p = p->next) {
+#ifndef NEW_INSETS
+ for (LyXParagraph * p = par; p; p = p->next_) {
+ p->resizeInsetsLyXText(bv);
+ }
+#else
+ for (LyXParagraph * p = par; p; p = p->next()) {
p->resizeInsetsLyXText(bv);
}
+#endif
}
need_update = FULL;
}
void InsetText::removeNewlines()
{
- for (LyXParagraph * p = par; p; p = p->next) {
+#ifndef NEW_INSETS
+ for (LyXParagraph * p = par; p; p = p->next_) {
+#else
+ for (LyXParagraph * p = par; p; p = p->next()) {
+#endif
for (int i = 0; i < p->Last(); ++i) {
if (p->GetChar(i) == LyXParagraph::META_NEWLINE)
p->Erase(i);
&textclasslist.Style(bv->buffer()->params.textclass,
par->GetLayout());
- if (layout->latextype == LATEX_PARAGRAPH && par->previous) {
#ifndef NEW_INSETS
- LyXParagraph * par2 = par->previous->FirstPhysicalPar();
+ if (layout->latextype == LATEX_PARAGRAPH && par->previous_) {
+ LyXParagraph * par2 = par->previous_->FirstPhysicalPar();
#else
- LyXParagraph * par2 = par->previous;
+ if (layout->latextype == LATEX_PARAGRAPH && par->previous()) {
+ LyXParagraph * par2 = par->previous();
#endif
LyXLayout const * layout2 =
&textclasslist.Style(bv->buffer()->params.textclass,
++pos;
else {
pos = 0;
- par = par->Next();
+ par = par->next();
}
}
if (par) {
else {
// We skip empty paragraphs (Asger)
do {
- par = par->Previous();
+ par = par->previous();
if (par)
pos = par->Last() - 1;
} while (par && pos < 0);
///
char itemdepth;
-
+#ifdef NEW_INSETS
+private:
+#endif
///
- LyXParagraph * next;
+ LyXParagraph * next_;
///
- LyXParagraph * previous;
-
+ LyXParagraph * previous_;
+public:
///
InsetBibKey * bibkey; // ale970302
+ ///
+ void next(LyXParagraph *);
/** these function are able to hide closed footnotes
*/
- LyXParagraph * Next();
-
+ LyXParagraph * next();
+ ///
+ LyXParagraph const * next() const;
+
+ ///
+ void previous(LyXParagraph *);
///
- LyXParagraph * Previous();
+ LyXParagraph * previous();
///
- LyXParagraph const * Previous() const;
+ LyXParagraph const * previous() const;
#ifndef NEW_INSETS
/** these function are able to hide open and closed footnotes
for (int i = 0; i < 10; ++i) setCounter(i , 0);
enumdepth = 0;
itemdepth = 0;
- next = 0;
- previous = 0;
+ next_ = 0;
+ previous_ = 0;
#ifndef NEW_INSETS
footnoteflag = LyXParagraph::NO_FOOTNOTE;
footnotekind = LyXParagraph::FOOTNOTE; // should not be needed
enumdepth = 0;
itemdepth = 0;
// double linked list begin
- next = par->next;
- if (next)
- next->previous = this;
- previous = par;
- previous->next = this;
+ next_ = par->next_;
+ if (next_)
+ next_->previous_ = this;
+ previous_ = par;
+ previous_->next_ = this;
// end
#ifndef NEW_INSETS
footnoteflag = LyXParagraph::NO_FOOTNOTE;
#ifndef NEW_INSETS
if (
footnoteflag != LyXParagraph::NO_FOOTNOTE ||
- !previous
- || previous->footnoteflag == LyXParagraph::NO_FOOTNOTE
+ !previous_
+ || previous_->footnoteflag == LyXParagraph::NO_FOOTNOTE
) {
#endif
}
// now write the next paragraph
- if (next)
- next->writeFile(buf, os, bparams, footflag, dth);
+ if (next_)
+ next_->writeFile(buf, os, bparams, footflag, dth);
}
features.floatflt = true;
#ifndef NEW_INSETS
if (layout.needprotect
- && next && next->footnoteflag != LyXParagraph::NO_FOOTNOTE)
+ && next_ && next_->footnoteflag != LyXParagraph::NO_FOOTNOTE)
features.NeedLyXFootnoteCode = true;
#endif
if (bparams.paragraph_separation == BufferParams::PARSEP_INDENT
// the destructor removes the new paragraph from the list
LyXParagraph::~LyXParagraph()
{
- if (previous)
- previous->next = next;
- if (next)
- next->previous = previous;
+ if (previous_)
+ previous_->next_ = next_;
+ if (next_)
+ next_->previous_ = previous_;
for (InsetList::iterator it = insetlist.begin();
it != insetlist.end(); ++it) {
// > because last is the next unused position, and you can
// use it if you want
if (pos > size()) {
- if (next && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
+ if (next_ && next_->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
NextAfterFootnote()->Erase(pos - text.size() - 1);
else
lyxerr.debug() << "ERROR (LyXParagraph::Erase): "
// > because last is the next unused position, and you can
// use it if you want
if (pos > size()) {
- if (next
- && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
+ if (next_
+ && next_->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
NextAfterFootnote()->InsertChar(pos - text.size() - 1,
c);
else
// > because last is the next unused position, and you can
// use it if you want
if (pos > size()) {
- if (next
- && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
+ if (next_
+ && next_->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
NextAfterFootnote()
->InsertInset(pos - text.size() - 1,
inset, font);
{
#ifndef NEW_INSETS
if (pos >= size()) {
- if (next
- && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
+ if (next_
+ && next_->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
return NextAfterFootnote()
->GetInset(pos - text.size() - 1);
else
{
#ifndef NEW_INSETS
if (pos >= size()) {
- if (next
- && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
+ if (next_
+ && next_->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
return NextAfterFootnote()
->GetInset(pos - text.size() - 1);
else
// > because last is the next unused position, and you can
// use it if you want
else if (pos > size()) {
- if (next
- && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
+ if (next_
+ && next_->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
return NextAfterFootnote()
->GetFontSettings(bparams,
pos - text.size() - 1);
}
#ifndef NEW_INSETS
- else if (next && next->footnoteflag != LyXParagraph::NO_FOOTNOTE)
+ else if (next_ && next_->footnoteflag != LyXParagraph::NO_FOOTNOTE)
return NextAfterFootnote()->GetFirstFontSettings();
#endif
return LyXFont(LyXFont::ALL_INHERIT);
// > because last is the next unused position, and you can
// use it if you want
else if (pos > size()) {
- if (next && next->footnoteflag != LyXParagraph::NO_FOOTNOTE)
+ if (next_ && next_->footnoteflag != LyXParagraph::NO_FOOTNOTE)
return NextAfterFootnote()
->GetChar(pos - text.size() - 1);
else
return '\0';
} else {
// We should have a footnote environment.
- if (!next || next->footnoteflag == LyXParagraph::NO_FOOTNOTE) {
+ if (!next_ || next_->footnoteflag == LyXParagraph::NO_FOOTNOTE) {
// Notice that LyX does request the
// last char from time to time. (Asger)
//lyxerr << "ERROR (LyXParagraph::GetChar): "
// "expected footnote." << endl;
return '\0';
}
- switch (next->footnotekind) {
+ switch (next_->footnotekind) {
case LyXParagraph::FOOTNOTE:
return LyXParagraph::META_FOOTNOTE;
case LyXParagraph::MARGIN:
LyXParagraph::size_type LyXParagraph::Last() const
{
#ifndef NEW_INSETS
- if (next && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
+ if (next_ && next_->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
return text.size() + NextAfterFootnote()->Last() + 1;
// the 1 is the symbol
// for the footnote
// > because last is the next unused position, and you can
// use it if you want
if (pos > size()) {
- if (next
- && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
+ if (next_
+ && next_->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
return NextAfterFootnote()
->ParFromPos(pos - text.size() - 1);
else
// > because last is the next unused position, and you can
// use it if you want
if (pos > size()) {
- if (next
- && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
+ if (next_
+ && next_->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
return NextAfterFootnote()
->PositionInParFromPos(pos - text.size() - 1);
else
// > because last is the next unused position, and you can
// use it if you want
if (pos > size()) {
- if (next &&
- next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) {
+ if (next_ &&
+ next_->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) {
NextAfterFootnote()->SetFont(pos - text.size() - 1,
font);
} else
}
}
-
+
+
+void LyXParagraph::next(LyXParagraph * p)
+{
+ next_ = p;
+}
+
+
// This function is able to hide closed footnotes.
-LyXParagraph * LyXParagraph::Next()
+LyXParagraph * LyXParagraph::next()
+{
+#ifndef NEW_INSETS
+ if (next_ && next_->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) {
+ LyXParagraph * tmp = next_;
+ while (tmp
+ && tmp->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
+ tmp = tmp->next_;
+ if (tmp && tmp->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE)
+ return tmp->next(); /* there can be more than one
+ footnote in a logical
+ paragraph */
+ else
+ return next_; // This should never happen!
+ } else
+#endif
+ return next_;
+}
+
+
+LyXParagraph const * LyXParagraph::next() const
{
#ifndef NEW_INSETS
- if (next && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) {
- LyXParagraph * tmp = next;
+ if (next_ && next_->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) {
+ LyXParagraph * tmp = next_;
while (tmp
&& tmp->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
- tmp = tmp->next;
+ tmp = tmp->next_;
if (tmp && tmp->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE)
- return tmp->Next(); /* there can be more than one
+ return tmp->next(); /* there can be more than one
footnote in a logical
paragraph */
else
- return next; // This should never happen!
+ return next_; // This should never happen!
} else
#endif
- return next;
+ return next_;
}
#ifndef NEW_INSETS
LyXParagraph * LyXParagraph::NextAfterFootnote()
{
- if (next && next->footnoteflag != LyXParagraph::NO_FOOTNOTE) {
- LyXParagraph * tmp = next;
+ if (next_ && next_->footnoteflag != LyXParagraph::NO_FOOTNOTE) {
+ LyXParagraph * tmp = next_;
while (tmp && tmp->footnoteflag != LyXParagraph::NO_FOOTNOTE)
- tmp = tmp->next;
+ tmp = tmp->next_;
if (tmp && tmp->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE)
return tmp; /* there can be more than one footnote
in a logical paragraph */
else
- return next; // This should never happen!
+ return next_; // This should never happen!
} else
- return next;
+ return next_;
}
#endif
#ifndef NEW_INSETS
LyXParagraph const * LyXParagraph::NextAfterFootnote() const
{
- if (next && next->footnoteflag != LyXParagraph::NO_FOOTNOTE) {
- LyXParagraph * tmp = next;
+ if (next_ && next_->footnoteflag != LyXParagraph::NO_FOOTNOTE) {
+ LyXParagraph * tmp = next_;
while (tmp && tmp->footnoteflag != LyXParagraph::NO_FOOTNOTE)
- tmp = tmp->next;
+ tmp = tmp->next_;
if (tmp && tmp->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE)
return tmp; /* there can be more than one footnote
in a logical paragraph */
else
- return next; // This should never happen!
+ return next_; // This should never happen!
} else
- return next;
+ return next_;
}
#endif
LyXParagraph * LyXParagraph::PreviousBeforeFootnote()
{
LyXParagraph * tmp;
- if (previous && previous->footnoteflag != LyXParagraph::NO_FOOTNOTE) {
- tmp = previous;
+ if (previous_ && previous_->footnoteflag != LyXParagraph::NO_FOOTNOTE) {
+ tmp = previous_;
while (tmp && tmp->footnoteflag != LyXParagraph::NO_FOOTNOTE)
- tmp = tmp->previous;
+ tmp = tmp->previous_;
if (tmp && tmp->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE)
return tmp; /* there can be more than one footnote
in a logical paragraph */
else
- return previous; // This should never happen!
+ return previous_; // This should never happen!
} else
- return previous;
+ return previous_;
}
#endif
return this;
LyXParagraph * tmp = this;
- while (tmp->next
- && tmp->next->footnoteflag != LyXParagraph::NO_FOOTNOTE)
+ while (tmp->next_
+ && tmp->next_->footnoteflag != LyXParagraph::NO_FOOTNOTE)
tmp = tmp->NextAfterFootnote();
return tmp;
return this;
LyXParagraph const * tmp = this;
- while (tmp->next
- && tmp->next->footnoteflag != LyXParagraph::NO_FOOTNOTE)
+ while (tmp->next_
+ && tmp->next_->footnoteflag != LyXParagraph::NO_FOOTNOTE)
tmp = tmp->NextAfterFootnote();
return tmp;
while (tmppar &&
(tmppar->IsDummy()
|| tmppar->footnoteflag != LyXParagraph::NO_FOOTNOTE))
- tmppar = tmppar->previous;
+ tmppar = tmppar->previous_;
if (!tmppar) {
return this;
while (tmppar &&
(tmppar->IsDummy()
|| tmppar->footnoteflag != LyXParagraph::NO_FOOTNOTE))
- tmppar = tmppar->previous;
+ tmppar = tmppar->previous_;
if (!tmppar) {
return this;
#endif
+void LyXParagraph::previous(LyXParagraph * p)
+{
+ previous_ = p;
+}
+
+
// This function is able to hide closed footnotes.
-LyXParagraph * LyXParagraph::Previous()
+LyXParagraph * LyXParagraph::previous()
{
#ifndef NEW_INSETS
- LyXParagraph * tmp = previous;
+ LyXParagraph * tmp = previous_;
if (!tmp)
return tmp;
- if (tmp->previous
- && tmp->previous->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) {
- tmp = tmp->previous;
+ if (tmp->previous_
+ && tmp->previous_->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) {
+ tmp = tmp->previous_;
while (tmp
&& tmp->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
- tmp = tmp->previous;
+ tmp = tmp->previous_;
if (tmp && tmp->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE)
- return tmp->next->Previous();
+ return tmp->next_->previous();
else
- return previous;
+ return previous_;
} else
#endif
- return previous;
+ return previous_;
}
// This function is able to hide closed footnotes.
-LyXParagraph const * LyXParagraph::Previous() const
+LyXParagraph const * LyXParagraph::previous() const
{
#ifndef NEW_INSETS
- LyXParagraph * tmp = previous;
+ LyXParagraph * tmp = previous_;
if (!tmp)
return tmp;
- if (tmp->previous
- && tmp->previous->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) {
- tmp = tmp->previous;
+ if (tmp->previous_
+ && tmp->previous_->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) {
+ tmp = tmp->previous_;
while (tmp
&& tmp->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
- tmp = tmp->previous;
+ tmp = tmp->previous_;
if (tmp && tmp->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE)
- return tmp->next->Previous();
+ return tmp->next_->previous();
else
- return previous;
+ return previous_;
} else
#endif
- return previous;
+ return previous_;
}
LyXParagraph * tmppar = this;
while (tmppar && (
(tmppar->IsDummy()
- && tmppar->previous->footnoteflag ==
+ && tmppar->previous_->footnoteflag ==
LyXParagraph::CLOSED_FOOTNOTE)
|| tmppar->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE))
- tmppar = tmppar->previous;
+ tmppar = tmppar->previous_;
if (!tmppar)
return this; // This should never happen!
void LyXParagraph::PasteParagraph(BufferParams const & bparams)
{
// copy the next paragraph to this one
- LyXParagraph * the_next = Next();
+ LyXParagraph * the_next = next();
#ifndef NEW_INSETS
LyXParagraph * firstpar = FirstPhysicalPar();
#endif
}
// delete the next paragraph
- LyXParagraph * ppar = the_next->previous;
- LyXParagraph * npar = the_next->next;
+ LyXParagraph * ppar = the_next->previous_;
+ LyXParagraph * npar = the_next->next_;
delete the_next;
- ppar->next = npar;
+ ppar->next(npar);
}
void LyXParagraph::OpenFootnote(LyXParagraph::size_type pos)
{
LyXParagraph * par = ParFromPos(pos);
- par = par->next;
+ par = par->next_;
while (par && par->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) {
par->footnoteflag = LyXParagraph::OPEN_FOOTNOTE;
- par = par->next;
+ par = par->next_;
}
}
void LyXParagraph::CloseFootnote(LyXParagraph::size_type pos)
{
LyXParagraph * par = ParFromPos(pos);
- par = par->next;
+ par = par->next_;
while (par && par->footnoteflag == LyXParagraph::OPEN_FOOTNOTE) {
par->footnoteflag = LyXParagraph::CLOSED_FOOTNOTE;
- par = par->next;
+ par = par->next_;
}
}
#endif
#ifndef NEW_INSETS
if (footnoteflag == NO_FOOTNOTE)
last = LastPhysicalPar();
- else if (next->footnoteflag == NO_FOOTNOTE)
+ else if (next_->footnoteflag == NO_FOOTNOTE)
return endlabeltype;
#else
last = this;
#endif
- if (!last || !last->next)
+ if (!last || !last->next_)
return endlabeltype;
- int next_depth = last->next->GetDepth();
+ int next_depth = last->next_->GetDepth();
if (par_depth > next_depth ||
- (par_depth == next_depth && layout != last->next->GetLayout() ))
+ (par_depth == next_depth && layout != last->next_->GetLayout() ))
return endlabeltype;
break;
}
par->layout = new_layout;
if (par->params.pextraType() == PEXTRA_NONE) {
- if (par->Previous()) {
+ if (par->previous()) {
#ifndef NEW_INSETS
- ppar = par->Previous()->FirstPhysicalPar();
+ ppar = par->previous()->FirstPhysicalPar();
#else
- ppar = par->Previous();
+ ppar = par->previous();
#endif
while(ppar
- && ppar->Previous()
+ && ppar->previous()
&& (ppar->params.depth() > par->params.depth()))
#ifndef NEW_INSETS
- ppar = ppar->Previous()->FirstPhysicalPar();
+ ppar = ppar->previous()->FirstPhysicalPar();
#else
- ppar = ppar->Previous();
+ ppar = ppar->previous();
#endif
}
- if (par->Next()) {
+ if (par->next()) {
#ifndef NEW_INSETS
- npar = par->Next()->NextAfterFootnote();
+ npar = par->next()->NextAfterFootnote();
#else
- npar = par->Next();
+ npar = par->next();
#endif
while(npar
- && npar->Next()
+ && npar->next()
&& (npar->params.depth() > par->params.depth()))
#ifndef NEW_INSETS
- npar = npar->Next()->NextAfterFootnote();
+ npar = npar->next()->NextAfterFootnote();
#else
- npar = npar->Next();
+ npar = npar->next();
#endif
}
if (ppar && (ppar->params.pextraType() != PEXTRA_NONE)) {
par->params.spacing(Spacing(Spacing::Default));
if (par->params.pextraType() == PEXTRA_NONE) {
- if (par->Previous()) {
+ if (par->previous()) {
#ifndef NEW_INSETS
- ppar = par->Previous()->FirstPhysicalPar();
+ ppar = par->previous()->FirstPhysicalPar();
#else
- ppar = par->Previous();
+ ppar = par->previous();
#endif
while(ppar
- && ppar->Previous()
+ && ppar->previous()
&& (ppar->params.depth() > par->params.depth()))
#ifndef NEW_INSETS
- ppar = ppar->Previous()->FirstPhysicalPar();
+ ppar = ppar->previous()->FirstPhysicalPar();
#else
- ppar = ppar->Previous();
+ ppar = ppar->previous();
#endif
}
- if (par->Next()) {
+ if (par->next()) {
#ifndef NEW_INSETS
- npar = par->Next()->NextAfterFootnote();
+ npar = par->next()->NextAfterFootnote();
#else
- npar = par->Next();
+ npar = par->next();
#endif
while(npar
- && npar->Next()
+ && npar->next()
&& (npar->params.depth() > par->params.depth()))
#ifndef NEW_INSETS
- npar = npar->Next()->NextAfterFootnote();
+ npar = npar->next()->NextAfterFootnote();
#else
- npar = npar->Next();
+ npar = npar->next();
#endif
}
if (ppar && (ppar->params.pextraType() != PEXTRA_NONE)) {
#ifndef NEW_INSETS
if (i == 0 && i == size() &&
!(footnoteflag == LyXParagraph::NO_FOOTNOTE
- && next && next->footnoteflag != LyXParagraph::NO_FOOTNOTE))
+ && next_ && next_->footnoteflag != LyXParagraph::NO_FOOTNOTE))
++i; /* the cursor should not jump
* to the main body if there
* is nothing in! */
do {
#ifndef NEW_INSETS
- newpar = newpar->FirstPhysicalPar()->Previous();
+ newpar = newpar->FirstPhysicalPar()->previous();
#else
- newpar = newpar->Previous();
+ newpar = newpar->previous();
#endif
} while (newpar && newpar->GetDepth() > deth
#ifndef NEW_INSETS
);
if (!newpar) {
- if (Previous() || GetDepth())
+ if (previous() || GetDepth())
lyxerr << "ERROR (LyXParagraph::DepthHook): "
"no hook." << endl;
newpar = this;
do {
#ifndef NEW_INSETS
- newpar = newpar->FirstPhysicalPar()->Previous();
+ newpar = newpar->FirstPhysicalPar()->previous();
#else
- newpar = newpar->Previous();
+ newpar = newpar->previous();
#endif
} while (newpar && newpar->GetDepth() > deth
#ifndef NEW_INSETS
);
if (!newpar) {
- if (Previous() || GetDepth())
+ if (previous() || GetDepth())
lyxerr << "ERROR (LyXParagraph::DepthHook): "
"no hook." << endl;
newpar = this;
#ifndef NEW_INSETS
// Think about footnotes.
if (footnoteflag == LyXParagraph::NO_FOOTNOTE
- && next && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) {
+ && next_ && next_->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) {
int const further =
NextAfterFootnote()->GetPositionOfInset(inset);
if (further != -1)
}
if (!params.spacing().isDefault()
- && (!Previous() || !Previous()->HasSameLayout(this))) {
+ && (!previous() || !previous()->HasSameLayout(this))) {
os << params.spacing().writeEnvirBegin() << "\n";
texrow.newline();
}
Language const * language = getParLanguage(bparams);
Language const * doc_language = bparams.language;
- Language const * previous_language = previous
- ? previous->getParLanguage(bparams) : doc_language;
+ Language const * previous_language = previous_
+ ? previous_->getParLanguage(bparams) : doc_language;
if (language->babel() != doc_language->babel() &&
language->babel() != previous_language->babel()) {
os << subst(lyxrc.language_command_begin, "$$lang",
bool need_par = SimpleTeXOnePar(buf, bparams, os, texrow, moving_arg);
- LyXParagraph * par = next;
+ LyXParagraph * par = next_;
#ifndef NEW_INSETS
// Spit out footnotes
if (lyxrc.rtl_support) {
- if (next && next->footnoteflag != LyXParagraph::NO_FOOTNOTE
- && next->footnoteflag != footnoteflag) {
+ if (next_ && next_->footnoteflag != LyXParagraph::NO_FOOTNOTE
+ && next_->footnoteflag != footnoteflag) {
LyXParagraph * p = 0;
bool is_rtl = (size() > 0)
? GetFontSettings(bparams,
? par->GetFontSettings(bparams,
par->size()-1).isRightToLeft()
: language->RightToLeft();
- if (par->next &&
- par->next->footnoteflag != LyXParagraph::NO_FOOTNOTE &&
+ if (par->next_ &&
+ par->next_->footnoteflag != LyXParagraph::NO_FOOTNOTE &&
(p = par->NextAfterFootnote()) != 0 &&
p->size() > 0 &&
p->GetFontSettings(bparams, 0).isRightToLeft() != is_rtl)
is_rtl = language->RightToLeft();
- par = par->next;
+ par = par->next_;
}
}
} else {
foot, foot_texrow, foot_count,
false);
par->SimpleTeXOnePar(buf, bparams, os, texrow, moving_arg);
- par = par->next;
+ par = par->next_;
}
}
#endif
LyXFont font = getFont(bparams, Last() - 1);
bool is_command = textclasslist.Style(bparams.textclass,
GetLayout()).isCommand();
- if (style.resfont.size() != font.size() && next && !is_command) {
+ if (style.resfont.size() != font.size() && next_ && !is_command) {
if (!need_par)
os << "{";
os << "\\" << font.latexSize() << " \\par}";
// or for tables in floats
// -- effectively creates a \par where there isn't one which
// breaks a \subfigure or \subtable.
- if (next) {
+ if (next_) {
// && footnoteflag == LyXParagraph::NO_FOOTNOTE) {
os << '\n';
texrow.newline();
}
// we don't need it for the last paragraph!!!
- if (next
+ if (next_
#ifndef NEW_INSETS
&& !(footnoteflag != LyXParagraph::NO_FOOTNOTE && par &&
par->footnoteflag == LyXParagraph::NO_FOOTNOTE)
if (style.isCommand()) {
os << '{';
++column;
- } else if (params.align() != LYX_ALIGN_LAYOUT && next) {
+ } else if (params.align() != LYX_ALIGN_LAYOUT && next_) {
// We do not need \par here (Dekel)
// os << "{\\par";
os << "{";
#ifndef NEW_INSETS
LyXParagraph * p = 0;
if (i == 0
- && previous &&
- previous->footnoteflag != LyXParagraph::NO_FOOTNOTE &&
+ && previous_ &&
+ previous_->footnoteflag != LyXParagraph::NO_FOOTNOTE &&
(p = PreviousBeforeFootnote()) != 0)
last_font = p->getFont(bparams, p->size() - 1);
else
// If we have an open font definition, we have to close it
if (open_font) {
LyXParagraph * p = 0;
- if (next
+ if (next_
#ifndef NEW_INSETS
- && next->footnoteflag != LyXParagraph::NO_FOOTNOTE
+ && next_->footnoteflag != LyXParagraph::NO_FOOTNOTE
&& (p = NextAfterFootnote()) != 0
#else
- && (p = next)
+ && (p = next_)
#endif
)
running_font.latexWriteEndChanges(os, basefont,
eindent_open = true;
}
if ((params.pextraType() == PEXTRA_MINIPAGE) && !minipage_open) {
- if (params.pextraHfill() && Previous() &&
- (Previous()->params.pextraType() == PEXTRA_MINIPAGE)) {
+ if (params.pextraHfill() && previous() &&
+ (previous()->params.pextraType() == PEXTRA_MINIPAGE)) {
os << "\\hfill{}\n";
texrow.newline();
}
}
if (par && par->layout == layout && par->params.depth() == params.depth() &&
(par->params.pextraType() == PEXTRA_MINIPAGE) && !minipage_open) {
- if (par->params.pextraHfill() && par->Previous() &&
- (par->Previous()->params.pextraType() == PEXTRA_MINIPAGE)){
+ if (par->params.pextraHfill() && par->previous() &&
+ (par->previous()->params.pextraType() == PEXTRA_MINIPAGE)){
os << "\\hfill{}\n";
texrow.newline();
}
LyXParagraph * par = this;
LyXLayout const & style =
textclasslist.Style(bparams.textclass,
- previous->GetLayout());
+ previous_->GetLayout());
if (style.needprotect && footnotekind != LyXParagraph::FOOTNOTE){
lyxerr << "ERROR (LyXParagraph::TeXFootnote): "
texrow.newline();
}
- lyxerr[Debug::LATEX] << "TeXFootnote...done " << par->next << endl;
+ lyxerr[Debug::LATEX] << "TeXFootnote...done " << par->next_ << endl;
return par;
}
bool LyXParagraph::IsDummy() const
{
- return (footnoteflag == LyXParagraph::NO_FOOTNOTE && previous
- && previous->footnoteflag != LyXParagraph::NO_FOOTNOTE);
+ return (footnoteflag == LyXParagraph::NO_FOOTNOTE && previous_
+ && previous_->footnoteflag != LyXParagraph::NO_FOOTNOTE);
}
#endif
while (par && (par->layout == layout)
&& (par->params.depth() == params.depth())) {
ppar = par;
- par = par->Previous();
+ par = par->previous();
#ifndef NEW_INSETS
if (par)
par = par->FirstPhysicalPar();
#endif
while (par && par->params.depth() > params.depth()) {
- par = par->Previous();
+ par = par->previous();
#ifndef NEW_INSETS
if (par)
par = par->FirstPhysicalPar();
#ifndef NEW_INSETS
par = par->NextAfterFootnote();
#else
- par = par->Next();
+ par = par->next();
#endif
if (par && (par->params.depth() > params.depth()))
par->SetPExtraType(bparams,
par = par->NextAfterFootnote();
#else
while (par && par->params.depth() > params.depth())
- par = par->Next();
+ par = par->next();
#endif
}
}
while (par && (par->layout == layout)
&& (par->params.depth() == params.depth())) {
ppar = par;
- par = par->Previous();
+ par = par->previous();
#ifndef NEW_INSETS
if (par)
par = par->FirstPhysicalPar();
#endif
while (par && par->params.depth() > params.depth()) {
- par = par->Previous();
+ par = par->previous();
#ifndef NEW_INSETS
if (par)
par = par->FirstPhysicalPar();
#ifndef NEW_INSETS
par = par->NextAfterFootnote();
#else
- par = par->Next();
+ par = par->next();
#endif
if (par && (par->params.depth() > params.depth()))
par->UnsetPExtraType(bparams);
par = par->NextAfterFootnote();
#else
while (par && par->params.depth() > params.depth())
- par = par->Next();
+ par = par->next();
#endif
}
}
#endif
if (size() > 0)
return GetFirstFontSettings().language();
- else if (previous)
- return previous->getParLanguage(bparams);
+ else if (previous_)
+ return previous_->getParLanguage(bparams);
else
return bparams.language;
}
}
#ifndef NEW_INSETS
- if (next && next->footnoteflag != LyXParagraph::NO_FOOTNOTE
+ if (next_ && next_->footnoteflag != LyXParagraph::NO_FOOTNOTE
&& footnoteflag == LyXParagraph::NO_FOOTNOTE)
s += NextAfterFootnote()->String(buffer, false);
}
+#ifndef NEW_INSETS
+LyXTabular::BoxType LyXTabular::UseParbox(int cell) const
+{
+ LyXParagraph * par = GetCellInset(cell)->par;
+
+ for (; par; par = par->next_) {
+ for (int i = 0; i < par->Last(); ++i) {
+ if (par->GetChar(i) == LyXParagraph::META_NEWLINE)
+ return BOX_PARBOX;
+ }
+ }
+ return BOX_NONE;
+}
+#else
LyXTabular::BoxType LyXTabular::UseParbox(int cell) const
{
LyXParagraph * par = GetCellInset(cell)->par;
- for (; par; par = par->next) {
+ for (; par; par = par->next()) {
for (int i = 0; i < par->Last(); ++i) {
if (par->GetChar(i) == LyXParagraph::META_NEWLINE)
return BOX_PARBOX;
}
return BOX_NONE;
}
+#endif
if (!row->par()->GetLayout()) {
// find the previous same level paragraph
#ifndef NEW_INSETS
- if (row->par()->FirstPhysicalPar()->Previous()) {
+ if (row->par()->FirstPhysicalPar()->previous()) {
#else
- if (row->par()->Previous()) {
+ if (row->par()->previous()) {
#endif
LyXParagraph * newpar = row->par()
->DepthHook(row->par()->GetDepth());
#ifndef NEW_INSETS
do {
- newpar = newpar->FirstPhysicalPar()->Previous();
+ newpar = newpar->FirstPhysicalPar()->previous();
if (newpar)
newpar = newpar->FirstPhysicalPar();
} while (newpar && newpar->GetDepth() >= row->par()->GetDepth()
&& newpar->footnoteflag == row->par()->footnoteflag);
#else
do {
- newpar = newpar->Previous();
+ newpar = newpar->previous();
} while (newpar
&& newpar->GetDepth() >= row->par()->GetDepth());
#endif
BufferParams::PARSEP_SKIP) {
if (layout.isParagraph()
&& firstpar->GetDepth() == 0
- && firstpar->Previous())
+ && firstpar->previous())
maxasc += bview->buffer()->params.getDefSkip().inPixels(bview);
- else if (firstpar->Previous()
+ else if (firstpar->previous()
&& textclasslist.Style(bview->buffer()->params.textclass,
- firstpar->Previous()->GetLayout()).isParagraph()
- && firstpar->Previous()->GetDepth() == 0)
+ firstpar->previous()->GetLayout()).isParagraph()
+ && firstpar->previous()->GetDepth() == 0)
// is it right to use defskip here too? (AS)
maxasc += bview->buffer()->params.getDefSkip().inPixels(bview);
}
- /* the paper margins */
- if (!row_ptr->par()->previous && bv_owner)
+ /* the paper margins */
+#ifndef NEW_INSETS
+ if (!row_ptr->par()->previous_ && bv_owner)
+ maxasc += LYX_PAPER_MARGIN;
+#else
+ if (!row_ptr->par()->previous() && bv_owner)
maxasc += LYX_PAPER_MARGIN;
+#endif
/* add the vertical spaces, that the user added */
if (firstpar->params.spaceTop().kind() != VSpace::NONE)
* or between the items of a itemize or enumerate environment */
if (!firstpar->params.pagebreakTop()) {
- LyXParagraph * prev = row_ptr->par()->Previous();
+ LyXParagraph * prev = row_ptr->par()->previous();
if (prev)
prev = row_ptr->par()->DepthHook(row_ptr->par()->GetDepth());
if (prev && prev->GetLayout() == firstpar->GetLayout()
prev->GetLayout()).parsep * DefaultHeight());
}
else {
- if (firstpar->Previous()
- && firstpar->Previous()->GetDepth() == 0
- && firstpar->Previous()->GetLayout() != firstpar->GetLayout()) {
+ if (firstpar->previous()
+ && firstpar->previous()->GetDepth() == 0
+ && firstpar->previous()->GetLayout() != firstpar->GetLayout()) {
/* avoid parsep */
}
- else if (firstpar->Previous()){
+ else if (firstpar->previous()){
maxasc += int(layout.parsep * DefaultHeight());
}
}
#else
row_ptr->par() == par
#endif
- && (!row_ptr->next() || row_ptr->next()->par() != row_ptr->par())) {
+ && (!row_ptr->next() || row_ptr->next()->par() != row_ptr->par())) {
- /* the paper margins */
- if (!par->next && bv_owner)
+ /* the paper margins */
+#ifndef NEW_INSETS
+ if (!par->next_ && bv_owner)
maxdesc += LYX_PAPER_MARGIN;
-
+#else
+ if (!par->next() && bv_owner)
+ maxdesc += LYX_PAPER_MARGIN;
+#endif
+
/* add the vertical spaces, that the user added */
if (firstpar->params.spaceBottom().kind() != VSpace::NONE)
maxdesc += int(firstpar->params.spaceBottom().inPixels(bview));
/* and now the layout spaces, for example before and after a section,
* or between the items of a itemize or enumerate environment */
- if (!firstpar->params.pagebreakBottom() && row_ptr->par()->Next()) {
- LyXParagraph * nextpar = row_ptr->par()->Next();
+ if (!firstpar->params.pagebreakBottom() && row_ptr->par()->next()) {
+ LyXParagraph * nextpar = row_ptr->par()->next();
LyXParagraph * comparepar = row_ptr->par();
float usual = 0;
float unusual = 0;
SetUndo(bview->buffer(), Undo::INSERT,
#ifndef NEW_INSETS
- cursor.par()->ParFromPos(cursor.pos())->previous,
- cursor.par()->ParFromPos(cursor.pos())->next
+ cursor.par()->ParFromPos(cursor.pos())->previous_,
+ cursor.par()->ParFromPos(cursor.pos())->next_
#else
- cursor.par()->previous,
- cursor.par()->next
+ cursor.par()->previous(),
+ cursor.par()->next()
#endif
);
cursor.par()->SetLayout(bview->buffer()->params, 0);
else
// set to standard-layout
- cursor.par()->Next()->SetLayout(bview->buffer()->params, 0);
+ cursor.par()->next()->SetLayout(bview->buffer()->params, 0);
}
/* if the cursor is at the beginning of a row without prior newline,
SetHeightOfRow(bview, cursor.row());
- while (cursor.par()->Next()->Last()
- && cursor.par()->Next()->IsNewline(0))
- cursor.par()->Next()->Erase(0);
+ while (cursor.par()->next()->Last()
+ && cursor.par()->next()->IsNewline(0))
+ cursor.par()->next()->Erase(0);
- InsertParagraph(bview, cursor.par()->Next(), cursor.row());
+ InsertParagraph(bview, cursor.par()->next(), cursor.row());
UpdateCounters(bview, cursor.row()->previous());
/* This check is necessary. Otherwise the new empty paragraph will
* be deleted automatically. And it is more friendly for the user! */
if (cursor.pos())
- SetCursor(bview, cursor.par()->Next(), 0);
+ SetCursor(bview, cursor.par()->next(), 0);
else
SetCursor(bview, cursor.par(), 0);
LyXParagraph * par = cursor.par()->ParFromPos(cursor.pos());
/* if there is no footnote in this paragraph, just return. */
- if (!par->next
- || par->next->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE)
+ if (!par->next_
+ || par->next_->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE)
return;
/* ok, move the cursor right before the footnote */
refresh_y = cursor.y() - cursor.row()->baseline();
tmppar = cursor.par();
- endpar = cursor.par()->Next();
+ endpar = cursor.par()->next();
row = cursor.row();
tmppar->OpenFootnote(cursor.pos());
row->fill(Fill(bview, row, workWidth(bview)));
SetHeightOfRow(bview, row);
// CHECK See comment on top of text.C
- tmppar = tmppar->Next();
+ tmppar = tmppar->next();
while (tmppar != endpar) {
if (tmppar) {
InsertParagraph(bview, tmppar, row);
while (row->next() && row->next()->par() == tmppar)
row = row->next();
- tmppar = tmppar->Next();
+ tmppar = tmppar->next();
}
}
- SetCursor(bview, par->next, 0);
+ SetCursor(bview, par->next_, 0);
sel_cursor = cursor;
}
#endif
void LyXText::RedoParagraph(BufferView * bview) const
{
ClearSelection(bview);
- RedoParagraphs(bview, cursor, cursor.par()->Next());
+ RedoParagraphs(bview, cursor, cursor.par()->next());
SetCursorIntern(bview, cursor.par(), cursor.pos());
}
{
SetUndo(bview->buffer(), Undo::INSERT,
#ifndef NEW_INSETS
- cursor.par()->ParFromPos(cursor.pos())->previous,
- cursor.par()->ParFromPos(cursor.pos())->next
+ cursor.par()->ParFromPos(cursor.pos())->previous_,
+ cursor.par()->ParFromPos(cursor.pos())->next_
#else
- cursor.par()->previous,
- cursor.par()->next
+ cursor.par()->previous(),
+ cursor.par()->next()
#endif
);
&& cursor.par()->IsNewline(cursor.pos() - 1))
|| (cursor.pos() == 0
#ifndef NEW_INSETS
- && !(cursor.par()->Previous()
- && cursor.par()->Previous()->footnoteflag
+ && !(cursor.par()->previous()
+ && cursor.par()->previous()->footnoteflag
== LyXParagraph::OPEN_FOOTNOTE)
#endif
)) {
// CHECK See comment on top of text.C
if (tmpcursor.pos() == tmpcursor.par()->Last()
- && tmpcursor.par()->Next()) {
- tmpcursor.par(tmpcursor.par()->Next());
+ && tmpcursor.par()->next()) {
+ tmpcursor.par(tmpcursor.par()->next());
tmpcursor.pos(0);
} else {
int steps = 0;
tmpcursor.pos(tmpcursor.pos() + 1);
if (tmpcursor.pos() == tmpcursor.par()->Last()){
- if (tmpcursor.par()->Next()) {
- tmpcursor.par(tmpcursor.par()->Next());
+ if (tmpcursor.par()->next()) {
+ tmpcursor.par(tmpcursor.par()->next());
tmpcursor.pos(0);
}
} else
|| tmpcursor.par()->IsHfill(tmpcursor.pos() - 1))) {
tmpcursor.pos(tmpcursor.pos() - 1);
} else if (!tmpcursor.pos()) {
- if (tmpcursor.par()->Previous()){
- tmpcursor.par(tmpcursor.par()->Previous());
+ if (tmpcursor.par()->previous()){
+ tmpcursor.par(tmpcursor.par()->previous());
tmpcursor.pos(tmpcursor.par()->Last());
}
} else { // Here, tmpcursor != 0
// If this is not the very first word, skip rest of
// current word because we are probably in the middle
// of a word if there is text here.
- if (cursor.pos() || cursor.par()->previous) {
+#ifndef NEW_INSETS
+ if (cursor.pos() || cursor.par()->previous_) {
while (cursor.pos() < cursor.par()->Last()
&& cursor.par()->IsLetter(cursor.pos()))
cursor.pos(cursor.pos() + 1);
}
+#else
+ if (cursor.pos() || cursor.par()->previous()) {
+ while (cursor.pos() < cursor.par()->Last()
+ && cursor.par()->IsLetter(cursor.pos()))
+ cursor.pos(cursor.pos() + 1);
+ }
+#endif
+
// Now, skip until we have real text (will jump paragraphs)
while ((cursor.par()->Last() > cursor.pos()
&& (!cursor.par()->IsLetter(cursor.pos())
|| cursor.par()->getFont(bview->buffer()->params, cursor.pos())
.latex() == LyXFont::ON))
|| (cursor.par()->Last() == cursor.pos()
- && cursor.par()->Next())){
+ && cursor.par()->next())){
if (cursor.pos() == cursor.par()->Last()) {
- cursor.par(cursor.par()->Next());
+ cursor.par(cursor.par()->next());
cursor.pos(0);
} else
cursor.pos(cursor.pos() + 1);
{
#ifndef NEW_INSETS
LyXParagraph * tmppar = cursor.par()->ParFromPos(cursor.pos());
-#else
- LyXParagraph * tmppar = cursor.par();
-#endif
- SetUndo(bview->buffer(),Undo::FINISH, tmppar->previous, tmppar->next);
+ SetUndo(bview->buffer(),Undo::FINISH,
+ tmppar->previous_, tmppar->next_);
-#ifndef NEW_INSETS
LyXParagraph::size_type tmppos =
cursor.par()->PositionInParFromPos(cursor.pos());
#else
+ LyXParagraph * tmppar = cursor.par();
+
+ SetUndo(bview->buffer(),Undo::FINISH,
+ tmppar->previous(), tmppar->next());
+
LyXParagraph::size_type tmppos = cursor.pos();
#endif
+
while (tmppos < tmppar->size()) {
unsigned char c = tmppar->GetChar(tmppos);
if (IsKommaChar(c) || IsLineSeparatorChar(c))
LyXCursor old_cursor = cursor;
int const old_cur_par_id = old_cursor.par()->id();
- int const old_cur_par_prev_id = old_cursor.par()->previous ?
- old_cursor.par()->previous->id() : 0;
+#ifndef NEW_INSETS
+ int const old_cur_par_prev_id = old_cursor.par()->previous_ ?
+ old_cursor.par()->previous_->id() : 0;
+#else
+ int const old_cur_par_prev_id = old_cursor.par()->previous() ?
+ old_cursor.par()->previous()->id() : 0;
+#endif
// just move to the right
CursorRight(bview);
// and that can very well delete the par or par->previous in
// old_cursor. Will a solution where we compare paragraph id's
//work better?
- if ((cursor.par()->previous ? cursor.par()->previous->id() : 0)
+ if (
+#ifndef NEW_INSETS
+ (cursor.par()->previous_ ? cursor.par()->previous_->id() : 0)
+#else
+ (cursor.par()->previous() ? cursor.par()->previous()->id() : 0)
+#endif
== old_cur_par_prev_id
&& cursor.par()->id() != old_cur_par_id)
return; // delete-empty-paragraph-mechanism has done it
cursor = old_cursor; // to make sure undo gets the right cursor position
SetUndo(bview->buffer(), Undo::DELETE,
#ifndef NEW_INSETS
- cursor.par()->ParFromPos(cursor.pos())->previous,
- cursor.par()->ParFromPos(cursor.pos())->next
+ cursor.par()->ParFromPos(cursor.pos())->previous_,
+ cursor.par()->ParFromPos(cursor.pos())->next_
#else
- cursor.par()->previous,
- cursor.par()->next
+ cursor.par()->previous(),
+ cursor.par()->next()
#endif
);
cursor = tmpcursor;
if ((lastpos == 0
|| (lastpos == 1 && cursor.par()->IsSeparator(0)))
#ifndef NEW_INSETS
- && !(cursor.par()->Next()
+ && !(cursor.par()->next()
&& cursor.par()->footnoteflag == LyXParagraph::NO_FOOTNOTE
- && cursor.par()->Next()->footnoteflag == LyXParagraph::OPEN_FOOTNOTE)
+ && cursor.par()->next()->footnoteflag == LyXParagraph::OPEN_FOOTNOTE)
#endif
) {
// This is an empty paragraph and we delete it just by moving the cursor one step
// left and let the DeleteEmptyParagraphMechanism handle the actual deletion
// of the paragraph.
- if (cursor.par()->previous) {
#ifndef NEW_INSETS
- LyXParagraph * tmppar = cursor.par()->previous->FirstPhysicalPar();
-#else
- LyXParagraph * tmppar = cursor.par()->previous;
-#endif
+ if (cursor.par()->previous_) {
+ LyXParagraph * tmppar = cursor.par()->previous_->FirstPhysicalPar();
if (cursor.par()->GetLayout() == tmppar->GetLayout()
-#ifndef NEW_INSETS
&& cursor.par()->footnoteflag == tmppar->footnoteflag
+#else
+ if (cursor.par()->previous()) {
+ LyXParagraph * tmppar = cursor.par()->previous();
+ if (cursor.par()->GetLayout() == tmppar->GetLayout()
#endif
&& cursor.par()->GetAlign() == tmppar->GetAlign()) {
// Inherit bottom DTD from the paragraph below.
}
#ifndef NEW_INSETS
- if (cursor.par()->ParFromPos(cursor.pos())->previous){
+ if (cursor.par()->ParFromPos(cursor.pos())->previous_) {
SetUndo(bview->buffer(), Undo::DELETE,
- cursor.par()->ParFromPos(cursor.pos())->previous->previous,
- cursor.par()->ParFromPos(cursor.pos())->next);
+ cursor.par()->ParFromPos(cursor.pos())->previous_->previous_,
+ cursor.par()->ParFromPos(cursor.pos())->next_);
}
#else
- if (cursor.par()->previous) {
+ if (cursor.par()->previous()) {
SetUndo(bview->buffer(), Undo::DELETE,
- cursor.par()->previous->previous,
- cursor.par()->next);
+ cursor.par()->previous()->previous(),
+ cursor.par()->next());
}
#endif
// not a good idea since it triggers the auto-delete
// mechanism. So we do a CursorLeftIntern()-lite,
// without the dreaded mechanism. (JMarc)
- if (cursor.par()->Previous()) {
+ if (cursor.par()->previous()) {
// steps into the above paragraph.
- SetCursorIntern(bview, cursor.par()->Previous(),
- cursor.par()->Previous()->Last(), false);
+ SetCursorIntern(bview, cursor.par()->previous(),
+ cursor.par()->previous()->Last(), false);
}
/* Pasting is not allowed, if the paragraphs have different
* any paragraphs */
SetUndo(bview->buffer(), Undo::DELETE,
#ifndef NEW_INSETS
- cursor.par()->ParFromPos(cursor.pos())->previous,
- cursor.par()->ParFromPos(cursor.pos())->next
+ cursor.par()->ParFromPos(cursor.pos())->previous_,
+ cursor.par()->ParFromPos(cursor.pos())->next_
#else
- cursor.par()->previous,
- cursor.par()->next
+ cursor.par()->previous(),
+ cursor.par()->next()
#endif
);
// We used to do CursorLeftIntern() here, but it is
if (bview->buffer()->params.paragraph_separation == BufferParams::PARSEP_SKIP) {
if (layout.latextype == LATEX_PARAGRAPH
&& firstpar->GetDepth() == 0
- && firstpar->Previous())
+ && firstpar->previous())
y_top += bview->buffer()->params.getDefSkip().inPixels(bview);
- else if (firstpar->Previous()
+ else if (firstpar->previous()
&& textclasslist.Style(bview->buffer()->params.textclass,
- firstpar->Previous()->GetLayout()).latextype == LATEX_PARAGRAPH
- && firstpar->Previous()->GetDepth() == 0)
+ firstpar->previous()->GetLayout()).latextype == LATEX_PARAGRAPH
+ && firstpar->previous()->GetDepth() == 0)
// is it right to use defskip here, too? (AS)
y_top += bview->buffer()->params.getDefSkip().inPixels(bview);
}
while (tmppar != sel_end_cursor.par()->ParFromPos(sel_end_cursor.pos()) &&
tmppar->footnoteflag == LyXParagraph::NO_FOOTNOTE)
- tmppar = tmppar->next;
+ tmppar = tmppar->next_;
if (tmppar != sel_end_cursor.par()->ParFromPos(sel_end_cursor.pos())
|| tmppar->footnoteflag != LyXParagraph::NO_FOOTNOTE) {
* and sel_end cursor */
SetUndo(bview->buffer(), Undo::FINISH,
- sel_start_cursor.par()->ParFromPos(sel_start_cursor.pos())->previous,
- sel_end_cursor.par()->ParFromPos(sel_end_cursor.pos())->next);
+ sel_start_cursor.par()->ParFromPos(sel_start_cursor.pos())->previous_,
+ sel_end_cursor.par()->ParFromPos(sel_end_cursor.pos())->next_);
if (sel_end_cursor.pos() > 0
&& sel_end_cursor.par()->IsLineSeparator(sel_end_cursor.pos() - 1))
sel_end_cursor.par()->BreakParagraphConservative(bview->buffer()->params, sel_end_cursor.pos());
- sel_end_cursor.par(sel_end_cursor.par()->Next());
+ sel_end_cursor.par(sel_end_cursor.par()->next());
sel_end_cursor.pos(0);
// don't forget to insert a dummy layout paragraph if necessary
if (sel_start_cursor.par()->GetLayout() != sel_end_cursor.par()->layout){
sel_end_cursor.par()->BreakParagraphConservative(bview->buffer()->params, 0);
sel_end_cursor.par()->layout = LYX_DUMMY_LAYOUT;
- sel_end_cursor.par(sel_end_cursor.par()->next);
+ sel_end_cursor.par(sel_end_cursor.par()->next_);
}
else
sel_end_cursor.par()->layout = LYX_DUMMY_LAYOUT;
sel_start_cursor.par()->BreakParagraphConservative(bview->buffer()->params,
sel_start_cursor.pos());
- tmppar = sel_start_cursor.par()->Next();
+ tmppar = sel_start_cursor.par()->next();
if (dummy_selection) {
tmppar->Clear();
while (tmppar != sel_end_cursor.par()) {
tmppar->footnoteflag = LyXParagraph::OPEN_FOOTNOTE;
tmppar->footnotekind = kind;
- tmppar = tmppar->Next();
+ tmppar = tmppar->next();
}
- RedoParagraphs(bview, sel_start_cursor, sel_end_cursor.par()->Next());
+ RedoParagraphs(bview, sel_start_cursor, sel_end_cursor.par()->next());
- SetCursor(bview, sel_start_cursor.par()->Next(), 0);
+ SetCursor(bview, sel_start_cursor.par()->next(), 0);
ClearSelection(bview);
}
current_font = GetFont(bv_owner->buffer(), par, 0);
while (par) {
InsertParagraph(bv_owner, par, lastrow);
- par = par->Next();
+ par = par->next();
}
SetCursor(bv_owner, firstrow->par(), 0);
} else
current_font = GetFont(bview->buffer(), par, 0);
while (par) {
InsertParagraph(bview, par, lastrow);
- par = par->Next();
+ par = par->next();
}
SetCursorIntern(bview, firstrow->par(), 0);
sel_cursor = cursor;
void LyXText::ToggleFootnote(BufferView * bview)
{
LyXParagraph * par = cursor.par()->ParFromPos(cursor.pos());
- if (par->next
- && par->next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) {
+ if (par->next_
+ && par->next_->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) {
OpenFootnote(bview);
bview->owner()->getMiniBuffer()->Set(_("Opened float"));
} else {
// there is no open footnote in this paragraph, just return.
if (cursor.par()->footnoteflag != LyXParagraph::OPEN_FOOTNOTE) {
- if (!par->next ||
- par->next->footnoteflag != LyXParagraph::OPEN_FOOTNOTE) {
+ if (!par->next_ ||
+ par->next_->footnoteflag != LyXParagraph::OPEN_FOOTNOTE) {
bview->owner()->getMiniBuffer()
->Set(_("Nothing to do"));
return;
tmppar = cursor.par();
while (tmppar->footnoteflag == LyXParagraph::OPEN_FOOTNOTE) {
// just a little bit faster than movin the cursor
- tmppar = tmppar->Previous();
+ tmppar = tmppar->previous();
}
SetCursor(bview, tmppar, tmppar->Last());
}
refresh_y = cursor.y() - cursor.row()->baseline();
tmppar = cursor.par();
- LyXParagraph * endpar = par->NextAfterFootnote()->Next();
+ LyXParagraph * endpar = par->NextAfterFootnote()->next();
Row * row = cursor.row();
tmppar->CloseFootnote(cursor.pos());
LyXTextClass::size_type layout)
{
#ifndef NEW_INSETS
- LyXParagraph * endpar = send_cur.par()->LastPhysicalPar()->Next();
+ LyXParagraph * endpar = send_cur.par()->LastPhysicalPar()->next();
#else
- LyXParagraph * endpar = send_cur.par()->Next();
+ LyXParagraph * endpar = send_cur.par()->next();
#endif
LyXParagraph * undoendpar = endpar;
if (endpar && endpar->GetDepth()) {
while (endpar && endpar->GetDepth()) {
#ifndef NEW_INSETS
- endpar = endpar->LastPhysicalPar()->Next();
+ endpar = endpar->LastPhysicalPar()->next();
#else
- endpar = endpar->Next();
+ endpar = endpar->next();
#endif
undoendpar = endpar;
}
} else if (endpar) {
- endpar = endpar->Next(); // because of parindents etc.
+ endpar = endpar->next(); // because of parindents etc.
}
SetUndo(bview->buffer(), Undo::EDIT,
#ifndef NEW_INSETS
- sstart_cur.par()->ParFromPos(sstart_cur.pos())->previous,
+ sstart_cur.par()->ParFromPos(sstart_cur.pos())->previous_,
#else
- sstart_cur.par()->previous,
+ sstart_cur.par()->previous(),
#endif
undoendpar);
#ifndef NEW_INSETS
}
#endif
- cur.par(cur.par()->Next());
+ cur.par(cur.par()->next());
}
#ifndef NEW_INSETS
if (cur.par()->footnoteflag == sstart_cur.par()->footnoteflag) {
// We end at the next paragraph with depth 0
LyXParagraph * endpar =
#ifndef NEW_INSETS
- sel_end_cursor.par()->LastPhysicalPar()->Next();
+ sel_end_cursor.par()->LastPhysicalPar()->next();
#else
- sel_end_cursor.par()->Next();
+ sel_end_cursor.par()->next();
#endif
LyXParagraph * undoendpar = endpar;
if (endpar && endpar->GetDepth()) {
while (endpar && endpar->GetDepth()) {
#ifndef NEW_INSETS
- endpar = endpar->LastPhysicalPar()->Next();
+ endpar = endpar->LastPhysicalPar()->next();
#else
- endpar = endpar->Next();
+ endpar = endpar->next();
#endif
undoendpar = endpar;
}
}
else if (endpar) {
- endpar = endpar->Next(); // because of parindents etc.
+ endpar = endpar->next(); // because of parindents etc.
}
SetUndo(bview->buffer(), Undo::EDIT,
#ifndef NEW_INSETS
sel_start_cursor
- .par()->ParFromPos(sel_start_cursor.pos())->previous,
+ .par()->ParFromPos(sel_start_cursor.pos())->previous_,
#else
- sel_start_cursor.par()->previous,
+ sel_start_cursor.par()->previous(),
#endif
undoendpar);
).labeltype != LABEL_BIBLIO) {
LyXParagraph * prev =
#ifndef NEW_INSETS
- cursor.par()->FirstPhysicalPar()->Previous();
+ cursor.par()->FirstPhysicalPar()->previous();
#else
- cursor.par()->Previous();
+ cursor.par()->previous();
#endif
if (prev
&& (prev->GetDepth() - cursor.par()->GetDepth() > 0
}
if (cursor.par() == sel_end_cursor.par())
break;
- cursor.par(cursor.par()->Next());
+ cursor.par(cursor.par()->next());
}
// if nothing changed set all depth to 0
#else
cursor.par()->params.depth(0);
#endif
- cursor.par(cursor.par()->Next());
+ cursor.par(cursor.par()->next());
}
#ifndef NEW_INSETS
if (cursor.par()->footnoteflag == sel_start_cursor.par()->footnoteflag)
sel_end_cursor = cursor;
}
#ifndef NEW_INSETS
- LyXParagraph * endpar = sel_end_cursor.par()->LastPhysicalPar()->Next();
+ LyXParagraph * endpar = sel_end_cursor.par()->LastPhysicalPar()->next();
#else
- LyXParagraph * endpar = sel_end_cursor.par()->Next();
+ LyXParagraph * endpar = sel_end_cursor.par()->next();
#endif
LyXParagraph * undoendpar = endpar;
if (endpar && endpar->GetDepth()) {
while (endpar && endpar->GetDepth()) {
#ifndef NEW_INSETS
- endpar = endpar->LastPhysicalPar()->Next();
+ endpar = endpar->LastPhysicalPar()->next();
#else
- endpar = endpar->Next();
+ endpar = endpar->next();
#endif
undoendpar = endpar;
}
}
else if (endpar) {
- endpar = endpar->Next(); // because of parindents etc.
+ endpar = endpar->next(); // because of parindents etc.
}
SetUndo(bview->buffer(), Undo::EDIT,
#ifndef NEW_INSETS
sel_start_cursor
- .par()->ParFromPos(sel_start_cursor.pos())->previous,
+ .par()->ParFromPos(sel_start_cursor.pos())->previous_,
#else
- sel_start_cursor.par()->previous,
+ sel_start_cursor.par()->previous(),
#endif
undoendpar);
#endif
if (cursor.par() == sel_end_cursor.par())
break;
- cursor.par(cursor.par()->Next());
+ cursor.par(cursor.par()->next());
}
RedoParagraphs(bview, sel_start_cursor, endpar);
SetUndo(bview->buffer(), Undo::EDIT,
#ifndef NEW_INSETS
- sel_start_cursor.par()->ParFromPos(sel_start_cursor.pos())->previous,
- sel_end_cursor.par()->ParFromPos(sel_end_cursor.pos())->next
+ sel_start_cursor.par()->ParFromPos(sel_start_cursor.pos())->previous_,
+ sel_end_cursor.par()->ParFromPos(sel_end_cursor.pos())->next_
#else
- sel_start_cursor.par()->previous,
- sel_end_cursor.par()->next
+ sel_start_cursor.par()->previous(),
+ sel_end_cursor.par()->next()
#endif
);
cursor = sel_start_cursor;
cursor.pos(cursor.pos() + 1);
} else {
cursor.pos(0);
- cursor.par(cursor.par()->Next());
+ cursor.par(cursor.par()->next());
}
}
- RedoParagraphs(bview, sel_start_cursor, sel_end_cursor.par()->Next());
+ RedoParagraphs(bview, sel_start_cursor, sel_end_cursor.par()->next());
// we have to reset the selection, because the
// geometry could have changed
tmprow = firstrow;
while (tmprow->next() && tmprow->next()->par() == tmppar)
tmprow = tmprow->next();
- tmppar = tmppar->Next();
+ tmppar = tmppar->next();
}
} while (tmppar != endpar);
// The paragraphs in between (if any)
LyXCursor tmpcur(sel_start_cursor);
- tmpcur.par(tmpcur.par()->Next());
+ tmpcur.par(tmpcur.par()->next());
while (tmpcur.par() != sel_end_cursor.par()) {
result += tmpcur.par()->String(buffer, 0, tmpcur.par()->Last()) + "\n\n";
- tmpcur.par(tmpcur.par()->Next()); // Or NextAfterFootnote??
+ tmpcur.par(tmpcur.par()->next()); // Or NextAfterFootnote??
}
// Last paragraph in selection
void LyXText::CursorTop(BufferView * bview) const
{
- while (cursor.par()->Previous())
- cursor.par(cursor.par()->Previous());
+ while (cursor.par()->previous())
+ cursor.par(cursor.par()->previous());
SetCursor(bview, cursor.par(), 0);
}
void LyXText::CursorBottom(BufferView * bview) const
{
- while (cursor.par()->Next())
- cursor.par(cursor.par()->Next());
+ while (cursor.par()->next())
+ cursor.par(cursor.par()->next());
SetCursor(bview, cursor.par(), cursor.par()->Last());
}
return;
SetUndo(bview->buffer(), Undo::FINISH,
- cursor.par()->PreviousBeforeFootnote()->previous,
- cursor.par()->NextAfterFootnote()->next);
+ cursor.par()->PreviousBeforeFootnote()->previous_,
+ cursor.par()->NextAfterFootnote()->next_);
/* ok, move to the beginning of the footnote. */
while (cursor.par()->footnoteflag == LyXParagraph::OPEN_FOOTNOTE)
- cursor.par(cursor.par()->Previous());
+ cursor.par(cursor.par()->previous());
SetCursor(bview, cursor.par(), cursor.par()->Last());
/* this is just faster than using CursorLeft(); */
tmppar = firsttmppar;
/* tmppar is now the paragraph right before the footnote */
- bool first_footnote_par_is_not_empty = tmppar->next->size();
+ bool first_footnote_par_is_not_empty = tmppar->next_->size();
- while (tmppar->next
- && tmppar->next->footnoteflag == LyXParagraph::OPEN_FOOTNOTE) {
- tmppar = tmppar->next; /* I use next instead of Next(),
+ while (tmppar->next_
+ && tmppar->next_->footnoteflag == LyXParagraph::OPEN_FOOTNOTE) {
+ tmppar = tmppar->next_; /* I use next instead of Next(),
* because there cannot be any
* footnotes in a footnote
* environment */
// now we will paste the ex-footnote, if the layouts allow it
// first restore the layout of the paragraph right behind
// the footnote
- if (tmppar->next)
- tmppar->next->MakeSameLayout(cursor.par());
+ if (tmppar->next_)
+ tmppar->next_->MakeSameLayout(cursor.par());
// first the end
if (!tmppar->GetLayout()
- || (tmppar->Next()
- && (!tmppar->Next()->Last()
- || tmppar->Next()->HasSameLayout(tmppar)))) {
- if (tmppar->Next()->Last()
- && tmppar->Next()->IsLineSeparator(0))
- tmppar->Next()->Erase(0);
+ || (tmppar->next()
+ && (!tmppar->next()->Last()
+ || tmppar->next()->HasSameLayout(tmppar)))) {
+ if (tmppar->next()->Last()
+ && tmppar->next()->IsLineSeparator(0))
+ tmppar->next()->Erase(0);
tmppar->PasteParagraph(bview->buffer()->params);
}
- tmppar = tmppar->Next(); /* make sure tmppar cannot be touched
+ tmppar = tmppar->next(); /* make sure tmppar cannot be touched
* by the pasting of the beginning */
/* then the beginning */
/* if there is no space between the text and the footnote, so we insert
* a blank
* (only if the previous par and the footnotepar are not empty!) */
- if (!firsttmppar->next->GetLayout()
- || firsttmppar->HasSameLayout(firsttmppar->next)) {
+ if (!firsttmppar->next_->GetLayout()
+ || firsttmppar->HasSameLayout(firsttmppar->next_)) {
if (firsttmppar->size()
&& !firsttmppar->IsSeparator(firsttmppar->size() - 1)
&& first_footnote_par_is_not_empty) {
- firsttmppar->next->InsertChar(0, ' ');
+ firsttmppar->next_->InsertChar(0, ' ');
}
firsttmppar->PasteParagraph(bview->buffer()->params);
}
// make sure that the depth behind the selection are restored, too
#ifndef NEW_INSETS
- LyXParagraph * endpar = sel_end_cursor.par()->LastPhysicalPar()->Next();
+ LyXParagraph * endpar = sel_end_cursor.par()->LastPhysicalPar()->next();
#else
- LyXParagraph * endpar = sel_end_cursor.par()->Next();
+ LyXParagraph * endpar = sel_end_cursor.par()->next();
#endif
LyXParagraph * undoendpar = endpar;
if (endpar && endpar->GetDepth()) {
while (endpar && endpar->GetDepth()) {
#ifndef NEW_INSETS
- endpar = endpar->LastPhysicalPar()->Next();
+ endpar = endpar->LastPhysicalPar()->next();
#else
- endpar = endpar->Next();
+ endpar = endpar->next();
#endif
undoendpar = endpar;
}
}
else if (endpar) {
- endpar = endpar->Next(); // because of parindents etc.
+ endpar = endpar->next(); // because of parindents etc.
}
SetUndo(bview->buffer(), Undo::EDIT,
#ifndef NEW_INSETS
sel_start_cursor
- .par()->ParFromPos(sel_start_cursor.pos())->previous,
+ .par()->ParFromPos(sel_start_cursor.pos())->previous_,
#else
- sel_start_cursor.par()->previous,
+ sel_start_cursor.par()->previous(),
#endif
undoendpar);
LyXParagraph * tmppar = sel_end_cursor.par();
#ifndef NEW_INSETS
- while (tmppar != sel_start_cursor.par()->FirstPhysicalPar()->Previous()) {
+ while (tmppar != sel_start_cursor.par()->FirstPhysicalPar()->previous()) {
SetCursor(bview, tmppar->FirstPhysicalPar(), 0);
#else
- while (tmppar != sel_start_cursor.par()->Previous()) {
+ while (tmppar != sel_start_cursor.par()->previous()) {
SetCursor(bview, tmppar, 0);
#endif
status = LyXText::NEED_MORE_REFRESH;
#ifndef NEW_INSETS
}
- tmppar = cursor.par()->FirstPhysicalPar()->Previous();
+ tmppar = cursor.par()->FirstPhysicalPar()->previous();
#else
- tmppar = cursor.par()->Previous();
+ tmppar = cursor.par()->previous();
#endif
}
// make sure that the depth behind the selection are restored, too
#ifndef NEW_INSETS
- LyXParagraph * endpar = sel_end_cursor.par()->LastPhysicalPar()->Next();
+ LyXParagraph * endpar = sel_end_cursor.par()->LastPhysicalPar()->next();
#else
- LyXParagraph * endpar = sel_end_cursor.par()->Next();
+ LyXParagraph * endpar = sel_end_cursor.par()->next();
#endif
LyXParagraph * undoendpar = endpar;
if (endpar && endpar->GetDepth()) {
while (endpar && endpar->GetDepth()) {
#ifndef NEW_INSETS
- endpar = endpar->LastPhysicalPar()->Next();
+ endpar = endpar->LastPhysicalPar()->next();
#else
- endpar = endpar->Next();
+ endpar = endpar->next();
#endif
undoendpar = endpar;
}
}
else if (endpar) {
- endpar = endpar->Next(); // because of parindents etc.
+ endpar = endpar->next(); // because of parindents etc.
}
SetUndo(bview->buffer(), Undo::EDIT,
#ifndef NEW_INSETS
sel_start_cursor
- .par()->ParFromPos(sel_start_cursor.pos())->previous,
+ .par()->ParFromPos(sel_start_cursor.pos())->previous_,
#else
- sel_start_cursor.par()->previous,
+ sel_start_cursor.par()->previous(),
#endif
undoendpar);
tmppar = sel_end_cursor.par();
#ifndef NEW_INSETS
- while(tmppar != sel_start_cursor.par()->FirstPhysicalPar()->Previous()) {
+ while(tmppar != sel_start_cursor.par()->FirstPhysicalPar()->previous()) {
SetCursor(bview, tmppar->FirstPhysicalPar(), 0);
#else
- while(tmppar != sel_start_cursor.par()->Previous()) {
+ while(tmppar != sel_start_cursor.par()->previous()) {
SetCursor(bview, tmppar, 0);
#endif
status = LyXText::NEED_MORE_REFRESH;
}
#ifndef NEW_INSETS
}
- tmppar = cursor.par()->FirstPhysicalPar()->Previous();
+ tmppar = cursor.par()->FirstPhysicalPar()->previous();
#else
- tmppar = cursor.par()->Previous();
+ tmppar = cursor.par()->previous();
#endif
}
RedoParagraphs(bview, sel_start_cursor, endpar);
/* copy the prev-counters to this one, unless this is the start of a
footnote or of a bibliography or the very first paragraph */
- if (par->Previous()
+ if (par->previous()
#ifndef NEW_INSETS
- && !(par->Previous()->footnoteflag == LyXParagraph::NO_FOOTNOTE
+ && !(par->previous()->footnoteflag == LyXParagraph::NO_FOOTNOTE
&& par->footnoteflag == LyXParagraph::OPEN_FOOTNOTE
&& par->footnotekind == LyXParagraph::FOOTNOTE)
#endif
&& !(textclasslist.Style(buf->params.textclass,
- par->Previous()->GetLayout()
+ par->previous()->GetLayout()
).labeltype != LABEL_BIBLIO
&& layout.labeltype == LABEL_BIBLIO)) {
for (int i = 0; i < 10; ++i) {
- par->setCounter(i, par->Previous()->GetFirstCounter(i));
+ par->setCounter(i, par->previous()->GetFirstCounter(i));
}
#ifndef NEW_INSETS
- par->params.appendix(par->Previous()->FirstPhysicalPar()->params.appendix());
+ par->params.appendix(par->previous()->FirstPhysicalPar()->params.appendix());
#else
- par->params.appendix(par->Previous()->params.appendix());
+ par->params.appendix(par->previous()->params.appendix());
#endif
if (!par->params.appendix() && par->params.startOfAppendix()) {
par->params.appendix(true);
}
}
#ifndef NEW_INSETS
- par->enumdepth = par->Previous()->FirstPhysicalPar()->enumdepth;
- par->itemdepth = par->Previous()->FirstPhysicalPar()->itemdepth;
+ par->enumdepth = par->previous()->FirstPhysicalPar()->enumdepth;
+ par->itemdepth = par->previous()->FirstPhysicalPar()->itemdepth;
#else
- par->enumdepth = par->Previous()->enumdepth;
- par->itemdepth = par->Previous()->itemdepth;
+ par->enumdepth = par->previous()->enumdepth;
+ par->itemdepth = par->previous()->itemdepth;
#endif
} else {
for (int i = 0; i < 10; ++i) {
// LaTeX behaviour (ARRae)
if (par->footnoteflag == LyXParagraph::OPEN_FOOTNOTE
&& par->footnotekind == LyXParagraph::MARGIN
- && par->Previous()
- && par->Previous()->footnoteflag != LyXParagraph::OPEN_FOOTNOTE
+ && par->previous()
+ && par->previous()->footnoteflag != LyXParagraph::OPEN_FOOTNOTE
&& (par->PreviousBeforeFootnote()
&& textclasslist.Style(buf->params.textclass,
par->PreviousBeforeFootnote()->GetLayout()
* AND, bibliographies can't have their depth changed ie. they
* are always of depth 0
*/
- if (par->Previous()
- && par->Previous()->GetDepth() < par->GetDepth()
+ if (par->previous()
+ && par->previous()->GetDepth() < par->GetDepth()
&& textclasslist.Style(buf->params.textclass,
- par->Previous()->GetLayout()
+ par->previous()->GetLayout()
).labeltype == LABEL_COUNTER_ENUMI
&& par->enumdepth < 3
#ifndef NEW_INSETS
- && !(par->Previous()->footnoteflag == LyXParagraph::NO_FOOTNOTE
+ && !(par->previous()->footnoteflag == LyXParagraph::NO_FOOTNOTE
&& par->footnoteflag == LyXParagraph::OPEN_FOOTNOTE
&& par->footnotekind == LyXParagraph::FOOTNOTE)
#endif
}
/* Maybe we have to decrement the enumeration depth, see note above */
- if (par->Previous()
- && par->Previous()->GetDepth() > par->GetDepth()
+ if (par->previous()
+ && par->previous()->GetDepth() > par->GetDepth()
#ifndef NEW_INSETS
- && !(par->Previous()->footnoteflag == LyXParagraph::NO_FOOTNOTE
+ && !(par->previous()->footnoteflag == LyXParagraph::NO_FOOTNOTE
&& par->footnoteflag == LyXParagraph::OPEN_FOOTNOTE
&& par->footnotekind == LyXParagraph::FOOTNOTE)
#endif
void LyXText::UpdateCounters(BufferView * bview, Row * row) const
{
LyXParagraph * par;
+#ifndef NEW_INSETS
if (!row) {
row = firstrow;
par = row->par();
+ } else if (row->par()->next_
+ && row->par()->next_->footnoteflag != LyXParagraph::OPEN_FOOTNOTE) {
+ par = row->par()->LastPhysicalPar()->next();
} else {
- if (row->par()->next
-#ifndef NEW_INSETS
- && row->par()->next->footnoteflag != LyXParagraph::OPEN_FOOTNOTE
-#endif
- ) {
-#ifndef NEW_INSETS
- par = row->par()->LastPhysicalPar()->Next();
+ par = row->par()->next_;
+ }
#else
- par = row->par()->Next();
-#endif
- } else {
- par = row->par()->next;
- }
+ if (!row) {
+ row = firstrow;
+ par = row->par();
+ } else {
+ par = row->par()->next();
}
+#endif
while (par) {
while (row->par() != par)
#ifndef NEW_INSETS
/* think about the damned open footnotes! */
- while (par->Next() &&
- (par->Next()->footnoteflag == LyXParagraph::OPEN_FOOTNOTE
- || par->Next()->IsDummy())){
- par = par->Next();
+ while (par->next() &&
+ (par->next()->footnoteflag == LyXParagraph::OPEN_FOOTNOTE
+ || par->next()->IsDummy())){
+ par = par->next();
if (par->IsDummy()) {
while (row->par() != par)
row = row->next();
#endif
}
#ifndef NEW_INSETS
- par = par->LastPhysicalPar()->Next();
+ par = par->LastPhysicalPar()->next();
#else
- par = par->Next();
+ par = par->next();
#endif
}
return;
SetUndo(bview->buffer(), Undo::INSERT,
#ifndef NEW_INSETS
- cursor.par()->ParFromPos(cursor.pos())->previous,
- cursor.par()->ParFromPos(cursor.pos())->next
+ cursor.par()->ParFromPos(cursor.pos())->previous_,
+ cursor.par()->ParFromPos(cursor.pos())->next_
#else
- cursor.par()->previous,
- cursor.par()->next
+ cursor.par()->previous(),
+ cursor.par()->next()
#endif
);
cursor.par()->InsertInset(cursor.pos(), inset);
_("sorry."));
return;
}
- tmppar = tmppar->Next();
+ tmppar = tmppar->next();
}
}
#endif
// make sure that the depth behind the selection are restored, too
#ifndef NEW_INSETS
- LyXParagraph * endpar = sel_end_cursor.par()->LastPhysicalPar()->Next();
+ LyXParagraph * endpar = sel_end_cursor.par()->LastPhysicalPar()->next();
#else
- LyXParagraph * endpar = sel_end_cursor.par()->Next();
+ LyXParagraph * endpar = sel_end_cursor.par()->next();
#endif
LyXParagraph * undoendpar = endpar;
if (endpar && endpar->GetDepth()) {
while (endpar && endpar->GetDepth()) {
#ifndef NEW_INSETS
- endpar = endpar->LastPhysicalPar()->Next();
+ endpar = endpar->LastPhysicalPar()->next();
#else
- endpar = endpar->Next();
+ endpar = endpar->next();
#endif
undoendpar = endpar;
}
} else if (endpar) {
- endpar = endpar->Next(); // because of parindents etc.
+ endpar = endpar->next(); // because of parindents etc.
}
SetUndo(bview->buffer(), Undo::DELETE,
#ifndef NEW_INSETS
sel_start_cursor
- .par()->ParFromPos(sel_start_cursor.pos())->previous,
+ .par()->ParFromPos(sel_start_cursor.pos())->previous_,
#else
- sel_start_cursor.par()->previous,
+ sel_start_cursor.par()->previous(),
#endif
undoendpar);
sel_end_cursor.pos(pos);
cursor.pos(sel_end_cursor.pos());
}
- endpar = endpar->Next();
+ endpar = endpar->next();
// sometimes necessary
if (doclear)
_("sorry."));
return;
}
- tmppar = tmppar->Next();
+ tmppar = tmppar->next();
}
}
#endif
SetUndo(bview->buffer(), Undo::INSERT,
#ifndef NEW_INSETS
- cursor.par()->ParFromPos(cursor.pos())->previous,
- cursor.par()->ParFromPos(cursor.pos())->next
+ cursor.par()->ParFromPos(cursor.pos())->previous_,
+ cursor.par()->ParFromPos(cursor.pos())->next_
#else
- cursor.par()->previous,
- cursor.par()->next
+ cursor.par()->previous(),
+ cursor.par()->next()
#endif
);
LyXParagraph * par = cursor.par();
LyXParagraph::size_type pos = cursor.pos();
LyXParagraph::size_type a = 0;
- LyXParagraph * endpar = cursor.par()->Next();
+ LyXParagraph * endpar = cursor.par()->next();
SetCursorParUndo(bview->buffer());
++pos;
}
par->BreakParagraph(bview->buffer()->params, pos, flag);
- par = par->Next();
+ par = par->next();
pos = 0;
}
++i;
if (res.pos() < res.par()->Last() - 1) {
res.pos(res.pos() + 1);
} else {
- res.par(res.par()->Next());
+ res.par(res.par()->next());
res.pos(0);
}
#ifndef NEW_INSETS
}
#endif
- par = par->Next();
+ par = par->next();
} while (par);
return false;
pos = par->PositionInParFromPos(pos);
par = tmppar;
}
- if (par->IsDummy() && par->previous &&
- par->previous->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) {
- while (par->previous &&
- ((par->previous->IsDummy() &&
- (par->previous->previous->footnoteflag ==
+ if (par->IsDummy() && par->previous_ &&
+ par->previous_->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) {
+ while (par->previous_ &&
+ ((par->previous_->IsDummy() &&
+ (par->previous_->previous_->footnoteflag ==
LyXParagraph::CLOSED_FOOTNOTE)) ||
- (par->previous->footnoteflag ==
+ (par->previous_->footnoteflag ==
LyXParagraph::CLOSED_FOOTNOTE))) {
- par = par->previous ;
+ par = par->previous_;
if (par->IsDummy() &&
- (par->previous->footnoteflag ==
+ (par->previous_->footnoteflag ==
LyXParagraph::CLOSED_FOOTNOTE))
pos += par->size() + 1;
}
- if (par->previous) {
- par = par->previous;
+ if (par->previous_) {
+ par = par->previous_;
}
pos += par->size() + 1;
}
if (!internal && !boundary &&
IsBoundary(bview->buffer(), cursor.par(), cursor.pos() + 1))
SetCursor(bview, cursor.par(), cursor.pos() + 1, true, true);
- } else if (cursor.par()->Previous()) { // steps into the above paragraph.
- LyXParagraph * par = cursor.par()->Previous();
+ } else if (cursor.par()->previous()) { // steps into the above paragraph.
+ LyXParagraph * par = cursor.par()->previous();
SetCursor(bview, par, par->Last());
}
}
if (!internal &&
IsBoundary(bview->buffer(), cursor.par(), cursor.pos()))
SetCursor(bview, cursor.par(), cursor.pos(), true, true);
- } else if (cursor.par()->Next())
- SetCursor(bview, cursor.par()->Next(), 0);
+ } else if (cursor.par()->next())
+ SetCursor(bview, cursor.par()->next(), 0);
}
if (cursor.pos() > 0) {
SetCursor(bview, cursor.par(), 0);
}
- else if (cursor.par()->Previous()) {
- SetCursor(bview, cursor.par()->Previous(), 0);
+ else if (cursor.par()->previous()) {
+ SetCursor(bview, cursor.par()->previous(), 0);
}
}
void LyXText::CursorDownParagraph(BufferView * bview) const
{
- if (cursor.par()->Next()) {
- SetCursor(bview, cursor.par()->Next(), 0);
+ if (cursor.par()->next()) {
+ SetCursor(bview, cursor.par()->next(), 0);
} else {
SetCursor(bview, cursor.par(), cursor.par()->Last());
}
&& old_cursor.par()->IsLineSeparator(old_cursor.pos())
&& old_cursor.par()->IsLineSeparator(old_cursor.pos() - 1)) {
old_cursor.par()->Erase(old_cursor.pos() - 1);
- RedoParagraphs(bview, old_cursor, old_cursor.par()->Next());
+ RedoParagraphs(bview, old_cursor, old_cursor.par()->next());
// correct cursor
if (old_cursor.par() == cursor.par() &&
cursor.pos() > old_cursor.pos()) {
refresh_y = old_cursor.y() - old_cursor.row()->baseline() - refresh_row->height();
tmpcursor = cursor;
cursor = old_cursor; // that undo can restore the right cursor position
- LyXParagraph * endpar = old_cursor.par()->next;
+#ifndef NEW_INSETS
+ LyXParagraph * endpar = old_cursor.par()->next_;
if (endpar && endpar->GetDepth()) {
while (endpar && endpar->GetDepth()) {
-#ifndef NEW_INSETS
- endpar = endpar->LastPhysicalPar()->Next();
+ endpar = endpar->LastPhysicalPar()->next();
+ }
+ }
+ SetUndo(bview->buffer(), Undo::DELETE,
+ old_cursor.par()->previous_,
+ endpar);
+ cursor = tmpcursor;
+
+ // delete old row
+ RemoveRow(old_cursor.row());
+ if (OwnerParagraph() == old_cursor.par()) {
+ OwnerParagraph(OwnerParagraph()->next_);
+ }
#else
- endpar = endpar->Next();
-#endif
+ LyXParagraph * endpar = old_cursor.par()->next();
+ if (endpar && endpar->GetDepth()) {
+ while (endpar && endpar->GetDepth()) {
+ endpar = endpar->next();
}
}
SetUndo(bview->buffer(), Undo::DELETE,
- old_cursor.par()->previous,
+ old_cursor.par()->previous(),
endpar);
cursor = tmpcursor;
// delete old row
RemoveRow(old_cursor.row());
if (OwnerParagraph() == old_cursor.par()) {
- OwnerParagraph(OwnerParagraph()->next);
+ OwnerParagraph(OwnerParagraph()->next());
}
+#endif
// delete old par
delete old_cursor.par();
tmpcursor = cursor;
cursor = old_cursor; // that undo can restore the right cursor position
- LyXParagraph * endpar = old_cursor.par()->next;
+#ifndef NEW_INSETS
+ LyXParagraph * endpar = old_cursor.par()->next_;
if (endpar && endpar->GetDepth()) {
while (endpar && endpar->GetDepth()) {
-#ifndef NEW_INSETS
- endpar = endpar->LastPhysicalPar()->Next();
+ endpar = endpar->LastPhysicalPar()->next();
+ }
+ }
+ SetUndo(bview->buffer(), Undo::DELETE,
+ old_cursor.par()->previous_,
+ endpar);
+ cursor = tmpcursor;
+
+ // delete old row
+ RemoveRow(old_cursor.row());
+ // delete old par
+ if (OwnerParagraph() == old_cursor.par()) {
+ OwnerParagraph(OwnerParagraph()->next_);
+ }
#else
- endpar = endpar->Next();
-#endif
+ LyXParagraph * endpar = old_cursor.par()->next();
+ if (endpar && endpar->GetDepth()) {
+ while (endpar && endpar->GetDepth()) {
+ endpar = endpar->next();
}
}
SetUndo(bview->buffer(), Undo::DELETE,
- old_cursor.par()->previous,
+ old_cursor.par()->previous(),
endpar);
cursor = tmpcursor;
RemoveRow(old_cursor.row());
// delete old par
if (OwnerParagraph() == old_cursor.par()) {
- OwnerParagraph(OwnerParagraph()->next);
+ OwnerParagraph(OwnerParagraph()->next());
}
+#endif
delete old_cursor.par();
/* Breakagain the next par. Needed
}
if (!deleted) {
if (old_cursor.par()->StripLeadingSpaces(bview->buffer()->params.textclass)) {
- RedoParagraphs(bview, old_cursor, old_cursor.par()->Next());
+ RedoParagraphs(bview, old_cursor, old_cursor.par()->next());
// correct cursor y
SetCursorIntern(bview, cursor.par(), cursor.pos());
sel_cursor = cursor;
}
+#ifndef NEW_INSETS
LyXParagraph * LyXText::GetParFromID(int id)
{
LyXParagraph * result = FirstParagraph();
while (result && result->id() != id)
- result = result->next;
+ result = result->next_;
return result;
}
+#else
+LyXParagraph * LyXText::GetParFromID(int id)
+{
+ LyXParagraph * result = FirstParagraph();
+ while (result && result->id() != id)
+ result = result->next();
+ return result;
+}
+#endif
// undo functions
LyXParagraph * tmppar3 = undo->par;
undo->par = 0; // otherwise the undo destructor would delete the paragraph
LyXParagraph * tmppar4 = tmppar3;
- if (tmppar4){
- while (tmppar4->next)
- tmppar4 = tmppar4->next;
+#ifndef NEW_INSETS
+ if (tmppar4) {
+ while (tmppar4->next_)
+ tmppar4 = tmppar4->next_;
+ } // get last undo par
+
+ // now remove the old text if there is any
+ if (before != behind || (!behind && !before)) {
+ if (before)
+ tmppar5 = before->next();
+ else
+ tmppar5 = OwnerParagraph();
+ tmppar2 = tmppar3;
+ while (tmppar5 && tmppar5 != behind) {
+ tmppar = tmppar5;
+ tmppar5 = tmppar5->next();
+ // a memory optimization for edit: Only layout information
+ // is stored in the undo. So restore the text informations.
+ if (undo->kind == Undo::EDIT) {
+ tmppar2->setContentsFromPar(tmppar);
+ tmppar->clearContents();
+ tmppar2 = tmppar2->next();
+ }
+ }
+ }
+
+#else
+ if (tmppar4) {
+ while (tmppar4->next())
+ tmppar4 = tmppar4->next();
} // get last undo par
// now remove the old text if there is any
- if (before != behind || (!behind && !before)){
+ if (before != behind || (!behind && !before)) {
if (before)
- tmppar5 = before->next;
+ tmppar5 = before->next();
else
tmppar5 = OwnerParagraph();
tmppar2 = tmppar3;
- while (tmppar5 && tmppar5 != behind){
+ while (tmppar5 && tmppar5 != behind) {
tmppar = tmppar5;
- tmppar5 = tmppar5->next;
+ tmppar5 = tmppar5->next();
// a memory optimization for edit: Only layout information
// is stored in the undo. So restore the text informations.
if (undo->kind == Undo::EDIT) {
tmppar2->setContentsFromPar(tmppar);
tmppar->clearContents();
- tmppar2 = tmppar2->next;
+ tmppar2 = tmppar2->next();
}
}
}
+#endif
// put the new stuff in the list if there is one
if (tmppar3){
if (before)
- before->next = tmppar3;
+ before->next(tmppar3);
else
OwnerParagraph(tmppar3);
- tmppar3->previous = before;
+ tmppar3->previous(before);
} else {
if (!before)
OwnerParagraph(behind);
}
if (tmppar4) {
- tmppar4->next = behind;
+ tmppar4->next(behind);
if (behind)
- behind->previous = tmppar4;
+ behind->previous(tmppar4);
}
#ifndef NEW_INSETS
// check wether before points to a closed float and open it if necessary
if (before && before->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE
- && before->next && before->next->footnoteflag != LyXParagraph::NO_FOOTNOTE){
+ && before->next_ && before->next_->footnoteflag != LyXParagraph::NO_FOOTNOTE){
tmppar4 = before;
- while (tmppar4->previous &&
- tmppar4->previous->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
- tmppar4 = tmppar4->previous;
+ while (tmppar4->previous_ &&
+ tmppar4->previous_->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
+ tmppar4 = tmppar4->previous_;
while (tmppar4 && tmppar4->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE){
tmppar4->footnoteflag = LyXParagraph::OPEN_FOOTNOTE;
- tmppar4 = tmppar4->next;
+ tmppar4 = tmppar4->next_;
}
}
#endif
#ifndef NEW_INSETS
// open a cosed footnote at the end if necessary
- if (behind && behind->previous &&
- behind->previous->footnoteflag != LyXParagraph::NO_FOOTNOTE &&
+ if (behind && behind->previous_ &&
+ behind->previous_->footnoteflag != LyXParagraph::NO_FOOTNOTE &&
behind->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE){
while (behind && behind->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE){
behind->footnoteflag = LyXParagraph::OPEN_FOOTNOTE;
- behind = behind->next;
+ behind = behind->next_;
}
}
#endif
if (behind) {
#ifndef NEW_INSETS
if (behind->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE)
- endpar = behind->LastPhysicalPar()->Next();
+ endpar = behind->LastPhysicalPar()->next();
else
- endpar = behind->NextAfterFootnote()->LastPhysicalPar()->Next();
+ endpar = behind->NextAfterFootnote()->LastPhysicalPar()->next();
#else
- endpar = behind->Next();
+ endpar = behind->next();
#endif
} else
endpar = behind;
LyXParagraph * start = 0;
LyXParagraph * end = 0;
-
+
+#ifndef NEW_INSETS
if (before)
- start = before->next;
+ start = before->next_;
else
start = FirstParagraph();
if (behind)
- end = behind->previous;
+ end = behind->previous_;
else {
end = FirstParagraph();
- while (end->next)
- end = end->next;
+ while (end->next_)
+ end = end->next_;
}
-
- if (start && end && (start != end->next) &&
- ((before != behind) || (!before && !behind)))
- {
+ if (start && end && (start != end->next_) &&
+ ((before != behind) || (!before && !behind))) {
tmppar = start;
tmppar2 = tmppar->Clone();
tmppar2->id(tmppar->id());
undopar = tmppar2;
- while (tmppar != end && tmppar->next) {
- tmppar = tmppar->next;
- tmppar2->next = tmppar->Clone();
- tmppar2->next->id(tmppar->id());
+ while (tmppar != end && tmppar->next_) {
+ tmppar = tmppar->next_;
+ tmppar2->next(tmppar->Clone());
+ tmppar2->next_->id(tmppar->id());
// a memory optimization: Just store the layout
// information when only edit
if (kind == Undo::EDIT){
//tmppar2->next->text.clear();
tmppar2->clearContents();
}
- tmppar2->next->previous = tmppar2;
- tmppar2 = tmppar2->next;
+ tmppar2->next_->previous(tmppar2);
+ tmppar2 = tmppar2->next_;
}
- tmppar2->next = 0;
+ tmppar2->next(0);
} else
undopar = 0; // nothing to replace (undo of delete maybe)
-#ifndef NEW_INSETS
int cursor_par = cursor.par()->ParFromPos(cursor.pos())->id();
int cursor_pos = cursor.par()->PositionInParFromPos(cursor.pos());
#else
+ 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))) {
+ tmppar = start;
+ tmppar2 = tmppar->Clone();
+ tmppar2->id(tmppar->id());
+
+ // a memory optimization: Just store the layout information
+ // when only edit
+ if (kind == Undo::EDIT){
+ //tmppar2->text.clear();
+ tmppar2->clearContents();
+ }
+
+ undopar = tmppar2;
+
+ while (tmppar != end && tmppar->next()) {
+ tmppar = tmppar->next();
+ tmppar2->next(tmppar->Clone());
+ tmppar2->next()->id(tmppar->id());
+ // a memory optimization: Just store the layout
+ // information when only edit
+ if (kind == Undo::EDIT){
+ //tmppar2->next->text.clear();
+ tmppar2->clearContents();
+ }
+ tmppar2->next()->previous(tmppar2);
+ tmppar2 = tmppar2->next();
+ }
+ tmppar2->next(0);
+ } else
+ undopar = 0; // nothing to replace (undo of delete maybe)
+
int cursor_par = cursor.par()->id();
int cursor_pos = cursor.pos();
#endif
-
+
Undo * undo = new Undo(kind,
before_number, behind_number,
cursor_par, cursor_pos,
return;
SetUndo(buf, Undo::FINISH,
#ifndef NEW_INSETS
- cursor.par()->ParFromPos(cursor.pos())->previous,
- cursor.par()->ParFromPos(cursor.pos())->next
+ cursor.par()->ParFromPos(cursor.pos())->previous_,
+ cursor.par()->ParFromPos(cursor.pos())->next_
#else
- cursor.par()->previous,
- cursor.par()->next
+ cursor.par()->previous(),
+ cursor.par()->next()
#endif
);
}
// ensure that we have only one start_of_appendix in this document
LyXParagraph * tmp = FirstParagraph();
- for (; tmp; tmp = tmp->next)
+#ifndef NEW_INSETS
+ for (; tmp; tmp = tmp->next_)
tmp->params.startOfAppendix(false);
+#else
+ for (; tmp; tmp = tmp->next())
+ tmp->params.startOfAppendix(false);
+#endif
par->params.startOfAppendix(start);
// we can set the refreshing parameters now
}
+#ifndef NEW_INSETS
Undo::~Undo()
{
LyXParagraph * tmppar;
while (par) {
tmppar = par;
- par = par->next;
+ par = par->next_;
delete tmppar;
}
}
+#else
+Undo::~Undo()
+{
+ LyXParagraph * tmppar;
+ while (par) {
+ tmppar = par;
+ par = par->next();
+ delete tmppar;
+ }
+}
+#endif
UndoStack::UndoStack()