Merge branch 'master' of git.lyx.org:lyx

This commit is contained in:
Uwe Stöhr 2013-04-21 21:18:17 +02:00
commit 7c88c843cb

View File

@ -478,12 +478,17 @@ void putClipboard(ParagraphList const & paragraphs,
// to be so, but the alternative is to construct a new one of these (with a // to be so, but the alternative is to construct a new one of these (with a
// new temporary directory, etc) every time, and then to destroy it. So maybe // new temporary directory, etc) every time, and then to destroy it. So maybe
// it's worth just keeping this one around. // it's worth just keeping this one around.
static Buffer * buffer = theBufferList().newInternalBuffer( Buffer * staticbuffer = theBufferList().newInternalBuffer(
FileName::tempName("clipboard.internal").absFileName()); FileName::tempName("clipboard.internal").absFileName());
// These two things only really need doing the first time. // These two things only really need doing the first time.
buffer->setUnnamed(true); staticbuffer->setUnnamed(true);
buffer->inset().setBuffer(*buffer); staticbuffer->inset().setBuffer(*staticbuffer);
// Use a clone for the complicated stuff so that we do not need to clean
// up in order to avoid a crash.
Buffer * buffer = staticbuffer->cloneBufferOnly();
LASSERT(buffer, return);
// This needs doing every time. // This needs doing every time.
buffer->params().setDocumentClass(docclass); buffer->params().setDocumentClass(docclass);
@ -494,6 +499,11 @@ void putClipboard(ParagraphList const & paragraphs,
ErrorList el; ErrorList el;
pasteSelectionHelper(dit, paragraphs, docclass, el); pasteSelectionHelper(dit, paragraphs, docclass, el);
// We don't want to produce images that are not used. Therefore,
// output formulas as MathML. Even if this is not understood by all
// applications, the number that can parse it should go up in the future.
buffer->params().html_math_output = BufferParams::MathML;
// The Buffer is being used to export. This is necessary so that the // The Buffer is being used to export. This is necessary so that the
// updateMacros call will record the needed information. // updateMacros call will record the needed information.
MarkAsExporting mex(buffer); MarkAsExporting mex(buffer);
@ -516,7 +526,7 @@ void putClipboard(ParagraphList const & paragraphs,
theClipboard().put(lyx, oshtml.str(), plaintext); theClipboard().put(lyx, oshtml.str(), plaintext);
// Save that memory // Save that memory
buffer->paragraphs().clear(); delete buffer;
} }