mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 21:40:19 +00:00
Fix too general application of \cprotect
This commit is contained in:
parent
001f5a4786
commit
e3a72156f9
@ -1042,10 +1042,15 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
|
|||||||
if (open_font && (!inset->inheritFont() || inset->allowMultiPar())) {
|
if (open_font && (!inset->inheritFont() || inset->allowMultiPar())) {
|
||||||
bool closeLanguage = arabtex
|
bool closeLanguage = arabtex
|
||||||
|| basefont.isRightToLeft() == running_font.isRightToLeft();
|
|| basefont.isRightToLeft() == running_font.isRightToLeft();
|
||||||
|
InsetText const * textinset = inset->asInsetText();
|
||||||
|
bool const cprotect = textinset
|
||||||
|
? textinset->hasCProtectContent(runparams.moving_arg)
|
||||||
|
&& !textinset->text().isMainText()
|
||||||
|
: false;
|
||||||
unsigned int count = running_font.latexWriteStartChanges(os, bparams,
|
unsigned int count = running_font.latexWriteStartChanges(os, bparams,
|
||||||
runparams, basefont,
|
runparams, basefont,
|
||||||
running_font, true,
|
running_font, true,
|
||||||
owner_->needsCProtection(runparams.moving_arg));
|
cprotect);
|
||||||
column += count;
|
column += count;
|
||||||
// if any font properties were closed, update the running_font,
|
// if any font properties were closed, update the running_font,
|
||||||
// making sure, however, to leave the language as it was
|
// making sure, however, to leave the language as it was
|
||||||
@ -2659,9 +2664,14 @@ void Paragraph::latex(BufferParams const & bparams,
|
|||||||
}
|
}
|
||||||
otexstringstream ots;
|
otexstringstream ots;
|
||||||
if (!multipar_inset) {
|
if (!multipar_inset) {
|
||||||
|
InsetText const * textinset = inInset().asInsetText();
|
||||||
|
bool const cprotect = textinset
|
||||||
|
? textinset->hasCProtectContent(runparams.moving_arg)
|
||||||
|
&& !textinset->text().isMainText()
|
||||||
|
: false;
|
||||||
column += current_font.latexWriteStartChanges(ots, bparams,
|
column += current_font.latexWriteStartChanges(ots, bparams,
|
||||||
runparams, basefont, last_font, false,
|
runparams, basefont, last_font, false,
|
||||||
needsCProtection(runparams.moving_arg));
|
cprotect);
|
||||||
}
|
}
|
||||||
// Check again for display math in ulem commands as a
|
// Check again for display math in ulem commands as a
|
||||||
// font change may also occur just before a math inset.
|
// font change may also occur just before a math inset.
|
||||||
|
Loading…
Reference in New Issue
Block a user