mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-28 06:49:43 +00:00
Make sure MarkAsExporting is deleted before buffer
This fixes a crash when cutting something.
This commit is contained in:
parent
ea118f2da5
commit
e115b006e6
@ -504,26 +504,29 @@ void putClipboard(ParagraphList const & paragraphs,
|
|||||||
// applications, the number that can parse it should go up in the future.
|
// applications, the number that can parse it should go up in the future.
|
||||||
buffer->params().html_math_output = BufferParams::MathML;
|
buffer->params().html_math_output = BufferParams::MathML;
|
||||||
|
|
||||||
// The Buffer is being used to export. This is necessary so that the
|
// Make sure MarkAsExporting is deleted before buffer is
|
||||||
// updateMacros call will record the needed information.
|
{
|
||||||
MarkAsExporting mex(buffer);
|
// The Buffer is being used to export. This is necessary so that the
|
||||||
|
// updateMacros call will record the needed information.
|
||||||
|
MarkAsExporting mex(buffer);
|
||||||
|
|
||||||
buffer->updateBuffer(Buffer::UpdateMaster, OutputUpdate);
|
buffer->updateBuffer(Buffer::UpdateMaster, OutputUpdate);
|
||||||
buffer->updateMacros();
|
buffer->updateMacros();
|
||||||
buffer->updateMacroInstances(OutputUpdate);
|
buffer->updateMacroInstances(OutputUpdate);
|
||||||
|
|
||||||
// LyX's own format
|
// LyX's own format
|
||||||
string lyx;
|
string lyx;
|
||||||
ostringstream oslyx;
|
ostringstream oslyx;
|
||||||
if (buffer->write(oslyx))
|
if (buffer->write(oslyx))
|
||||||
lyx = oslyx.str();
|
lyx = oslyx.str();
|
||||||
|
|
||||||
// XHTML format
|
// XHTML format
|
||||||
odocstringstream oshtml;
|
odocstringstream oshtml;
|
||||||
OutputParams runparams(encodings.fromLyXName("utf8"));
|
OutputParams runparams(encodings.fromLyXName("utf8"));
|
||||||
buffer->writeLyXHTMLSource(oshtml, runparams, Buffer::FullSource);
|
buffer->writeLyXHTMLSource(oshtml, runparams, Buffer::FullSource);
|
||||||
|
|
||||||
theClipboard().put(lyx, oshtml.str(), plaintext);
|
theClipboard().put(lyx, oshtml.str(), plaintext);
|
||||||
|
}
|
||||||
|
|
||||||
// Save that memory
|
// Save that memory
|
||||||
delete buffer;
|
delete buffer;
|
||||||
|
Loading…
Reference in New Issue
Block a user