X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FChanges.cpp;h=29471f244af1405d6501efb0ff439260444c5d5b;hb=449c766e03d94ddf6c823cfcae845f76f83c0e1c;hp=4292f1bd886b1e5e9a8c9d13961ab835febbf3ba;hpb=5a4363c0f56780cbf83306d2f5c5451897528050;p=lyx.git diff --git a/src/Changes.cpp b/src/Changes.cpp index 4292f1bd88..29471f244a 100644 --- a/src/Changes.cpp +++ b/src/Changes.cpp @@ -27,6 +27,7 @@ #include "support/gettext.h" #include "support/lassert.h" #include "support/lstrings.h" +#include "support/mutex.h" #include "frontends/alert.h" @@ -348,9 +349,7 @@ docstring getLaTeXMarkup(docstring const & macro, docstring const & author, if (macro.empty()) return docstring(); - // FIXME THREAD - static docstring warned_author = docstring(); - docstring uncodable_author = warned_author; + docstring uncodable_author; odocstringstream ods; ods << macro; @@ -367,8 +366,12 @@ docstring getLaTeXMarkup(docstring const & macro, docstring const & author, ods << author_latexed.first << "}{" << chgTime << "}{"; // warn user (once) if we found uncodable glyphs. - if (uncodable_author != warned_author) { - frontend::Alert::warning(_("Uncodable character in author name"), + if (!uncodable_author.empty()) { + static std::set warned_authors; + static Mutex warned_mutex; + Mutex::Locker locker(&warned_mutex); + if (warned_authors.find(uncodable_author) == warned_authors.end()) { + frontend::Alert::warning(_("Uncodable character in author name"), support::bformat(_("The author name '%1$s',\n" "used for change tracking, contains the following glyphs that\n" "cannot be represented in the current encoding: %2$s.\n" @@ -376,7 +379,8 @@ docstring getLaTeXMarkup(docstring const & macro, docstring const & author, "Choose an appropriate document encoding (such as utf8)\n" "or change the spelling of the author name."), uncodable_author, author_latexed.second)); - warned_author = uncodable_author; + warned_authors.insert(uncodable_author); + } } return ods.str(); @@ -389,7 +393,7 @@ int Changes::latexMarkChange(otexstream & os, BufferParams const & bparams, Change const & oldChange, Change const & change, OutputParams const & runparams) { - if (!bparams.outputChanges || oldChange == change) + if (!bparams.output_changes || oldChange == change) return 0; int column = 0;