docstring before, docstring after, docstring dialog, bool next) const
{
// incorrect use of macros could put us in an infinite loop
- static int max_passes = 5000;
+ static int const max_passes = 5000;
// the use of overly large keys can lead to performance problems, due
// to eventual attempts to convert LaTeX macros to unicode. See bug
// #8944. This is perhaps not the best solution, but it will have to
/// Creates the per buffer temporary directory
static FileName createBufferTmpDir()
{
+ // FIXME THREAD
static int count;
// We are in our own directory. Why bother to mangle name?
// In fact I wrote this code to circumvent a problematic behaviour
FileNameList const & BufferList::fileNames() const
{
+ // FIXME THREAD
static FileNameList nvec;
nvec.clear();
BufferStorage::const_iterator it = bstore.begin();
ParSepTranslator const & parseptranslator()
{
- static ParSepTranslator translator = init_parseptranslator();
+ static ParSepTranslator const translator =
+ init_parseptranslator();
return translator;
}
QuotesLangTranslator const & quoteslangtranslator()
{
- static QuotesLangTranslator translator = init_quoteslangtranslator();
+ static QuotesLangTranslator const translator =
+ init_quoteslangtranslator();
return translator;
}
PaperSizeTranslator const & papersizetranslator()
{
- static PaperSizeTranslator translator = initPaperSizeTranslator();
+ static PaperSizeTranslator const translator =
+ initPaperSizeTranslator();
return translator;
}
PaperOrientationTranslator const & paperorientationtranslator()
{
- static PaperOrientationTranslator translator = init_paperorientationtranslator();
+ static PaperOrientationTranslator const translator =
+ init_paperorientationtranslator();
return translator;
}
SidesTranslator const & sidestranslator()
{
- static SidesTranslator translator = init_sidestranslator();
+ static SidesTranslator const translator = init_sidestranslator();
return translator;
}
PackageTranslator const & packagetranslator()
{
- static PackageTranslator translator = init_packagetranslator();
+ static PackageTranslator const translator =
+ init_packagetranslator();
return translator;
}
CiteEngineTypeTranslator const & citeenginetypetranslator()
{
- static CiteEngineTypeTranslator translator = init_citeenginetypetranslator();
+ static CiteEngineTypeTranslator const translator =
+ init_citeenginetypetranslator();
return translator;
}
SpaceTranslator const & spacetranslator()
{
- static SpaceTranslator translator = init_spacetranslator();
+ static SpaceTranslator const translator = init_spacetranslator();
return translator;
}
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()) {
// adding a package here implies a file format change!
case LFUN_WORD_FIND_FORWARD:
case LFUN_WORD_FIND_BACKWARD: {
+ // FIXME THREAD
+ // Would it maybe be better if this variable were view specific anyway?
static docstring last_search;
docstring searched_string;
if (macro.empty())
return docstring();
+ // FIXME THREAD
static docstring warned_author = docstring();
docstring uncodable_author = warned_author;
odocstringstream ods;
}
+// FIXME THREAD
+// This should be OK because it is only assigned during init()
static FileName cache_dir;
// to be so, but the alternative is to construct a new one of these (with a
// new temporary directory, etc) every time, and then to destroy it. So maybe
// it's worth just keeping this one around.
+ // FIXME THREAD
static Buffer * staticbuffer = theBufferList().newInternalBuffer(
FileName::tempName("clipboard.internal").absFileName());
#ifdef HAVE_EXCEPTIONS
throw UnknownFloatType(t);
#else
- static Floating empty_float;
+ static Floating const empty_float;
return empty_float;
#endif
}
}
-Font & FontList::get(pos_type pos)
+Font const & FontList::get(pos_type pos)
{
iterator end = list_.end();
iterator it = fontIterator(pos);
if (it != end && it->pos() == pos)
return it->font_;
- static Font dummy;
+
+ static Font const dummy;
return dummy;
}
///
const_iterator fontIterator(pos_type pos) const;
///
- Font & get(pos_type pos);
+ Font const & get(pos_type pos);
///
void set(pos_type pos, Font const & font);
///
};
+// FIXME THREAD
/// Mapping absolute pathnames of files to their ZippedInfo metadata.
static std::map<std::string, ZippedInfo> zipped_;
FlavorTranslator const & flavorTranslator()
{
- static FlavorTranslator translator = initFlavorTranslator();
+ static FlavorTranslator const translator = initFlavorTranslator();
return translator;
}
if (cit->prefixes) {
// this is a prefix key - set new map
seq->curmap = cit->prefixes.get();
- static FuncRequest prefix(LFUN_COMMAND_PREFIX);
+ static const FuncRequest prefix(LFUN_COMMAND_PREFIX);
return prefix;
} else {
// final key - reset map
FileName const fn = FileName(makeAbsPath(tmp));
ifstream ifs(fn.toFilesystemEncoding().c_str());
bool fle_style = false;
- static regex file_line_error(".+\\.\\D+:[0-9]+: (.+)");
- static regex child_file(".*([0-9]+[A-Za-z]*_.+\\.tex).*");
+ static regex const file_line_error(".+\\.\\D+:[0-9]+: (.+)");
+ static regex const child_file(".*([0-9]+[A-Za-z]*_.+\\.tex).*");
// Flag for 'File ended while scanning' message.
// We need to wait for subsequent processing.
string wait_for_error;
// (and in addition to those above)
if (regex_match(token, sub, reg5)) {
// search for strings in <...>
- static regex reg5_1("<([^>]+)(.)");
+ static regex const reg5_1("<([^>]+)(.)");
fragment_pos = iterateLine(token, reg5_1, ">",
fragment_pos, head);
fragment = (fragment_pos != -1);
// where "File: file.ext" would be skipped
if (regex_match(token, sub, reg6)) {
// search for strings in (...)
- static regex reg6_1("\\(([^()]+)(.)");
+ static regex const reg6_1("\\(([^()]+)(.)");
fragment_pos = iterateLine(token, reg6_1, ")",
fragment_pos, head);
fragment = (fragment_pos != -1);
void LaTeXFeatures::useLayout(docstring const & layoutname)
{
// Some code to avoid loops in dependency definition
+ // FIXME THREAD
static int level = 0;
const int maxlevel = 30;
if (level > maxlevel) {
void Layout::readEndLabelType(Lexer & lex)
{
+ // this should be const, but can't be because
+ // of PushPopHelper.
static LexerKeyword endlabelTypeTags[] = {
{ "box", END_LABEL_BOX },
{ "filled_box", END_LABEL_FILLED_BOX },
Buffer * newUnnamedFile(FileName const & path, string const & prefix,
string const & templatename)
{
+ // FIXME THREAD
static map<string, int> file_number;
FileName filename;
static vector<string> const & allManualsFiles()
{
- static vector<string> v;
static const char * files[] = {
"Intro", "UserGuide", "Tutorial", "Additional",
"EmbeddedObjects", "Math", "Customization", "Shortcuts",
"LFUNs", "LaTeXConfig"
};
+
+ static vector<string> v;
if (v.empty()) {
FileName fname;
for (size_t i = 0; i < sizeof(files) / sizeof(files[0]); ++i) {
v.push_back(fname.absFileName());
}
}
+
return v;
}
namespace lyx {
namespace frontend {
+// FIXME THREAD
+// I am guessing that it would not hurt to make these private members.
static vector<string> citeCmds_;
static vector<CitationStyle> citeStyles_;
docstring field, docstring entry_type,
bool case_sensitive, bool reg_exp, bool reset)
{
+ // FIXME THREAD
// Used for optimisation: store last searched string.
static QString last_searched_string;
// Used to disable the above optimisation.
map<string, MathSymbol>::const_iterator it =
math_symbols_.find(tex_name);
- static MathSymbol unknown_symbol;
+ static MathSymbol const unknown_symbol;
if (it == math_symbols_.end())
return unknown_symbol;
map<char_type, string>::const_iterator it =
tex_names_.find(math_symbol);
- static string empty_string;
+ static string const empty_string;
if (it == tex_names_.end())
return empty_string;
{
// use a cache here to avoid repeated validation
// of the same parameters
+ // FIXME THREAD
static string param_cache;
static QString msg_cache;
void GuiDocument::setListingsMessage()
{
+ // FIXME THREAD
static bool isOK = true;
QString msg = validateListingsParameters();
if (msg.isEmpty()) {
bool FontLoader::available(FontInfo const & f)
{
+ // FIXME THREAD
static vector<int> cache_set(NUM_FAMILIES, false);
static vector<int> cache(NUM_FAMILIES, false);
size_t const rorigin_size = sizeof(rorigin_lyx_strs) / sizeof(char *);
-static string autostr = N_("automatically");
+static string const autostr = N_("automatically");
} // namespace anon
{
// use a cache here to avoid repeated validation
// of the same parameters
+ // FIXME THREAD
static string param_cache = string();
static docstring msg_cache = docstring();
void GuiInclude::setListingsMsg()
{
+ // FIXME THREAD
static bool isOK = true;
docstring msg = validate_listings_params();
if (msg.empty()) {
{
// use a cache here to avoid repeated validation
// of the same parameters
+ // FIXME THREAD
static string param_cache;
static docstring msg_cache;
void GuiListings::setListingsMsg()
{
+ // FIXME THREAD
static bool isOK = true;
docstring msg = validate_listings_params();
if (msg.empty()) {
return;
// double the size if needed
+ // FIXME THREAD
static QVector<QPoint> points(32);
if (np > points.size())
points.resize(2 * np);
if (haveMultiParSelection()) {
// FIXME: in case of multi-paragraph selection, it would be nice to
// initialise the parameters that are common to all paragraphs.
- static ParagraphParameters empty;
+ static ParagraphParameters const empty;
return empty;
}
return bufferview()->cursor().innerParagraph().params();
QString getBlock(char_type c)
{
// store an educated guess for the next search
+ // FIXME THREAD
static int lastBlock = 0;
// "clever reset"
static QString const strCharacter = qt_("Character: ");
static QString const strCodePoint = qt_("Code Point: ");
+ // FIXME THREAD
static char codeName[10];
char_type c = symbols_.at(index.row());
view->buffer().getSourceCode(ostr, format, par_begin, par_end + 1,
output, master);
docstring s = ostr.str();
+ // FIXME THREAD
+ // Could this be private to this particular dialog? We could have
+ // more than one of these, in different windows.
static size_t crc = 0;
size_t newcrc = crcCheck(s);
if (newcrc == crc && !force_getcontent)
stopBlinkingCursor();
// last_width : for checking if last preedit string was/wasn't empty.
+ // FIXME THREAD
+ // We could have more than one work area, right?
static bool last_width = false;
if (!last_width && preedit_string.empty()) {
// if last_width is last length of preedit string.
<< "\n--------------------------------------\n");
// Output the script to file.
+ // FIXME THREAD
static int counter = 0;
script_file_ = FileName(onlyPath(to_file_base) + "lyxconvert" +
convert<string>(counter++) + ".py");
// Create a temporary base file-name for all intermediate steps.
// Remember to remove the temp file because we only want the name...
+ // FIXME THREAD
static int counter = 0;
string const tmp = "gconvert" + convert<string>(counter++);
string const to_base = FileName::tempName(tmp).toFilesystemEncoding();
//static int s_numimages_ = 5;
//static int s_millisecs_ = 500;
+// FIXME THREAD
static int s_numimages_ = 10;
static int s_millisecs_ = 500;
string const unique_filename(string const & bufferpath)
{
+ // FIXME THREAD
static int theCounter = 0;
string const filename = lyx::convert<string>(theCounter++) + "lyxpreview";
return addName(bufferpath, filename);
return ptr;
}
+ // FIXME THREAD
static bool first = true;
if (first) {
first = false;
if (wait) {
ForkedCall call(buffer_.filePath());
int ret = call.startScript(ForkedProcess::Wait, command);
+ // FIXME THREAD
static int fake = (2^20) + 1;
int pid = fake++;
inprogress.pid = pid;
namespace lyx {
+// FIXME THREAD
int InsetBibitem::key_counter = 0;
docstring const key_prefix = from_ascii("key-");
BoxTranslator const & boxtranslator()
{
- static BoxTranslator translator = initBoxtranslator();
+ static BoxTranslator const translator = initBoxtranslator();
return translator;
}
BoxTranslatorLoc const & boxtranslator_loc()
{
- static BoxTranslatorLoc translator = initBoxtranslatorLoc();
+ static BoxTranslatorLoc const translator = initBoxtranslatorLoc();
return translator;
}
IPADecoTranslator const & ipadecotranslator()
{
- static IPADecoTranslator decotranslator = init_ipadecotranslator();
+ static IPADecoTranslator const decotranslator =
+ init_ipadecotranslator();
return decotranslator;
}
IPADecoTranslatorLoc const & ipadecotranslator_loc()
{
- static IPADecoTranslatorLoc translator = init_ipadecotranslator_loc();
+ static IPADecoTranslatorLoc const translator =
+ init_ipadecotranslator_loc();
return translator;
}
IPACharTranslator const & ipachartranslator()
{
- static IPACharTranslator chartranslator = init_ipachartranslator();
+ static IPACharTranslator const chartranslator =
+ init_ipachartranslator();
return chartranslator;
}
docstring const uniqueID()
{
+ // FIXME THREAD
static unsigned int seed = 1000;
return "file" + convert<docstring>(++seed);
}
NoteTranslator const & notetranslator()
{
- static NoteTranslator translator = init_notetranslator();
+ static NoteTranslator const translator = init_notetranslator();
return translator;
}
PhantomTranslator const & phantomtranslator()
{
- static PhantomTranslator translator = init_phantomtranslator();
+ static PhantomTranslator const translator =
+ init_phantomtranslator();
return translator;
}
PhantomTranslatorLoc const & phantomtranslator_loc()
{
- static PhantomTranslatorLoc translator = init_phantomtranslator_loc();
+ static PhantomTranslatorLoc const translator =
+ init_phantomtranslator_loc();
return translator;
}
}
-InsetRef::type_info InsetRef::types[] = {
+InsetRef::type_info const InsetRef::types[] = {
{ "ref", N_("Standard"), N_("Ref: ")},
{ "eqref", N_("Equation"), N_("EqRef: ")},
{ "pageref", N_("Page Number"), N_("Page: ")},
///
std::string short_gui_name;
};
- static type_info types[];
+ static const type_info types[];
///
static int getType(std::string const & name);
///
ScriptTranslator const & scripttranslator()
{
- static ScriptTranslator translator = init_scripttranslator();
+ static ScriptTranslator const translator =
+ init_scripttranslator();
return translator;
}
ScriptTranslatorLoc const & scripttranslator_loc()
{
- static ScriptTranslatorLoc translator = init_scripttranslator_loc();
+ static ScriptTranslatorLoc const translator =
+ init_scripttranslator_loc();
return translator;
}
CJK
};
+// FIXME THREAD
+// There could easily be a conflict here, with the export process
+// setting this one way, and a View>Source process (possbily for
+// another Buffer) resetting it.
static int open_encoding_ = none;
static int cjk_inherited_ = 0;
Language const * prev_env_language_ = 0;
docstring const sgml::uniqueID(docstring const label)
{
+ // FIXME THREAD
+ // It seems unlikely there could be a problem here,
+ // but we could have concurrent access, in principle.
static unsigned int seed = 1000;
return label + convert<docstring>(++seed);
}
docstring content;
+ // FIXME THREAD
typedef map<docstring, docstring> MangledMap;
static MangledMap mangledNames;
static int mangleID = 1;
string DocFileName::mangledFileName(string const & dir) const
{
+ // FIXME THREAD
+ // Concurrent access to these variables is possible.
+
// We need to make sure that every DocFileName instance for a given
// filename returns the same mangled name.
typedef map<string, string> MangledMap;
// Add the extension back on
mname = support::changeExtension(mname, getExtension(name));
+ // FIXME THREAD
// Prepend a counter to the filename. This is necessary to make
// the mangled name unique.
static int counter = 0;
};
-static ProgressInterface* progress_instance = 0;
+static ProgressInterface * progress_instance = 0;
void ProgressInterface::setInstance(ProgressInterface* p)
{
}
-ProgressInterface* ProgressInterface::instance()
+ProgressInterface * ProgressInterface::instance()
{
if (!progress_instance) {
static ProgressDummy dummy;
{
string const name = n;
// find the last occurence of /src/ in name
- static regex re("[\\/]src[\\/]");
+ static const regex re("[\\/]src[\\/]");
string::const_iterator const begin = name.begin();
string::const_iterator it = begin;
string::const_iterator const end = name.end();
// the argument of putenv() needs to be static, because changing its
// value will change the environment. Therefore we need a different static
// storage for each variable.
+ // FIXME THREAD
static map<string, string> varmap;
varmap[name] = name + '=' + encoded;
return ::putenv(const_cast<char*>(varmap[name].c_str())) == 0;
// $[A-Za-z_][A-Za-z_0-9]*
static string const envvar = "[$]([A-Za-z_][A-Za-z_0-9]*)";
- static regex envvar_br_re("(.*)" + envvar_br + "(.*)");
- static regex envvar_re("(.*)" + envvar + "(.*)");
+ static regex const envvar_br_re("(.*)" + envvar_br + "(.*)");
+ static regex const envvar_re("(.*)" + envvar + "(.*)");
string result = path;
while (1) {
smatch what;
// without #include "support/docstring" there.
docstring const & empty_docstring()
{
- static docstring s;
+ static const docstring s;
return s;
}
// without #include <string>
string const & empty_string()
{
- static string s;
+ static const string s;
return s;
}
string const python(bool reset)
{
+ // FIXME THREAD
// Check whether the first python in PATH is the right one.
static string command = python2("python -tt");
if (reset) {