* src/OutputParams.h:

* src/Paragraph.cpp:
	* src/OutputParams.cpp: fix LaTeX output in change tracking mode:
	text inside logically deleted insets must always be output as logically
	deleted


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19164 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Michael Schmitt 2007-07-21 18:10:55 +00:00
parent cce9cfc975
commit 31494ad259
3 changed files with 23 additions and 1 deletions

View File

@ -23,6 +23,7 @@ OutputParams::OutputParams(Encoding const * enc)
linelen(0), depth(0), linelen(0), depth(0),
exportdata(new ExportData), exportdata(new ExportData),
inComment(false), inComment(false),
inDeletedInset(0), changeOfDeletedInset(Change::UNCHANGED),
par_begin(0), par_end(0), par_begin(0), par_end(0),
dryrun(false) dryrun(false)
{} {}

View File

@ -16,6 +16,7 @@
#include "support/types.h" #include "support/types.h"
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include "Changes.h"
namespace lyx { namespace lyx {
@ -120,6 +121,16 @@ public:
*/ */
bool inComment; bool inComment;
/** Whether we are inside an inset that is logically deleted.
* A value > 0 indicates a deleted inset.
*/
int inDeletedInset;
/** The change information of the outermost logically deleted inset.
* changeOfDeletedInset shall only be evaluated if inDeletedInset > 0.
*/
Change changeOfDeletedInset;
/** allow output of only part of the top-level paragraphs /** allow output of only part of the top-level paragraphs
* par_begin: beginning paragraph * par_begin: beginning paragraph
*/ */

View File

@ -726,6 +726,11 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
break; break;
} }
if (lookupChange(i).type == Change::DELETED) {
if( ++runparams.inDeletedInset == 1)
runparams.changeOfDeletedInset = lookupChange(i);
}
if (inset->canTrackChanges()) { if (inset->canTrackChanges()) {
column += Changes::latexMarkChange(os, bparams, running_change, column += Changes::latexMarkChange(os, bparams, running_change,
Change(Change::UNCHANGED)); Change(Change::UNCHANGED));
@ -801,6 +806,10 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
} else { } else {
column += os.tellp() - len; column += os.tellp() - len;
} }
if (lookupChange(i).type == Change::DELETED) {
--runparams.inDeletedInset;
}
} }
break; break;
@ -2039,7 +2048,8 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
runparams.moving_arg); runparams.moving_arg);
} }
Change const & change = pimpl_->lookupChange(i); Change const & change = runparams.inDeletedInset ? runparams.changeOfDeletedInset
: pimpl_->lookupChange(i);
if (bparams.outputChanges && runningChange != change) { if (bparams.outputChanges && runningChange != change) {
if (open_font) { if (open_font) {