Michael Gerz schrieb:
Guys,
with Dov's latest patch (#1820) committed, I was able to produce a CT
patch that does not touch the present (non-)const-ness of OutputParams.
Since I consider this bug a major CT bug (text inside deleted insets
is displayed as unchanged text), I would like you to reconsider the
patch for 1.5.0.
In a certain sense, it is a one-liner because it effects current
behavior only with this statement:
- Change const & change = pimpl_->lookupChange(i);
+ Change const & change = runparams.inDeletedInset ?
runparams.changeOfDeletedInset
+ :
pimpl_->lookupChange(i);
Implementation notes:
In order to fix the bug, it is necessary to pass information down the
call stack. Prior to #1820, it would have been possible to make a
local copy of the (const) outputparams, modify them locally, and pass
the modified params down. However, it turns out that Dov needs to pass
information _up_. Therefore, IMHO it is not a good idea to create
local copies of outputParams in the same method. Instead, I modify the
needed parameter at the beginning and reset them at the end
(increment/decrement of inDeletedInset).
BTW: If you still don't like to add this information to OutputParams, I
have to add more parameters to several methods, e.g. to:
void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
BufferParams const & bparams,
odocstream & os,
TexRow & texrow,
OutputParams & runparams,
Font & running_font,
Font & basefont,
Font const & outerfont,
bool & open_font,
Change & running_change,
Layout const & style,
pos_type & i,
unsigned int & column,
value_type const c)
IMHO 14 parameters are enough. Don't you think that a container like
OutputParams is the better solution?
Michael