X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsgml.cpp;h=75802c2bd44d2113da87253c0c31ffb0fc267df0;hb=f3ee4a0a493fa96be99f5bbc7ee9de00a5f69b34;hp=3153ce37200113934c4eaafa5fe9c405d64fc0b3;hpb=fdbe775b9f5468e8f53dc83a66583f412b5970fb;p=lyx.git diff --git a/src/sgml.cpp b/src/sgml.cpp index 3153ce3720..75802c2bd4 100644 --- a/src/sgml.cpp +++ b/src/sgml.cpp @@ -28,6 +28,7 @@ #include "support/textutils.h" #include +#include using namespace std; using namespace lyx::support; @@ -102,7 +103,7 @@ docstring sgml::escapeString(docstring const & raw) } -docstring const sgml::uniqueID(docstring const label) +docstring const sgml::uniqueID(docstring const & label) { // FIXME THREAD // It seems unlikely there could be a problem here, @@ -135,10 +136,11 @@ docstring sgml::cleanID(Buffer const & buf, OutputParams const & runparams, docstring content; - // FIXME THREAD typedef map MangledMap; - static MangledMap mangledNames; - static int mangleID = 1; + static QThreadStorage tMangledNames; + static QThreadStorage tMangleID; + + MangledMap & mangledNames = tMangledNames.localData(); MangledMap::const_iterator const known = mangledNames.find(orig); if (known != mangledNames.end()) @@ -167,9 +169,10 @@ docstring sgml::cleanID(Buffer const & buf, OutputParams const & runparams, } } - if (mangle) + if (mangle) { + int & mangleID = tMangleID.localData(); content += "-" + convert(mangleID++); - else if (isDigitASCII(content[content.size() - 1])) + } else if (isDigitASCII(content[content.size() - 1])) content += "."; mangledNames[orig] = content;