d->texrow.reset();
if (!only_body) {
- os << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"" <<
- " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
+ os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+ os << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN\" \"http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd\">\n";
// FIXME Language should be set properly.
- os << "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n";
+ os << "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
// FIXME Header
os << "<head>\n";
// FIXME Presumably need to set this right
os << "</head>\n<body>\n";
}
+ XHTMLStream xs(os);
params().documentClass().counters().reset();
- xhtmlParagraphs(text(), *this, os, runparams);
+ xhtmlParagraphs(text(), *this, xs, runparams);
if (!only_body)
os << "</body>\n</html>\n";
}
lyx::dispatch(FuncRequest(LFUN_DIALOG_SHOW, "sendto"));
break;
}
- doExport(argument, false);
bool success = doExport(argument, false);
dr.setError(success);
if (!success)
int AutoSaveBuffer::generateChild()
{
+#if defined(__APPLE__)
+ /* FIXME fork() is not usable for autosave on Mac OS X 10.6 (snow leopard)
+ * We should use something else like threads.
+ *
+ * Since I do not know how to determine at run time what is the OS X
+ * version, I just disable forking altogether for now (JMarc)
+ */
+ pid_t const pid = -1;
+#else
// tmp_ret will be located (usually) in /tmp
// will that be a problem?
// Note that this calls ForkedCalls::fork(), so it's
// you should set pid to -1, and comment out the fork.
if (pid != 0 && pid != -1)
return pid;
+#endif
// pid = -1 signifies that lyx was unable
// to fork. But we will do the save
updateMacroInstances();
// Plain text backend
- if (backend_format == "text")
+ if (backend_format == "text") {
+ runparams.flavor = OutputParams::TEXT;
writePlaintextFile(*this, FileName(filename), runparams);
+ }
// HTML backend
else if (backend_format == "xhtml") {
runparams.flavor = OutputParams::HTML;
vector<string> Buffer::backends() const
{
vector<string> v;
- if (params().baseClass()->isTeXClassAvailable()) {
- v.push_back(bufferFormat());
- // FIXME: Don't hardcode format names here, but use a flag
- if (v.back() == "latex")
- v.push_back("pdflatex");
- }
+ v.push_back(bufferFormat());
+ // FIXME: Don't hardcode format names here, but use a flag
+ if (v.back() == "latex")
+ v.push_back("pdflatex");
v.push_back("xhtml");
v.push_back("text");
v.push_back("lyx");
// set the label of a paragraph. This includes the counters.
-static void setLabel(Buffer const & buf, ParIterator & it)
+void Buffer::setLabel(ParIterator & it) const
{
- BufferParams const & bp = buf.masterBuffer()->params();
+ BufferParams const & bp = this->masterBuffer()->params();
DocumentClass const & textclass = bp.documentClass();
Paragraph & par = it.paragraph();
Layout const & layout = par.layout();
string const & type = counters.current_float();
docstring full_label;
if (type.empty())
- full_label = buf.B_("Senseless!!! ");
+ full_label = this->B_("Senseless!!! ");
else {
- docstring name = buf.B_(textclass.floats().getType(type).name());
+ docstring name = this->B_(textclass.floats().getType(type).name());
if (counters.hasCounter(from_utf8(type))) {
string const & lang = par.getParLanguage(bp)->code();
counters.step(from_utf8(type));
maxdepth = parit->getMaxDepthAfter();
// set the counter for this paragraph
- setLabel(*this, parit);
+ setLabel(parit);
// Now the insets
InsetList::const_iterator iit = parit->insetList().begin();