#include "support/filetools.h"
#include "support/gettext.h"
#include "support/Messages.h"
+#include "support/mutex.h"
#include "support/Translator.h"
#include "support/lstrings.h"
};
-static char const * const string_footnotekinds[] = {
- "footnote", "margin", "fig", "tab", "alg", "wide-fig", "wide-tab", ""
-};
-
-
static char const * const tex_graphics[] = {
"default", "dvialw", "dvilaser", "dvipdf", "dvipdfm", "dvipdfmx",
"dvips", "dvipsone", "dvitops", "dviwin", "dviwindo", "dvi2ps", "emtex",
biblio_style = "plain";
use_bibtopic = false;
use_indices = false;
- trackChanges = false;
- outputChanges = false;
+ track_changes = false;
+ output_changes = false;
use_default_options = true;
maintain_unincluded_children = false;
secnumdepth = 3;
map<string, string> const & BufferParams::auto_packages()
{
- // FIXME THREAD
- // It is extremely unlikely that there could be a problem here, but...
static map<string, string> packages;
if (packages.empty()) {
+ // We could have a race condition here that two threads
+ // discover an empty map at the same time and want to fill
+ // it, but that is no problem, since the same contents is
+ // filled in twice then. Having the locker inside the
+ // packages.empty() condition has the advantage that we
+ // don't need the mutex overhead for simple reading.
+ static Mutex mutex;
+ Mutex::Locker locker(&mutex);
// adding a package here implies a file format change!
packages["amsmath"] =
N_("The LaTeX package amsmath is only used if AMS formula types or symbols from the AMS math toolbars are inserted into formulas");
} else if (token == "\\use_indices") {
lex >> use_indices;
} else if (token == "\\tracking_changes") {
- lex >> trackChanges;
+ lex >> track_changes;
} else if (token == "\\output_changes") {
- lex >> outputChanges;
+ lex >> output_changes;
} else if (token == "\\branch") {
lex.eatLine();
docstring branch = lex.getDocString();
}
}
- os << "\\tracking_changes " << convert<string>(trackChanges) << '\n'
- << "\\output_changes " << convert<string>(outputChanges) << '\n'
+ os << "\\tracking_changes " << convert<string>(track_changes) << '\n'
+ << "\\output_changes " << convert<string>(output_changes) << '\n'
<< "\\html_math_output " << html_math_output << '\n'
<< "\\html_css_as_file " << html_css_as_file << '\n'
<< "\\html_be_strict " << convert<string>(html_be_strict) << '\n';
if (columns > 1 && language->rightToLeft())
features.require("rtloutputdblcol");
- if (outputChanges) {
+ if (output_changes) {
bool dvipost = LaTeXFeatures::isAvailable("dvipost");
bool xcolorulem = LaTeXFeatures::isAvailable("ulem") &&
LaTeXFeatures::isAvailable("xcolor");
}
-OutputParams::FLAVOR BufferParams::getOutputFlavor(string const format) const
+OutputParams::FLAVOR BufferParams::getOutputFlavor(string const & format) const
{
string const dformat = (format.empty() || format == "default") ?
getDefaultOutputFormat() : format;
}
-InsetQuotes::QuoteLanguage BufferParams::getQuoteStyle(string const qs) const
+InsetQuotes::QuoteLanguage BufferParams::getQuoteStyle(string const & qs) const
{
return quoteslangtranslator().find(qs);
}