)
{
bool the_end_read = false;
+#ifdef NO_LATEX
+ static string inset_ert_contents;
+#endif
#ifndef NO_PEXTRA_REALLY
// This is super temporary but is needed to get the compability
// mode for minipages work correctly together with new tabulars.
checkminipage = true;
} else if (token == "\\i") {
Inset * inset = new InsetLatexAccent;
- inset->Read(this, lex);
+ inset->read(this, lex);
par->insertInset(pos, inset, font);
++pos;
} else if (token == "\\layout") {
+#ifdef NO_LATEX
+ // Do the insetert.
+ if (!inset_ert_contents.empty()) {
+ Inset * inset = new InsetERT(inset_ert_contents);
+ par->insertInset(pos, inset, font);
+ ++pos;
+ inset_ert_contents.erase();
+ }
+#endif
lex.EatLine();
string const layoutname = lex.GetString();
pair<bool, LyXTextClass::LayoutList::size_type> pp
istringstream istr(old_float.str());
LyXLex nylex(0, 0);
nylex.setStream(istr);
- inset->Read(this, nylex);
+ inset->read(this, nylex);
par->insertInset(pos, inset, font);
++pos;
} else if (token == "\\begin_deeper") {
} else if (token == "\\size") {
lex.next();
font.setLyXSize(lex.GetString());
+#ifndef NO_LATEX
+#ifdef WITH_WARNINGS
+#warning compatability hack needed
+#endif
} else if (token == "\\latex") {
lex.next();
string const tok = lex.GetString();
else
lex.printError("Unknown LaTeX font flag "
"`$$Token'");
+#else
+ } else if (token == "\\latex") {
+ lex.next();
+ string const tok = lex.GetString();
+ if (tok == "no_latex") {
+ ; // nothing
+ } else if (tok == "latex") {
+ ; // nothing
+ } else if (tok == "default") {
+ ; // nothing
+ } else {
+ lex.printError("Unknown LaTeX font flag "
+ "`$$Token'");
+ }
+#endif
} else if (token == "\\lang") {
lex.next();
string const tok = lex.GetString();
}
} else {
Inset * inset = new InsetSpecialChar;
- inset->Read(this, lex);
+ inset->read(this, lex);
par->insertInset(pos, inset, font);
}
++pos;
++pos;
} else if (token == "\\LyXTable") {
Inset * inset = new InsetTabular(*this);
- inset->Read(this, lex);
+ inset->read(this, lex);
par->insertInset(pos, inset, font);
++pos;
// because of OLD_TABULAR_READ where tabulars have been
InsetCommandParams p("bibitem", "dummy");
par->bibkey = new InsetBibKey(p);
}
- par->bibkey->Read(this, lex);
+ par->bibkey->read(this, lex);
} else if (token == "\\backslash") {
par->insertChar(pos, '\\', font);
++pos;
// test the different insets
if (tmptok == "LatexCommand") {
InsetCommandParams inscmd;
- inscmd.Read(lex);
+ inscmd.read(lex);
string const cmdName = inscmd.getCmdName();
inset = new InsetFloatList;
}
- if (inset) inset->Read(this, lex);
+ if (inset) inset->read(this, lex);
}
if (inset) {
} else {
lyxerr << "Should this ever happen?" << endl;
}
-
+
+#ifndef NO_LATEX
LyXFont const font1 = LyXFont(LyXFont::ALL_INHERIT, params.language);
+#endif
for (Paragraph::size_type i = 0; i < par->size(); ++i) {
if (!i && !noparbreak) {
if (linelen > 0)
currlinelen += (ltype_depth-depth)*2;
}
}
+#ifndef NO_LATEX
LyXFont const font2 = par->getFontSettings(params, i);
if (font1.latex() != font2.latex()) {
if (font2.latex() == LyXFont::OFF)
} else {
islatex = 0;
}
+#endif
char c = par->getUChar(params, i);
if (islatex)
{
Inset const * inset = par->getInset(i);
if (inset) {
- if (!inset->Ascii(this, buffer)) {
+ if (!inset->ascii(this, buffer)) {
string dummy;
string const s =
rsplit(buffer.str().c_str(),
} else if (c != '\0')
buffer << c;
else if (c == '\0')
- lyxerr.debug() << "writeAsciiFile: NULL char in structure." << endl;
+ lyxerr[Debug::INFO] << "writeAsciiFile: NULL char in structure." << endl;
++currlinelen;
break;
}
texrow.newline();
texrow.newline();
}
- lyxerr.debug() << "lyx header finished" << endl;
+ lyxerr[Debug::INFO] << "lyx header finished" << endl;
// There are a few differences between nice LaTeX and usual files:
// usual is \batchmode and has a
// special input@path to allow the including of figures
ofs << "\\begin{document}\n";
texrow.newline();
} // only_body
- lyxerr.debug() << "preamble finished, now the body." << endl;
+ lyxerr[Debug::INFO] << "preamble finished, now the body." << endl;
if (!lyxrc.language_auto_begin) {
ofs << subst(lyxrc.language_command_begin, "$$lang",
lyxerr << "File was not closed properly." << endl;
}
- lyxerr.debug() << "Finished making latex file." << endl;
+ lyxerr[Debug::INFO] << "Finished making latex file." << endl;
}
string const & latexname) const
{
if (!latexname.empty() && latexname != "!-- --")
- os << string(depth, ' ') << "<" << latexname << ">\n";
+ os << "<!-- " << depth << " -->" << "<" << latexname << ">";
+ //os << string(depth, ' ') << "<" << latexname << ">\n";
}
string const & latexname) const
{
if (!latexname.empty() && latexname != "!-- --")
- os << string(depth, ' ') << "</" << latexname << ">\n";
+ os << "<!-- " << depth << " -->" << "</" << latexname << ">\n";
+ //os << string(depth, ' ') << "</" << latexname << ">\n";
}
// treat <toc> as a special case for compatibility with old code
if (par->getChar(0) == Paragraph::META_INSET) {
Inset * inset = par->getInset(0);
- Inset::Code lyx_code = inset->LyxCode();
+ Inset::Code lyx_code = inset->lyxCode();
if (lyx_code == Inset::TOC_CODE){
string const temp = "toc";
sgmlOpenTag(ofs, depth, temp);
case LATEX_COMMAND:
if (depth!= 0)
- LinuxDocError(par, 0,
+ linuxDocError(par, 0,
_("Error : Wrong depth for"
" LatexType Command.\n"));
break;
}
- SimpleLinuxDocOnePar(ofs, par, depth);
+ simpleLinuxDocOnePar(ofs, par, depth);
par = par->next();
}
-void Buffer::DocBookHandleCaption(ostream & os, string & inner_tag,
+void Buffer::docBookHandleCaption(ostream & os, string & inner_tag,
Paragraph::depth_type depth, int desc_on,
Paragraph * & par)
{
"Caption").second) {
sgmlOpenTag(os, depth + 1, inner_tag);
string extra_par;
- SimpleDocBookOnePar(os, extra_par, tpar,
+ simpleDocBookOnePar(os, extra_par, tpar,
desc_on, depth + 2);
sgmlCloseTag(os, depth+1, inner_tag);
if (!extra_par.empty())
// Handle internal paragraph parsing -- layout already processed.
-void Buffer::SimpleLinuxDocOnePar(ostream & os,
+void Buffer::simpleLinuxDocOnePar(ostream & os,
Paragraph * par,
Paragraph::depth_type /*depth*/)
{
if (c == Paragraph::META_INSET) {
Inset * inset = par->getInset(i);
- inset->Linuxdoc(this, os);
+ inset->linuxdoc(this, os);
font_old = font;
continue;
}
- if (font.latex() == LyXFont::ON || style.latexparam() == "CDATA") {
+ if (
+#ifndef NO_LATEX
+ font.latex() == LyXFont::ON ||
+#endif
+ style.latexparam() == "CDATA") {
// "TeX"-Mode on == > SGML-Mode on.
if (c != '\0')
os << c;
// Print an error message.
-void Buffer::LinuxDocError(Paragraph * par, int pos,
+void Buffer::linuxDocError(Paragraph * par, int pos,
string const & message)
{
// insert an error marker in text
case LATEX_COMMAND:
if (depth != 0)
- LinuxDocError(par, 0,
+ linuxDocError(par, 0,
_("Error : Wrong depth for "
"LatexType Command.\n"));
// more WYSIWYM handling.
if (par->getChar(0) == Paragraph::META_INSET) {
Inset * inset = par->getInset(0);
- Inset::Code lyx_code = inset->LyxCode();
+ Inset::Code lyx_code = inset->lyxCode();
if (lyx_code == Inset::LABEL_CODE){
command_name += " id=\"";
command_name += (static_cast<InsetCommand *>(inset))->getContents();
}
string extra_par;
- SimpleDocBookOnePar(ofs, extra_par, par, desc_on,
+ simpleDocBookOnePar(ofs, extra_par, par, desc_on,
depth + 1 + command_depth);
par = par->next();
}
-void Buffer::SimpleDocBookOnePar(ostream & os, string & extra,
+void Buffer::simpleDocBookOnePar(ostream & os, string & extra,
Paragraph * par, int & desc_on,
Paragraph::depth_type depth) const
{
LyXFont font_old = style.labeltype == LABEL_MANUAL ? style.labelfont : style.font;
int char_line_count = depth;
- if (!style.free_spacing)
- os << string(depth,' ');
+ //if (!style.free_spacing)
+ // os << string(depth,' ');
// parsing main loop
for (Paragraph::size_type i = 0;
if (c == Paragraph::META_INSET) {
Inset * inset = par->getInset(i);
std::ostringstream ost;
- inset->DocBook(this, ost);
+ inset->docBook(this, ost);
string tmp_out = ost.str().c_str();
//
else
os << tmp_out;
}
+#ifndef NO_LATEX
} else if (font.latex() == LyXFont::ON) {
// "TeX"-Mode on ==> SGML-Mode on.
if (c != '\0')
os << c;
++char_line_count;
+#endif
} else {
string sgml_string;
if (par->linuxDocConvertChar(c, sgml_string)
// <term> not closed...
os << "</term>";
}
- os << '\n';
+ if(style.free_spacing) os << '\n';
}
{
if (!users->text) return 0;
- ProhibitInput(users);
+ users->owner()->prohibitInput();
// get LaTeX-Filename
string const name = getLatexName();
users->redraw();
users->fitCursor(users->text);
}
- AllowInput(users);
+ users->owner()->allowInput();
return res;
}
string lst;
for (inset_iterator it = inset_iterator_begin();
it != inset_iterator_end(); ++it) {
- if ((*it)->LyxCode() == Inset::INCLUDE_CODE) {
+ if ((*it)->lyxCode() == Inset::INCLUDE_CODE) {
InsetInclude * insetinc =
static_cast<InsetInclude *>(*it);
if (insetinc->isIncludeOnly()) {
}
}
}
- lyxerr.debug() << "Includeonly(" << lst << ')' << endl;
+ lyxerr[Debug::INFO] << "Includeonly(" << lst << ')' << endl;
return lst;
}
par->inset_iterator_end();
for (; it != end; ++it) {
- if ((*it)->LyxCode() == Inset::FLOAT_CODE) {
+ if ((*it)->lyxCode() == Inset::FLOAT_CODE) {
InsetFloat * il =
static_cast<InsetFloat*>(*it);
for (inset_iterator it = inset_iterator_begin();
it != inset_iterator_end(); ++it) {
// Search for Bibtex or Include inset
- if ((*it)->LyxCode() == Inset::BIBTEX_CODE) {
+ if ((*it)->lyxCode() == Inset::BIBTEX_CODE) {
vector<pair<string,string> > tmp =
static_cast<InsetBibtex*>(*it)->getKeys(this);
keys.insert(keys.end(), tmp.begin(), tmp.end());
- } else if ((*it)->LyxCode() == Inset::INCLUDE_CODE) {
+ } else if ((*it)->lyxCode() == Inset::INCLUDE_CODE) {
vector<pair<string,string> > const tmp =
static_cast<InsetInclude*>(*it)->getKeys();
keys.insert(keys.end(), tmp.begin(), tmp.end());
}
-bool Buffer::Dispatch(string const & command)
+bool Buffer::dispatch(string const & command)
{
// Split command string into command and argument
string cmd;
string line = frontStrip(command);
string const arg = strip(frontStrip(split(line, cmd, ' ')));
- return Dispatch(lyxaction.LookupFunc(cmd), arg);
+ return dispatch(lyxaction.LookupFunc(cmd), arg);
}
-bool Buffer::Dispatch(int action, string const & argument)
+bool Buffer::dispatch(int action, string const & argument)
{
bool dispatched = true;
switch (action) {
}
-void Buffer::ChangeLanguage(Language const * from, Language const * to)
+void Buffer::changeLanguage(Language const * from, Language const * to)
{
Paragraph * par = paragraph;
it = par->InsetIterator(pos);
if (it == par->inset_iterator_end()) {
par = par->next();
- SetParagraph();
+ setParagraph();
}
}
-void Buffer::inset_iterator::SetParagraph()
+void Buffer::inset_iterator::setParagraph()
{
while (par) {
it = par->inset_iterator_begin();