mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 05:25:26 +00:00
Correctly track ulem commands with change tracking
LyX assumes that everything in \lyxdeleted is struck out by ulem and increases the corresponding counter. However, deleted display math material is struck out using tikz. As we also take into account the deletion of underlined display math (in order to properly position such material vertically), we have to take care that the count is correct.
This commit is contained in:
parent
9ba76e6c40
commit
dea5ba16de
@ -428,7 +428,7 @@ int Changes::latexMarkChange(otexstream & os, BufferParams const & bparams,
|
|||||||
// close \lyxadded or \lyxdeleted
|
// close \lyxadded or \lyxdeleted
|
||||||
os << '}';
|
os << '}';
|
||||||
column++;
|
column++;
|
||||||
if (oldChange.type == Change::DELETED)
|
if (oldChange.type == Change::DELETED && !runparams.wasDisplayMath)
|
||||||
--runparams.inulemcmd;
|
--runparams.inulemcmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -440,7 +440,8 @@ int Changes::latexMarkChange(otexstream & os, BufferParams const & bparams,
|
|||||||
docstring macro_beg;
|
docstring macro_beg;
|
||||||
if (change.type == Change::DELETED) {
|
if (change.type == Change::DELETED) {
|
||||||
macro_beg = from_ascii("\\lyxdeleted{");
|
macro_beg = from_ascii("\\lyxdeleted{");
|
||||||
++runparams.inulemcmd;
|
if (!runparams.inDisplayMath)
|
||||||
|
++runparams.inulemcmd;
|
||||||
}
|
}
|
||||||
else if (change.type == Change::INSERTED)
|
else if (change.type == Change::INSERTED)
|
||||||
macro_beg = from_ascii("\\lyxadded{");
|
macro_beg = from_ascii("\\lyxadded{");
|
||||||
|
@ -23,7 +23,7 @@ OutputParams::OutputParams(Encoding const * enc)
|
|||||||
moving_arg(false), intitle(false), inulemcmd(0), local_font(0), master_language(0),
|
moving_arg(false), intitle(false), inulemcmd(0), local_font(0), master_language(0),
|
||||||
encoding(enc), free_spacing(false), use_babel(false), use_polyglossia(false),
|
encoding(enc), free_spacing(false), use_babel(false), use_polyglossia(false),
|
||||||
use_indices(false), use_japanese(false), linelen(0), depth(0),
|
use_indices(false), use_japanese(false), linelen(0), depth(0),
|
||||||
exportdata(new ExportData), inDisplayMath(false),
|
exportdata(new ExportData), inDisplayMath(false), wasDisplayMath(false),
|
||||||
inComment(false), inTableCell(NO), inFloat(NONFLOAT),
|
inComment(false), inTableCell(NO), inFloat(NONFLOAT),
|
||||||
inIndexEntry(false), inIPA(false), inDeletedInset(0),
|
inIndexEntry(false), inIPA(false), inDeletedInset(0),
|
||||||
changeOfDeletedInset(Change::UNCHANGED),
|
changeOfDeletedInset(Change::UNCHANGED),
|
||||||
|
@ -187,11 +187,16 @@ public:
|
|||||||
*/
|
*/
|
||||||
std::shared_ptr<ExportData> exportdata;
|
std::shared_ptr<ExportData> exportdata;
|
||||||
|
|
||||||
/** Whether we are inside a display math inset.
|
/** Whether we are entering a display math inset.
|
||||||
* Needed to correctly strike out deleted math in change tracking.
|
* Needed to correctly strike out deleted math in change tracking.
|
||||||
*/
|
*/
|
||||||
mutable bool inDisplayMath;
|
mutable bool inDisplayMath;
|
||||||
|
|
||||||
|
/** Whether we are leaving a display math inset.
|
||||||
|
* Needed to correctly track nested ulem commands in change tracking.
|
||||||
|
*/
|
||||||
|
mutable bool wasDisplayMath;
|
||||||
|
|
||||||
/** Whether we are inside a comment inset. Insets that are including
|
/** Whether we are inside a comment inset. Insets that are including
|
||||||
* external files like InsetGraphics, InsetInclude and InsetExternal
|
* external files like InsetGraphics, InsetInclude and InsetExternal
|
||||||
* may only write the usual output and must not attempt to do
|
* may only write the usual output and must not attempt to do
|
||||||
|
@ -2389,6 +2389,7 @@ void Paragraph::latex(BufferParams const & bparams,
|
|||||||
runparams);
|
runparams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
runparams.wasDisplayMath = runparams.inDisplayMath;
|
||||||
runparams.inDisplayMath = false;
|
runparams.inDisplayMath = false;
|
||||||
bool deleted_display_math = false;
|
bool deleted_display_math = false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user