extern void MenuExport(Buffer *, string const &);
extern LyXAction lyxaction;
extern void MenuExport(Buffer *, string const &);
extern LyXAction lyxaction;
lyx_clean = true;
bak_clean = true;
dvi_clean_orgd = false; // Heinrich Bauer, 23/03/98
dvi_clean_tmpd = false; // Heinrich Bauer, 23/03/98
dep_clean = 0;
read_only = ronly;
lyx_clean = true;
bak_clean = true;
dvi_clean_orgd = false; // Heinrich Bauer, 23/03/98
dvi_clean_tmpd = false; // Heinrich Bauer, 23/03/98
dep_clean = 0;
read_only = ronly;
-// candidate for move to BufferView
-void Buffer::InsetUnlock()
-{
- if (the_locking_inset) {
- if (!inset_slept) the_locking_inset->InsetUnlock();
- the_locking_inset = 0;
- users->text->FinishUndo();
- inset_slept = false;
- }
-}
-
-
-// candidate for move to BufferView
WriteAlert(_("Error!"),
_("Cannot open specified file: "),
MakeDisplayPath(fname, 50));
return false;
}
LyXLex lex(0, 0);
WriteAlert(_("Error!"),
_("Cannot open specified file: "),
MakeDisplayPath(fname, 50));
return false;
}
LyXLex lex(0, 0);
font = LyXFont(LyXFont::ALL_INHERIT);
} else if (token == "\\begin_float") {
tmpret = lex.FindToken(string_footnotekinds);
font = LyXFont(LyXFont::ALL_INHERIT);
} else if (token == "\\begin_float") {
tmpret = lex.FindToken(string_footnotekinds);
if (tmpret != LYX_LAYOUT_DEFAULT)
footnotekind = static_cast<LyXParagraph::footnote_kind>(tmpret); // bad
if (footnotekind == LyXParagraph::FOOTNOTE
if (tmpret != LYX_LAYOUT_DEFAULT)
footnotekind = static_cast<LyXParagraph::footnote_kind>(tmpret); // bad
if (footnotekind == LyXParagraph::FOOTNOTE
} else if (token == "\\end_deeper") {
if (!depth) {
lex.printError("\\end_deeper: "
"depth is already null");
}
else
} else if (token == "\\end_deeper") {
if (!depth) {
lex.printError("\\end_deeper: "
"depth is already null");
}
else
} else if (token == "\\begin_preamble") {
params.readPreamble(lex);
} else if (token == "\\textclass") {
lex.EatLine();
} else if (token == "\\begin_preamble") {
params.readPreamble(lex);
} else if (token == "\\textclass") {
lex.EatLine();
lex.nextToken();
} else if (token == "\\epsfig") { // obsolete
// Indeed it is obsolete, but we HAVE to be backwards
lex.nextToken();
} else if (token == "\\epsfig") { // obsolete
// Indeed it is obsolete, but we HAVE to be backwards
// this is obsolete, so we just skip it.
lex.nextToken();
} else if (token == "\\family") {
// this is obsolete, so we just skip it.
lex.nextToken();
} else if (token == "\\family") {
} else if (token == "\\align") {
tmpret = lex.FindToken(string_align);
if (tmpret == -1) tmpret++;
} else if (token == "\\align") {
tmpret = lex.FindToken(string_align);
if (tmpret == -1) tmpret++;
if (!inscmd.getOptions().empty() || !inscmd.getContents().empty()) {
inset = new InsetRef(inscmd, this);
}
if (!inscmd.getOptions().empty() || !inscmd.getContents().empty()) {
inset = new InsetRef(inscmd, this);
}
- /* This condition comes from a temporary solution
- to the latexdel ref inset that was transformed to an empty ref
- inset plus the body surronded by latexdel insets */
+ // This condition comes from a
+ // temporary solution to the latexdel
+ // ref inset that was transformed to
+ // an empty ref inset plus the body
+ // surronded by latexdel insets
else {
string cont, opt, tmptmptok, cmdname;
lex.next();
else {
string cont, opt, tmptmptok, cmdname;
lex.next();
inset = new InsetPrintIndex(this);
} else if (inscmd.getCmdName() == "lyxparent") {
inset = new InsetParent(inscmd.getContents(), this);
inset = new InsetPrintIndex(this);
} else if (inscmd.getCmdName() == "lyxparent") {
inset = new InsetParent(inscmd.getContents(), this);
// The following three are only for compatibility
if (inscmd.getCmdName() == "-") {
inset = new InsetSpecialChar(InsetSpecialChar::HYPHENATION);
// The following three are only for compatibility
if (inscmd.getCmdName() == "-") {
inset = new InsetSpecialChar(InsetSpecialChar::HYPHENATION);
if (inset) {
par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
if (inset) {
par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
} else if (token == "\\SpecialChar") {
inset = new InsetSpecialChar;
inset->Read(lex);
par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
} else if (token == "\\SpecialChar") {
inset = new InsetSpecialChar;
inset->Read(lex);
par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
} else if (token == "\\Figure") {
inset = new InsetFig(100, 100, this);
inset->Read(lex);
par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
} else if (token == "\\Figure") {
inset = new InsetFig(100, 100, this);
inset->Read(lex);
par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
} else if (token == "\\newline") {
par->InsertChar(pos, LyXParagraph::META_NEWLINE);
par->SetFont(pos, font);
} else if (token == "\\newline") {
par->InsertChar(pos, LyXParagraph::META_NEWLINE);
par->SetFont(pos, font);
} else if (token == "\\LyXTable") {
par->table = new LyXTable(lex);
} else if (token == "\\hfill") {
par->InsertChar(pos, LyXParagraph::META_HFILL);
par->SetFont(pos, font);
} else if (token == "\\LyXTable") {
par->table = new LyXTable(lex);
} else if (token == "\\hfill") {
par->InsertChar(pos, LyXParagraph::META_HFILL);
par->SetFont(pos, font);
} else if (token == "\\protected_separator") {
par->InsertChar(pos, LyXParagraph::META_PROTECTED_SEPARATOR);
par->SetFont(pos, font);
} else if (token == "\\protected_separator") {
par->InsertChar(pos, LyXParagraph::META_PROTECTED_SEPARATOR);
par->SetFont(pos, font);
}else if (token == "\\backslash") {
par->InsertChar(pos, '\\');
par->SetFont(pos, font);
}else if (token == "\\backslash") {
par->InsertChar(pos, '\\');
par->SetFont(pos, font);
bool nice, bool only_body)
{
lyxerr[Debug::LATEX] << "makeLaTeXFile..." << endl;
bool nice, bool only_body)
{
lyxerr[Debug::LATEX] << "makeLaTeXFile..." << endl;
niceFile = nice; // this will be used by Insetincludes.
tex_code_break_column = lyxrc->ascii_linelen;
niceFile = nice; // this will be used by Insetincludes.
tex_code_break_column = lyxrc->ascii_linelen;
}
lyxerr.debug() << "lyx header finished" << endl;
// There are a few differences between nice LaTeX and usual files:
}
lyxerr.debug() << "lyx header finished" << endl;
// There are a few differences between nice LaTeX and usual files:
// special input@path to allow the including of figures
// with either \input or \includegraphics (what figinsets do).
// batchmode is not set if there is a tex_code_break_column.
// special input@path to allow the including of figures
// with either \input or \includegraphics (what figinsets do).
// batchmode is not set if there is a tex_code_break_column.
void Buffer::sgmlOpenTag(ostream & os, int depth,
string const & latexname) const
{
void Buffer::sgmlOpenTag(ostream & os, int depth,
string const & latexname) const
{
-#if 0
- static char const * space[] = {
- " "," ", " ", " ", " ", " ",
- " ",
- " ", " ", " ",
- " "};
- os << space[depth] << "<" << latexname << ">\n";
-#endif
void Buffer::sgmlCloseTag(ostream & os, int depth,
string const & latexname) const
{
void Buffer::sgmlCloseTag(ostream & os, int depth,
string const & latexname) const
{
-#if 0
- static char * space[] = {" ", " ", " ", " ", " ",
- " ", " ", " ",
- " ", " ", " "};
-
- os << space[depth] << "</" << latexname << ">\n";
-#endif
for( ; depth > par->depth; --depth) {
sgmlCloseTag(ofs, depth, environment_stack[depth]);
environment_stack[depth].clear();
}
for( ; depth > par->depth; --depth) {
sgmlCloseTag(ofs, depth, environment_stack[depth]);
environment_stack[depth].clear();
}
void Buffer::push_tag(ostream & os, char const * tag,
int & pos, char stack[5][3])
{
void Buffer::push_tag(ostream & os, char const * tag,
int & pos, char stack[5][3])
{
os << "</" << stack[j] << ">";
/* add new tag */
sprintf(stack[++pos], "%s", tag);
/* push all tags */
os << "</" << stack[j] << ">";
/* add new tag */
sprintf(stack[++pos], "%s", tag);
/* push all tags */
void Buffer::pop_tag(ostream & os, char const * tag,
int & pos, char stack[5][3])
{
void Buffer::pop_tag(ostream & os, char const * tag,
int & pos, char stack[5][3])
{
os << "</" << stack[j] << ">";
// closes the tag
os << "</" << tag << ">";
// push all tags, but the specified one
os << "</" << stack[j] << ">";
// closes the tag
os << "</" << tag << ">";
// push all tags, but the specified one
- for (j = j + 1; j <= pos; ++j) {
- os << "<" << stack[j] << ">";
- strcpy(stack[j-1], stack[j]);
+ for (int i = 0; i <= pos; ++i) {
+ os << "<" << stack[i] << ">";
+ strcpy(stack[i - 1], stack[i]);
LyXCursor tmpcursor = cursor;
cursor.par = tmpcursor.par->ParFromPos(tmpcursor.pos);
cursor.pos = tmpcursor.par->PositionInParFromPos(tmpcursor.pos);
LyXCursor tmpcursor = cursor;
cursor.par = tmpcursor.par->ParFromPos(tmpcursor.pos);
cursor.pos = tmpcursor.par->PositionInParFromPos(tmpcursor.pos);
- /* this is possible now, since SetCursor takes
- care about footnotes */
- users->text->SetCursorIntern(par, 0);
- users->text->RedoParagraphs(users->text->cursor, users->text->cursor.par->Next());
- users->text->FullRebreak();
+ // this is possible now, since SetCursor takes
+ // care about footnotes
+ text->SetCursorIntern(par, 0);
+ text->RedoParagraphs(text->cursor,
+ text->cursor.par->Next());
+ text->FullRebreak();
// Always generate the LaTeX file
makeLaTeXFile(name, org_path, false);
// Always generate the LaTeX file
makeLaTeXFile(name, org_path, false);
} else if ((res & LaTeX::ERRORS)) {
users->owner()->getMiniBuffer()->Set(_("Done"));
// Insert all errors as errors boxes
} else if ((res & LaTeX::ERRORS)) {
users->owner()->getMiniBuffer()->Set(_("Done"));
// Insert all errors as errors boxes
// Dvi should also be kept dirty if the latex run
// ends up with errors. However it should be possible
// Dvi should also be kept dirty if the latex run
// ends up with errors. However it should be possible
} else if ((res & Literate::ERRORS)) {
users->owner()->getMiniBuffer()->Set(_("Done"));
// Insert all errors as errors boxes
} else if ((res & Literate::ERRORS)) {
users->owner()->getMiniBuffer()->Set(_("Done"));
// Insert all errors as errors boxes
// Dvi should also be kept dirty if the latex run
// ends up with errors. However it should be possible
// Dvi should also be kept dirty if the latex run
// ends up with errors. However it should be possible
} else if ((res & Literate::ERRORS)) {
users->owner()->getMiniBuffer()->Set(_("Done"));
// Insert all errors as errors boxes
} else if ((res & Literate::ERRORS)) {
users->owner()->getMiniBuffer()->Set(_("Done"));
// Insert all errors as errors boxes
_("Could not run with file:"), name);
} else if (res > 0) {
// Insert all errors as errors boxes
_("Could not run with file:"), name);
} else if (res > 0) {
// Insert all errors as errors boxes
-extern void AllFloats(char, char);
-
-
-// candidate for move to BufferView
-void Buffer::insertErrors(TeXErrors & terr)
+void BufferView::insertErrors(TeXErrors & terr)
- users->text->SetCursorIntern(texrowpar, tmppos);
- users->text->InsertInset(new_inset);
- users->text->FullRebreak();
+ text->SetCursorIntern(texrowpar, tmppos);
+ text->InsertInset(new_inset);
+ text->FullRebreak();
-// candidate for move to BufferView
-void Buffer::insertInset(Inset * inset, string const & lout,
+void BufferView::insertInset(Inset * inset, string const & lout,
WriteAlert(_("Impossible Operation!"),
_("Cannot insert table/list in table."),
_("Sorry."));
return;
}
// not quite sure if we want this...
WriteAlert(_("Impossible Operation!"),
_("Cannot insert table/list in table."),
_("Sorry."));
return;
}
// not quite sure if we want this...
string Buffer::getReferenceList(char delim)
{
/// if this is a child document and the parent is already loaded
string Buffer::getReferenceList(char delim)
{
/// if this is a child document and the parent is already loaded
string Buffer::getBibkeyList(char delim)
{
/// if this is a child document and the parent is already loaded
string Buffer::getBibkeyList(char delim)
{
/// if this is a child document and the parent is already loaded
/* This is also a buffer property (ale) */
// Not so sure about that. a goto Label function can not be buffer local, just
// think how this will work in a multiwindo/buffer environment, all the
// cursors in all the views showing this buffer will move. (Lgb)
// OK, then no cursor action should be allowed in buffer. (ale)
/* This is also a buffer property (ale) */
// Not so sure about that. a goto Label function can not be buffer local, just
// think how this will work in a multiwindo/buffer environment, all the
// cursors in all the views showing this buffer will move. (Lgb)
// OK, then no cursor action should be allowed in buffer. (ale)
while ((inset = par->ReturnNextInsetPointer(pos))){
for (int i = 0; i < inset->GetNumberOfLabels(); i++) {
if (label == inset->getLabel(i)) {
while ((inset = par->ReturnNextInsetPointer(pos))){
for (int i = 0; i < inset->GetNumberOfLabels(); i++) {
if (label == inset->getLabel(i)) {
- BeforeChange();
- users->text->SetCursor(par, pos);
- users->text->sel_cursor = users->text->cursor;
- users->update(0);
+ beforeChange();
+ text->SetCursor(par, pos);
+ text->sel_cursor = text->cursor;
+ update(0);
{
// Split command string into command and argument
string cmd, line = frontStrip(command);
{
// Split command string into command and argument
string cmd, line = frontStrip(command);