Fix non-BibTeX detection of "author (year)" labels.

Jurgen, this one is actually for branch, too.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33142 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-01-21 19:48:53 +00:00
parent ca40daccb0
commit 9a327ccc51

View File

@ -217,7 +217,11 @@ docstring const BibTeXInfo::getAbbreviatedAuthor() const
return docstring(); return docstring();
docstring authors; docstring authors;
split(opt, authors, '('); docstring const remainder = trim(split(opt, authors, '('));
if (remainder.empty())
// in this case, we didn't find a "(",
// so we don't have author (year)
return docstring();
return authors; return authors;
} }
@ -254,9 +258,12 @@ docstring const BibTeXInfo::getYear() const
return docstring(); return docstring();
docstring authors; docstring authors;
docstring const tmp = split(opt, authors, '('); docstring tmp = split(opt, authors, '(');
if (tmp.empty())
// we don't have author (year)
return docstring();
docstring year; docstring year;
split(tmp, year, ')'); tmp = split(tmp, year, ')');
return year; return year;
} }