* src/bufferparams.h: make author_map use an unsigned index, to avoid

a warning.

	* src/text.C (readParToken): handle \change_inserted and
	\change_deleted tokens with wrong author index (bug 2614).



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14028 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2006-06-07 17:05:25 +00:00
parent 6bdbfecce3
commit 459303729c
2 changed files with 17 additions and 3 deletions

View File

@ -223,7 +223,7 @@ public:
AuthorList const & authors() const;
/// map of the file's author IDs to buffer author IDs
std::vector<int> author_map;
std::vector<unsigned int> author_map;
///
std::string const dvips_options() const;
///

View File

@ -328,14 +328,28 @@ void readParToken(Buffer const & buf, Paragraph & par, LyXLex & lex,
int aid;
lyx::time_type ct;
is >> aid >> ct;
change = Change(Change::INSERTED, bp.author_map[aid], ct);
if (aid >= bp.author_map.size()) {
buf.error(ErrorItem(_("Change tracking error"),
bformat(_("Unknown author index for insertion: %1$d\n"), aid),
par.id(), 0, par.size()));
change = Change(Change::UNCHANGED);
} else
change = Change(Change::INSERTED, bp.author_map[aid], ct);
} else if (token == "\\change_deleted") {
lex.eatLine();
std::istringstream is(lex.getString());
int aid;
lyx::time_type ct;
is >> aid >> ct;
change = Change(Change::DELETED, bp.author_map[aid], ct);
if (aid >= bp.author_map.size()) {
buf.error(ErrorItem(_("Change tracking error"),
bformat(_("Unknown author index for deletion: %1$d\n"), aid),
par.id(), 0, par.size()));
change = Change(Change::UNCHANGED);
} else
change = Change(Change::DELETED, bp.author_map[aid], ct);
} else {
lex.eatLine();
buf.error(ErrorItem(_("Unknown token"),