mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
* 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:
parent
6bdbfecce3
commit
459303729c
@ -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;
|
||||
///
|
||||
|
18
src/text.C
18
src/text.C
@ -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"),
|
||||
|
Loading…
Reference in New Issue
Block a user