tmpbuf->eraseChar(i--, false);
}
- tmpbuf->setChange(Change(buffer.params().track_changes ?
- Change::INSERTED : Change::UNCHANGED));
+ if (lyxrc.ct_markup_copied)
+ tmpbuf->setChange(Change(buffer.params().track_changes ?
+ Change::INSERTED : Change::UNCHANGED));
}
bool const empty = pars[pit].empty();
void putClipboard(ParagraphList const & paragraphs,
- DocumentClassConstPtr docclass, docstring const & plaintext)
+ DocumentClassConstPtr docclass, docstring const & plaintext,
+ BufferParams const bp)
{
Buffer * buffer = copyToTempBuffer(paragraphs, docclass);
if (!buffer) // already asserted in copyToTempBuffer()
// applications, the number that can parse it should go up in the future.
buffer->params().html_math_output = BufferParams::MathML;
+ if (lyxrc.ct_markup_copied) {
+ // Copy authors to the params. We need those pointers.
+ for (Author const & a : bp.authors())
+ buffer->params().authors().record(a);
+ }
+
// Make sure MarkAsExporting is deleted before buffer is
{
// The Buffer is being used to export. This is necessary so that the
// do not copy text (also nested in insets) which is marked as
// deleted, unless the whole selection was deleted
- if (!isFullyDeleted(copy_pars))
- acceptChanges(copy_pars, buf.params());
- else
- rejectChanges(copy_pars, buf.params());
+ if (!lyxrc.ct_markup_copied) {
+ if (!isFullyDeleted(copy_pars))
+ acceptChanges(copy_pars, buf.params());
+ else
+ rejectChanges(copy_pars, buf.params());
+ }
// do some final cleanup now, to make sure that the paragraphs
// Even if there is no selection.
if (putclip)
putClipboard(cuts[0].first, cuts[0].second,
- cur.selectionAsString(true, true));
+ cur.selectionAsString(true, true), bp);
}
if (begpit != endpit)
theCuts.push(make_pair(pars, bp.documentClassPtr()));
// stuff the selection onto the X clipboard, from an explicit copy request
- putClipboard(theCuts[0].first, theCuts[0].second, plaintext);
+ putClipboard(theCuts[0].first, theCuts[0].second, plaintext, bp);
}
}
// stuff the selection onto the X clipboard, from an explicit copy request
- putClipboard(theCuts[0].first, theCuts[0].second, plaintext);
+ putClipboard(theCuts[0].first, theCuts[0].second, plaintext,
+ cur.buffer()->params());
}
void pasteParagraphList(Cursor & cur, ParagraphList const & parlist,
- DocumentClassConstPtr docclass, ErrorList & errorList,
- cap::BranchAction branchAction)
+ DocumentClassConstPtr docclass, ErrorList & errorList,
+ cap::BranchAction branchAction)
{
if (cur.inTexted()) {
Text * text = cur.text();