185 files changed:
-std::ostream & operator<<(std::ostream & os, Author const & a)
+ostream & operator<<(ostream & os, Author const & a)
{
// FIXME UNICODE
os << "\"" << to_utf8(a.name()) << "\" " << to_utf8(a.email());
return os;
}
{
// FIXME UNICODE
os << "\"" << to_utf8(a.name()) << "\" " << to_utf8(a.email());
return os;
}
-std::istream & operator>>(std::istream & is, Author & a)
+istream & operator>>(istream & is, Author & a)
{
string s;
getline(is, s);
{
string s;
getline(is, s);
//////////////////////////////////////////////////////////////////////
namespace {
//////////////////////////////////////////////////////////////////////
namespace {
-// A functor for use with std::sort, leading to case insensitive sorting
- class compareNoCase: public std::binary_function<docstring, docstring, bool>
+// A functor for use with sort, leading to case insensitive sorting
+ class compareNoCase: public binary_function<docstring, docstring, bool>
{
public:
bool operator()(docstring const & s1, docstring const & s2) const {
{
public:
bool operator()(docstring const & s1, docstring const & s2) const {
BiblioInfo::const_iterator it = begin();
for (; it != end(); ++it)
bibkeys.push_back(it->first);
BiblioInfo::const_iterator it = begin();
for (; it != end(); ++it)
bibkeys.push_back(it->first);
- std::sort(bibkeys.begin(), bibkeys.end(), compareNoCase());
+ sort(bibkeys.begin(), bibkeys.end(), compareNoCase());
set<docstring>::const_iterator end = fieldNames.end();
for (; it != end; ++it)
bibfields.push_back(*it);
set<docstring>::const_iterator end = fieldNames.end();
for (; it != end; ++it)
bibfields.push_back(*it);
- std::sort(bibfields.begin(), bibfields.end());
+ sort(bibfields.begin(), bibfields.end());
set<docstring>::const_iterator end = entryTypes.end();
for (; it != end; ++it)
bibentries.push_back(*it);
set<docstring>::const_iterator end = entryTypes.end();
for (; it != end; ++it)
bibentries.push_back(*it);
- std::sort(bibentries.begin(), bibentries.end());
+ sort(bibentries.begin(), bibentries.end());
}
char const * const * const last = citeCommands + nCiteCommands;
}
char const * const * const last = citeCommands + nCiteCommands;
- char const * const * const ptr = std::find(citeCommands, last, cmd);
+ char const * const * const ptr = find(citeCommands, last, cmd);
if (ptr != last) {
size_t idx = ptr - citeCommands;
if (ptr != last) {
size_t idx = ptr - citeCommands;
string cite = citeCommands[style];
if (full) {
CiteStyle const * last = citeStylesFull + nCiteStylesFull;
string cite = citeCommands[style];
if (full) {
CiteStyle const * last = citeStylesFull + nCiteStylesFull;
- if (std::find(citeStylesFull, last, style) != last)
+ if (find(citeStylesFull, last, style) != last)
cite += '*';
}
if (forceUCase) {
CiteStyle const * last = citeStylesUCase + nCiteStylesUCase;
cite += '*';
}
if (forceUCase) {
CiteStyle const * last = citeStylesUCase + nCiteStylesUCase;
- if (std::find(citeStylesUCase, last, style) != last)
+ if (find(citeStylesUCase, last, style) != last)
{
return os << "x1,y1: " << b.x1 << ',' << b.y1
<< " x2,y2: " << b.x2 << ',' << b.y2
{
return os << "x1,y1: " << b.x1 << ',' << b.y1
<< " x2,y2: " << b.x2 << ',' << b.y2
Branch * BranchList::find(docstring const & name)
{
List::iterator it =
Branch * BranchList::find(docstring const & name)
{
List::iterator it =
- std::find_if(list.begin(), list.end(), BranchNamesEqual(name));
+ find_if(list.begin(), list.end(), BranchNamesEqual(name));
return it == list.end() ? 0 : &*it;
}
return it == list.end() ? 0 : &*it;
}
Branch const * BranchList::find(docstring const & name) const
{
List::const_iterator it =
Branch const * BranchList::find(docstring const & name) const
{
List::const_iterator it =
- std::find_if(list.begin(), list.end(), BranchNamesEqual(name));
+ find_if(list.begin(), list.end(), BranchNamesEqual(name));
return it == list.end() ? 0 : &*it;
}
return it == list.end() ? 0 : &*it;
}
name = s.substr(i, j - i);
// Is this name already in the list?
bool const already =
name = s.substr(i, j - i);
// Is this name already in the list?
bool const already =
- std::find_if(list.begin(), list.end(),
+ find_if(list.begin(), list.end(),
BranchNamesEqual(name)) != list.end();
if (!already) {
added = true;
BranchNamesEqual(name)) != list.end();
if (!already) {
added = true;
-typedef std::map<string, bool> DepClean;
+typedef map<string, bool> DepClean;
mutable TocBackend toc_backend;
/// macro table
mutable TocBackend toc_backend;
/// macro table
- typedef std::map<unsigned int, MacroData, std::greater<int> > PositionToMacroMap;
- typedef std::map<docstring, PositionToMacroMap> NameToPositionMacroMap;
+ typedef map<unsigned int, MacroData, greater<int> > PositionToMacroMap;
+ typedef map<docstring, PositionToMacroMap> NameToPositionMacroMap;
NameToPositionMacroMap macros;
/// Container for all sort of Buffer dependant errors.
NameToPositionMacroMap macros;
/// Container for all sort of Buffer dependant errors.
-bool Buffer::readString(std::string const & s)
+bool Buffer::readString(string const & s)
{
params().compressed = false;
// remove dummy empty par
paragraphs().clear();
Lexer lex(0, 0);
{
params().compressed = false;
// remove dummy empty par
paragraphs().clear();
Lexer lex(0, 0);
- std::istringstream is(s);
lex.setStream(is);
FileName const name(tempName());
switch (readFile(lex, name, true)) {
lex.setStream(is);
FileName const name(tempName());
switch (readFile(lex, name, true)) {
return false;
case wrongversion: {
// We need to call lyx2lyx, so write the input to a file
return false;
case wrongversion: {
// We need to call lyx2lyx, so write the input to a file
- std::ofstream os(name.toFilesystemEncoding().c_str());
+ ofstream os(name.toFilesystemEncoding().c_str());
os << s;
os.close();
return readFile(name);
os << s;
os.close();
return readFile(name);
{
#ifdef HAVE_LOCALE
// Use the standard "C" locale for file output.
{
#ifdef HAVE_LOCALE
// Use the standard "C" locale for file output.
- ofs.imbue(std::locale::classic());
+ ofs.imbue(locale::classic());
#endif
// The top of the file should not be written by params().
#endif
// The top of the file should not be written by params().
lyxerr << "Caught iconv exception: " << e.what() << endl;
failed_export = true;
}
lyxerr << "Caught iconv exception: " << e.what() << endl;
failed_export = true;
}
- catch (std::exception const & e) {
+ catch (exception const & e) {
lyxerr << "Caught \"normal\" exception: " << e.what() << endl;
failed_export = true;
}
lyxerr << "Caught \"normal\" exception: " << e.what() << endl;
failed_export = true;
}
pars[i].setMacrocontextPosition(i);
//lyxerr << "searching main par " << i
pars[i].setMacrocontextPosition(i);
//lyxerr << "searching main par " << i
- // << " for macro definitions" << std::endl;
+ // << " for macro definitions" << endl;
InsetList const & insets = pars[i].insetList();
InsetList::const_iterator it = insets.begin();
InsetList::const_iterator end = insets.end();
InsetList const & insets = pars[i].insetList();
InsetList::const_iterator it = insets.begin();
InsetList::const_iterator end = insets.end();
paramName = "reference";
}
paramName = "reference";
}
- if (std::count(labels.begin(), labels.end(), from) > 1)
+ if (count(labels.begin(), labels.end(), from) > 1)
return;
for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) {
return;
for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) {
ErrorList & Buffer::errorList(string const & type) const
{
static ErrorList emptyErrorList;
ErrorList & Buffer::errorList(string const & type) const
{
static ErrorList emptyErrorList;
- std::map<string, ErrorList>::iterator I = d->errorLists.find(type);
+ map<string, ErrorList>::iterator I = d->errorLists.find(type);
if (I == d->errorLists.end())
return emptyErrorList;
if (I == d->errorLists.end())
return emptyErrorList;
-void Buffer::errors(std::string const & err) const
+void Buffer::errors(string const & err) const
{
if (gui_)
gui_->errors(err);
{
if (gui_)
gui_->errors(err);
-int BufferList::bufferNum(std::string const & name) const
+int BufferList::bufferNum(string const & name) const
{
vector<string> buffers = getFileNames();
vector<string>::const_iterator cit =
{
vector<string> buffers = getFileNames();
vector<string>::const_iterator cit =
- std::find(buffers.begin(), buffers.end(), name);
+ find(buffers.begin(), buffers.end(), name);
if (cit == buffers.end())
return 0;
return int(cit - buffers.begin());
if (cit == buffers.end())
return 0;
return int(cit - buffers.begin());
-typedef Translator<std::string, PAPER_SIZE> PaperSizeTranslator;
+typedef Translator<string, PAPER_SIZE> PaperSizeTranslator;
PaperSizeTranslator const init_papersizetranslator()
PaperSizeTranslator const init_papersizetranslator()
-std::vector<string> const & BufferParams::getModules() const {
+vector<string> const & BufferParams::getModules() const {
-bool BufferParams::addLayoutModules(std::vector<string>modNames)
+bool BufferParams::addLayoutModules(vector<string>modNames)
- std::vector<string>::const_iterator it = modNames.begin();
- std::vector<string>::const_iterator end = modNames.end();
+ vector<string>::const_iterator it = modNames.begin();
+ vector<string>::const_iterator end = modNames.end();
for (; it != end; ++it)
retval &= addLayoutModule(*it, false);
makeTextClass();
for (; it != end; ++it)
retval &= addLayoutModule(*it, false);
makeTextClass();
// Create a list with all the input encodings used
// in the document
// Create a list with all the input encodings used
// in the document
- std::set<string> encodings =
+ set<string> encodings =
features.getEncodingSet(doc_encoding);
// When the encodings EUC-JP-plain, JIS-plain, or SJIS-plainare used, the
features.getEncodingSet(doc_encoding);
// When the encodings EUC-JP-plain, JIS-plain, or SJIS-plainare used, the
if (!encodings.empty() || package == Encoding::inputenc) {
os << "\\usepackage[";
if (!encodings.empty() || package == Encoding::inputenc) {
os << "\\usepackage[";
- std::set<string>::const_iterator it = encodings.begin();
- std::set<string>::const_iterator const end = encodings.end();
+ set<string>::const_iterator it = encodings.begin();
+ set<string>::const_iterator const end = encodings.end();
if (it != end) {
os << from_ascii(*it);
++it;
if (it != end) {
os << from_ascii(*it);
++it;
/// A map from a Text to the associated text metrics
/// A map from a Text to the associated text metrics
-typedef std::map<Text const *, TextMetrics> TextMetricsCache;
+typedef map<Text const *, TextMetrics> TextMetricsCache;
enum ScreenUpdateStrategy {
NoScreenUpdate,
enum ScreenUpdateStrategy {
NoScreenUpdate,
TextMetrics & tm = d->text_metrics_[text];
int ymax = height_ + offset;
while (true) {
TextMetrics & tm = d->text_metrics_[text];
int ymax = height_ + offset;
while (true) {
- std::pair<pit_type, ParagraphMetrics const *> last = tm.last();
+ pair<pit_type, ParagraphMetrics const *> last = tm.last();
int bottom_pos = last.second->position() + last.second->descent();
if (last.first + 1 == int(text->paragraphs().size())) {
if (bottom_pos <= height_)
int bottom_pos = last.second->position() + last.second->descent();
if (last.first + 1 == int(text->paragraphs().size())) {
if (bottom_pos <= height_)
TextMetrics & tm = d->text_metrics_[text];
int ymin = - offset;
while (true) {
TextMetrics & tm = d->text_metrics_[text];
int ymin = - offset;
while (true) {
- std::pair<pit_type, ParagraphMetrics const *> first = tm.first();
+ pair<pit_type, ParagraphMetrics const *> first = tm.first();
int top_pos = first.second->position() - first.second->ascent();
if (first.first == 0) {
if (top_pos >= 0)
int top_pos = first.second->position() - first.second->ascent();
if (first.first == 0) {
if (top_pos >= 0)
for (InsetIterator it = inset_iterator_begin(buffer_.inset()); it; ++it) {
vector<docstring> labels;
it->getLabelList(buffer_, labels);
for (InsetIterator it = inset_iterator_begin(buffer_.inset()); it; ++it) {
vector<docstring> labels;
it->getLabelList(buffer_, labels);
- if (std::find(labels.begin(), labels.end(), label) != labels.end()) {
+ if (find(labels.begin(), labels.end(), label) != labels.end()) {
setCursor(it);
processUpdateFlags(Update::FitCursor);
return;
setCursor(it);
processUpdateFlags(Update::FitCursor);
return;
// For an example, see bug 2933:
// http://bugzilla.lyx.org/show_bug.cgi?id=2933
// The code below could maybe be moved to a DocIterator method.
// For an example, see bug 2933:
// http://bugzilla.lyx.org/show_bug.cgi?id=2933
// The code below could maybe be moved to a DocIterator method.
- //lyxerr << "cur before " << cur <<std::endl;
+ //lyxerr << "cur before " << cur <<endl;
DocIterator dit(cur.inset());
dit.push_back(cur.bottom());
size_t i = 1;
DocIterator dit(cur.inset());
dit.push_back(cur.bottom());
size_t i = 1;
dit.push_back(cur[i]);
++i;
}
dit.push_back(cur[i]);
++i;
}
- //lyxerr << "5 cur after" << dit <<std::endl;
+ //lyxerr << "5 cur after" << dit <<endl;
d->cursor_.setCursor(dit);
d->cursor_.boundary(cur.boundary());
d->cursor_.setCursor(dit);
d->cursor_.boundary(cur.boundary());
int pos = sl.pos();
if (pos && boundary)
--pos;
int pos = sl.pos();
if (pos && boundary)
--pos;
-// lyxerr << "coordOffset: boundary:" << boundary << " depth:" << dit.depth() << " pos:" << pos << " sl.pos:" << sl.pos() << std::endl;
+// lyxerr << "coordOffset: boundary:" << boundary << " depth:" << dit.depth() << " pos:" << pos << " sl.pos:" << sl.pos() << endl;
rend = pm.pos2row(pos);
} else
rend = pm.pos2row(sl.pos());
rend = pm.pos2row(pos);
} else
rend = pm.pos2row(sl.pos());
tm.draw(pi, 0, y);
// and possibly grey out below
tm.draw(pi, 0, y);
// and possibly grey out below
- std::pair<pit_type, ParagraphMetrics const *> lastpm = tm.last();
+ pair<pit_type, ParagraphMetrics const *> lastpm = tm.last();
int const y2 = lastpm.second->position() + lastpm.second->descent();
if (y2 < height_)
pain.fillRectangle(0, y2, width_, height_ - y2, Color_bottomarea);
int const y2 = lastpm.second->position() + lastpm.second->descent();
if (y2 < height_)
pain.fillRectangle(0, y2, width_, height_ - y2, Color_bottomarea);
-void BufferView::showDialog(std::string const & name)
+void BufferView::showDialog(string const & name)
{
if (d->gui_)
d->gui_->showDialog(name, string());
}
{
if (d->gui_)
d->gui_->showDialog(name, string());
}
-void BufferView::showDialog(std::string const & name,
- std::string const & data, Inset * inset)
+void BufferView::showDialog(string const & name,
+ string const & data, Inset * inset)
{
if (d->gui_)
d->gui_->showDialog(name, data, inset);
}
{
if (d->gui_)
d->gui_->showDialog(name, data, inset);
}
-void BufferView::updateDialog(std::string const & name, std::string const & data)
+void BufferView::updateDialog(string const & name, string const & data)
{
if (d->gui_)
d->gui_->updateDialog(name, data);
{
if (d->gui_)
d->gui_->updateDialog(name, data);
<< (it + 1)->range.end << ")");
(it + 1)->range.start = it->range.start;
<< (it + 1)->range.end << ")");
(it + 1)->range.start = it->range.start;
- (it + 1)->change.changetime = std::max(it->change.changetime,
+ (it + 1)->change.changetime = max(it->change.changetime,
(it + 1)->change.changetime);
table_.erase(it);
// start again
(it + 1)->change.changetime);
table_.erase(it);
// start again
-void Changes::lyxMarkChange(std::ostream & os, int & column,
+void Changes::lyxMarkChange(ostream & os, int & column,
Change const & old, Change const & change)
{
if (old == change)
Change const & old, Change const & change)
{
if (old == change)
{
int val = 0;
istringstream is(str);
{
int val = 0;
istringstream is(str);
- is >> std::setbase(16) >> val;
+ is >> setbase(16) >> val;
- ostr << '#' << std::setbase(16) << std::setfill('0')
+ ostr << '#' << setbase(16) << setfill('0')
<< setw(2) << col.r
<< setw(2) << col.g
<< setw(2) << col.b;
<< setw(2) << col.r
<< setw(2) << col.g
<< setw(2) << col.b;
InfoTab::iterator it = infotab.find(col);
if (it == infotab.end()) {
lyxerr << "Color " << col << " not found in database."
InfoTab::iterator it = infotab.find(col);
if (it == infotab.end()) {
lyxerr << "Color " << col << " not found in database."
-std::vector<Format const *> const
-Converters::intToFormat(std::vector<int> const & input)
+vector<Format const *> const
+Converters::intToFormat(vector<int> const & input)
{
vector<Format const *> result(input.size());
{
vector<Format const *> result(input.size());
unsigned long do_crc(string const & s)
{
boost::crc_32_type crc;
unsigned long do_crc(string const & s)
{
boost::crc_32_type crc;
- crc = std::for_each(s.begin(), s.end(), crc);
+ crc = for_each(s.begin(), s.end(), crc);
time_t t, unsigned long c)
: timestamp(t), checksum(c)
{
time_t t, unsigned long c)
: timestamp(t), checksum(c)
{
- std::ostringstream os;
- os << std::setw(10) << std::setfill('0') << do_crc(orig_from.absFilename())
+ ostringstream os;
+ os << setw(10) << setfill('0') << do_crc(orig_from.absFilename())
<< '-' << to_format;
cache_name = FileName(addName(cache_dir.absFilename(), os.str()));
LYXERR(Debug::FILES, "Add file cache item " << orig_from
<< '-' << to_format;
cache_name = FileName(addName(cache_dir.absFilename(), os.str()));
LYXERR(Debug::FILES, "Add file cache item " << orig_from
/** The cache contains one item per orig file and target format, so use a
* nested map to find the cache item quickly by filename and format.
*/
/** The cache contains one item per orig file and target format, so use a
* nested map to find the cache item quickly by filename and format.
*/
-typedef std::map<string, CacheItem> FormatCacheType;
+typedef map<string, CacheItem> FormatCacheType;
class FormatCache {
public:
/// Format of the source file
class FormatCache {
public:
/// Format of the source file
/// Cache target format -> item to quickly find the item by format
FormatCacheType cache;
};
/// Cache target format -> item to quickly find the item by format
FormatCacheType cache;
};
-typedef std::map<FileName, FormatCache> CacheType;
+typedef map<FileName, FormatCache> CacheType;
class ConverterCache::Impl {
class ConverterCache::Impl {
{
time_t const now = current_time();
FileName const index(addName(cache_dir.absFilename(), "index"));
{
time_t const now = current_time();
FileName const index(addName(cache_dir.absFilename(), "index"));
- std::ifstream is(index.toFilesystemEncoding().c_str());
+ ifstream is(index.toFilesystemEncoding().c_str());
Lexer lex(0, 0);
lex.setStream(is);
while (lex.isOK()) {
Lexer lex(0, 0);
lex.setStream(is);
while (lex.isOK()) {
void ConverterCache::Impl::writeIndex()
{
FileName const index(addName(cache_dir.absFilename(), "index"));
void ConverterCache::Impl::writeIndex()
{
FileName const index(addName(cache_dir.absFilename(), "index"));
- std::ofstream os(index.toFilesystemEncoding().c_str());
+ ofstream os(index.toFilesystemEncoding().c_str());
os.close();
if (!lyx::support::chmod(index, 0600))
return;
os.close();
if (!lyx::support::chmod(index, 0600))
return;
if (!cache_dir.exists())
if (support::mkdir(cache_dir, 0700) != 0) {
lyxerr << "Could not create cache directory `"
if (!cache_dir.exists())
if (support::mkdir(cache_dir, 0700) != 0) {
lyxerr << "Could not create cache directory `"
- << cache_dir << "'." << std::endl;
+ << cache_dir << "'." << endl;
exit(EXIT_FAILURE);
}
get().pimpl_->readIndex();
exit(EXIT_FAILURE);
}
get().pimpl_->readIndex();
// Used only in mathed
DocIterator bruteFind2(Cursor const & c, int x, int y)
{
// Used only in mathed
DocIterator bruteFind2(Cursor const & c, int x, int y)
{
- double best_dist = std::numeric_limits<double>::max();
+ double best_dist = numeric_limits<double>::max();
int xo;
int yo;
Inset const * inset = &it.inset();
int xo;
int yo;
Inset const * inset = &it.inset();
- std::map<Inset const *, Geometry> const & data =
+ map<Inset const *, Geometry> const & data =
c.bv().coordCache().getInsets().getData();
c.bv().coordCache().getInsets().getData();
- std::map<Inset const *, Geometry>::const_iterator I = data.find(inset);
+ map<Inset const *, Geometry>::const_iterator I = data.find(inset);
// FIXME: in the case where the inset is not in the cache, this
// means that no part of it is visible on screen. In this case
// FIXME: in the case where the inset is not in the cache, this
// means that no part of it is visible on screen. In this case
- double best_dist = std::numeric_limits<double>::max();;
+ double best_dist = numeric_limits<double>::max();;
DocIterator best_cursor = et;
for ( ; it != et; it.forwardPos(true)) {
DocIterator best_cursor = et;
for ( ; it != et; it.forwardPos(true)) {
it.pit() = from;
DocIterator et = doc_iterator_end(inset);
it.pit() = from;
DocIterator et = doc_iterator_end(inset);
- double best_dist = std::numeric_limits<double>::max();
+ double best_dist = numeric_limits<double>::max();
DocIterator best_cursor = et;
for ( ; it != et; it.forwardPos()) {
DocIterator best_cursor = et;
for ( ; it != et; it.forwardPos()) {
-std::ostream & operator<<(std::ostream & os, Cursor const & cur)
+ostream & operator<<(ostream & os, Cursor const & cur)
{
os << "\n cursor: | anchor:\n";
for (size_t i = 0, n = cur.depth(); i != n; ++i) {
{
os << "\n cursor: | anchor:\n";
for (size_t i = 0, n = cur.depth(); i != n; ++i) {
Cursor old = *this;
if (up) {
if (row > 0) {
Cursor old = *this;
if (up) {
if (row > 0) {
- top().pos() = std::min(tm.x2pos(pit(), row - 1, xo), top().lastpos());
+ top().pos() = min(tm.x2pos(pit(), row - 1, xo), top().lastpos());
} else if (pit() > 0) {
--pit();
ParagraphMetrics const & pmcur = bv_->parMetrics(text(), pit());
} else if (pit() > 0) {
--pit();
ParagraphMetrics const & pmcur = bv_->parMetrics(text(), pit());
- top().pos() = std::min(tm.x2pos(pit(), pmcur.rows().size() - 1, xo), top().lastpos());
+ top().pos() = min(tm.x2pos(pit(), pmcur.rows().size() - 1, xo), top().lastpos());
}
} else {
if (row + 1 < int(pm.rows().size())) {
}
} else {
if (row + 1 < int(pm.rows().size())) {
- top().pos() = std::min(tm.x2pos(pit(), row + 1, xo), top().lastpos());
+ top().pos() = min(tm.x2pos(pit(), row + 1, xo), top().lastpos());
} else if (pit() + 1 < int(text()->paragraphs().size())) {
++pit();
} else if (pit() + 1 < int(text()->paragraphs().size())) {
++pit();
- top().pos() = std::min(tm.x2pos(pit(), 0, xo), top().lastpos());
+ top().pos() = min(tm.x2pos(pit(), 0, xo), top().lastpos());
-std::ostream & operator<<(std::ostream & os, CursorSlice const & item)
+ostream & operator<<(ostream & os, CursorSlice const & item)
{
return os
<< "inset: " << (void *)&item.inset()
{
return os
<< "inset: " << (void *)&item.inset()
-typedef std::pair<pit_type, int> PitPosPair;
+typedef pair<pit_type, int> PitPosPair;
typedef limited_stack<pair<ParagraphList, TextClassPtr> > CutStack;
typedef limited_stack<pair<ParagraphList, TextClassPtr> > CutStack;
c1 = p.col(i1.idx());
c2 = p.col(i2.idx());
if (c1 > c2)
c1 = p.col(i1.idx());
c2 = p.col(i2.idx());
if (c1 > c2)
r1 = p.row(i1.idx());
r2 = p.row(i2.idx());
if (r1 > r2)
r1 = p.row(i1.idx());
r2 = p.row(i2.idx());
if (r1 > r2)
buffer.setUnnamed(true);
buffer.paragraphs() = paragraphs;
buffer.params().setTextClass(textclass);
buffer.setUnnamed(true);
buffer.paragraphs() = paragraphs;
buffer.params().setTextClass(textclass);
- std::ostringstream lyx;
if (buffer.write(lyx))
theClipboard().put(lyx.str(), plaintext);
else
if (buffer.write(lyx))
theClipboard().put(lyx.str(), plaintext);
else
-std::vector<docstring> const availableSelections(Buffer const & buffer)
+vector<docstring> const availableSelections(Buffer const & buffer)
{
vector<docstring> selList;
{
vector<docstring> selList;
// FIXME: What is wrong with the following?
#if 0
// FIXME: What is wrong with the following?
#if 0
for (DocIterator dit = cur.selectionBegin();
dit != cur.selectionEnd(); dit.forwardPos())
os << asString(dit.cell());
for (DocIterator dit = cur.selectionBegin();
dit != cur.selectionEnd(); dit.forwardPos())
os << asString(dit.cell());
-void DocIterator::cutOff(DocIterator::idx_type above, std::vector<CursorSlice> & cut)
+void DocIterator::cutOff(DocIterator::idx_type above, vector<CursorSlice> & cut)
- cut = std::vector<CursorSlice>(slices_.begin() + above + 1, slices_.end());
+ cut = vector<CursorSlice>(slices_.begin() + above + 1, slices_.end());
slices_.resize(above + 1);
}
slices_.resize(above + 1);
}
-void DocIterator::append(std::vector<CursorSlice> const & x)
+void DocIterator::append(vector<CursorSlice> const & x)
{
slices_.insert(slices_.end(), x.begin(), x.end());
}
{
slices_.insert(slices_.end(), x.begin(), x.end());
}
-std::ostream & operator<<(std::ostream & os, DocIterator const & dit)
+ostream & operator<<(ostream & os, DocIterator const & dit)
{
for (size_t i = 0, n = dit.depth(); i != n; ++i)
os << " " << dit[i] << "\n";
{
for (size_t i = 0, n = dit.depth(); i != n; ++i)
os << " " << dit[i] << "\n";
bool operator<(DocIterator const & p, DocIterator const & q)
{
bool operator<(DocIterator const & p, DocIterator const & q)
{
- size_t depth = std::min(p.depth(), q.depth());
+ size_t depth = min(p.depth(), q.depth());
for (size_t i = 0 ; i < depth ; ++i) {
if (p[i] != q[i])
return p[i] < q[i];
for (size_t i = 0 ; i < depth ; ++i) {
if (p[i] != q[i])
return p[i] < q[i];
-std::ostream & operator<<(std::ostream & os, StableDocIterator const & dit)
+ostream & operator<<(ostream & os, StableDocIterator const & dit)
{
for (size_t i = 0, n = dit.data_.size(); i != n; ++i)
os << " " << dit.data_[i] << "\n";
{
for (size_t i = 0, n = dit.data_.size(); i != n; ++i)
os << " " << dit.data_[i] << "\n";
EmbeddedFiles::EmbeddedFileList::const_iterator
EmbeddedFiles::EmbeddedFileList::const_iterator
-EmbeddedFiles::find(std::string filename) const
+EmbeddedFiles::find(string filename) const
{
EmbeddedFileList::const_iterator it = file_list_.begin();
EmbeddedFileList::const_iterator it_end = file_list_.end();
{
EmbeddedFileList::const_iterator it = file_list_.begin();
EmbeddedFileList::const_iterator it_end = file_list_.end();
-typedef std::map<char_type, CharInfo> CharInfoMap;
+typedef map<char_type, CharInfo> CharInfoMap;
CharInfoMap unicodesymbols;
CharInfoMap unicodesymbols;
// if we check all 256 code points of this encoding.
for (unsigned short j = 0; j < 256; ++j) {
char const c = char(j);
// if we check all 256 code points of this encoding.
for (unsigned short j = 0; j < 256; ++j) {
char const c = char(j);
- std::vector<char_type> const ucs4 = eightbit_to_ucs4(&c, 1, iconvName_);
+ vector<char_type> const ucs4 = eightbit_to_ucs4(&c, 1, iconvName_);
if (ucs4.size() == 1) {
char_type const c = ucs4[0];
CharInfoMap::const_iterator const it = unicodesymbols.find(c);
if (ucs4.size() == 1) {
char_type const c = ucs4[0];
CharInfoMap::const_iterator const it = unicodesymbols.find(c);
// therefore we need to check all UCS4 code points.
// This is expensive!
for (char_type c = 0; c < max_ucs4; ++c) {
// therefore we need to check all UCS4 code points.
// This is expensive!
for (char_type c = 0; c < max_ucs4; ++c) {
- std::vector<char> const eightbit = ucs4_to_eightbit(&c, 1, iconvName_);
+ vector<char> const eightbit = ucs4_to_eightbit(&c, 1, iconvName_);
if (!eightbit.empty()) {
CharInfoMap::const_iterator const it = unicodesymbols.find(c);
if (it == unicodesymbols.end() || !it->second.force)
if (!eightbit.empty()) {
CharInfoMap::const_iterator const it = unicodesymbols.find(c);
if (it == unicodesymbols.end() || !it->second.force)
CharInfoMap::const_iterator const it = unicodesymbols.find(c);
if (it == unicodesymbols.end())
lyxerr << "Could not find LaTeX command for character 0x"
CharInfoMap::const_iterator const it = unicodesymbols.find(c);
if (it == unicodesymbols.end())
lyxerr << "Could not find LaTeX command for character 0x"
- << std::hex << c << std::dec
<< ".\nLaTeX export will fail."
<< endl;
else
<< ".\nLaTeX export will fail."
<< endl;
else
Encoding const * Encodings::getFromLaTeXName(string const & name) const
{
Encoding const * Encodings::getFromLaTeXName(string const & name) const
{
- // We don't use std::find_if because it makes copies of the pairs in
+ // We don't use find_if because it makes copies of the pairs in
// the map.
// This linear search is OK since we don't have many encodings.
// Users could even optimize it by putting the encodings they use
// the map.
// This linear search is OK since we don't have many encodings.
// Users could even optimize it by putting the encodings they use
string flags;
if (symbolslex.next(true)) {
string flags;
if (symbolslex.next(true)) {
- std::istringstream is(symbolslex.getString());
+ istringstream is(symbolslex.getString());
// reading symbol directly does not work if
// reading symbol directly does not work if
- // char_type == std::wchar_t.
+ // char_type == wchar_t.
- if(!(is >> std::hex >> tmp))
+ if(!(is >> hex >> tmp))
break;
symbol = tmp;
} else
break;
symbol = tmp;
} else
else
lyxerr << "Ignoring unknown flag `" << flag
<< "' for symbol `0x"
else
lyxerr << "Ignoring unknown flag `" << flag
<< "' for symbol `0x"
- << std::hex << symbol << std::dec
+ << hex << symbol << dec
-std::string Font::toString(bool const toggle) const
+string Font::toString(bool const toggle) const
{
string lang = "ignore";
if (language())
{
string lang = "ignore";
if (language())
-ostream & operator<<(std::ostream & os, FontInfo const & f)
+ostream & operator<<(ostream & os, FontInfo const & f)
{
return os << "font:"
<< " family " << f.family()
{
return os << "font:"
<< " family " << f.family()
-std::ostream & operator<<(std::ostream & os, Font const & font)
+ostream & operator<<(ostream & os, Font const & font)
{
return os << font.bits_
<< " lang: " << (font.lang_ ? font.lang_->lang() : 0);
{
return os << font.bits_
<< " lang: " << (font.lang_ ? font.lang_->lang() : 0);
string const token_socket_format("$$a");
string const token_socket_format("$$a");
-class FormatNamesEqual : public std::unary_function<Format, bool> {
+class FormatNamesEqual : public unary_function<Format, bool> {
public:
FormatNamesEqual(string const & name)
: name_(name) {}
public:
FormatNamesEqual(string const & name)
: name_(name) {}
-class FormatExtensionsEqual : public std::unary_function<Format, bool> {
+class FormatExtensionsEqual : public unary_function<Format, bool> {
public:
FormatExtensionsEqual(string const & extension)
: extension_(extension) {}
public:
FormatExtensionsEqual(string const & extension)
: extension_(extension) {}
-std::ostream & operator<<(std::ostream & os, FuncRequest const & cmd)
+ostream & operator<<(ostream & os, FuncRequest const & cmd)
{
return os
<< " action: " << cmd.action
{
return os
<< " action: " << cmd.action
- Q_ = std::queue<int>();
if (clear_visited)
fill(visited_.begin(), visited_.end(), false);
if (clear_visited)
fill(visited_.begin(), visited_.end(), false);
string const to_iconv_encoding(docstring const & s, string const & encoding)
{
if (lyxrc.isp_use_input_encoding) {
string const to_iconv_encoding(docstring const & s, string const & encoding)
{
if (lyxrc.isp_use_input_encoding) {
- std::vector<char> const encoded =
+ vector<char> const encoded =
ucs4_to_eightbit(s.data(), s.length(), encoding);
return string(encoded.begin(), encoded.end());
}
ucs4_to_eightbit(s.data(), s.length(), encoding);
return string(encoded.begin(), encoded.end());
}
docstring const from_iconv_encoding(string const & s, string const & encoding)
{
if (lyxrc.isp_use_input_encoding) {
docstring const from_iconv_encoding(string const & s, string const & encoding)
{
if (lyxrc.isp_use_input_encoding) {
- std::vector<char_type> const ucs4 =
+ vector<char_type> const ucs4 =
eightbit_to_ucs4(s.data(), s.length(), encoding);
return docstring(ucs4.begin(), ucs4.end());
}
eightbit_to_ucs4(s.data(), s.length(), encoding);
return docstring(ucs4.begin(), ucs4.end());
}
///
Pimpl(keyword_item * tab, int num);
///
///
Pimpl(keyword_item * tab, int num);
///
- std::string const getString() const;
+ string const getString() const;
///
docstring const getDocString() const;
///
///
docstring const getDocString() const;
///
- void printError(std::string const & message) const;
+ void printError(string const & message) const;
- void printTable(std::ostream & os);
+ void printTable(ostream & os);
///
void pushTable(keyword_item * tab, int num);
///
///
void pushTable(keyword_item * tab, int num);
///
///
bool setFile(support::FileName const & filename);
///
///
bool setFile(support::FileName const & filename);
///
- void setStream(std::istream & i);
+ void setStream(istream & i);
///
void setCommentChar(char c);
///
///
void setCommentChar(char c);
///
/// test if there is a pushed token or the stream is ok
bool inputAvailable();
///
/// test if there is a pushed token or the stream is ok
bool inputAvailable();
///
- void pushToken(std::string const &);
+ void pushToken(string const &);
/// fb_ is only used to open files, the stream is accessed through is.
/// fb_ is only used to open files, the stream is accessed through is.
/// gz_ is only used to open files, the stream is accessed through is.
gz::gzstreambuf gz_;
/// the stream that we use.
/// gz_ is only used to open files, the stream is accessed through is.
gz::gzstreambuf gz_;
/// the stream that we use.
///
keyword_item * table;
///
int no_items;
///
///
keyword_item * table;
///
int no_items;
///
///
int status;
///
int lineno;
///
///
int status;
///
int lineno;
///
///
char commentChar;
private:
///
char commentChar;
private:
- std::stack<pushed_table> pushed;
+ stack<pushed_table> pushed;
namespace {
class compare_tags
namespace {
class compare_tags
- : public std::binary_function<keyword_item, keyword_item, bool> {
+ : public binary_function<keyword_item, keyword_item, bool> {
public:
// used by lower_bound, sort and sorted
bool operator()(keyword_item const & a, keyword_item const & b) const
public:
// used by lower_bound, sort and sorted
bool operator()(keyword_item const & a, keyword_item const & b) const
Lexer::operator void const *() const
{
Lexer::operator void const *() const
{
- // This behaviour is NOT the same as the std::streams which would
+ // This behaviour is NOT the same as the streams which would
// use fail() here. However, our implementation of getString() et al.
// can cause the eof() and fail() bits to be set, even though we
// haven't tried to read 'em.
// use fail() here. However, our implementation of getString() et al.
// can cause the eof() and fail() bits to be set, even though we
// haven't tried to read 'em.
-Lexer & Lexer::operator>>(std::string & s)
+Lexer & Lexer::operator>>(string & s)
/// quotes a string, e.g. for use in preferences files or as an argument of the "log" dialog
string const Lexer::quoteString(string const & arg)
{
/// quotes a string, e.g. for use in preferences files or as an argument of the "log" dialog
string const Lexer::quoteString(string const & arg)
{
os << '"' << subst(subst(arg, "\\", "\\\\"), "\"", "\\\"") << '"';
return os.str();
}
os << '"' << subst(subst(arg, "\\", "\\\\"), "\"", "\\\"") << '"';
return os.str();
}
string cl_system_support;
string cl_user_support;
string cl_system_support;
string cl_user_support;
-std::string geometryArg;
/// has this user started lyx for the first time?
bool first_start;
/// the parsed command line batch command if any
/// has this user started lyx for the first time?
bool first_start;
/// the parsed command line batch command if any
- std::string batch_command;
-Messages & LyX::getMessages(std::string const & language)
+Messages & LyX::getMessages(string const & language)
{
map<string, Messages>::iterator it = pimpl_->messages_.find(language);
if (it != pimpl_->messages_.end())
return it->second;
{
map<string, Messages>::iterator it = pimpl_->messages_.find(language);
if (it != pimpl_->messages_.end())
return it->second;
- std::pair<map<string, Messages>::iterator, bool> result =
- pimpl_->messages_.insert(std::make_pair(language, Messages(language)));
+ pair<map<string, Messages>::iterator, bool> result =
+ pimpl_->messages_.insert(make_pair(language, Messages(language)));
BOOST_ASSERT(result.second);
return result.first->second;
BOOST_ASSERT(result.second);
return result.first->second;
-void LyX::setGuiLanguage(std::string const & language)
+void LyX::setGuiLanguage(string const & language)
{
pimpl_->messages_["GUI"] = Messages(language);
}
{
pimpl_->messages_["GUI"] = Messages(language);
}
void LyX::addFileToLoad(FileName const & fname)
{
void LyX::addFileToLoad(FileName const & fname)
{
- vector<FileName>::const_iterator cit = std::find(
+ vector<FileName>::const_iterator cit = find(
pimpl_->files_to_load_.begin(), pimpl_->files_to_load_.end(),
fname);
pimpl_->files_to_load_.begin(), pimpl_->files_to_load_.end(),
fname);
{
docstring tmp = _("LyX: ") + ei.error + char_type(':')
+ ei.description;
{
docstring tmp = _("LyX: ") + ei.error + char_type(':')
+ ei.description;
- std::cerr << to_utf8(tmp) << std::endl;
+ cerr << to_utf8(tmp) << endl;
};
// Ensure that a file is read only once (prevents include loops)
};
// Ensure that a file is read only once (prevents include loops)
- static std::list<string> uifiles;
- std::list<string>::const_iterator it = uifiles.begin();
- std::list<string>::const_iterator end = uifiles.end();
- it = std::find(it, end, name);
+ static list<string> uifiles;
+ list<string>::const_iterator it = uifiles.begin();
+ list<string>::const_iterator end = uifiles.end();
+ it = find(it, end, name);
if (it != end) {
LYXERR(Debug::INIT, "UI file '" << name << "' has been read already. "
<< "Is this an include loop?");
if (it != end) {
LYXERR(Debug::INIT, "UI file '" << name << "' has been read already. "
<< "Is this an include loop?");
void LyX::easyParse(int & argc, char * argv[])
{
void LyX::easyParse(int & argc, char * argv[])
{
- std::map<string, cmd_helper> cmdmap;
+ map<string, cmd_helper> cmdmap;
cmdmap["-dbg"] = parse_dbg;
cmdmap["-help"] = parse_help;
cmdmap["-dbg"] = parse_dbg;
cmdmap["-help"] = parse_help;
cmdmap["-geometry"] = parse_geometry;
for (int i = 1; i < argc; ++i) {
cmdmap["-geometry"] = parse_geometry;
for (int i = 1; i < argc; ++i) {
- std::map<string, cmd_helper>::const_iterator it
+ map<string, cmd_helper>::const_iterator it
= cmdmap.find(argv[i]);
// don't complain if not found - may be parsed later
= cmdmap.find(argv[i]);
// don't complain if not found - may be parsed later
-Mover const & getMover(std::string const & fmt)
+Mover const & getMover(string const & fmt)
{
return LyX::ref().pimpl_->movers_(fmt);
}
{
return LyX::ref().pimpl_->movers_(fmt);
}
-void setMover(std::string const & fmt, std::string const & command)
+void setMover(string const & fmt, string const & command)
{
LyX::ref().pimpl_->movers_.set(fmt, command);
}
{
LyX::ref().pimpl_->movers_.set(fmt, command);
}
-Messages & getMessages(std::string const & language)
+Messages & getMessages(string const & language)
{
return LyX::ref().getMessages(language);
}
{
return LyX::ref().getMessages(language);
}
case LFUN_CALL: {
FuncRequest func;
case LFUN_CALL: {
FuncRequest func;
- std::string name = to_utf8(cmd.argument());
+ string name = to_utf8(cmd.argument());
if (LyX::ref().topLevelCmdDef().lock(name, func)) {
func.origin = cmd.origin;
flag = getStatus(func);
if (LyX::ref().topLevelCmdDef().lock(name, func)) {
func.origin = cmd.origin;
flag = getStatus(func);
void loadTextClass(string const & name)
{
void loadTextClass(string const & name)
{
- std::pair<bool, textclass_type> const tc_pair =
+ pair<bool, textclass_type> const tc_pair =
textclasslist.numberOfClass(name);
if (!tc_pair.first) {
lyxerr << "Document class \"" << name
<< "\" does not exist."
textclasslist.numberOfClass(name);
if (!tc_pair.first) {
lyxerr << "Document class \"" << name
<< "\" does not exist."
if (!format) {
lyxerr << "Format \"" << format_name
<< "\" not recognized!"
if (!format) {
lyxerr << "Format \"" << format_name
<< "\" not recognized!"
}
default:
lyxerr << "Inset type '" << name <<
}
default:
lyxerr << "Inset type '" << name <<
- "' not recognized in LFUN_DIALOG_SHOW_NEW_INSET" << std:: endl;
+ "' not recognized in LFUN_DIALOG_SHOW_NEW_INSET" << endl;
insetCodeOK = false;
break;
} // end switch(code)
insetCodeOK = false;
break;
} // end switch(code)
- std::pair<bool, textclass_type> const tc_pair =
+ pair<bool, textclass_type> const tc_pair =
textclasslist.numberOfClass(argument);
if (!tc_pair.first)
textclasslist.numberOfClass(argument);
if (!tc_pair.first)
-int LyXRC::read(std::istream & is)
+int LyXRC::read(istream & is)
{
Lexer lexrc(lyxrcTags, lyxrcCount);
if (lyxerr.debugging(Debug::PARSER))
{
Lexer lexrc(lyxrcTags, lyxrcCount);
if (lyxerr.debugging(Debug::PARSER))
class SameMover {
public:
class SameMover {
public:
- typedef std::pair<std::string, SpecialisedMover> Data;
+ typedef pair<string, SpecialisedMover> Data;
SameMover(Data const & comparison)
: comparison_(comparison) {}
SameMover(Data const & comparison)
: comparison_(comparison) {}
<< cit->shortcut() << "\" \""
<< cit->viewer() << "\" \""
<< cit->editor() << "\" \"";
<< cit->shortcut() << "\" \""
<< cit->viewer() << "\" \""
<< cit->editor() << "\" \"";
- std::vector<string> flags;
if (cit->documentFormat())
flags.push_back("document");
if (cit->vectorFormat())
if (cit->documentFormat())
flags.push_back("document");
if (cit->vectorFormat())
for (; it != end; ++it) {
Movers::const_iterator const sysit =
for (; it != end; ++it) {
Movers::const_iterator const sysit =
- std::find_if(sysbegin, sysend, SameMover(*it));
+ find_if(sysbegin, sysend, SameMover(*it));
- std::string const & fmt = it->first;
- std::string const & command =
+ string const & fmt = it->first;
+ string const & command =
it->second.command();
os << "\\copier " << fmt
it->second.command();
os << "\\copier " << fmt
-class MenuNamesEqual : public std::unary_function<Menu, bool> {
+class MenuNamesEqual : public unary_function<Menu, bool> {
public:
MenuNamesEqual(docstring const & name)
: name_(name) {}
public:
MenuNamesEqual(docstring const & name)
: name_(name) {}
bool Menu::hasFunc(FuncRequest const & func) const
{
return find_if(begin(), end(),
bool Menu::hasFunc(FuncRequest const & func) const
{
return find_if(begin(), end(),
- bind(std::equal_to<FuncRequest>(),
+ bind(equal_to<FuncRequest>(),
bind(&MenuItem::func, _1),
func)) != end();
}
bind(&MenuItem::func, _1),
func)) != end();
}
-void expandFlexInsert(Menu & tomenu, Buffer const * buf, std::string s)
+void expandFlexInsert(Menu & tomenu, Buffer const * buf, string s)
{
if (!buf) {
tomenu.add(MenuItem(MenuItem::Command,
{
if (!buf) {
tomenu.add(MenuItem(MenuItem::Command,
// check whether depth is smaller than the smallest depth in toc.
int min_depth = 1000;
for (Toc::size_type i = from; i < to; ++i)
// check whether depth is smaller than the smallest depth in toc.
int min_depth = 1000;
for (Toc::size_type i = from; i < to; ++i)
- min_depth = std::min(min_depth, toc_list[i].depth());
+ min_depth = min(min_depth, toc_list[i].depth());
if (min_depth > depth)
depth = min_depth;
if (min_depth > depth)
depth = min_depth;
LYXERR(Debug::TCLASS, "End of parsing of lyxmodules.lst");
if (!moduleList.empty())
LYXERR(Debug::TCLASS, "End of parsing of lyxmodules.lst");
if (!moduleList.empty())
- std::sort(moduleList.begin(), moduleList.end(), ModuleSorter());
+ sort(moduleList.begin(), moduleList.end(), ModuleSorter());
return Mover::do_copy(from, to, latex, mode);
if (mode != (unsigned long int)-1) {
return Mover::do_copy(from, to, latex, mode);
if (mode != (unsigned long int)-1) {
- std::ofstream ofs(to.toFilesystemEncoding().c_str(), ios::binary | ios::out | ios::trunc);
+ ofstream ofs(to.toFilesystemEncoding().c_str(), ios::binary | ios::out | ios::trunc);
if (!ofs)
return false;
ofs.close();
if (!ofs)
return false;
ofs.close();
pos_type initial) const;
/// match a string against a particular point in the paragraph
pos_type initial) const;
/// match a string against a particular point in the paragraph
- bool isTextAt(std::string const & str, pos_type pos) const;
+ bool isTextAt(string const & str, pos_type pos) const;
/// Which Paragraph owns us?
Paragraph * owner_;
/// Which Paragraph owns us?
Paragraph * owner_;
// this check is to amend a bug. LyX sometimes
// inserts '\0' this could cause problems.
if (c != '\0') {
// this check is to amend a bug. LyX sometimes
// inserts '\0' this could cause problems.
if (c != '\0') {
- std::vector<char> tmp = ucs4_to_utf8(c);
+ vector<char> tmp = ucs4_to_utf8(c);
tmp.push_back('\0');
os << &tmp[0];
} else
tmp.push_back('\0');
os << &tmp[0];
} else
size_t newsize = oldsize + end;
size_t capacity = d->text_.capacity();
if (newsize >= capacity)
size_t newsize = oldsize + end;
size_t capacity = d->text_.capacity();
if (newsize >= capacity)
- d->text_.reserve(std::max(capacity + 100, newsize));
+ d->text_.reserve(max(capacity + 100, newsize));
// when appending characters, no need to update tables
d->text_.append(s);
// when appending characters, no need to update tables
d->text_.append(s);
for (; cit != end; ++cit) {
if (cit->pos() >= pos) {
if (pos >= beginOfBody())
for (; cit != end; ++cit) {
if (cit->pos() >= pos) {
if (pos >= beginOfBody())
- return FontSpan(std::max(start, beginOfBody()),
+ return FontSpan(max(start, beginOfBody()),
cit->pos());
else
return FontSpan(start,
cit->pos());
else
return FontSpan(start,
- std::min(beginOfBody() - 1,
cit->pos()));
}
start = cit->pos() + 1;
cit->pos()));
}
start = cit->pos() + 1;
if (!runparams.verbatim &&
runparams.encoding->package() == Encoding::none &&
font.language()->encoding()->package() == Encoding::none) {
if (!runparams.verbatim &&
runparams.encoding->package() == Encoding::none &&
font.language()->encoding()->package() == Encoding::none) {
- std::pair<bool, int> const enc_switch = switchEncoding(os, bparams,
+ pair<bool, int> const enc_switch = switchEncoding(os, bparams,
runparams, *(runparams.encoding),
*(font.language()->encoding()));
if (enc_switch.first) {
runparams, *(runparams.encoding),
*(font.language()->encoding()));
if (enc_switch.first) {
-void ParagraphParameters::read(std::string str, bool merge)
+void ParagraphParameters::read(string str, bool merge)
- std::istringstream is(str);
Lexer lex(0, 0);
lex.setStream(is);
read(lex, merge);
Lexer lex(0, 0);
lex.setStream(is);
read(lex, merge);
#if !defined (HAVE_MKFIFO)
// We provide a stub class that disables the lyxserver.
#if !defined (HAVE_MKFIFO)
// We provide a stub class that disables the lyxserver.
-LyXComm::LyXComm(std::string const &, Server *, ClientCallbackfct)
+LyXComm::LyXComm(string const &, Server *, ClientCallbackfct)
{}
void LyXComm::openConnection()
{}
void LyXComm::openConnection()
#else // defined (HAVE_MKFIFO)
#else // defined (HAVE_MKFIFO)
-LyXComm::LyXComm(std::string const & pip, Server * cli, ClientCallbackfct ccb)
+LyXComm::LyXComm(string const & pip, Server * cli, ClientCallbackfct ccb)
: pipename_(pip), client_(cli), clientcb_(ccb)
{
ready_ = false;
: pipename_(pip), client_(cli), clientcb_(ccb)
{
ready_ = false;
-Server::Server(LyXFunc * f, std::string const & pipes)
+Server::Server(LyXFunc * f, string const & pipes)
: numclients_(0), func_(f), pipes_(pipes, this, &ServerCallback)
{}
: numclients_(0), func_(f), pipes_(pipes, this, &ServerCallback)
{}
// lyxerr << "ServerSocket debug dump.\n"
// << "fd = " << fd_ << ", address = " << address_.absFilename() << ".\n"
// << "Clients: " << clients.size() << ".\n";
// lyxerr << "ServerSocket debug dump.\n"
// << "fd = " << fd_ << ", address = " << address_.absFilename() << ".\n"
// << "Clients: " << clients.size() << ".\n";
-// std::map<int, shared_ptr<LyXDataSocket> >::const_iterator client = clients.begin();
-// std::map<int, shared_ptr<LyXDataSocket> >::const_iterator end = clients.end();
+// map<int, shared_ptr<LyXDataSocket> >::const_iterator client = clients.begin();
+// map<int, shared_ptr<LyXDataSocket> >::const_iterator end = clients.end();
// for (; client != end; ++client)
// lyxerr << "fd = " << client->first << '\n';
// }
// for (; client != end; ++client)
// lyxerr << "fd = " << client->first << '\n';
// }
}
} while (is.good());
// sort the toolbars by location, line and position
}
} while (is.good());
// sort the toolbars by location, line and position
- std::sort(toolbars.begin(), toolbars.end());
+ sort(toolbars.begin(), toolbars.end());
////////////////////////////////////////////////////////////////
TexStream::TexStream(TexStreamBase * sbuf, TexRow * texrow)
////////////////////////////////////////////////////////////////
TexStream::TexStream(TexStreamBase * sbuf, TexRow * texrow)
- : std::basic_ostream<char_type>(sbuf_ = new TexStreamBuffer(sbuf, texrow))
+ : basic_ostream<char_type>(sbuf_ = new TexStreamBuffer(sbuf, texrow))
int main(int argc, char *argv[])
{
int main(int argc, char *argv[])
{
- TexStream out(std::cout.rdbuf());
+ TexStream out(cout.rdbuf());
- while (std::cin) {
- if (std::cin.get(c))
+ while (cin) {
+ if (cin.get(c))
- std::cout << "line count: " << out.line() << std::endl;
+ cout << "line count: " << out.line() << endl;
change = Change(Change::UNCHANGED);
} else if (token == "\\change_inserted") {
lex.eatLine();
change = Change(Change::UNCHANGED);
} else if (token == "\\change_inserted") {
lex.eatLine();
- std::istringstream is(lex.getString());
+ istringstream is(lex.getString());
unsigned int aid;
time_t ct;
is >> aid >> ct;
unsigned int aid;
time_t ct;
is >> aid >> ct;
change = Change(Change::INSERTED, bp.author_map[aid], ct);
} else if (token == "\\change_deleted") {
lex.eatLine();
change = Change(Change::INSERTED, bp.author_map[aid], ct);
} else if (token == "\\change_deleted") {
lex.eatLine();
- std::istringstream is(lex.getString());
+ istringstream is(lex.getString());
unsigned int aid;
time_t ct;
is >> aid >> ct;
unsigned int aid;
time_t ct;
is >> aid >> ct;
pasteParagraphList(cur, plist, b.params().getTextClassPtr(),
b.errorList("Paste"));
// restore position
pasteParagraphList(cur, plist, b.params().getTextClassPtr(),
b.errorList("Paste"));
// restore position
- cur.pit() = std::min(cur.lastpit(), spit);
- cur.pos() = std::min(cur.lastpos(), spos);
+ cur.pit() = min(cur.lastpit(), spit);
+ cur.pos() = min(cur.lastpos(), spos);
}
cur.clearSelection();
cur.resetAnchor();
}
cur.clearSelection();
cur.resetAnchor();
-void Text::write(Buffer const & buf, std::ostream & os) const
+void Text::write(Buffer const & buf, ostream & os) const
{
ParagraphList::const_iterator pit = paragraphs().begin();
ParagraphList::const_iterator end = paragraphs().end();
{
ParagraphList::const_iterator pit = paragraphs().begin();
ParagraphList::const_iterator end = paragraphs().end();
if (!par.empty() && cur.pos() < par.size()) {
// Force output of code point, not character
size_t const c = par.getChar(cur.pos());
if (!par.empty() && cur.pos() < par.size()) {
// Force output of code point, not character
size_t const c = par.getChar(cur.pos());
- os << _(", Char: 0x") << std::hex << c;
+ os << _(", Char: 0x") << hex << c;
}
os << _(", Boundary: ") << cur.boundary();
// Row & row = cur.textRow();
}
os << _(", Boundary: ") << cur.boundary();
// Row & row = cur.textRow();
// Not found; do nothing
if (toclevel == Layout::NOT_IN_TOC || toclevel > thistoclevel)
break;
// Not found; do nothing
if (toclevel == Layout::NOT_IN_TOC || toclevel > thistoclevel)
break;
- pit_type const newpit = std::distance(bgn, dest);
- pit_type const len = std::distance(start, finish);
+ pit_type const newpit = distance(bgn, dest);
+ pit_type const len = distance(start, finish);
pit_type const deletepit = pit + len;
buf.undo().recordUndo(cur, ATOMIC_UNDO, newpit, deletepit - 1);
pars.insert(dest, start, finish);
pit_type const deletepit = pit + len;
buf.undo().recordUndo(cur, ATOMIC_UNDO, newpit, deletepit - 1);
pars.insert(dest, start, finish);
break;
}
// One such was found:
break;
}
// One such was found:
- pit_type newpit = std::distance(bgn, dest);
- pit_type const len = std::distance(start, finish);
+ pit_type newpit = distance(bgn, dest);
+ pit_type const len = distance(start, finish);
buf.undo().recordUndo(cur, ATOMIC_UNDO, pit, newpit - 1);
pars.insert(dest, start, finish);
start = boost::next(bgn, pit);
buf.undo().recordUndo(cur, ATOMIC_UNDO, pit, newpit - 1);
pars.insert(dest, start, finish);
start = boost::next(bgn, pit);
pit_type const pit = cur.pit();
recUndo(cur, pit, pit + 1);
cur.finishUndo();
pit_type const pit = cur.pit();
recUndo(cur, pit, pit + 1);
cur.finishUndo();
- std::swap(pars_[pit], pars_[pit + 1]);
+ swap(pars_[pit], pars_[pit + 1]);
updateLabels(cur.buffer());
needsUpdate = true;
++cur.pit();
updateLabels(cur.buffer());
needsUpdate = true;
++cur.pit();
pit_type const pit = cur.pit();
recUndo(cur, pit - 1, pit);
cur.finishUndo();
pit_type const pit = cur.pit();
recUndo(cur, pit - 1, pit);
cur.finishUndo();
- std::swap(pars_[pit], pars_[pit - 1]);
+ swap(pars_[pit], pars_[pit - 1]);
updateLabels(cur.buffer());
--cur.pit();
needsUpdate = true;
updateLabels(cur.buffer());
--cur.pit();
needsUpdate = true;
is >> x >> y;
if (!is)
lyxerr << "SETXY: Could not parse coordinates in '"
is >> x >> y;
if (!is)
lyxerr << "SETXY: Could not parse coordinates in '"
- << to_utf8(cmd.argument()) << std::endl;
+ << to_utf8(cmd.argument()) << endl;
else
tm.setCursorFromCoordinates(cur, x, y);
break;
else
tm.setCursorFromCoordinates(cur, x, y);
break;
CursorSlice old = bvcur.top();
int const wh = bv->workHeight();
CursorSlice old = bvcur.top();
int const wh = bv->workHeight();
- int const y = std::max(0, std::min(wh - 1, cmd.y));
+ int const y = max(0, min(wh - 1, cmd.y));
tm.setCursorFromCoordinates(cur, cmd.x, y);
cur.setTargetX(cmd.x);
tm.setCursorFromCoordinates(cur, cmd.x, y);
cur.setTargetX(cmd.x);
-class LayoutNamesEqual : public std::unary_function<LayoutPtr, bool> {
+class LayoutNamesEqual : public unary_function<LayoutPtr, bool> {
public:
LayoutNamesEqual(docstring const & name)
: name_(name)
public:
LayoutNamesEqual(docstring const & name)
: name_(name)
- std::ostringstream command;
command << support::os::python() << ' ' << quoteName(script.toFilesystemEncoding())
<< ' ' << quoteName(filename.toFilesystemEncoding())
<< ' ' << quoteName(tempfile.toFilesystemEncoding());
command << support::os::python() << ' ' << quoteName(script.toFilesystemEncoding())
<< ' ' << quoteName(filename.toFilesystemEncoding())
<< ' ' << quoteName(tempfile.toFilesystemEncoding());
if (min_toclevel_ == Layout::NOT_IN_TOC)
min_toclevel_ = toclevel;
else
if (min_toclevel_ == Layout::NOT_IN_TOC)
min_toclevel_ = toclevel;
else
- min_toclevel_ = std::min(min_toclevel_,
+ min_toclevel_ = min(min_toclevel_,
- max_toclevel_ = std::max(max_toclevel_,
+ max_toclevel_ = max(max_toclevel_,
// used when sorting the textclass list.
class less_textclass_avail_desc
// used when sorting the textclass list.
class less_textclass_avail_desc
- : public std::binary_function<TextClass, TextClass, int>
+ : public binary_function<TextClass, TextClass, int>
{
public:
int operator()(TextClass const & tc1,
{
public:
int operator()(TextClass const & tc1,
-std::pair<bool, textclass_type> const
-TextClassList::addTextClass(std::string const & textclass, std::string const & path)
+pair<bool, textclass_type> const
+TextClassList::addTextClass(string const & textclass, string const & path)
{
// only check for textclass.layout file, .cls can be anywhere in $TEXINPUTS
// NOTE: latex class name is defined in textclass.layout, which can be different from textclass
{
// only check for textclass.layout file, .cls can be anywhere in $TEXINPUTS
// NOTE: latex class name is defined in textclass.layout, which can be different from textclass
first = end;
++row_index;
first = end;
++row_index;
- pm.dim().wid = std::max(pm.dim().wid, dim.wid);
+ pm.dim().wid = max(pm.dim().wid, dim.wid);
pm.dim().des += dim.height();
} while (first < par.size());
pm.dim().des += dim.height();
} while (first < par.size());
if (par.isLineSeparator(i - 1))
add -= singleWidth(pit, i - 1);
if (par.isLineSeparator(i - 1))
add -= singleWidth(pit, i - 1);
- add = std::max(add, label_end - x);
+ add = max(add, label_end - x);
int TextMetrics::cursorY(CursorSlice const & sl, bool boundary) const
{
int TextMetrics::cursorY(CursorSlice const & sl, bool boundary) const
{
- //lyxerr << "TextMetrics::cursorY: boundary: " << boundary << std::endl;
+ //lyxerr << "TextMetrics::cursorY: boundary: " << boundary << endl;
ParagraphMetrics const & pm = par_metrics_[sl.pit()];
if (pm.rows().empty())
return 0;
ParagraphMetrics const & pm = par_metrics_[sl.pit()];
if (pm.rows().empty())
return 0;
// 12 lines lower):
if (lyxerr.debugging(Debug::PAINTING) && inside
&& (row_selection || pi.full_repaint || row_has_changed)) {
// 12 lines lower):
if (lyxerr.debugging(Debug::PAINTING) && inside
&& (row_selection || pi.full_repaint || row_has_changed)) {
- std::string const foreword = text_->isMainText(bv_->buffer()) ?
+ string const foreword = text_->isMainText(bv_->buffer()) ?
"main text redraw " : "inset text redraw: ";
LYXERR(Debug::PAINTING, foreword << "pit=" << pit << " row=" << i
<< " row_selection=" << row_selection
"main text redraw " : "inset text redraw: ";
LYXERR(Debug::PAINTING, foreword << "pit=" << pit << " row=" << i
<< " row_selection=" << row_selection
//
///////////////////////////////////////////////////////////////////////////
//
///////////////////////////////////////////////////////////////////////////
-Toc const & TocBackend::toc(std::string const & type) const
+Toc const & TocBackend::toc(string const & type) const
{
// Is the type already supported?
TocList::const_iterator it = tocs_.find(type);
{
// Is the type already supported?
TocList::const_iterator it = tocs_.find(type);
-TocIterator const TocBackend::item(std::string const & type,
+TocIterator const TocBackend::item(string const & type,
ParConstIterator const & par_it) const
{
TocList::const_iterator toclist_it = tocs_.find(type);
ParConstIterator const & par_it) const
{
TocList::const_iterator toclist_it = tocs_.find(type);
if (s.length() > 1) {
if (accent != TEX_TIE || s.length() > 2)
lyxerr << "Warning: Too many characters given for accent "
if (s.length() > 1) {
if (accent != TEX_TIE || s.length() > 2)
lyxerr << "Warning: Too many characters given for accent "
- << lyx_accent_table[accent].name << '.' << std::endl;
+ << lyx_accent_table[accent].name << '.' << endl;
os << s.substr(1);
}
return normalize_c(os.str());
os << s.substr(1);
}
return normalize_c(os.str());
-std::ostream & operator<<(std::ostream & os, UndoElement const & undo)
+ostream & operator<<(ostream & os, UndoElement const & undo)
{
return os << " from: " << undo.from << " end: " << undo.end
<< " cell:\n" << undo.cell
{
return os << " from: " << undo.from << " end: " << undo.end
<< " cell:\n" << undo.cell
bool isUndoOperation)
{
if (first_pit > last_pit)
bool isUndoOperation)
{
if (first_pit > last_pit)
- std::swap(first_pit, last_pit);
+ swap(first_pit, last_pit);
// create the position information of the Undo entry
UndoElement undo;
undo.array = 0;
// create the position information of the Undo entry
UndoElement undo;
undo.array = 0;
// push the undo entry to undo stack
stack.push(undo);
// push the undo entry to undo stack
stack.push(undo);
- //lyxerr << "undo record: " << stack.top() << std::endl;
+ //lyxerr << "undo record: " << stack.top() << endl;
// next time we'll try again to combine entries if possible
undo_finished = false;
// next time we'll try again to combine entries if possible
undo_finished = false;
redostack.clear();
//lyxerr << "undostack:\n";
//for (size_t i = 0, n = buf.undostack().size(); i != n && i < 6; ++i)
redostack.clear();
//lyxerr << "undostack:\n";
//for (size_t i = 0, n = buf.undostack().size(); i != n && i < 6; ++i)
- // lyxerr << " " << i << ": " << buf.undostack()[i] << std::endl;
+ // lyxerr << " " << i << ": " << buf.undostack()[i] << endl;
// This is a full document
otherstack.top().bparams = buffer_.params();
buffer_.params() = undo.bparams;
// This is a full document
otherstack.top().bparams = buffer_.params();
buffer_.params() = undo.bparams;
- std::swap(buffer_.paragraphs(), *undo.pars);
+ swap(buffer_.paragraphs(), *undo.pars);
delete undo.pars;
undo.pars = 0;
} else if (dit.inMathed()) {
delete undo.pars;
undo.pars = 0;
} else if (dit.inMathed()) {
namespace boost {
#ifndef BOOST_NO_EXCEPTIONS
namespace boost {
#ifndef BOOST_NO_EXCEPTIONS
-void throw_exception(std::exception const & e)
+void throw_exception(exception const & e)
{
lyxerr << "Exception caught:\n" << e.what() << endl;
BOOST_ASSERT(false);
{
lyxerr << "Exception caught:\n" << e.what() << endl;
BOOST_ASSERT(false);
if (prev_depth == min_depth)
return prev_par.itemdepth;
}
if (prev_depth == min_depth)
return prev_par.itemdepth;
}
- min_depth = std::min(min_depth, prev_depth);
+ min_depth = min(min_depth, prev_depth);
// small optimization: if we are at depth 0, we won't
// find anything else
if (prev_depth == 0)
// small optimization: if we are at depth 0, we won't
// find anything else
if (prev_depth == 0)
// libstdc++ that is distributed with GNU G++.
class Messages::Pimpl {
public:
// libstdc++ that is distributed with GNU G++.
class Messages::Pimpl {
public:
- typedef std::messages<char>::catalog catalog;
+ typedef messages<char>::catalog catalog;
Pimpl(string const & l)
: lang_(l),
loc_gl(lang_.c_str()),
Pimpl(string const & l)
: lang_(l),
loc_gl(lang_.c_str()),
- mssg_gl(std::use_facet<std::messages<char> >(loc_gl))
+ mssg_gl(use_facet<messages<char> >(loc_gl))
{
//lyxerr << "Messages: language(" << l
{
//lyxerr << "Messages: language(" << l
- // << ") in dir(" << dir << ")" << std::endl;
+ // << ") in dir(" << dir << ")" << endl;
string const locale_dir = package().locale_dir().toFilesystemEncoding();
cat_gl = mssg_gl.open(PACKAGE, loc_gl, locale_dir.c_str());
string const locale_dir = package().locale_dir().toFilesystemEncoding();
cat_gl = mssg_gl.open(PACKAGE, loc_gl, locale_dir.c_str());
- std::messages<char> const & mssg_gl;
+ messages<char> const & mssg_gl;
: lang_(l)
{
//lyxerr << "Messages: language(" << l
: lang_(l)
{
//lyxerr << "Messages: language(" << l
- // << ") in dir(" << dir << ")" << std::endl;
+ // << ") in dir(" << dir << ")" << endl;
#include <exception>
#include <ostream>
#include <exception>
#include <ostream>
-void throw_exception(std::exception const & e)
+void throw_exception(exception const & e)
{
lyx::lyxerr << "Exception caught:\n" << e.what() << endl;
BOOST_ASSERT(false);
{
lyx::lyxerr << "Exception caught:\n" << e.what() << endl;
BOOST_ASSERT(false);
class CmdLineParser {
public:
typedef int (*optfunc)(vector<docstring> const & args);
class CmdLineParser {
public:
typedef int (*optfunc)(vector<docstring> const & args);
- std::map<string, optfunc> helper;
- std::map<string, bool> isset;
+ map<string, optfunc> helper;
+ map<string, bool> isset;
bool parse(int, char * []);
vector<char *> nonopt;
};
bool parse(int, char * []);
vector<char *> nonopt;
};
{ l.stream() << t; return l; }
LyXErr & operator<<(LyXErr & l, double t)
{ l.stream() << t; return l; }
{ l.stream() << t; return l; }
LyXErr & operator<<(LyXErr & l, double t)
{ l.stream() << t; return l; }
-LyXErr & operator<<(LyXErr & l, std::string const & t)
+LyXErr & operator<<(LyXErr & l, string const & t)
{ l.stream() << t; return l; }
LyXErr & operator<<(LyXErr & l, docstring const & t)
{ l.stream() << to_utf8(t); return l; }
LyXErr & operator<<(LyXErr & l, support::FileName const & t)
{ l.stream() << t; return l; }
{ l.stream() << t; return l; }
LyXErr & operator<<(LyXErr & l, docstring const & t)
{ l.stream() << to_utf8(t); return l; }
LyXErr & operator<<(LyXErr & l, support::FileName const & t)
{ l.stream() << t; return l; }
-LyXErr & operator<<(LyXErr & l, std::ostream &(*t)(std::ostream &))
+LyXErr & operator<<(LyXErr & l, ostream &(*t)(ostream &))
{ l.stream() << t; return l; }
{ l.stream() << t; return l; }
-LyXErr & operator<<(LyXErr & l, std::ios_base &(*t)(std::ios_base &))
+LyXErr & operator<<(LyXErr & l, ios_base &(*t)(ios_base &))
{ l.stream() << t; return l; }
LyXErr lyxerr;
{ l.stream() << t; return l; }
LyXErr lyxerr;
case LFUN_TABULAR_INSERT: {
if (cmd.argument().empty())
return 0;
case LFUN_TABULAR_INSERT: {
if (cmd.argument().empty())
return 0;
- std::istringstream ss(to_utf8(cmd.argument()));
+ istringstream ss(to_utf8(cmd.argument()));
int r = 0, c = 0;
ss >> r >> c;
if (r <= 0)
int r = 0, c = 0;
ss >> r >> c;
if (r <= 0)
default:
lyxerr << "Inset '" << name << "' not permitted with LFUN_INSET_INSERT."
default:
lyxerr << "Inset '" << name << "' not permitted with LFUN_INSET_INSERT."
case NO_CODE:
default:
lyxerr << "unknown CommandInset '" << insetType
case NO_CODE:
default:
lyxerr << "unknown CommandInset '" << insetType
while (lex.isOK() && lex.getString() != "\\end_inset")
lex.next();
return 0;
while (lex.isOK() && lex.getString() != "\\end_inset")
lex.next();
return 0;
inset.reset(new InsetInfo(buf.params()));
} else {
lyxerr << "unknown Inset type '" << tmptok
inset.reset(new InsetInfo(buf.params()));
} else {
lyxerr << "unknown Inset type '" << tmptok
while (lex.isOK() && lex.getString() != "\\end_inset")
lex.next();
return 0;
while (lex.isOK() && lex.getString() != "\\end_inset")
lex.next();
return 0;
#include <QPixmap>
#include <QPainter>
#include <QPixmap>
#include <QPainter>
void BulletsModule::setupPanel(QListWidget * lw, QString const & panelname,
void BulletsModule::setupPanel(QListWidget * lw, QString const & panelname,
- std::string const & fname)
{
connect(lw, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),
this, SLOT(bulletSelected(QListWidgetItem *, QListWidgetItem*)));
{
connect(lw, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),
this, SLOT(bulletSelected(QListWidgetItem *, QListWidgetItem*)));
namespace lyx {
namespace frontend {
namespace lyx {
namespace frontend {
<< printInput(input)
<< " from state "
<< printState(state_)
<< printInput(input)
<< " from state "
<< printState(state_)
-std::ostream & operator<<(std::ostream & os, ButtonPolicy::State st)
+ostream & operator<<(ostream & os, ButtonPolicy::State st)
{
return os << int(st);
}
{
return os << int(st);
}
-std::ostream & operator<<(std::ostream & os, ButtonPolicy::SMInput smi)
+ostream & operator<<(ostream & os, ButtonPolicy::SMInput smi)
{
return os << int(smi);
}
{
return os << int(smi);
}
-Dialog::Dialog(GuiView & lv, std::string const & name)
+Dialog::Dialog(GuiView & lv, string const & name)
: name_(name), lyxview_(&lv)
{}
: name_(name), lyxview_(&lv)
{}
-std::string const & Dialog::name() const
+string const & Dialog::name() const
-std::string const Dialog::bufferFilepath() const
+string const Dialog::bufferFilepath() const
{
return buffer().filePath();
}
{
return buffer().filePath();
}
#include <QCloseEvent>
#include <QShowEvent>
#include <QCloseEvent>
#include <QShowEvent>
namespace lyx {
namespace frontend {
namespace lyx {
namespace frontend {
-DialogView::DialogView(GuiView & lv, std::string const & name)
+DialogView::DialogView(GuiView & lv, string const & name)
: QDialog(&lv), Dialog(lv, name)
{}
: QDialog(&lv), Dialog(lv, name)
{}
while (true) {
size_t const nxtpos1 = text.find(' ', curpos);
size_t const nxtpos2 = text.find('\n', curpos);
while (true) {
size_t const nxtpos1 = text.find(' ', curpos);
size_t const nxtpos2 = text.find('\n', curpos);
- size_t const nxtpos = std::min(nxtpos1, nxtpos2);
+ size_t const nxtpos = min(nxtpos1, nxtpos2);
docstring const word =
nxtpos == docstring::npos ?
docstring const word =
nxtpos == docstring::npos ?
- catch (std::exception const & e) {
+ catch (exception const & e) {
docstring s = _("LyX has caught an exception, it will now "
"attempt to save all unsaved documents and exit."
"\n\nException: ");
docstring s = _("LyX has caught an exception, it will now "
"attempt to save all unsaved documents and exit."
"\n\nException: ");
*it = onlyFilename(*it);
}
// sort on filename only (no path)
*it = onlyFilename(*it);
}
// sort on filename only (no path)
- std::sort(data.begin(), data.end());
+ sort(data.begin(), data.end());
*it = onlyFilename(*it);
}
// sort on filename only (no path)
*it = onlyFilename(*it);
}
// sort on filename only (no path)
- std::sort(data.begin(), data.end());
+ sort(data.begin(), data.end());
template<class A, class B>
template<class A, class B>
-static int findPos2nd(vector<std::pair<A, B> > const & vec, B const & val)
+static int findPos2nd(vector<pair<A, B> > const & vec, B const & val)
- typedef typename vector<std::pair<A, B> >::const_iterator
+ typedef typename vector<pair<A, B> >::const_iterator
const_iterator;
for (const_iterator cit = vec.begin(); cit != vec.end(); ++cit)
const_iterator;
for (const_iterator cit = vec.begin(); cit != vec.end(); ++cit)
void GuiCitation::applyView()
{
void GuiCitation::applyView()
{
- int const choice = std::max(0, citationStyleCO->currentIndex());
+ int const choice = max(0, citationStyleCO->currentIndex());
style_ = choice;
bool const full = fulllistCB->isChecked();
bool const force = forceuppercaseCB->isChecked();
style_ = choice;
bool const full = fulllistCB->isChecked();
bool const force = forceuppercaseCB->isChecked();
list->resize(list->sizeHint());
QPoint const pos = edit_->mapToGlobal(QPoint(0, 0));
list->resize(list->sizeHint());
QPoint const pos = edit_->mapToGlobal(QPoint(0, 0));
- int const y = std::max(0, pos.y() - list->height());
+ int const y = max(0, pos.y() - list->height());
leftLW->setViewMode(QListView::IconMode);
rightLW->setViewMode(QListView::IconMode);
leftLW->setViewMode(QListView::IconMode);
rightLW->setViewMode(QListView::IconMode);
- typedef std::map<char_type, QListWidgetItem *> ListItems;
+ typedef map<char_type, QListWidgetItem *> ListItems;
ListItems list_items;
// The last element is the empty one.
int const end = nr_latex_delimiters - 1;
ListItems list_items;
// The last element is the empty one.
int const end = nr_latex_delimiters - 1;
namespace lyx {
namespace frontend {
namespace lyx {
namespace frontend {
-GuiDialog::GuiDialog(GuiView & lv, std::string const & name)
+GuiDialog::GuiDialog(GuiView & lv, string const & name)
: DialogView(lv, name), is_closing_(false)
{}
: DialogView(lv, name), is_closing_(false)
{}
-std::vector<typename Pair::second_type> const
-getSecond(std::vector<Pair> const & pr)
+vector<typename Pair::second_type> const
+getSecond(vector<Pair> const & pr)
- std::vector<typename Pair::second_type> tmp(pr.size());
- std::transform(pr.begin(), pr.end(), tmp.begin(),
+ vector<typename Pair::second_type> tmp(pr.size());
+ transform(pr.begin(), pr.end(), tmp.begin(),
boost::bind(&Pair::second, _1));
return tmp;
}
boost::bind(&Pair::second, _1));
return tmp;
}
If not found, return 0.
*/
template<class A>
If not found, return 0.
*/
template<class A>
-static size_t findPos(std::vector<A> const & vec, A const & val)
+static size_t findPos(vector<A> const & vec, A const & val)
- typename std::vector<A>::const_iterator it =
- std::find(vec.begin(), vec.end(), val);
+ typename vector<A>::const_iterator it =
+ find(vec.begin(), vec.end(), val);
if (it == vec.end())
return 0;
return distance(vec.begin(), it);
if (it == vec.end())
return 0;
return distance(vec.begin(), it);
#include <QPushButton>
#include <QCloseEvent>
#include <QPushButton>
#include <QCloseEvent>
namespace lyx {
namespace frontend {
namespace lyx {
namespace frontend {
-bool GuiERT::initialiseParams(std::string const & data)
+bool GuiERT::initialiseParams(string const & data)
{
InsetERTMailer::string2params(data, status_);
return true;
{
InsetERTMailer::string2params(data, status_);
return true;
// Now make the selection.
// This should be implemented using an LFUN. (Angus)
// if pos_end is 0, this means it is end-of-paragraph
// Now make the selection.
// This should be implemented using an LFUN. (Angus)
// if pos_end is 0, this means it is end-of-paragraph
- pos_type const end = err.pos_end ? std::min(err.pos_end, pit->size())
+ pos_type const end = err.pos_end ? min(err.pos_end, pit->size())
- pos_type const start = std::min(err.pos_start, end);
+ pos_type const start = min(err.pos_start, end);
pos_type const range = end - start;
DocIterator const dit = makeDocIterator(pit, start);
bufferview()->putSelectionAt(dit, range, false);
pos_type const range = end - start;
DocIterator const dit = makeDocIterator(pit, start);
bufferview()->putSelectionAt(dit, range, false);
bc().addCheckedLineEdit(ytED, rtLA);
bc().addCheckedLineEdit(fileED, fileLA);
bc().addCheckedLineEdit(ytED, rtLA);
bc().addCheckedLineEdit(fileED, fileLA);
- std::vector<string> templates = getTemplates();
+ vector<string> templates = getTemplates();
- for (std::vector<string>::const_iterator cit = templates.begin();
+ for (vector<string>::const_iterator cit = templates.begin();
cit != templates.end(); ++cit) {
externalCO->addItem(qt_(*cit));
}
cit != templates.end(); ++cit) {
externalCO->addItem(qt_(*cit));
}
void GuiExternal::extraChanged(const QString& text)
{
void GuiExternal::extraChanged(const QString& text)
{
- std::string const format = fromqstr(extraFormatCO->currentText());
+ string const format = fromqstr(extraFormatCO->currentText());
extra_[format] = text;
changed();
}
extra_[format] = text;
changed();
}
external::ResizeData const & data)
{
bool using_scale = data.usingScale();
external::ResizeData const & data)
{
bool using_scale = data.usingScale();
- std::string scale = data.scale;
+ string scale = data.scale;
if (data.no_resize()) {
// Everything is zero, so default to this!
using_scale = true;
if (data.no_resize()) {
// Everything is zero, so default to this!
using_scale = true;
#include <QFontInfo>
#include <QFontDatabase>
#include <QFontInfo>
#include <QFontDatabase>
QString const math_fonts[] = {"cmex10", "cmmi10", "cmr10", "cmsy10",
"eufm10", "msam10", "msbm10", "wasy10", "esint10"};
QString const math_fonts[] = {"cmex10", "cmmi10", "cmr10", "cmsy10",
"eufm10", "msam10", "msbm10", "wasy10", "esint10"};
bool GuiFontLoader::available(FontInfo const & f)
{
bool GuiFontLoader::available(FontInfo const & f)
{
- static std::vector<int> cache_set(NUM_FAMILIES, false);
- static std::vector<int> cache(NUM_FAMILIES, false);
+ static vector<int> cache_set(NUM_FAMILIES, false);
+ static vector<int> cache(NUM_FAMILIES, false);
FontFamily family = f.family();
if (cache_set[family])
FontFamily family = f.family();
if (cache_set[family])
-/// The (tranlated) GUI std::string and it's LaTeX equivalent.
-typedef std::pair<docstring, std::string> RotationOriginPair;
+/// The (tranlated) GUI string and it's LaTeX equivalent.
+typedef pair<docstring, string> RotationOriginPair;
-std::vector<RotationOriginPair> getRotationOriginData();
+vector<RotationOriginPair> getRotationOriginData();
GuiGraphics::GuiGraphics(GuiView & lv)
GuiGraphics::GuiGraphics(GuiView & lv)
igp.rotateAngle = fromqstr(angle->text());
double rotAngle = convert<double>(igp.rotateAngle);
igp.rotateAngle = fromqstr(angle->text());
double rotAngle = convert<double>(igp.rotateAngle);
- if (std::abs(rotAngle) > 360.0) {
+ if (abs(rotAngle) > 360.0) {
rotAngle -= 360.0 * floor(rotAngle / 360.0);
igp.rotateAngle = convert<string>(rotAngle);
}
rotAngle -= 360.0 * floor(rotAngle / 360.0);
igp.rotateAngle = convert<string>(rotAngle);
}
#include <QImage>
#include <QImageReader>
#include <QImage>
#include <QImageReader>
-using lyx::support::ascii_lowercase;
-
+using namespace std;
+using namespace lyx::support;
namespace lyx {
namespace graphics {
namespace lyx {
namespace graphics {
LYXERR(Debug::GRAPHICS, (const char *) *it << ", ");
LYXERR(Debug::GRAPHICS, (const char *) *it << ", ");
- std::string ext = ascii_lowercase((const char *) *it);
+ string ext = ascii_lowercase((const char *) *it);
// special case
if (ext == "jpeg")
// special case
if (ext == "jpeg")
/////////////////////////////////////////////////////////////////
GuiIndexDialogBase::GuiIndexDialogBase(GuiView & lv,
/////////////////////////////////////////////////////////////////
GuiIndexDialogBase::GuiIndexDialogBase(GuiView & lv,
- docstring const & title, QString const & label, std::string const & name)
+ docstring const & title, QString const & label, string const & name)
: GuiCommand(lv, name)
{
label_ = label;
: GuiCommand(lv, name)
{
label_ = label;
-static string plainParam(std::string const & par)
+static string plainParam(string const & par)
{
// remove enclosing braces
if (prefixIs(par, "{") && suffixIs(par, "}"))
{
// remove enclosing braces
if (prefixIs(par, "{") && suffixIs(par, "}"))
getContents(ss);
logTB->setPlainText(toqstr(ss.str()));
getContents(ss);
logTB->setPlainText(toqstr(ss.str()));
-void GuiLog::getContents(std::ostream & ss) const
+void GuiLog::getContents(ostream & ss) const
- std::ifstream in(logfile_.toFilesystemEncoding().c_str());
+ ifstream in(logfile_.toFilesystemEncoding().c_str());
namespace lyx {
namespace frontend {
namespace lyx {
namespace frontend {
-GuiMath::GuiMath(GuiView & lv, std::string const & name)
+GuiMath::GuiMath(GuiView & lv, string const & name)
: GuiDialog(lv, name)
{
// FIXME: Ideally, those unicode codepoints would be defined
: GuiDialog(lv, name)
{
// FIXME: Ideally, those unicode codepoints would be defined
math_symbols_["vert"] = MathSymbol(0x007C, 106, CMSY_FAMILY);
math_symbols_["Vert"] = MathSymbol(0x2016, 107, CMSY_FAMILY);
math_symbols_["vert"] = MathSymbol(0x007C, 106, CMSY_FAMILY);
math_symbols_["Vert"] = MathSymbol(0x2016, 107, CMSY_FAMILY);
- std::map<string, MathSymbol>::const_iterator it = math_symbols_.begin();
- std::map<string, MathSymbol>::const_iterator end = math_symbols_.end();
+ map<string, MathSymbol>::const_iterator it = math_symbols_.begin();
+ map<string, MathSymbol>::const_iterator end = math_symbols_.end();
for (; it != end; ++it)
tex_names_[it->second.unicode] = it->first;
}
for (; it != end; ++it)
tex_names_[it->second.unicode] = it->first;
}
-std::string const & GuiMath::texName(char_type math_symbol) const
+string const & GuiMath::texName(char_type math_symbol) const
{
map<char_type, string>::const_iterator it =
tex_names_.find(math_symbol);
{
map<char_type, string>::const_iterator it =
tex_names_.find(math_symbol);
// We need to draw the text as LTR as we use our own bidi code.
setLayoutDirection(Qt::LeftToRight);
drawText(x, y, str);
// We need to draw the text as LTR as we use our own bidi code.
setLayoutDirection(Qt::LeftToRight);
drawText(x, y, str);
- //LYXERR(Debug::PAINTING, "draw " << std::string(str.toUtf8())
+ //LYXERR(Debug::PAINTING, "draw " << string(str.toUtf8())
// << " at " << x << "," << y);
return textwidth;
}
// << " at " << x << "," << y);
return textwidth;
}
// Only the left bearing of the first character is important
// as we always write from left to right, even for
// right-to-left languages.
// Only the left bearing of the first character is important
// as we always write from left to right, even for
// right-to-left languages.
- int const lb = std::min(fi.metrics.lbearing(s[0]), 0);
+ int const lb = min(fi.metrics.lbearing(s[0]), 0);
int const mA = fi.metrics.maxAscent();
if (!QPixmapCache::find(key, pm)) {
// Only the right bearing of the last character is
int const mA = fi.metrics.maxAscent();
if (!QPixmapCache::find(key, pm)) {
// Only the right bearing of the last character is
/////////////////////////////////////////////////////////////////////
template<class A>
/////////////////////////////////////////////////////////////////////
template<class A>
-static size_t findPos_helper(std::vector<A> const & vec, A const & val)
+static size_t findPos_helper(vector<A> const & vec, A const & val)
- typedef typename std::vector<A>::const_iterator Cit;
+ typedef typename vector<A>::const_iterator Cit;
- Cit it = std::find(vec.begin(), vec.end(), val);
+ Cit it = find(vec.begin(), vec.end(), val);
if (it == vec.end())
return 0;
if (it == vec.end())
return 0;
- return std::distance(vec.begin(), it);
+ return distance(vec.begin(), it);
}
static void parseFontName(QString const & mangled0,
string & name, string & foundry)
{
}
static void parseFontName(QString const & mangled0,
string & name, string & foundry)
{
- std::string mangled = fromqstr(mangled0);
+ string mangled = fromqstr(mangled0);
size_t const idx = mangled.find('[');
if (idx == string::npos || idx == 0) {
name = mangled;
size_t const idx = mangled.find('[');
if (idx == string::npos || idx == 0) {
name = mangled;
lcolors_.push_back(lc);
}
lcolors_.push_back(lc);
}
- std::sort(lcolors_.begin(), lcolors_.end(), ColorSorter());
+ sort(lcolors_.begin(), lcolors_.end(), ColorSorter());
vector<ColorCode>::const_iterator cit = lcolors_.begin();
vector<ColorCode>::const_iterator const end = lcolors_.end();
for (; cit != end; ++cit) {
vector<ColorCode>::const_iterator cit = lcolors_.begin();
vector<ColorCode>::const_iterator const end = lcolors_.end();
for (; cit != end; ++cit) {
Converters::const_iterator ccit = form_->converters().begin();
Converters::const_iterator cend = form_->converters().end();
for (; ccit != cend; ++ccit) {
Converters::const_iterator ccit = form_->converters().begin();
Converters::const_iterator cend = form_->converters().end();
for (; ccit != cend; ++ccit) {
- std::string const name =
ccit->From->prettyname() + " -> " + ccit->To->prettyname();
int type = form_->converters().getNumber(ccit->From->name(), ccit->To->name());
new QListWidgetItem(toqstr(name), convertersLW, type);
ccit->From->prettyname() + " -> " + ccit->To->prettyname();
int type = form_->converters().getNumber(ccit->From->name(), ccit->To->name());
new QListWidgetItem(toqstr(name), convertersLW, type);
-std::string FormatNameValidator::str(Formats::const_iterator it) const
+string FormatNameValidator::str(Formats::const_iterator it) const
-std::string FormatPrettynameValidator::str(Formats::const_iterator it) const
+string FormatPrettynameValidator::str(Formats::const_iterator it) const
{
return it->prettyname();
}
{
return it->prettyname();
}
defaultLanguageCO->clear();
// store the lang identifiers for later
defaultLanguageCO->clear();
// store the lang identifiers for later
- std::vector<LanguagePair> const langs = getLanguageData(false);
- std::vector<LanguagePair>::const_iterator lit = langs.begin();
- std::vector<LanguagePair>::const_iterator lend = langs.end();
+ vector<LanguagePair> const langs = getLanguageData(false);
+ vector<LanguagePair>::const_iterator lit = langs.begin();
+ vector<LanguagePair>::const_iterator lend = langs.end();
lang_.clear();
for (; lit != lend; ++lit) {
defaultLanguageCO->addItem(toqstr(lit->first));
lang_.clear();
for (; lit != lend; ++lit) {
defaultLanguageCO->addItem(toqstr(lit->first));
-bool GuiPreferences::initialiseParams(std::string const &)
+bool GuiPreferences::initialiseParams(string const &)
{
rc_ = lyxrc;
formats_ = lyx::formats;
{
rc_ = lyxrc;
formats_ = lyx::formats;
-bool GuiPrint::initialiseParams(std::string const &)
+bool GuiPrint::initialiseParams(string const &)
{
/// get global printer parameters
string const name = support::changeExtension(buffer().absFileName(),
{
/// get global printer parameters
string const name = support::changeExtension(buffer().absFileName(),
// the first item inserted
QString const oldSelection(referenceED->text());
// the first item inserted
QString const oldSelection(referenceED->text());
- for (std::vector<docstring>::const_iterator iter = refs_.begin();
+ for (vector<docstring>::const_iterator iter = refs_.begin();
iter != refs_.end(); ++iter) {
refsLW->addItem(toqstr(*iter));
}
iter != refs_.end(); ++iter) {
refsLW->addItem(toqstr(*iter));
}
-bool GuiSendTo::initialiseParams(std::string const &)
+bool GuiSendTo::initialiseParams(string const &)
{
format_ = 0;
command_ = lyxrc.custom_export_command;
{
format_ = 0;
command_ = lyxrc.custom_export_command;
}
// Remove repeated formats.
}
// Remove repeated formats.
- std::sort(to.begin(), to.end());
- to.erase(std::unique(to.begin(), to.end()), to.end());
+ sort(to.begin(), to.end());
+ to.erase(unique(to.begin(), to.end()), to.end());
#include <QPushButton>
#include <QCloseEvent>
#include <QPushButton>
#include <QCloseEvent>
namespace lyx {
namespace frontend {
namespace lyx {
namespace frontend {
-bool GuiShowFile::initialiseParams(std::string const & data)
+bool GuiShowFile::initialiseParams(string const & data)
{
filename_ = FileName(data);
return true;
{
filename_ = FileName(data);
return true;
-bool GuiSpellchecker::initialiseParams(std::string const &)
+bool GuiSpellchecker::initialiseParams(string const &)
{
LYXERR(Debug::GUI, "Spellchecker::initialiseParams");
{
LYXERR(Debug::GUI, "Spellchecker::initialiseParams");
*it1 = support::onlyFilename(*it1);
// sort on filename only (no path)
*it1 = support::onlyFilename(*it1);
// sort on filename only (no path)
- std::sort(data.begin(), data.end());
+ sort(data.begin(), data.end());
fileListLW->clear();
ContentsType::const_iterator it = data.begin();
fileListLW->clear();
ContentsType::const_iterator it = data.begin();
if (filename.empty())
return string();
string optionList;
if (filename.empty())
return string();
string optionList;
- std::ifstream is(filename.toFilesystemEncoding().c_str());
+ ifstream is(filename.toFilesystemEncoding().c_str());
while (is) {
string s;
is >> s;
while (is) {
string s;
is >> s;
QTreeWidgetItem * i = new QTreeWidgetItem(meaningsTV);
i->setText(0, toqstr(cit->first));
meaningsTV->expandItem(i);
QTreeWidgetItem * i = new QTreeWidgetItem(meaningsTV);
i->setText(0, toqstr(cit->first));
meaningsTV->expandItem(i);
- for (std::vector<docstring>::const_iterator cit2 = cit->second.begin();
+ for (vector<docstring>::const_iterator cit2 = cit->second.begin();
cit2 != cit->second.end(); ++cit2) {
QTreeWidgetItem * i2 = new QTreeWidgetItem(i);
i2->setText(0, toqstr(*cit2));
cit2 != cit->second.end(); ++cit2) {
QTreeWidgetItem * i2 = new QTreeWidgetItem(i);
i2->setText(0, toqstr(*cit2));
PngMap const * const end = begin + nr_sorted_png_map;
BOOST_ASSERT(sorted(begin, end));
PngMap const * const end = begin + nr_sorted_png_map;
BOOST_ASSERT(sorted(begin, end));
- PngMap const * const it = std::find_if(begin, end, CompareKey(name));
+ PngMap const * const it = find_if(begin, end, CompareKey(name));
string png_name;
if (it != end)
string png_name;
if (it != end)
- std::cout << "State " << info.state << " FLAGS: " << flags
+ cout << "State " << info.state << " FLAGS: " << flags
<< " ON:" << (flags & ToolbarBackend::ON)
<< " OFF:" << (flags & ToolbarBackend::OFF)
<< " L:" << (flags & ToolbarBackend::LEFT)
<< " ON:" << (flags & ToolbarBackend::ON)
<< " OFF:" << (flags & ToolbarBackend::OFF)
<< " L:" << (flags & ToolbarBackend::LEFT)
<< " RE:" << (flags & ToolbarBackend::REVIEW)
<< " TB:" << (flags & ToolbarBackend::TABLE)
<< " AU:" << (flags & ToolbarBackend::AUTO)
<< " RE:" << (flags & ToolbarBackend::REVIEW)
<< " TB:" << (flags & ToolbarBackend::TABLE)
<< " AU:" << (flags & ToolbarBackend::AUTO)
*/
// now set the flags
tbinfo.flags = static_cast<lyx::ToolbarInfo::Flags>(flags);
*/
// now set the flags
tbinfo.flags = static_cast<lyx::ToolbarInfo::Flags>(flags);
bool GuiToolbars::visible(string const & name) const
{
bool GuiToolbars::visible(string const & name) const
{
- std::map<string, GuiToolbar *>::const_iterator it =
+ map<string, GuiToolbar *>::const_iterator it =
toolbars_.find(name);
if (it == toolbars_.end())
return false;
toolbars_.find(name);
if (it == toolbars_.end())
return false;
GuiLayoutBox * layout_;
///
GuiLayoutBox * layout_;
///
- std::map<std::string, Inset *> open_insets_;
+ map<string, Inset *> open_insets_;
- std::map<std::string, DialogPtr> dialogs_;
+ map<string, DialogPtr> dialogs_;
unsigned int smallIconSize;
unsigned int normalIconSize;
unsigned int smallIconSize;
unsigned int normalIconSize;
settings.setValue(key + "/icon_size", iconSize());
d.toolbars_->saveToolbarInfo();
// Now take care of all other dialogs:
settings.setValue(key + "/icon_size", iconSize());
d.toolbars_->saveToolbarInfo();
// Now take care of all other dialogs:
- std::map<string, DialogPtr>::const_iterator it = d.dialogs_.begin();
+ map<string, DialogPtr>::const_iterator it = d.dialogs_.begin();
for (; it!= d.dialogs_.end(); ++it)
it->second->saveSession();
}
for (; it!= d.dialogs_.end(); ++it)
it->second->saveSession();
}
if (!isDialogVisible(name))
return;
if (!isDialogVisible(name))
return;
- std::map<string, DialogPtr>::const_iterator it = d.dialogs_.find(name);
+ map<string, DialogPtr>::const_iterator it = d.dialogs_.find(name);
if (it == d.dialogs_.end())
return;
if (it == d.dialogs_.end())
return;
bool isValidName(string const & name)
{
bool isValidName(string const & name)
{
- return std::find_if(dialognames, end_dialognames,
+ return find_if(dialognames, end_dialognames,
cmpCStr(name.c_str())) != end_dialognames;
}
cmpCStr(name.c_str())) != end_dialognames;
}
if (!isValidName(name))
return 0;
if (!isValidName(name))
return 0;
- std::map<string, DialogPtr>::iterator it = d.dialogs_.find(name);
+ map<string, DialogPtr>::iterator it = d.dialogs_.find(name);
if (it != d.dialogs_.end())
return it->second.get();
if (it != d.dialogs_.end())
return it->second.get();
bool GuiView::isDialogVisible(string const & name) const
{
bool GuiView::isDialogVisible(string const & name) const
{
- std::map<string, DialogPtr>::const_iterator it = d.dialogs_.find(name);
+ map<string, DialogPtr>::const_iterator it = d.dialogs_.find(name);
if (it == d.dialogs_.end())
return false;
return it->second.get()->isVisibleView();
if (it == d.dialogs_.end())
return false;
return it->second.get()->isVisibleView();
- std::map<string, DialogPtr>::const_iterator it = d.dialogs_.find(name);
+ map<string, DialogPtr>::const_iterator it = d.dialogs_.find(name);
if (it == d.dialogs_.end())
return;
if (it == d.dialogs_.end())
return;
if (!isValidName(name))
return 0;
if (!isValidName(name))
return 0;
- std::map<string, Inset *>::const_iterator it = d.open_insets_.find(name);
+ map<string, Inset *>::const_iterator it = d.open_insets_.find(name);
return it == d.open_insets_.end() ? 0 : it->second;
}
void GuiView::hideAll() const
{
return it == d.open_insets_.end() ? 0 : it->second;
}
void GuiView::hideAll() const
{
- std::map<string, DialogPtr>::const_iterator it = d.dialogs_.begin();
- std::map<string, DialogPtr>::const_iterator end = d.dialogs_.end();
+ map<string, DialogPtr>::const_iterator it = d.dialogs_.begin();
+ map<string, DialogPtr>::const_iterator end = d.dialogs_.end();
for(; it != end; ++it)
it->second->hideView();
for(; it != end; ++it)
it->second->hideView();
void GuiView::hideBufferDependent() const
{
void GuiView::hideBufferDependent() const
{
- std::map<string, DialogPtr>::const_iterator it = d.dialogs_.begin();
- std::map<string, DialogPtr>::const_iterator end = d.dialogs_.end();
+ map<string, DialogPtr>::const_iterator it = d.dialogs_.begin();
+ map<string, DialogPtr>::const_iterator end = d.dialogs_.end();
for(; it != end; ++it) {
Dialog * dialog = it->second.get();
for(; it != end; ++it) {
Dialog * dialog = it->second.get();
void GuiView::updateBufferDependent(bool switched) const
{
void GuiView::updateBufferDependent(bool switched) const
{
- std::map<string, DialogPtr>::const_iterator it = d.dialogs_.begin();
- std::map<string, DialogPtr>::const_iterator end = d.dialogs_.end();
+ map<string, DialogPtr>::const_iterator it = d.dialogs_.begin();
+ map<string, DialogPtr>::const_iterator end = d.dialogs_.end();
for(; it != end; ++it) {
Dialog * dialog = it->second.get();
for(; it != end; ++it) {
Dialog * dialog = it->second.get();
void GuiView::checkStatus()
{
void GuiView::checkStatus()
{
- std::map<string, DialogPtr>::const_iterator it = d.dialogs_.begin();
- std::map<string, DialogPtr>::const_iterator end = d.dialogs_.end();
+ map<string, DialogPtr>::const_iterator it = d.dialogs_.begin();
+ map<string, DialogPtr>::const_iterator end = d.dialogs_.end();
for(; it != end; ++it) {
Dialog * const dialog = it->second.get();
for(; it != end; ++it) {
Dialog * const dialog = it->second.get();
par_end = view->cursor().selectionEnd().bottom().pit();
}
if (par_begin > par_end)
par_end = view->cursor().selectionEnd().bottom().pit();
}
if (par_begin > par_end)
- std::swap(par_begin, par_end);
+ swap(par_begin, par_end);
odocstringstream ostr;
view->buffer().getSourceCode(ostr, par_begin, par_end + 1, fullSource);
return toqstr(ostr.str());
odocstringstream ostr;
view->buffer().getSourceCode(ostr, par_begin, par_end + 1, fullSource);
return toqstr(ostr.str());
// do what cursor movement does (some grey)
int const h = scroll_.height + viewport()->height() / 4;
// do what cursor movement does (some grey)
int const h = scroll_.height + viewport()->height() / 4;
- int scroll_max_ = std::max(0, h - viewport()->height());
+ int scroll_max_ = max(0, h - viewport()->height());
verticalScrollBar()->setRange(0, scroll_max_);
verticalScrollBar()->setSliderPosition(scroll_.position);
verticalScrollBar()->setRange(0, scroll_max_);
verticalScrollBar()->setSliderPosition(scroll_.position);
namespace lyx {
namespace frontend {
namespace lyx {
namespace frontend {
void TocWidget::updateGui()
{
void TocWidget::updateGui()
{
- std::vector<docstring> const & type_names = form_.typeNames();
+ vector<docstring> const & type_names = form_.typeNames();
if (type_names.empty()) {
enableControls(false);
typeCO->clear();
if (type_names.empty()) {
enableControls(false);
typeCO->clear();
Sorter() : loc_ok(true)
{
try {
Sorter() : loc_ok(true)
{
try {
- loc_ = std::locale("");
} catch (...) {
loc_ok = false;
}
} catch (...) {
loc_ok = false;
}
return lhs.first < rhs.first;
}
private:
return lhs.first < rhs.first;
}
private:
vector<LanguagePair>::iterator begin = character_dlg ?
langs.begin() + 2 : langs.begin();
vector<LanguagePair>::iterator begin = character_dlg ?
langs.begin() + 2 : langs.begin();
- std::sort(begin, langs.end(), Sorter());
+ sort(begin, langs.end(), Sorter());
-void getTexFileList(string const & filename, std::vector<string> & list)
+void getTexFileList(string const & filename, vector<string> & list)
{
list.clear();
FileName const file = libFileSearch("", filename);
{
list.clear();
FileName const file = libFileSearch("", filename);
return;
// FIXME Unicode.
return;
// FIXME Unicode.
- std::vector<docstring> doclist =
+ vector<docstring> doclist =
getVectorFromString(file.fileContents("UTF-8"), from_ascii("\n"));
// Normalise paths like /foo//bar ==> /foo/bar
boost::RegEx regex("/{2,}");
getVectorFromString(file.fileContents("UTF-8"), from_ascii("\n"));
// Normalise paths like /foo//bar ==> /foo/bar
boost::RegEx regex("/{2,}");
- std::vector<docstring>::iterator it = doclist.begin();
- std::vector<docstring>::iterator end = doclist.end();
+ vector<docstring>::iterator it = doclist.begin();
+ vector<docstring>::iterator end = doclist.end();
for (; it != end; ++it)
list.push_back(regex.Merge(to_utf8(*it), "/"));
// remove empty items and duplicates
for (; it != end; ++it)
list.push_back(regex.Merge(to_utf8(*it), "/"));
// remove empty items and duplicates
- list.erase(std::remove(list.begin(), list.end(), ""), list.end());
+ list.erase(remove(list.begin(), list.end(), ""), list.end());
eliminate_duplicates(list);
}
eliminate_duplicates(list);
}
-typedef std::map<string, string> InfoMap;
+typedef map<string, string> InfoMap;
-// A functor for use with std::find_if, used to ascertain whether a
+// A functor for use with find_if, used to ascertain whether a
// data entry matches the required regex_
// This class is unfortunately copied from ../frontend_helpers.cpp, so we should
// try to make sure to keep the two in sync.
// data entry matches the required regex_
// This class is unfortunately copied from ../frontend_helpers.cpp, so we should
// try to make sure to keep the two in sync.
-class RegexMatch : public std::unary_function<string, bool>
+class RegexMatch : public unary_function<string, bool>
{
public:
// re and icase are used to construct an instance of boost::RegEx.
{
public:
// re and icase are used to construct an instance of boost::RegEx.
-void throw_exception(std::exception const & /*e*/)
+void throw_exception(exception const & /*e*/)
/** The cache contains one item per file, so use a map to find the
* cache item quickly by filename.
*/
/** The cache contains one item per file, so use a map to find the
* cache item quickly by filename.
*/
-typedef std::map<FileName, Cache::ItemPtr> CacheType;
+typedef map<FileName, Cache::ItemPtr> CacheType;
class Cache::Impl {
public:
class Cache::Impl {
public:
-std::vector<string> Cache::loadableFormats() const
+vector<string> Cache::loadableFormats() const
{
return Image::loadableFormats();
}
{
return Image::loadableFormats();
}
script_file_ = FileName(onlyPath(to_file_base) + "lyxconvert" +
convert<string>(counter++) + ".py");
script_file_ = FileName(onlyPath(to_file_base) + "lyxconvert" +
convert<string>(counter++) + ".py");
- std::ofstream fs(script_file_.toFilesystemEncoding().c_str());
+ ofstream fs(script_file_.toFilesystemEncoding().c_str());
if (!fs.good()) {
lyxerr << "Unable to write the conversion script to \""
<< script_file_ << '\n'
<< "Please check your directory permissions."
if (!fs.good()) {
lyxerr << "Unable to write the conversion script to \""
<< script_file_ << '\n'
<< "Please check your directory permissions."
/// This class is a singleton class... use LoaderQueue::get() instead
LoaderQueue();
/// The in-progress loading queue (elements are unique here).
/// This class is a singleton class... use LoaderQueue::get() instead
LoaderQueue();
/// The in-progress loading queue (elements are unique here).
- std::list<Cache::ItemPtr> cache_queue_;
+ list<Cache::ItemPtr> cache_queue_;
/// Used to make the insertion of new elements faster.
/// Used to make the insertion of new elements faster.
- std::set<Cache::ItemPtr> cache_set_;
+ set<Cache::ItemPtr> cache_set_;
/// Newly touched elements go here. loadNext moves them to cache_queue_
/// Newly touched elements go here. loadNext moves them to cache_queue_
- std::queue<Cache::ItemPtr> bucket_;
+ queue<Cache::ItemPtr> bucket_;
list<Cache::ItemPtr>::iterator
end = cache_queue_.end();
list<Cache::ItemPtr>::iterator
end = cache_queue_.end();
- it = std::find(it, end, item);
+ it = find(it, end, item);
if (it != end)
cache_queue_.erase(it);
}
if (it != end)
cache_queue_.erase(it);
}
-std::ostream & operator<<(std::ostream & os, BoundingBox const & bb)
+ostream & operator<<(ostream & os, BoundingBox const & bb)
{
os << bb.xl << ' ' << bb.yb << ' ' << bb.xr << ' ' << bb.yt;
return os;
{
os << bb.xl << ' ' << bb.yb << ' ' << bb.xr << ' ' << bb.yt;
return os;
- std::istringstream is(bb.c_str());
+ istringstream is(bb.c_str());
string a, b, c, d;
is >> a >> b >> c >> d;
string a, b, c, d;
is >> a >> b >> c >> d;
PendingSnippets::const_iterator pend = pending.end();
BitmapFile::iterator sit = snippets.begin();
PendingSnippets::const_iterator pend = pending.end();
BitmapFile::iterator sit = snippets.begin();
- std::transform(pit, pend, sit,
+ transform(pit, pend, sit,
IncrementedFileName(to_format, filename_base));
}
IncrementedFileName(to_format, filename_base));
}
InProgressProcesses::iterator ipit = in_progress_.begin();
InProgressProcesses::iterator ipend = in_progress_.end();
InProgressProcesses::iterator ipit = in_progress_.begin();
InProgressProcesses::iterator ipend = in_progress_.end();
- std::for_each(ipit, ipend, EraseSnippet(latex_snippet));
+ for_each(ipit, ipend, EraseSnippet(latex_snippet));
while (ipit != ipend) {
InProgressProcesses::iterator curr = ipit++;
while (ipit != ipend) {
InProgressProcesses::iterator curr = ipit++;
BitmapFile::const_iterator it = git->second.snippets.begin();
BitmapFile::const_iterator end = git->second.snippets.end();
BitmapFile::const_iterator it = git->second.snippets.begin();
BitmapFile::const_iterator end = git->second.snippets.end();
- std::list<PreviewImagePtr> newimages;
+ list<PreviewImagePtr> newimages;
int metrics_counter = 0;
for (; it != end; ++it, ++metrics_counter) {
int metrics_counter = 0;
for (; it != end; ++it, ++metrics_counter) {
in_progress_.erase(git);
// Tell the outside world
in_progress_.erase(git);
// Tell the outside world
- std::list<PreviewImagePtr>::const_reverse_iterator
+ list<PreviewImagePtr>::const_reverse_iterator
nit = newimages.rbegin();
nit = newimages.rbegin();
- std::list<PreviewImagePtr>::const_reverse_iterator
+ list<PreviewImagePtr>::const_reverse_iterator
nend = newimages.rend();
for (; nit != nend; ++nit) {
imageReady(*nit->get());
nend = newimages.rend();
for (; nit != nend; ++nit) {
imageReady(*nit->get());
#include "insets/Inset.h"
#include "insets/Inset.h"
///
typedef boost::shared_ptr<PreviewLoader> PreviewLoaderPtr;
///
///
typedef boost::shared_ptr<PreviewLoader> PreviewLoaderPtr;
///
- typedef std::map<Buffer const *, PreviewLoaderPtr> CacheType;
+ typedef map<Buffer const *, PreviewLoaderPtr> CacheType;
str = substituteOptions(params, str, format);
// FIXME UNICODE
os << from_utf8(str);
str = substituteOptions(params, str, format);
// FIXME UNICODE
os << from_utf8(str);
- return int(std::count(str.begin(), str.end(),'\n'));
+ return int(count(str.begin(), str.end(),'\n'));
Template::Format const & format,
InsetExternalParams const & params)
{
Template::Format const & format,
InsetExternalParams const & params)
{
- typedef std::map<TransformID, TransformStore> Transformers;
+ typedef map<TransformID, TransformStore> Transformers;
Transformers::const_iterator it = format.command_transformers.find(id);
if (it == format.command_transformers.end())
return input;
Transformers::const_iterator it = format.command_transformers.find(id);
if (it == format.command_transformers.end())
return input;
Template::Format const & format,
InsetExternalParams const & params)
{
Template::Format const & format,
InsetExternalParams const & params)
{
- typedef std::map<TransformID, TransformStore> Transformers;
+ typedef map<TransformID, TransformStore> Transformers;
Transformers::const_iterator it = format.option_transformers.find(id);
if (it == format.option_transformers.end())
return input;
Transformers::const_iterator it = format.option_transformers.find(id);
if (it == format.option_transformers.end())
return input;
vector<string>::const_iterator qit = ft.requirements.begin();
vector<string>::const_iterator qend = ft.requirements.end();
for (; qit != qend; ++qit) {
vector<string>::const_iterator qit = ft.requirements.begin();
vector<string>::const_iterator qend = ft.requirements.end();
for (; qit != qend; ++qit) {
- lyxerr << "req:" << *qit << std::endl;
+ lyxerr << "req:" << *qit << endl;
ost << "\t\tRequirement " << *qit << '\n';
}
ost << "\t\tRequirement " << *qit << '\n';
}
if (int(id) == -1) {
lyxerr << "external::Template::readTemplate\n"
<< "Transform " << name << " is not recognized"
if (int(id) == -1) {
lyxerr << "external::Template::readTemplate\n"
<< "Transform " << name << " is not recognized"
} else {
ids.push_back(id);
}
} else {
ids.push_back(id);
}
-void transform_not_found(std::ostream & os, string const & transform)
+void transform_not_found(ostream & os, string const & transform)
{
os << "external::Format::readFormat. Transformation \""
{
os << "external::Format::readFormat. Transformation \""
- << transform << "\" is unrecognized." << std::endl;
+ << transform << "\" is unrecognized." << endl;
-void transform_class_not_found(std::ostream & os, string const & tclass)
+void transform_class_not_found(ostream & os, string const & tclass)
{
os << "external::Format::readFormat. Transformation class \""
{
os << "external::Format::readFormat. Transformation class \""
- << tclass << "\" is unrecognized." << std::endl;
+ << tclass << "\" is unrecognized." << endl;
#include <boost/regex.hpp>
#include <boost/regex.hpp>
-#include <cmath> // std::abs
#include <sstream>
using namespace std;
#include <sstream>
using namespace std;
string const ExtraData::get(string const & id) const
{
string const ExtraData::get(string const & id) const
{
- std::map<string, string>::const_iterator it = data_.find(id);
+ map<string, string>::const_iterator it = data_.find(id);
return it == data_.end() ? string() : it->second;
}
return it == data_.end() ? string() : it->second;
}
bool RotationData::no_rotation() const
{
bool RotationData::no_rotation() const
{
- return (angle.empty() || std::abs(convert<double>(angle)) < 0.1);
+ return (angle.empty() || abs(convert<double>(angle)) < 0.1);
{
// Ensure that angle lies in the range -360 < angle < 360
double rotAngle = convert<double>(angle);
{
// Ensure that angle lies in the range -360 < angle < 360
double rotAngle = convert<double>(angle);
- if (std::abs(rotAngle) > 360.0) {
+ if (abs(rotAngle) > 360.0) {
rotAngle -= 360.0 * floor(rotAngle / 360.0);
return convert<string>(rotAngle);
}
rotAngle -= 360.0 * floor(rotAngle / 360.0);
return convert<string>(rotAngle);
}
if (data.no_resize())
return string();
if (data.no_resize())
return string();
if (data.usingScale()) {
double const scl = convert<double>(data.scale) / 100.0;
os << "\\scalebox{" << scl << "}[" << scl << "]{";
if (data.usingScale()) {
double const scl = convert<double>(data.scale) / 100.0;
os << "\\scalebox{" << scl << "}[" << scl << "]{";
-std::ostream & operator<<(std::ostream & os, RotationData::OriginType type)
+ostream & operator<<(ostream & os, RotationData::OriginType type)
{
switch (type) {
case RotationData::DEFAULT:
{
switch (type) {
case RotationData::DEFAULT:
if (data.no_rotation())
return string();
if (data.no_rotation())
return string();
os << "\\rotatebox";
if (data.origin() != RotationData::DEFAULT)
os << "\\rotatebox";
if (data.origin() != RotationData::DEFAULT)
if (!data.clip || data.bbox.empty())
return string();
if (!data.clip || data.bbox.empty())
return string();
if (!data.bbox.empty())
os << "bb=" << data.bbox << ',';
if (data.clip)
if (!data.bbox.empty())
os << "bb=" << data.bbox << ',';
if (data.clip)
if (data.no_resize())
return string();
if (data.no_resize())
return string();
if (data.usingScale()) {
double const scl = convert<double>(data.scale);
if (!float_equal(scl, 100.0, 0.05))
if (data.usingScale()) {
double const scl = convert<double>(data.scale);
if (!float_equal(scl, 100.0, 0.05))
if (data.no_rotation())
return string();
if (data.no_rotation())
return string();
os << "angle=" << data.angle << ',';
if (data.origin() != RotationData::DEFAULT)
os << "angle=" << data.angle << ',';
if (data.origin() != RotationData::DEFAULT)
class InsetName {
public:
class InsetName {
public:
- InsetName(std::string const & n, InsetCode c) : name(n), code(c) {}
- std::string name;
+ InsetName(string const & n, InsetCode c) : name(n), code(c) {}
+ string name;
-typedef std::map<std::string, InsetCode> TranslatorMap;
+typedef map<string, InsetCode> TranslatorMap;
static TranslatorMap const build_translator()
static TranslatorMap const build_translator()
size_t const insetnames_size =
sizeof(insetnames) / sizeof(insetnames[0]);
size_t const insetnames_size =
sizeof(insetnames) / sizeof(insetnames[0]);
- std::map<std::string, InsetCode> data;
+ map<string, InsetCode> data;
for (size_t i = 0; i != insetnames_size; ++i) {
InsetName const & var = insetnames[i];
data[var.name] = var.code;
for (size_t i = 0; i != insetnames_size; ++i) {
InsetName const & var = insetnames[i];
data[var.name] = var.code;
-InsetCode insetCode(std::string const & name)
+InsetCode insetCode(string const & name)
{
static TranslatorMap const translator = build_translator();
{
static TranslatorMap const translator = build_translator();
-std::string insetName(InsetCode c)
+string insetName(InsetCode c)
{
static TranslatorMap const translator = build_translator();
{
static TranslatorMap const translator = build_translator();
if (it->second == c)
return it->first;
}
if (it->second == c)
return it->first;
}
-CommandInfo const * InsetBibitem::findInfo(std::string const & /* cmdName */)
+CommandInfo const * InsetBibitem::findInfo(string const & /* cmdName */)
{
static const char * const paramnames[] = {"label", "key", ""};
static const bool isoptional[] = {true, false};
{
static const char * const paramnames[] = {"label", "key", ""};
static const bool isoptional[] = {true, false};
if (support::prefixIs(getParam("key"), key_prefix)) {
int const key = convert<int>(getParam("key").substr(key_prefix.length()));
if (support::prefixIs(getParam("key"), key_prefix)) {
int const key = convert<int>(getParam("key").substr(key_prefix.length()));
- key_counter = std::max(key_counter, key);
+ key_counter = max(key_counter, key);
-CommandInfo const * InsetBibtex::findInfo(std::string const & /* cmdName */)
+CommandInfo const * InsetBibtex::findInfo(string const & /* cmdName */)
{
static const char * const paramnames[] =
{"options", "btprint", "bibfiles", ""};
{
static const char * const paramnames[] =
{"options", "btprint", "bibfiles", ""};
// 8bit clean bibtex forks exist.
idocfstream ifs(it->toFilesystemEncoding().c_str(),
// 8bit clean bibtex forks exist.
idocfstream ifs(it->toFilesystemEncoding().c_str(),
buffer.params().encoding().iconvName());
char_type ch;
buffer.params().encoding().iconvName());
char_type ch;
if (entryType == from_ascii("comment")) {
if (entryType == from_ascii("comment")) {
- ifs.ignore(std::numeric_limits<int>::max(), '\n');
+ ifs.ignore(numeric_limits<int>::max(), '\n');
-typedef Translator<std::string, InsetBox::BoxType> BoxTranslator;
+typedef Translator<string, InsetBox::BoxType> BoxTranslator;
typedef Translator<docstring, InsetBox::BoxType> BoxTranslatorLoc;
BoxTranslator const init_boxtranslator()
typedef Translator<docstring, InsetBox::BoxType> BoxTranslatorLoc;
BoxTranslator const init_boxtranslator()
BranchList const & branchlist = realbuffer.params().branchlist();
BranchList::const_iterator const end = branchlist.end();
BranchList::const_iterator it =
BranchList const & branchlist = realbuffer.params().branchlist();
BranchList::const_iterator const end = branchlist.end();
BranchList::const_iterator it =
- std::find_if(branchlist.begin(), end,
+ find_if(branchlist.begin(), end,
BranchNamesEqual(params_.branch));
if (it == end)
return false;
BranchNamesEqual(params_.branch));
if (it == end)
return false;
InsetText::metrics(mi, textdim);
mi.base.font = tmpfont;
mi.base.textwidth += dim.wid;
InsetText::metrics(mi, textdim);
mi.base.font = tmpfont;
mi.base.textwidth += dim.wid;
- dim.des = std::max(dim.des - textdim.asc + dim.asc, textdim.des);
+ dim.des = max(dim.des - textdim.asc + dim.asc, textdim.des);
dim.asc = textdim.asc;
dim.wid += textdim.wid;
}
dim.asc = textdim.asc;
dim.wid += textdim.wid;
}
return docstring();
// Cache the labels
return docstring();
// Cache the labels
- typedef std::map<Buffer const *, BiblioInfo> CachedMap;
+ typedef map<Buffer const *, BiblioInfo> CachedMap;
static CachedMap cached_keys;
// and cache the timestamp of the bibliography files.
static CachedMap cached_keys;
// and cache the timestamp of the bibliography files.
- static std::map<FileName, time_t> bibfileStatus;
+ static map<FileName, time_t> bibfileStatus;
for (FileNameList::const_iterator it = bibfilesCache.begin();
it != bibfilesCache.end(); ++ it) {
FileName const f = *it;
for (FileNameList::const_iterator it = bibfilesCache.begin();
it != bibfilesCache.end(); ++ it) {
FileName const f = *it;
- std::time_t lastw = f.lastModified();
+ time_t lastw = f.lastModified();
if (lastw != bibfileStatus[f]) {
changed = true;
bibfileStatus[f] = lastw;
if (lastw != bibfileStatus[f]) {
changed = true;
bibfileStatus[f] = lastw;
-CommandInfo const * InsetCitation::findInfo(std::string const & /* cmdName */)
+CommandInfo const * InsetCitation::findInfo(string const & /* cmdName */)
{
// standard cite does only take one argument if jurabib is
// not used, but jurabib extends this to two arguments, so
{
// standard cite does only take one argument if jurabib is
// not used, but jurabib extends this to two arguments, so
-bool InsetCitation::isCompatibleCommand(std::string const & cmd)
+bool InsetCitation::isCompatibleCommand(string const & cmd)
{
vector<string> const & possibles = possible_cite_commands();
vector<string>::const_iterator const end = possibles.end();
{
vector<string> const & possibles = possible_cite_commands();
vector<string>::const_iterator const end = possibles.end();
- return std::find(possibles.begin(), end, cmd) != end;
+ return find(possibles.begin(), end, cmd) != end;
docstring label;
pos_type const max_length = 15;
pos_type const p_siz = paragraphs().begin()->size();
docstring label;
pos_type const max_length = 15;
pos_type const p_siz = paragraphs().begin()->size();
- pos_type const n = std::min(max_length, p_siz);
+ pos_type const n = min(max_length, p_siz);
pos_type i = 0;
pos_type j = 0;
for (; i < n && j < p_siz; ++j) {
pos_type i = 0;
pos_type j = 0;
for (; i < n && j < p_siz; ++j) {
CommandInfo const * InsetCommandParams::findInfo(
CommandInfo const * InsetCommandParams::findInfo(
- InsetCode code, std::string const & cmdName)
+ InsetCode code, string const & cmdName)
{
switch (code) {
case BIBITEM_CODE:
{
switch (code) {
case BIBITEM_CODE:
-std::string InsetCommandParams::getDefaultCmd(InsetCode code) {
+string InsetCommandParams::getDefaultCmd(InsetCode code) {
switch (code) {
case BIBITEM_CODE:
return InsetBibitem::defaultCommand();
switch (code) {
case BIBITEM_CODE:
return InsetBibitem::defaultCommand();
bool InsetCommandParams::isCompatibleCommand(
bool InsetCommandParams::isCompatibleCommand(
- InsetCode code, std::string const & s)
+ InsetCode code, string const & s)
{
switch (code) {
case BIBITEM_CODE:
{
switch (code) {
case BIBITEM_CODE:
params[j] = params_[i];
}
info_ = info;
params[j] = params_[i];
}
info_ = info;
- std::swap(params, params_);
-void InsetCommandParams::write(std::ostream & os) const
+void InsetCommandParams::write(ostream & os) const
{
os << "CommandInset " << insetType() << '\n';
os << "LatexCommand " << cmdName_ << '\n';
{
os << "CommandInset " << insetType() << '\n';
os << "LatexCommand " << cmdName_ << '\n';
#include "TexRow.h"
#include "TextClass.h"
#include "TexRow.h"
#include "TextClass.h"
-void InsetEnvironment::write(Buffer const & buf, std::ostream & os) const
+void InsetEnvironment::write(Buffer const & buf, ostream & os) const
{
os << "Environment " << to_utf8(name()) << "\n";
InsetText::write(buf, os);
{
os << "Environment " << to_utf8(name()) << "\n";
InsetText::write(buf, os);
const_iterator it = ids.begin();
const_iterator end = ids.end();
const_iterator it = ids.begin();
const_iterator end = ids.end();
- it = std::find(it, end, value);
+ it = find(it, end, value);
if (it == end)
data = T();
}
if (it == end)
data = T();
}
for (; par != end; ++par) {
par->simpleDocBookOnePar(buf, os, runparams,
for (; par != end; ++par) {
par->simpleDocBookOnePar(buf, os, runparams,
- outerFont(std::distance(beg, par),
+ outerFont(distance(beg, par),
-CommandInfo const * InsetFloatList::findInfo(std::string const & /* cmdName */)
+CommandInfo const * InsetFloatList::findInfo(string const & /* cmdName */)
{
static const char * const paramnames[] = {"type", ""};
static const bool isoptional[] = {false};
{
static const char * const paramnames[] = {"type", ""};
static const bool isoptional[] = {false};
-bool InsetFloatList::isCompatibleCommand(std::string const & s)
+bool InsetFloatList::isCompatibleCommand(string const & s)
- std::string str = s.substr(0, 6);
+ string str = s.substr(0, 6);
return str == "listof";
}
return str == "listof";
}
-void InsetFloatList::write(Buffer const &, std::ostream & os) const
+void InsetFloatList::write(Buffer const &, ostream & os) const
{
os << "FloatList " << to_ascii(getParam("type")) << "\n";
}
{
os << "FloatList " << to_ascii(getParam("type")) << "\n";
}
-void InsetFootlike::write(Buffer const & buf, std::ostream & os) const
+void InsetFootlike::write(Buffer const & buf, ostream & os) const
{
os << to_utf8(name()) << "\n";
InsetCollapsable::write(buf, os);
{
os << to_utf8(name()) << "\n";
InsetCollapsable::write(buf, os);
} else {
if (!params_.Read(lex, token, bufpath))
lyxerr << "Unknown token, " << token << ", skipping."
} else {
if (!params_.Read(lex, token, bufpath))
lyxerr << "Unknown token, " << token << ", skipping."
-std::pair<GraphicsCopyStatus, FileName> const
+pair<GraphicsCopyStatus, FileName> const
copyFileIfNeeded(FileName const & file_in, FileName const & file_out)
{
LYXERR(Debug::FILES, "Comparing " << file_in << " and " << file_out);
copyFileIfNeeded(FileName const & file_in, FileName const & file_out)
{
LYXERR(Debug::FILES, "Comparing " << file_in << " and " << file_out);
if (checksum_in == checksum_out)
// Nothing to do...
if (checksum_in == checksum_out)
// Nothing to do...
- return std::make_pair(IDENTICAL_CONTENTS, file_out);
+ return make_pair(IDENTICAL_CONTENTS, file_out);
Mover const & mover = getMover(formats.getFormatFromFile(file_in));
bool const success = mover.copy(file_in, file_out);
Mover const & mover = getMover(formats.getFormatFromFile(file_in));
bool const success = mover.copy(file_in, file_out);
}
GraphicsCopyStatus status = success ? SUCCESS : FAILURE;
}
GraphicsCopyStatus status = success ? SUCCESS : FAILURE;
- return std::make_pair(status, file_out);
+ return make_pair(status, file_out);
-std::pair<GraphicsCopyStatus, FileName> const
+pair<GraphicsCopyStatus, FileName> const
copyToDirIfNeeded(DocFileName const & file, string const & dir)
{
using support::rtrim;
copyToDirIfNeeded(DocFileName const & file, string const & dir)
{
using support::rtrim;
string const file_in = file.absFilename();
string const only_path = support::onlyPath(file_in);
if (rtrim(support::onlyPath(file_in) , "/") == rtrim(dir, "/"))
string const file_in = file.absFilename();
string const only_path = support::onlyPath(file_in);
if (rtrim(support::onlyPath(file_in) , "/") == rtrim(dir, "/"))
- return std::make_pair(IDENTICAL_PATHS, file_in);
+ return make_pair(IDENTICAL_PATHS, file_in);
string mangled = file.mangledFilename();
if (file.isZipped()) {
string mangled = file.mangledFilename();
if (file.isZipped()) {
LYXERR(Debug::GRAPHICS, "InsetGraphics::latex outputting:\n" << latex_str);
// Return how many newlines we issued.
LYXERR(Debug::GRAPHICS, "InsetGraphics::latex outputting:\n" << latex_str);
// Return how many newlines we issued.
- return int(std::count(latex_str.begin(), latex_str.end(),'\n'));
+ return int(count(latex_str.begin(), latex_str.end(),'\n'));
{
if (runparams.flavor != OutputParams::XML)
os << "<![ %output.print." << format
{
if (runparams.flavor != OutputParams::XML)
os << "<![ %output.print." << format
os <<"<imageobject><imagedata fileref=\"&"
<< graphic_label
os <<"<imageobject><imagedata fileref=\"&"
<< graphic_label
os << "</imageobject>";
if (runparams.flavor != OutputParams::XML)
os << "</imageobject>";
if (runparams.flavor != OutputParams::XML)
- os << std::endl << "]]>" ;
return runparams.flavor == OutputParams::XML ? 0 : 2;
}
return runparams.flavor == OutputParams::XML ? 0 : 2;
}
namespace lyx {
InsetHFill::InsetHFill()
namespace lyx {
InsetHFill::InsetHFill()
- : InsetCommand(InsetCommandParams(HFILL_CODE), std::string())
+ : InsetCommand(InsetCommandParams(HFILL_CODE), string())
-CommandInfo const * InsetHFill::findInfo(std::string const & /* cmdName */)
+CommandInfo const * InsetHFill::findInfo(string const & /* cmdName */)
{
static const char * const paramnames[] = {""};
static const CommandInfo info = {0, paramnames, 0};
{
static const char * const paramnames[] = {""};
static const CommandInfo info = {0, paramnames, 0};
-void InsetHFill::write(Buffer const &, std::ostream & os) const
+void InsetHFill::write(Buffer const &, ostream & os) const
-Types type(std::string const & s)
+Types type(string const & s)
{
if (s == "input")
return INPUT;
{
if (s == "input")
return INPUT;
-CommandInfo const * InsetInclude::findInfo(std::string const & /* cmdName */)
+CommandInfo const * InsetInclude::findInfo(string const & /* cmdName */)
{
// FIXME
// This is only correct for the case of listings, but it'll do for now.
{
// FIXME
// This is only correct for the case of listings, but it'll do for now.
-bool InsetInclude::isCompatibleCommand(std::string const & s)
+bool InsetInclude::isCompatibleCommand(string const & s)
{
return type(s) != NONE;
}
{
return type(s) != NONE;
}
void InsetInclude::getLabelList(Buffer const & buffer,
void InsetInclude::getLabelList(Buffer const & buffer,
- std::vector<docstring> & list) const
+ vector<docstring> & list) const
{
if (isListings(params())) {
InsetListingsParams p(to_utf8(params()["lstparams"]));
{
if (isListings(params())) {
InsetListingsParams p(to_utf8(params()["lstparams"]));
-void InsetIndex::write(Buffer const & buf, std::ostream & os) const
+void InsetIndex::write(Buffer const & buf, ostream & os) const
{
os << to_utf8(name()) << "\n";
InsetCollapsable::write(buf, os);
{
os << to_utf8(name()) << "\n";
InsetCollapsable::write(buf, os);
-CommandInfo const * InsetPrintIndex::findInfo(std::string const & /* cmdName */)
+CommandInfo const * InsetPrintIndex::findInfo(string const & /* cmdName */)
{
static const char * const paramnames[] = {"name", ""};
static const bool isoptional[] = {false};
{
static const char * const paramnames[] = {"name", ""};
static const bool isoptional[] = {false};
-Translator<InsetInfo::info_type, std::string> const & InsetInfo::nameTranslator() const
+Translator<InsetInfo::info_type, string> const & InsetInfo::nameTranslator() const
{
static Translator<info_type, string> const translator =
initTranslator();
{
static Translator<info_type, string> const translator =
initTranslator();
-void InsetInfo::write(Buffer const &, std::ostream & os) const
+void InsetInfo::write(Buffer const &, ostream & os) const
{
os << "Info\ntype \""
<< nameTranslator().find(type_)
{
os << "Info\ntype \""
<< nameTranslator().find(type_)
#include "support/lstrings.h"
#include "support/lyxalgo.h"
#include "support/lstrings.h"
#include "support/lyxalgo.h"
-CommandInfo const * InsetLabel::findInfo(std::string const & /* cmdName */)
+CommandInfo const * InsetLabel::findInfo(string const & /* cmdName */)
{
static const char * const paramnames[] = {"name", ""};
static const bool isoptional[] = {false};
{
static const char * const paramnames[] = {"name", ""};
static const bool isoptional[] = {false};
-void InsetLabel::getLabelList(Buffer const &, std::vector<docstring> & list) const
+void InsetLabel::getLabelList(Buffer const &, vector<docstring> & list) const
{
list.push_back(getParam("name"));
}
{
list.push_back(getParam("name"));
}
lists.push_back(v);
// good, find the string
lists.push_back(v);
// good, find the string
- if (std::find(lists.begin(), lists.end(), par2) != lists.end()) {
+ if (find(lists.begin(), lists.end(), par2) != lists.end()) {
if (unclosed)
return _("Unbalanced braces!");
return docstring();
if (unclosed)
return _("Unbalanced braces!");
return docstring();
#include "support/docstring.h"
#include "support/docstream.h"
#include "support/docstring.h"
#include "support/docstream.h"
-void InsetNewpage::write(Buffer const &, std::ostream & os) const
+void InsetNewpage::write(Buffer const &, ostream & os) const
{
os << "\n" << getCmdName() << '\n';
}
{
os << "\n" << getCmdName() << '\n';
}
-CommandInfo const * InsetNomencl::findInfo(std::string const & /* cmdName */)
+CommandInfo const * InsetNomencl::findInfo(string const & /* cmdName */)
{
static const char * const paramnames[] = {"prefix", "symbol", "description", ""};
static const bool isoptional[] = {true, false, false};
{
static const char * const paramnames[] = {"prefix", "symbol", "description", ""};
static const bool isoptional[] = {true, false, false};
-CommandInfo const * InsetPrintNomencl::findInfo(std::string const & /* cmdName */)
+CommandInfo const * InsetPrintNomencl::findInfo(string const & /* cmdName */)
{
static const char * const paramnames[] = {"labelwidth", ""};
static const bool isoptional[] = {true};
{
static const char * const paramnames[] = {"labelwidth", ""};
static const bool isoptional[] = {true};
-typedef Translator<std::string, InsetNoteParams::Type> NoteTranslator;
+typedef Translator<string, InsetNoteParams::Type> NoteTranslator;
typedef Translator<docstring, InsetNoteParams::Type> NoteTranslatorLoc;
NoteTranslator const init_notetranslator()
typedef Translator<docstring, InsetNoteParams::Type> NoteTranslatorLoc;
NoteTranslator const init_notetranslator()
os << str;
runparams_in.encoding = runparams.encoding;
// Return how many newlines we issued.
os << str;
runparams_in.encoding = runparams.encoding;
// Return how many newlines we issued.
- return int(std::count(str.begin(), str.end(), '\n'));
+ return int(count(str.begin(), str.end(), '\n'));
#include "support/docstream.h"
#include "support/docstream.h"
-void InsetOptArg::write(Buffer const & buf, std::ostream & os) const
+void InsetOptArg::write(Buffer const & buf, ostream & os) const
{
os << "OptArg" << "\n";
InsetCollapsable::write(buf, os);
{
os << "OptArg" << "\n";
InsetCollapsable::write(buf, os);
-bool InsetRef::isCompatibleCommand(std::string const & s) {
+bool InsetRef::isCompatibleCommand(string const & s) {
//FIXME This is likely not the best way to handle this.
//But this stuff is hardcoded elsewhere already.
return s == "ref"
//FIXME This is likely not the best way to handle this.
//But this stuff is hardcoded elsewhere already.
return s == "ref"
-CommandInfo const * InsetRef::findInfo(std::string const & /* cmdName */)
+CommandInfo const * InsetRef::findInfo(string const & /* cmdName */)
{
static const char * const paramnames[] = {"name", "reference", ""};
static const bool isoptional[] = {true, false};
{
static const char * const paramnames[] = {"name", "reference", ""};
static const bool isoptional[] = {true, false};
-CommandInfo const * InsetTOC::findInfo(std::string const & /* cmdName */)
+CommandInfo const * InsetTOC::findInfo(string const & /* cmdName */)
{
static const char * const paramnames[] = {"type", ""};
static const bool isoptional[] = {false};
{
static const char * const paramnames[] = {"type", ""};
static const bool isoptional[] = {false};
-class FeatureEqual : public std::unary_function<TabularFeature, bool> {
+class FeatureEqual : public unary_function<TabularFeature, bool> {
public:
FeatureEqual(Tabular::Feature feature)
: feature_(feature) {}
public:
FeatureEqual(Tabular::Feature feature)
: feature_(feature) {}
{
TabularFeature * end = tabularFeature +
sizeof(tabularFeature) / sizeof(TabularFeature);
{
TabularFeature * end = tabularFeature +
sizeof(tabularFeature) / sizeof(TabularFeature);
- TabularFeature * it = std::find_if(tabularFeature, end,
+ TabularFeature * it = find_if(tabularFeature, end,
FeatureEqual(feature));
return (it == end) ? string() : it->feature;
}
FeatureEqual(feature));
return (it == end) ? string() : it->feature;
}
InsetTabular::idx_type InsetTabular::getNearestCell(BufferView & bv, int x, int y) const
{
idx_type idx_min = 0;
InsetTabular::idx_type InsetTabular::getNearestCell(BufferView & bv, int x, int y) const
{
idx_type idx_min = 0;
- int dist_min = std::numeric_limits<int>::max();
+ int dist_min = numeric_limits<int>::max();
for (idx_type i = 0, n = nargs(); i != n; ++i) {
if (bv.coordCache().getInsets().has(tabular.getCellInset(i).get())) {
int const d = dist(bv, i, x, y);
for (idx_type i = 0, n = nargs(); i != n; ++i) {
if (bv.coordCache().getInsets().has(tabular.getCellInset(i).get())) {
int const d = dist(bv, i, x, y);
ParagraphList::iterator ins = pl.insert(pl.end(), *pit);
++pit;
mergeParagraph(buffer->params(), pl,
ParagraphList::iterator ins = pl.insert(pl.end(), *pit);
++pit;
mergeParagraph(buffer->params(), pl,
- std::distance(pl.begin(), ins) - 1);
+ distance(pl.begin(), ins) - 1);
for_each(pit, plist.end(),
bind(&ParagraphList::push_back, ref(pl), _1));
for_each(pit, plist.end(),
bind(&ParagraphList::push_back, ref(pl), _1));
#include <boost/bind.hpp>
#include <boost/bind.hpp>
docstring const msg = statusMessage(params_, loader_.status());
if (!msg.empty()) {
msgFont.setSize(FONT_SIZE_TINY);
docstring const msg = statusMessage(params_, loader_.status());
if (!msg.empty()) {
msgFont.setSize(FONT_SIZE_TINY);
- font_width = std::max(font_width,
+ font_width = max(font_width,
theFontMetrics(msgFont).width(msg));
}
theFontMetrics(msgFont).width(msg));
}
- dim.wid = std::max(50, font_width + 15);
+ dim.wid = max(50, font_width + 15);
// Print the file name.
FontInfo msgFont = pi.base.font;
msgFont.setFamily(SANS_FAMILY);
// Print the file name.
FontInfo msgFont = pi.base.font;
msgFont.setFamily(SANS_FAMILY);
- std::string const justname = params_.filename.onlyFileName();
+ string const justname = params_.filename.onlyFileName();
if (!justname.empty()) {
msgFont.setSize(FONT_SIZE_FOOTNOTE);
if (!justname.empty()) {
msgFont.setSize(FONT_SIZE_FOOTNOTE);
-class MatchString : public std::binary_function<Paragraph, pos_type, bool>
+class MatchString : public binary_function<Paragraph, pos_type, bool>
{
public:
MatchString(docstring const & str, bool cs, bool mw)
{
public:
MatchString(docstring const & str, bool cs, bool mw)
if (!bv || ev.action != LFUN_WORD_FIND)
return;
if (!bv || ev.action != LFUN_WORD_FIND)
return;
- //lyxerr << "find called, cmd: " << ev << std::endl;
+ //lyxerr << "find called, cmd: " << ev << endl;
// data is of the form
// "<search>
// data is of the form
// "<search>
+using namespace std;
+
+
int main(int argc, char * argv[])
{
#ifdef HAVE_IOS
int main(int argc, char * argv[])
{
#ifdef HAVE_IOS
- std::ios_base::sync_with_stdio(false);
+ ios_base::sync_with_stdio(false);
#endif
// To avoid ordering of global object problems with some
// stdlibs we do the initialization here, but still as
// early as possible.
#endif
// To avoid ordering of global object problems with some
// stdlibs we do the initialization here, but still as
// early as possible.
- lyx::lyxerr.setStream(std::cerr);
+ lyx::lyxerr.setStream(cerr);
InsetFormulaMacro::InsetFormulaMacro(string const & s)
: InsetMathNest(2), name_("unknownB")
{
InsetFormulaMacro::InsetFormulaMacro(string const & s)
: InsetMathNest(2), name_("unknownB")
{
- std::istringstream is(s);
-void InsetFormulaMacro::read(std::istream & is)
+void InsetFormulaMacro::read(istream & is)
{
auto_ptr<MathMacroTemplate> p(new MathMacroTemplate(is));
name_ = p->name();
{
auto_ptr<MathMacroTemplate> p(new MathMacroTemplate(is));
name_ = p->name();
-std::ostream & operator<<(std::ostream & os, MathAtom const & at)
+ostream & operator<<(ostream & os, MathAtom const & at)
{
odocstringstream oss;
WriteStream wi(oss, false, false);
{
odocstringstream oss;
WriteStream wi(oss, false, false);
Dimension dim0;
cell(0).metrics(mi, dim0);
Dimension t = theFontMetrics(mi.base.font).dimension('{');
Dimension dim0;
cell(0).metrics(mi, dim0);
Dimension t = theFontMetrics(mi.base.font).dimension('{');
- dim.asc = std::max(dim0.asc, t.asc);
- dim.des = std::max(dim0.des, t.des);
+ dim.asc = max(dim0.asc, t.asc);
+ dim.des = max(dim0.des, t.des);
dim.wid = dim0.width() + 2 * t.wid;
metricsMarkers(dim);
// Cache the inset dimension.
dim.wid = dim0.width() + 2 * t.wid;
metricsMarkers(dim);
// Cache the inset dimension.
InsetMathDecoration::InsetMathDecoration(latexkeys const * key)
: InsetMathNest(1), key_(key)
{
InsetMathDecoration::InsetMathDecoration(latexkeys const * key)
: InsetMathNest(1), key_(key)
{
-// lyxerr << " creating deco " << key->name << std::endl;
+// lyxerr << " creating deco " << key->name << endl;
#include "frontends/Painter.h"
#include "frontends/Painter.h"
ShapeChanger dummy2(mi.base.font, UP_SHAPE);
cell(1).metrics(mi, dim1);
dim.wid = dim0.width() + dim1.wid + 5;
ShapeChanger dummy2(mi.base.font, UP_SHAPE);
cell(1).metrics(mi, dim1);
dim.wid = dim0.width() + dim1.wid + 5;
- dim.asc = std::max(dim0.asc, dim1.asc);
- dim.des = std::max(dim0.des, dim1.des);
+ dim.asc = max(dim0.asc, dim1.asc);
+ dim.des = max(dim0.des, dim1.des);
} else {
cell(2).metrics(mi, dim2);
ShapeChanger dummy2(mi.base.font, UP_SHAPE);
} else {
cell(2).metrics(mi, dim2);
ShapeChanger dummy2(mi.base.font, UP_SHAPE);
cell(0).metrics(mi, dim0);
cell(1).metrics(mi, dim1);
dim.wid = dim0.width() + dim1.wid + dim2.wid + 10;
cell(0).metrics(mi, dim0);
cell(1).metrics(mi, dim1);
dim.wid = dim0.width() + dim1.wid + dim2.wid + 10;
- dim.asc = std::max(dim2.asc, dim0.height() + 5);
- dim.des = std::max(dim2.des, dim1.height() - 5);
+ dim.asc = max(dim2.asc, dim0.height() + 5);
+ dim.des = max(dim2.des, dim1.height() - 5);
}
} else {
FracChanger dummy(mi.base);
}
} else {
FracChanger dummy(mi.base);
dim.asc = dim0.height() + 5;
dim.des = dim1.height() - 5;
} else {
dim.asc = dim0.height() + 5;
dim.des = dim1.height() - 5;
} else {
- dim.wid = std::max(dim0.width(), dim1.wid) + 2;
+ dim.wid = max(dim0.width(), dim1.wid) + 2;
dim.asc = dim0.height() + 2 + 5;
dim.des = dim1.height() + 2 - 5;
}
dim.asc = dim0.height() + 2 + 5;
dim.des = dim1.height() + 2 - 5;
}
Dimension dim0, dim1;
cell(0).metricsT(mi, dim0);
cell(1).metricsT(mi, dim1);
Dimension dim0, dim1;
cell(0).metricsT(mi, dim0);
cell(1).metricsT(mi, dim1);
- dim.wid = std::max(dim0.width(), dim1.wid);
+ dim.wid = max(dim0.width(), dim1.wid);
dim.asc = dim0.height() + 1;
dim.des = dim1.height();
}
dim.asc = dim0.height() + 1;
dim.des = dim1.height();
}
Dimension dim0, dim1;
cell(0).metrics(mi, dim0);
cell(1).metrics(mi, dim1);
Dimension dim0, dim1;
cell(0).metrics(mi, dim0);
cell(1).metrics(mi, dim1);
- dim.wid = std::max(dim0.wid, dim1.wid) + 2;
+ dim.wid = max(dim0.wid, dim1.wid) + 2;
dim.asc = dim0.height() + 2 + 5;
dim.des = dim1.height() + 2 - 5;
// Cache the inset dimension.
dim.asc = dim0.height() + 2 + 5;
dim.des = dim1.height() + 2 - 5;
// Cache the inset dimension.
cell(0).metrics(mi, dim0);
Dimension dim1;
cell(1).metrics(mi, dim1);
cell(0).metrics(mi, dim0);
Dimension dim1;
cell(1).metrics(mi, dim1);
- dim.wid = std::max(dim0.width(), dim1.width()) + 2;
+ dim.wid = max(dim0.width(), dim1.width()) + 2;
dim.asc = dim0.height() + 2 + 5;
dim.des = dim1.height() + 2 - 5;
// Cache the inset dimension.
dim.asc = dim0.height() + 2 + 5;
dim.des = dim1.height() + 2 - 5;
// Cache the inset dimension.
cell(1).metrics(mi, dim1);
dim.asc = dim0.height() + 4 + 5;
dim.des = dim1.height() + 4 - 5;
cell(1).metrics(mi, dim1);
dim.asc = dim0.height() + 4 + 5;
dim.des = dim1.height() + 4 - 5;
- dim.wid = std::max(dim0.width(), dim1.wid) + 2 * dw(dim.height()) + 4;
+ dim.wid = max(dim0.width(), dim1.wid) + 2 * dw(dim.height()) + 4;
metricsMarkers2(dim);
// Cache the inset dimension.
setDimCache(mi, dim);
metricsMarkers2(dim);
// Cache the inset dimension.
setDimCache(mi, dim);
cell(1).metrics(mi, dim1);
dim.asc = dim0.height() + 4 + 5;
dim.des = dim1.height() + 4 - 5;
cell(1).metrics(mi, dim1);
dim.asc = dim0.height() + 4 + 5;
dim.des = dim1.height() + 4 - 5;
- dim.wid = std::max(dim0.width(), dim1.wid) + 2 * dw(dim.height()) + 4;
+ dim.wid = max(dim0.width(), dim1.wid) + 2 * dw(dim.height()) + 4;
metricsMarkers2(dim);
// Cache the inset dimension.
setDimCache(mi, dim);
metricsMarkers2(dim);
// Cache the inset dimension.
setDimCache(mi, dim);
cell(1).metrics(mi, dim1);
dim.asc = dim0.height() + 4 + 5;
dim.des = dim1.height() + 4 - 5;
cell(1).metrics(mi, dim1);
dim.asc = dim0.height() + 4 + 5;
dim.des = dim1.height() + 4 - 5;
- dim.wid = std::max(dim0.width(), dim1.wid) + 2 * dw(dim.height()) + 4;
+ dim.wid = max(dim0.width(), dim1.wid) + 2 * dw(dim.height()) + 4;
metricsMarkers2(dim);
// Cache the inset dimension.
setDimCache(mi, dim);
metricsMarkers2(dim);
// Cache the inset dimension.
setDimCache(mi, dim);
- colinfo_[col].lines_ = std::count(
+ colinfo_[col].lines_ = count(
colinfo_[col].special_.begin(),
colinfo_[col].special_.end(), '|');
LYXERR(Debug::MATHED, "special column separator: `"
colinfo_[col].special_.begin(),
colinfo_[col].special_.end(), '|');
LYXERR(Debug::MATHED, "special column separator: `"
colinfo_[col].align_ = static_cast<char>(c);
if (!colinfo_[col].special_.empty()) {
colinfo_[col].special_ += c;
colinfo_[col].align_ = static_cast<char>(c);
if (!colinfo_[col].special_.empty()) {
colinfo_[col].special_ += c;
- colinfo_[col].lines_ = std::count(
+ colinfo_[col].lines_ = count(
colinfo_[col].special_.begin(),
colinfo_[col].special_.end(), '|');
LYXERR(Debug::MATHED, "special column separator: `"
colinfo_[col].special_.begin(),
colinfo_[col].special_.end(), '|');
LYXERR(Debug::MATHED, "special column separator: `"
iss >> dlang >> extra;
if (extra.empty())
extra = from_ascii("noextra");
iss >> dlang >> extra;
if (extra.empty())
extra = from_ascii("noextra");
- std::string const lang = to_ascii(dlang);
+ string const lang = to_ascii(dlang);
// FIXME: temporarily disabled
//if (cur.selection()) {
// FIXME: temporarily disabled
//if (cur.selection()) {
InsetCommandParams p(LABEL_CODE);
p["name"] = cmd.argument().empty() ? old_label : cmd.argument();
InsetCommandParams p(LABEL_CODE);
p["name"] = cmd.argument().empty() ? old_label : cmd.argument();
- std::string const data = InsetCommandMailer::params2string("label", p);
+ string const data = InsetCommandMailer::params2string("label", p);
if (cmd.argument().empty())
cur.bv().showDialog("label", data);
if (cmd.argument().empty())
cur.bv().showDialog("label", data);
case LFUN_INSET_INSERT: {
//lyxerr << "arg: " << to_utf8(cmd.argument()) << endl;
case LFUN_INSET_INSERT: {
//lyxerr << "arg: " << to_utf8(cmd.argument()) << endl;
- std::string const name = cmd.getArg(0);
+ string const name = cmd.getArg(0);
if (name == "label") {
InsetCommandParams p(LABEL_CODE);
InsetCommandMailer::string2params(name, to_utf8(cmd.argument()), p);
if (name == "label") {
InsetCommandParams p(LABEL_CODE);
InsetCommandMailer::string2params(name, to_utf8(cmd.argument()), p);
return InsetMathGrid::getStatus(cur, cmd, status);
case LFUN_TABULAR_FEATURE: {
istringstream is(to_utf8(cmd.argument()));
return InsetMathGrid::getStatus(cur, cmd, status);
case LFUN_TABULAR_FEATURE: {
istringstream is(to_utf8(cmd.argument()));
is >> s;
if (!rowChangeOK()
&& (s == "append-row"
is >> s;
if (!rowChangeOK()
&& (s == "append-row"
-void InsetMathHull::write(Buffer const &, std::ostream & os) const
+void InsetMathHull::write(Buffer const &, ostream & os) const
{
odocstringstream oss;
WriteStream wi(oss, false, false);
{
odocstringstream oss;
WriteStream wi(oss, false, false);
ws << "}";
} else {
ws << "\\mbox{\n";
ws << "}";
} else {
ws << "\\mbox{\n";
text_.write(buf, os);
ws.os() << from_utf8(os.str());
ws << "}";
text_.write(buf, os);
ws.os() << from_utf8(os.str());
ws << "}";
}
Point const pt2 = coord_cache.getInsets().xy(this);
//lyxerr << "retrieving position cache for MathData "
}
Point const pt2 = coord_cache.getInsets().xy(this);
//lyxerr << "retrieving position cache for MathData "
- // << pt.x_ << ' ' << pt.y_ << std::endl;
+ // << pt.x_ << ' ' << pt.y_ << endl;
x = pt.x_ - pt2.x_ + ar.pos2x(sl.pos());
y = pt.y_ - pt2.y_;
// lyxerr << "pt.y_ : " << pt.y_ << " pt2_.y_ : " << pt2.y_
x = pt.x_ - pt2.x_ + ar.pos2x(sl.pos());
y = pt.y_ - pt2.y_;
// lyxerr << "pt.y_ : " << pt.y_ << " pt2_.y_ : " << pt2.y_
void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
{
void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- //lyxerr << "InsetMathNest: request: " << cmd << std::endl;
+ //lyxerr << "InsetMathNest: request: " << cmd << endl;
//CursorSlice sl = cur.current();
switch (cmd.action) {
//CursorSlice sl = cur.current();
switch (cmd.action) {
#include "Cursor.h"
#include "LaTeXFeatures.h"
#include "Cursor.h"
#include "LaTeXFeatures.h"
FracChanger dummy(mi.base);
Dimension dim0;
cell(0).metrics(mi, dim0);
FracChanger dummy(mi.base);
Dimension dim0;
cell(0).metrics(mi, dim0);
- dim.wid = std::max(dim0.width(), dim1.wid) + 4;
+ dim.wid = max(dim0.width(), dim1.wid) + 4;
dim.asc = dim1.asc + dim0.height() + 4;
dim.des = dim1.des;
metricsMarkers(dim);
dim.asc = dim1.asc + dim0.height() + 4;
dim.des = dim1.des;
metricsMarkers(dim);
#include "MathData.h"
#include "MathStream.h"
#include "MathData.h"
#include "MathStream.h"
FracChanger dummy(mi.base);
Dimension dim0;
cell(0).metrics(mi, dim0);
FracChanger dummy(mi.base);
Dimension dim0;
cell(0).metrics(mi, dim0);
- dim.wid = std::max(dim0.width(), dim1.width()) + 4;
+ dim.wid = max(dim0.width(), dim1.width()) + 4;
dim.asc = dim1.ascent() + dim0.height() + 4;
dim.des = dim1.descent();
metricsMarkers(dim);
dim.asc = dim1.ascent() + dim0.height() + 4;
dim.des = dim1.descent();
metricsMarkers(dim);
//lyxerr << "metrics: symbol: '" << sym_->name
// << "' in font: '" << sym_->inset
// << "' drawn as: '" << sym_->draw
//lyxerr << "metrics: symbol: '" << sym_->name
// << "' in font: '" << sym_->inset
// << "' drawn as: '" << sym_->draw
- // << "'" << std::endl;
int const em = mathed_char_width(mi.base.font, 'M');
FontSetChanger dummy(mi.base, sym_->inset);
int const em = mathed_char_width(mi.base.font, 'M');
FontSetChanger dummy(mi.base, sym_->inset);
//lyxerr << "metrics: symbol: '" << sym_->name
// << "' in font: '" << sym_->inset
// << "' drawn as: '" << sym_->draw
//lyxerr << "metrics: symbol: '" << sym_->name
// << "' in font: '" << sym_->inset
// << "' drawn as: '" << sym_->draw
- // << "'" << std::endl;
int const em = mathed_char_width(pi.base.font, 'M');
if (isRelOp())
x += static_cast<int>(0.25*em+0.5);
int const em = mathed_char_width(pi.base.font, 'M');
if (isRelOp())
x += static_cast<int>(0.25*em+0.5);
#include "Cursor.h"
#include "LaTeXFeatures.h"
#include "Cursor.h"
#include "LaTeXFeatures.h"
FracChanger dummy(mi.base);
Dimension dim0;
cell(0).metrics(mi, dim0);
FracChanger dummy(mi.base);
Dimension dim0;
cell(0).metrics(mi, dim0);
- dim.wid = std::max(dim0.width(), dim1.width()) + 4;
+ dim.wid = max(dim0.width(), dim1.width()) + 4;
dim.asc = dim1.ascent();
dim.des = dim1.descent() + dim0.height() + 4;
metricsMarkers(dim);
dim.asc = dim1.ascent();
dim.des = dim1.descent() + dim0.height() + 4;
metricsMarkers(dim);
#include "LaTeXFeatures.h"
#include "LaTeXFeatures.h"
cell(0).metrics(mi, dim0);
Dimension dim1;
cell(1).metrics(mi, dim1);
cell(0).metrics(mi, dim0);
Dimension dim1;
cell(1).metrics(mi, dim1);
- dim.wid = std::max(dim0.width(), dim1.width()) + 10;
+ dim.wid = max(dim0.width(), dim1.width()) + 10;
dim.asc = dim0.height() + 10;
dim.des = dim1.height();
metricsMarkers(dim);
dim.asc = dim0.height() + 10;
dim.des = dim1.height();
metricsMarkers(dim);
MacroData::MacroData(docstring const & definition,
MacroData::MacroData(docstring const & definition,
- std::vector<docstring> const & defaults,
+ vector<docstring> const & defaults,
int numargs, int optionals, docstring const & display,
string const & requires)
: definition_(definition), numargs_(numargs), display_(display),
int numargs, int optionals, docstring const & display,
string const & requires)
: definition_(definition), numargs_(numargs), display_(display),
-std::vector<docstring> const & MacroData::defaults() const
+vector<docstring> const & MacroData::defaults() const
MathMacro * macroInset = operator[](macroPos).nucleus()->asMacro();
// detach all arguments
MathMacro * macroInset = operator[](macroPos).nucleus()->asMacro();
// detach all arguments
- std::vector<MathData> detachedArgs;
+ vector<MathData> detachedArgs;
if (macroPos + 1 == size())
// strip arguments if we are at the MathData end
macroInset->detachArguments(detachedArgs, true);
if (macroPos + 1 == size())
// strip arguments if we are at the MathData end
macroInset->detachArguments(detachedArgs, true);
int curMacroSlice = cur.find(macroInset);
idx_type curMacroIdx = -1;
pos_type curMacroPos = -1;
int curMacroSlice = cur.find(macroInset);
idx_type curMacroIdx = -1;
pos_type curMacroPos = -1;
- std::vector<CursorSlice> argSlices;
+ vector<CursorSlice> argSlices;
if (curMacroSlice != -1) {
curMacroPos = cur[curMacroSlice].pos();
curMacroIdx = cur[curMacroSlice].idx();
if (curMacroSlice != -1) {
curMacroPos = cur[curMacroSlice].pos();
curMacroIdx = cur[curMacroSlice].idx();
// start at atom behind the macro again, maybe with some new arguments
// from the detach phase above, to add them back into the macro inset
size_t p = macroPos + 1;
// start at atom behind the macro again, maybe with some new arguments
// from the detach phase above, to add them back into the macro inset
size_t p = macroPos + 1;
- std::vector<MathData> detachedArgs;
+ vector<MathData> detachedArgs;
MathAtom scriptToPutAround;
// find cursor slice again of this MathData
MathAtom scriptToPutAround;
// find cursor slice again of this MathData
void MathData::collectOptionalParameters(Cursor & cur,
void MathData::collectOptionalParameters(Cursor & cur,
- const size_type numOptionalParams, std::vector<MathData> & params,
+ const size_type numOptionalParams, vector<MathData> & params,
size_t & pos, const pos_type macroPos, const int thisPos, const int thisSlice)
{
// insert optional arguments?
size_t & pos, const pos_type macroPos, const int thisPos, const int thisSlice)
{
// insert optional arguments?
// place cursor in optional argument of macro
if (thisSlice != -1
&& thisPos >= int(pos) && thisPos <= int(right)) {
// place cursor in optional argument of macro
if (thisSlice != -1
&& thisPos >= int(pos) && thisPos <= int(right)) {
- int paramPos = std::max(0, thisPos - int(pos) - 1);
- std::vector<CursorSlice> x;
+ int paramPos = max(0, thisPos - int(pos) - 1);
+ vector<CursorSlice> x;
cur.cutOff(thisSlice, x);
cur[thisSlice].pos() = macroPos;
if (brace) {
cur.cutOff(thisSlice, x);
cur[thisSlice].pos() = macroPos;
if (brace) {
void MathData::collectParameters(Cursor & cur,
void MathData::collectParameters(Cursor & cur,
- const size_type numParams, std::vector<MathData> & params,
+ const size_type numParams, vector<MathData> & params,
size_t & pos, MathAtom & scriptToPutAround,
const pos_type macroPos, const int thisPos, const int thisSlice)
{
size_t & pos, MathAtom & scriptToPutAround,
const pos_type macroPos, const int thisPos, const int thisSlice)
{
MathAtom & cell = operator[](pos);
// fix cursor
MathAtom & cell = operator[](pos);
// fix cursor
- std::vector<CursorSlice> argSlices;
+ vector<CursorSlice> argSlices;
int argPos = 0;
if (thisSlice != -1 && thisPos == int(pos)) {
cur.cutOff(thisSlice, argSlices);
int argPos = 0;
if (thisSlice != -1 && thisPos == int(pos)) {
cur.cutOff(thisSlice, argSlices);
if ((*it)->getChar() == ' ')
x += glue;
//lyxerr << "char: " << (*it)->getChar()
if ((*it)->getChar() == ' ')
x += glue;
//lyxerr << "char: " << (*it)->getChar()
- // << "width: " << (*it)->width() << std::endl;
+ // << "width: " << (*it)->width() << endl;
x += atom_dims_[i].wid;
}
return x;
x += atom_dims_[i].wid;
}
return x;
void MathData::setXY(BufferView & bv, int x, int y) const
{
void MathData::setXY(BufferView & bv, int x, int y) const
{
- //lyxerr << "setting position cache for MathData " << this << std::endl;
+ //lyxerr << "setting position cache for MathData " << this << endl;
bv.coordCache().arrays().add(this, x, y);
}
bv.coordCache().arrays().add(this, x, y);
}
-std::ostream & operator<<(std::ostream & os, MathData const & ar)
+ostream & operator<<(ostream & os, MathData const & ar)
{
odocstringstream oss;
NormalStream ns(oss);
{
odocstringstream oss;
NormalStream ns(oss);
// create extra script inset and move superscript over
InsetMathScript * p = ar[i].nucleus()->asScriptInset();
// create extra script inset and move superscript over
InsetMathScript * p = ar[i].nucleus()->asScriptInset();
- std::auto_ptr<InsetMathScript> q(new InsetMathScript(true));
+ auto_ptr<InsetMathScript> q(new InsetMathScript(true));
swap(q->up(), p->up());
p->removeScript(true);
swap(q->up(), p->up());
p->removeScript(true);
extractScript(exp, jt, ar.end(), true);
// create a proper inset as replacement
extractScript(exp, jt, ar.end(), true);
// create a proper inset as replacement
- std::auto_ptr<InsetMathExFunc> p(new InsetMathExFunc(name));
+ auto_ptr<InsetMathExFunc> p(new InsetMathExFunc(name));
// jt points to the "argument". Get hold of this.
MathData::iterator st = extractArgument(p->cell(0), jt, ar.end(), true);
// jt points to the "argument". Get hold of this.
MathData::iterator st = extractArgument(p->cell(0), jt, ar.end(), true);
}
// create a proper diff inset
}
// create a proper diff inset
- std::auto_ptr<InsetMathDiff> diff(new InsetMathDiff);
+ auto_ptr<InsetMathDiff> diff(new InsetMathDiff);
// collect function, let jt point behind last used item
MathData::iterator jt = it + 1;
// collect function, let jt point behind last used item
MathData::iterator jt = it + 1;
- std::string captureOutput(std::string const & cmd, std::string const & data)
+ string captureOutput(string const & cmd, string const & data)
{
// In order to avoid parsing problems with command interpreters
// we pass input data through a file
{
// In order to avoid parsing problems with command interpreters
// we pass input data through a file
if (cas_tmpfile.empty()) {
lyxerr << "Warning: cannot create temporary file."
<< endl;
if (cas_tmpfile.empty()) {
lyxerr << "Warning: cannot create temporary file."
<< endl;
- std::ofstream os(cas_tmpfile.toFilesystemEncoding().c_str());
+ ofstream os(cas_tmpfile.toFilesystemEncoding().c_str());
os << data << endl;
os.close();
os << data << endl;
os.close();
- std::string command = cmd + " < "
+ string command = cmd + " < "
+ quoteName(cas_tmpfile.toFilesystemEncoding());
lyxerr << "calling: " << cmd
<< "\ninput: '" << data << "'" << endl;
+ quoteName(cas_tmpfile.toFilesystemEncoding());
lyxerr << "calling: " << cmd
<< "\ninput: '" << data << "'" << endl;
- size_t get_matching_brace(std::string const & str, size_t i)
+ size_t get_matching_brace(string const & str, size_t i)
{
int count = 1;
size_t n = str.size();
{
int count = 1;
size_t n = str.size();
- size_t get_matching_brace_back(std::string const & str, size_t i)
+ size_t get_matching_brace_back(string const & str, size_t i)
{
int count = 1;
while (i > 0) {
{
int count = 1;
while (i > 0) {
docstring expr = os.str();
docstring const header = from_ascii("simpsum:true;");
docstring expr = os.str();
docstring const header = from_ascii("simpsum:true;");
for (int i = 0; i < 100; ++i) { // at most 100 attempts
// try to fix missing '*' the hard way
//
for (int i = 0; i < 100; ++i) { // at most 100 attempts
// try to fix missing '*' the hard way
//
// search line with "Incorrect syntax"
istringstream is(out);
// search line with "Incorrect syntax"
istringstream is(out);
while (is) {
getline(is, line);
if (line.find("Incorrect syntax") != npos)
while (is) {
getline(is, line);
if (line.find("Incorrect syntax") != npos)
expr.insert(pos, from_ascii("*"));
}
expr.insert(pos, from_ascii("*"));
}
- vector<std::string> tmp = getVectorFromString(out, "$$");
+ vector<string> tmp = getVectorFromString(out, "$$");
if (tmp.size() < 2)
return MathData();
if (tmp.size() < 2)
return MathData();
- out = subst(tmp[1], "\\>", std::string());
+ out = subst(tmp[1], "\\>", string());
lyxerr << "output: '" << out << "'" << endl;
// Ugly code that tries to make the result prettier
lyxerr << "output: '" << out << "'" << endl;
// Ugly code that tries to make the result prettier
size_t k = get_matching_brace(out, j + 1);
k = get_matching_brace(out, k + 1);
k = get_matching_brace(out, k + 1);
size_t k = get_matching_brace(out, j + 1);
k = get_matching_brace(out, k + 1);
k = get_matching_brace(out, k + 1);
- std::string mid = out.substr(i + 13, j - i - 13);
+ string mid = out.substr(i + 13, j - i - 13);
if (mid.find("\\over") != npos)
mid = '{' + mid + '}';
out = out.substr(0,i)
if (mid.find("\\over") != npos)
mid = '{' + mid + '}';
out = out.substr(0,i)
MathData pipeThroughMaple(docstring const & extra, MathData const & ar)
{
MathData pipeThroughMaple(docstring const & extra, MathData const & ar)
{
- std::string header = "readlib(latex):\n";
+ string header = "readlib(latex):\n";
// remove the \\it for variable names
//"#`latex/csname_font` := `\\it `:"
// remove the \\it for variable names
//"#`latex/csname_font` := `\\it `:"
//"#`latex/latex/symbol` "
// " := subs((\\'_\\' = \\'`\\_`\\',eval(`latex/latex/symbol`)): ";
//"#`latex/latex/symbol` "
// " := subs((\\'_\\' = \\'`\\_`\\',eval(`latex/latex/symbol`)): ";
- std::string trailer = "quit;";
+ string trailer = "quit;";
odocstringstream os;
MapleStream ms(os);
ms << ar;
odocstringstream os;
MapleStream ms(os);
ms << ar;
- std::string expr = to_utf8(os.str());
+ string expr = to_utf8(os.str());
lyxerr << "ar: '" << ar << "'\n"
<< "ms: '" << expr << "'" << endl;
lyxerr << "ar: '" << ar << "'\n"
<< "ms: '" << expr << "'" << endl;
namespace {
// file scope
namespace {
// file scope
-typedef std::map<docstring, latexkeys> WordList;
+typedef map<docstring, latexkeys> WordList;
- std::ifstream fs(filename.toFilesystemEncoding().c_str());
+ ifstream fs(filename.toFilesystemEncoding().c_str());
string line;
bool skip = false;
while (getline(fs, line)) {
string line;
bool skip = false;
while (getline(fs, line)) {
Dimension bsdim;
mathed_string_dim(mi.base.font, from_ascii("\\"), bsdim);
dim.wid += bsdim.width() + 1;
Dimension bsdim;
mathed_string_dim(mi.base.font, from_ascii("\\"), bsdim);
dim.wid += bsdim.width() + 1;
- dim.asc = std::max(bsdim.ascent(), dim.ascent());
- dim.des = std::max(bsdim.descent(), dim.descent());
+ dim.asc = max(bsdim.ascent(), dim.ascent());
+ dim.des = max(bsdim.descent(), dim.descent());
metricsMarkers(dim);
} else {
BOOST_ASSERT(macro_ != 0);
metricsMarkers(dim);
} else {
BOOST_ASSERT(macro_ != 0);
mathed_string_dim(font, name(), namedim);
#if 0
dim.wid += 2 + namedim.wid + 2 + 2;
mathed_string_dim(font, name(), namedim);
#if 0
dim.wid += 2 + namedim.wid + 2 + 2;
- dim.asc = std::max(dim.asc, namedim.asc) + 2;
- dim.des = std::max(dim.des, namedim.des) + 2;
+ dim.asc = max(dim.asc, namedim.asc) + 2;
+ dim.des = max(dim.des, namedim.des) + 2;
- dim.wid = std::max(1 + namedim.wid + 1, 2 + dim.wid + 2);
+ dim.wid = max(1 + namedim.wid + 1, 2 + dim.wid + 2);
dim.asc += 1 + namedim.height() + 1;
dim.des += 2;
}
dim.asc += 1 + namedim.height() + 1;
dim.des += 2;
}
needsUpdate_ = false;
// get default values of macro
needsUpdate_ = false;
// get default values of macro
- std::vector<docstring> const & defaults = macro_->defaults();
+ vector<docstring> const & defaults = macro_->defaults();
// create MathMacroArgumentValue objects pointing to the cells of the macro
// create MathMacroArgumentValue objects pointing to the cells of the macro
- std::vector<MathData> values(nargs());
+ vector<MathData> values(nargs());
for (size_t i = 0; i < nargs(); ++i) {
if (!cell(i).empty() || i >= defaults.size() ||
defaults[i].empty() || curIdx == (int)i)
for (size_t i = 0; i < nargs(); ++i) {
if (!cell(i).empty() || i >= defaults.size() ||
defaults[i].empty() || curIdx == (int)i)
-void MathMacro::detachArguments(std::vector<MathData> & args, bool strip)
+void MathMacro::detachArguments(vector<MathData> & args, bool strip)
{
BOOST_ASSERT(displayMode_ == DISPLAY_NORMAL);
args = cells_;
{
BOOST_ASSERT(displayMode_ == DISPLAY_NORMAL);
args = cells_;
-void MathMacro::attachArguments(std::vector<MathData> const & args, size_t arity, int optionals)
+void MathMacro::attachArguments(vector<MathData> const & args, size_t arity, int optionals)
{
BOOST_ASSERT(displayMode_ == DISPLAY_NORMAL);
cells_ = args;
{
BOOST_ASSERT(displayMode_ == DISPLAY_NORMAL);
cells_ = args;
// Use macroBackup_ instead of macro_ here, because
// this is outside the metrics/draw calls, hence the macro_
// variable can point to a MacroData which was freed already.
// Use macroBackup_ instead of macro_ here, because
// this is outside the metrics/draw calls, hence the macro_
// variable can point to a MacroData which was freed already.
- std::vector<docstring> const & defaults = macroBackup_.defaults();
+ vector<docstring> const & defaults = macroBackup_.defaults();
// Optional argument
if (os.latex()) {
// Optional argument
if (os.latex()) {
MathMacroTemplate::MathMacroTemplate(docstring const & name, int numargs,
int optionals, docstring const & type,
MathMacroTemplate::MathMacroTemplate(docstring const & name, int numargs,
int optionals, docstring const & type,
- std::vector<MathData> const & optionalValues,
+ vector<MathData> const & optionalValues,
MathData const & def, MathData const & display)
: InsetMathNest(optionals + 3), numargs_(numargs),
optionals_(optionals), optionalValues_(optionalValues), type_(type)
MathData const & def, MathData const & display)
: InsetMathNest(optionals + 3), numargs_(numargs),
optionals_(optionals), optionalValues_(optionalValues), type_(type)
if (numargs_ > 9)
lyxerr << "MathMacroTemplate::MathMacroTemplate: wrong # of arguments: "
if (numargs_ > 9)
lyxerr << "MathMacroTemplate::MathMacroTemplate: wrong # of arguments: "
- << numargs_ << std::endl;
asArray(name, cell(0));
optionalValues_.resize(9);
asArray(name, cell(0));
optionalValues_.resize(9);
defdim.width() + 16 + dspdim.width() + 2;
dim.asc = dim0.ascent();
defdim.width() + 16 + dspdim.width() + 2;
dim.asc = dim0.ascent();
- dim.asc = std::max(dim.asc, labeldim.ascent());
- dim.asc = std::max(dim.asc, defdim.ascent());
- dim.asc = std::max(dim.asc, dspdim.ascent());
+ dim.asc = max(dim.asc, labeldim.ascent());
+ dim.asc = max(dim.asc, defdim.ascent());
+ dim.asc = max(dim.asc, dspdim.ascent());
dim.des = dim0.descent();
dim.des = dim0.descent();
- dim.des = std::max(dim.des, labeldim.descent());
- dim.des = std::max(dim.des, defdim.descent());
- dim.des = std::max(dim.des, dspdim.descent());
+ dim.des = max(dim.des, labeldim.descent());
+ dim.des = max(dim.des, defdim.descent());
+ dim.des = max(dim.des, dspdim.descent());
// make the name cell vertically centered, and 5 pixel lines margin
int real_asc = dim.asc - dim0.ascent() / 2;
int real_des = dim.des + dim0.ascent() / 2;
// make the name cell vertically centered, and 5 pixel lines margin
int real_asc = dim.asc - dim0.ascent() / 2;
int real_des = dim.des + dim0.ascent() / 2;
- dim.asc = std::max(real_asc, real_des) + dim0.ascent() / 2 + 5;
- dim.des = std::max(real_asc, real_des) - dim0.ascent() / 2 + 5;
+ dim.asc = max(real_asc, real_des) + dim0.ascent() / 2 + 5;
+ dim.des = max(real_asc, real_des) - dim0.ascent() / 2 + 5;
void MathMacroTemplate::doDispatch(Cursor & cur, FuncRequest & cmd)
{
void MathMacroTemplate::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- std::string const arg = to_utf8(cmd.argument());
+ string const arg = to_utf8(cmd.argument());
switch (cmd.action) {
case LFUN_MATH_MACRO_ADD_PARAM:
switch (cmd.action) {
case LFUN_MATH_MACRO_ADD_PARAM:
FuncStatus & flag) const
{
bool ret = true;
FuncStatus & flag) const
{
bool ret = true;
- std::string const arg = to_utf8(cmd.argument());
+ string const arg = to_utf8(cmd.argument());
switch (cmd.action) {
case LFUN_MATH_MACRO_ADD_PARAM: {
int num = numargs_ + 1;
switch (cmd.action) {
case LFUN_MATH_MACRO_ADD_PARAM: {
int num = numargs_ + 1;
-void MathMacroTemplate::write(Buffer const &, std::ostream & os) const
+void MathMacroTemplate::write(Buffer const &, ostream & os) const
{
odocstringstream oss;
WriteStream wi(oss, false, false);
{
odocstringstream oss;
WriteStream wi(oss, false, false);
MacroData MathMacroTemplate::asMacroData() const
{
MacroData MathMacroTemplate::asMacroData() const
{
- std::vector<docstring> defaults(numargs_);
+ vector<docstring> defaults(numargs_);
for (int i = 0; i < optionals_; ++i)
defaults[i] = asString(cell(optIdx(i)));
return MacroData(asString(cell(defIdx())), defaults,
for (int i = 0; i < optionals_; ++i)
defaults[i] = asString(cell(optIdx(i)));
return MacroData(asString(cell(defIdx())), defaults,
- numargs_, optionals_, asString(cell(displayIdx())), std::string());
+ numargs_, optionals_, asString(cell(displayIdx())), string());
///
Parser(Lexer & lex);
/// Only use this for reading from .lyx file format, for the reason
///
Parser(Lexer & lex);
/// Only use this for reading from .lyx file format, for the reason
- /// see Parser::tokenize(std::istream &).
+ /// see Parser::tokenize(istream &).
Parser(istream & is);
///
Parser(docstring const & str);
Parser(istream & is);
///
Parser(docstring const & str);
docstring name;
int nargs = 0;
int optionals = 0;
docstring name;
int nargs = 0;
int optionals = 0;
- std::vector<MathData> optionalValues;
+ vector<MathData> optionalValues;
if (t.cs() == "def") {
// get name
name = getToken().cs();
if (t.cs() == "def") {
// get name
name = getToken().cs();
-NormalStream & operator<<(NormalStream & ns, const std::string & s)
+NormalStream & operator<<(NormalStream & ns, const string & s)
{
ns.os() << from_utf8(s);
return ns;
{
ns.os() << from_utf8(s);
return ns;
ws.pendingSpace(false);
}
ws.os() << s;
ws.pendingSpace(false);
}
ws.os() << s;
- ws.addlines(int(std::count(s, s + strlen(s), '\n')));
+ ws.addlines(int(count(s, s + strlen(s), '\n')));
-OctaveStream & operator<<(OctaveStream & os, std::string const & s)
+OctaveStream & operator<<(OctaveStream & os, string const & s)
{
os.os() << from_utf8(s);
return os;
{
os.os() << from_utf8(s);
return os;
-std::map<docstring, deco_struct> deco_list;
+map<docstring, deco_struct> deco_list;
// sort the table on startup
class init_deco_table {
// sort the table on startup
class init_deco_table {
deco_struct const * search_deco(docstring const & name)
{
deco_struct const * search_deco(docstring const & name)
{
- std::map<docstring, deco_struct>::const_iterator p = deco_list.find(name);
+ map<docstring, deco_struct>::const_iterator p = deco_list.find(name);
return p == deco_list.end() ? 0 : &(p->second);
}
return p == deco_list.end() ? 0 : &(p->second);
}
FontFamily family_;
FontSeries series_;
FontShape shape_;
FontFamily family_;
FontSeries series_;
FontShape shape_;
{
//lyxerr << "searching font '" << name << "'" << endl;
int const n = sizeof(fontinfos) / sizeof(fontinfo);
{
//lyxerr << "searching font '" << name << "'" << endl;
int const n = sizeof(fontinfos) / sizeof(fontinfo);
- std::string name = to_utf8(name0);
+ string name = to_utf8(name0);
for (int i = 0; i < n; ++i)
if (fontinfos[i].cmd_ == name) {
//lyxerr << "found '" << i << "'" << endl;
for (int i = 0; i < n; ++i)
if (fontinfos[i].cmd_ == name) {
//lyxerr << "found '" << i << "'" << endl;
if (par != pbegin)
os << '\n';
if (par->layout() == defaultstyle && par->emptyTag()) {
if (par != pbegin)
os << '\n';
if (par->layout() == defaultstyle && par->emptyTag()) {
- par->simpleDocBookOnePar(buf, os, runparams, outerFont(std::distance(paragraphs.begin(), par), paragraphs));
+ par->simpleDocBookOnePar(buf, os, runparams, outerFont(distance(paragraphs.begin(), par), paragraphs));
} else {
sgml::openTag(buf, os, runparams, *par);
} else {
sgml::openTag(buf, os, runparams, *par);
- par->simpleDocBookOnePar(buf, os, runparams, outerFont(std::distance(paragraphs.begin(), par), paragraphs));
+ par->simpleDocBookOnePar(buf, os, runparams, outerFont(distance(paragraphs.begin(), par), paragraphs));
sgml::closeTag(os, *par);
}
}
sgml::closeTag(os, *par);
}
}
case LATEX_ITEM_ENVIRONMENT: {
if (par->params().depth() == pbegin->params().depth()) {
sgml::openTag(os, wrapper);
case LATEX_ITEM_ENVIRONMENT: {
if (par->params().depth() == pbegin->params().depth()) {
sgml::openTag(os, wrapper);
- par->simpleDocBookOnePar(buf, os, runparams, outerFont(std::distance(paragraphs.begin(), par), paragraphs), sep);
+ par->simpleDocBookOnePar(buf, os, runparams, outerFont(distance(paragraphs.begin(), par), paragraphs), sep);
sgml::closeTag(os, wrapper);
++par;
}
sgml::closeTag(os, wrapper);
++par;
}
// Opend inner tag and close inner tags
sgml::openTag(os, bstyle->innertag());
// Opend inner tag and close inner tags
sgml::openTag(os, bstyle->innertag());
- par->simpleDocBookOnePar(buf, os, runparams, outerFont(std::distance(paragraphs.begin(), par), paragraphs));
+ par->simpleDocBookOnePar(buf, os, runparams, outerFont(distance(paragraphs.begin(), par), paragraphs));
sgml::closeTag(os, bstyle->innertag());
os << '\n';
sgml::closeTag(os, bstyle->innertag());
os << '\n';
break;
}
// makeEnvironment may process more than one paragraphs and bypass pend
break;
}
// makeEnvironment may process more than one paragraphs and bypass pend
- if (std::distance(lastpar, par) >= std::distance(lastpar, pend))
+ if (distance(lastpar, par) >= distance(lastpar, pend))
LayoutPtr style;
if (runparams_in.verbatim) {
LayoutPtr style;
if (runparams_in.verbatim) {
- int const dist = std::distance(paragraphs.begin(), pit);
+ int const dist = distance(paragraphs.begin(), pit);
Font const outerfont = outerFont(dist, paragraphs);
// No newline if only one paragraph in this lyxtext
Font const outerfont = outerFont(dist, paragraphs);
// No newline if only one paragraph in this lyxtext
- outerFont(std::distance(paragraphs.begin(), pit),
+ outerFont(distance(paragraphs.begin(), pit),
paragraphs);
// FIXME UNICODE
paragraphs);
// FIXME UNICODE
par = TeXOnePar(buf, paragraphs, par, os, texrow,
runparams, everypar);
}
par = TeXOnePar(buf, paragraphs, par, os, texrow,
runparams, everypar);
}
- if (std::distance(lastpar, par) >= std::distance(lastpar, endpar))
+ if (distance(lastpar, par) >= distance(lastpar, endpar))
break;
}
// It might be that we only have a title in this document
break;
}
// It might be that we only have a title in this document
if (dim.wid != dim2.wid)
lyxerr << "Error: inset " << to_ascii(inset->getInsetName())
<< " draw width " << dim.width()
if (dim.wid != dim2.wid)
lyxerr << "Error: inset " << to_ascii(inset->getInsetName())
<< " draw width " << dim.width()
- << "> metrics width " << dim2.wid << "." << std::endl;
+ << "> metrics width " << dim2.wid << "." << endl;
if (dim->asc != dim2.asc)
lyxerr << "Error: inset " << to_ascii(inset->getInsetName())
<< " draw ascent " << dim.ascent()
if (dim->asc != dim2.asc)
lyxerr << "Error: inset " << to_ascii(inset->getInsetName())
<< " draw ascent " << dim.ascent()
- << "> metrics ascent " << dim2.asc << "." << std::endl;
+ << "> metrics ascent " << dim2.asc << "." << endl;
if (dim2.descent() != dim.des)
lyxerr << "Error: inset " << to_ascii(inset->getInsetName())
<< " draw ascent " << dim.descent()
if (dim2.descent() != dim.des)
lyxerr << "Error: inset " << to_ascii(inset->getInsetName())
<< " draw ascent " << dim.descent()
- << "> metrics descent " << dim2.des << "." << std::endl;
+ << "> metrics descent " << dim2.des << "." << endl;
BOOST_ASSERT(dim2.wid == dim.wid);
BOOST_ASSERT(dim2.asc == dim.asc);
BOOST_ASSERT(dim2.des == dim.des);
BOOST_ASSERT(dim2.wid == dim.wid);
BOOST_ASSERT(dim2.asc == dim.asc);
BOOST_ASSERT(dim2.des == dim.des);
Change::Type const prev_change = par_.lookupChange(pos).type;
// first character
Change::Type const prev_change = par_.lookupChange(pos).type;
// first character
- std::vector<char_type> str;
str.reserve(100);
str.push_back(par_.getChar(pos));
str.reserve(100);
str.push_back(par_.getChar(pos));
char_type const c = par_.getChar(pos);
// special case languages
char_type const c = par_.getChar(pos);
// special case languages
- std::string const & lang = orig_font.language()->lang();
+ string const & lang = orig_font.language()->lang();
bool const hebrew = lang == "hebrew";
bool const arabic = lang == "arabic_arabtex" || lang == "arabic_arabi" ||
lang == "farsi";
bool const hebrew = lang == "hebrew";
bool const arabic = lang == "arabic_arabtex" || lang == "arabic_arabi" ||
lang == "farsi";
bool const is_rtl = text_.isRTL(buffer, par_);
bool const is_seq = isFirstInSequence(pit_, text_.paragraphs());
bool const is_rtl = text_.isRTL(buffer, par_);
bool const is_seq = isFirstInSequence(pit_, text_.paragraphs());
- //lyxerr << "paintFirst: " << par_.id() << " is_seq: " << is_seq << std::endl;
+ //lyxerr << "paintFirst: " << par_.id() << " is_seq: " << is_seq << endl;
// should we print a label?
if (layout->labeltype >= LABEL_STATIC
// should we print a label?
if (layout->labeltype >= LABEL_STATIC
namespace support {
FileFilterList::Filter::Filter(docstring const & description,
namespace support {
FileFilterList::Filter::Filter(docstring const & description,
- std::string const & globs)
: desc_(description)
{
typedef boost::tokenizer<boost::char_separator<char> > Tokenizer;
: desc_(description)
{
typedef boost::tokenizer<boost::char_separator<char> > Tokenizer;
-std::string FileName::onlyFileName() const
+string FileName::onlyFileName() const
{
return support::onlyFilename(absFilename());
}
{
return support::onlyFilename(absFilename());
}
-FileNameList FileName::dirList(std::string const & ext) const
+FileNameList FileName::dirList(string const & ext) const
{
FileNameList dirlist;
if (!isDirectory()) {
{
FileNameList dirlist;
if (!isDirectory()) {
-FileName FileName::tempName(FileName const & dir, std::string const & mask)
+FileName FileName::tempName(FileName const & dir, string const & mask)
{
return support::tempName(dir, mask);
}
{
return support::tempName(dir, mask);
}
-std::time_t FileName::lastModified() const
+time_t FileName::lastModified() const
{
return d->fi.lastModified().toTime_t();
}
{
return d->fi.lastModified().toTime_t();
}
-void FileName::changeExtension(std::string const & extension)
+void FileName::changeExtension(string const & extension)
{
// FIXME: use Qt native methods...
string const oldname = absFilename();
{
// FIXME: use Qt native methods...
string const oldname = absFilename();
-std::ostream & operator<<(std::ostream & os, FileName const & filename)
+ostream & operator<<(ostream & os, FileName const & filename)
{
return os << filename.absFilename();
}
{
return os << filename.absFilename();
}
-string DocFileName::mangledFilename(std::string const & dir) const
+string DocFileName::mangledFilename(string const & dir) const
{
// We need to make sure that every DocFileName instance for a given
// filename returns the same mangled name.
{
// We need to make sure that every DocFileName instance for a given
// filename returns the same mangled name.
// Prepend a counter to the filename. This is necessary to make
// the mangled name unique.
static int counter = 0;
// Prepend a counter to the filename. This is necessary to make
// the mangled name unique.
static int counter = 0;
s << counter++ << mname;
mname = s.str();
s << counter++ << mname;
mname = s.str();
// If dir.size() > max length, all bets are off for YAP. We truncate
// the filename nevertheless, keeping a minimum of 10 chars.
// If dir.size() > max length, all bets are off for YAP. We truncate
// the filename nevertheless, keeping a minimum of 10 chars.
- string::size_type max_length = std::max(100 - ((int)dir.size() + 1), 10);
+ string::size_type max_length = max(100 - ((int)dir.size() + 1), 10);
// If the mangled file name is too long, hack it to fit.
// We know we're guaranteed to have a unique file name because
// If the mangled file name is too long, hack it to fit.
// We know we're guaranteed to have a unique file name because
# include <sys/wait.h>
#endif
# include <sys/wait.h>
#endif
-using namespace std;\r
-\r
using boost::bind;
namespace lyx {
using boost::bind;
namespace lyx {
{
if (pid_ != 0)
support::kill(pid_, SIGKILL);
{
if (pid_ != 0)
support::kill(pid_, SIGKILL);
- lyxerr << "Killed " << pid_ << std::endl;
+ lyxerr << "Killed " << pid_ << endl;
- int const tolerance = std::max(0, tol);
+ int const tolerance = max(0, tol);
if (tolerance == 0) {
// Kill it dead NOW!
Murder::killItDead(0, pid());
if (tolerance == 0) {
// Kill it dead NOW!
Murder::killItDead(0, pid());
DWORD exit_code = 0;
if (!GetExitCodeProcess(hProcess, &exit_code)) {
lyxerr << "GetExitCodeProcess failed waiting for child\n"
DWORD exit_code = 0;
if (!GetExitCodeProcess(hProcess, &exit_code)) {
lyxerr << "GetExitCodeProcess failed waiting for child\n"
- << getChildErrorMessage() << std::endl;
+ << getChildErrorMessage() << endl;
} else
retval_ = exit_code;
break;
}
case WAIT_FAILED:
lyxerr << "WaitForSingleObject failed waiting for child\n"
} else
retval_ = exit_code;
break;
}
case WAIT_FAILED:
lyxerr << "WaitForSingleObject failed waiting for child\n"
- << getChildErrorMessage() << std::endl;
+ << getChildErrorMessage() << endl;
for (; ait != aend; ++ait)
if (*ait)
lyxerr << '\t'<< *ait << '\n';
for (; ait != aend; ++ait)
if (*ait)
lyxerr << '\t'<< *ait << '\n';
- lyxerr << "</command>" << std::endl;
+ lyxerr << "</command>" << endl;
namespace ForkedCallQueue {
/// A process in the queue
namespace ForkedCallQueue {
/// A process in the queue
-typedef std::pair<std::string, ForkedCall::SignalTypePtr> Process;
+typedef pair<string, ForkedCall::SignalTypePtr> Process;
/** Add a process to the queue. Processes are forked sequentially
* only one is running at a time.
* Connect to the returned signal and you'll be informed when
* the process has ended.
*/
/** Add a process to the queue. Processes are forked sequentially
* only one is running at a time.
* Connect to the returned signal and you'll be informed when
* the process has ended.
*/
-ForkedCall::SignalTypePtr add(std::string const & process);
+ForkedCall::SignalTypePtr add(string const & process);
-static std::queue<Process> callQueue_;
+static queue<Process> callQueue_;
/// flag whether queue is running
static bool running_ = 0;
/// flag whether queue is running
static bool running_ = 0;
(LPTSTR) &t_message, 0, 0
) != 0;
(LPTSTR) &t_message, 0, 0
) != 0;
ss << "LyX: Error waiting for child: " << error_code;
if (ok) {
ss << "LyX: Error waiting for child: " << error_code;
if (ok) {
namespace ForkedCallsController {
typedef boost::shared_ptr<ForkedProcess> ForkedProcessPtr;
namespace ForkedCallsController {
typedef boost::shared_ptr<ForkedProcess> ForkedProcessPtr;
-typedef std::list<ForkedProcessPtr> ListType;
+typedef list<ForkedProcessPtr> ListType;
typedef ListType::iterator iterator;
typedef ListType::iterator iterator;
DWORD exit_code = 0;
if (!GetExitCodeProcess(hProcess, &exit_code)) {
lyxerr << "GetExitCodeProcess failed waiting for child\n"
DWORD exit_code = 0;
if (!GetExitCodeProcess(hProcess, &exit_code)) {
lyxerr << "GetExitCodeProcess failed waiting for child\n"
- << getChildErrorMessage() << std::endl;
+ << getChildErrorMessage() << endl;
// Child died, so pretend it returned 1
actCall->setRetValue(1);
} else {
// Child died, so pretend it returned 1
actCall->setRetValue(1);
} else {
}
case WAIT_FAILED:
lyxerr << "WaitForSingleObject failed waiting for child\n"
}
case WAIT_FAILED:
lyxerr << "WaitForSingleObject failed waiting for child\n"
- << getChildErrorMessage() << std::endl;
+ << getChildErrorMessage() << endl;
actCall->setRetValue(1);
remove_it = true;
break;
actCall->setRetValue(1);
remove_it = true;
break;
- std::pair<TranslationCache::iterator, bool> result =
- cache_.insert(std::make_pair(m, trans));
+ pair<TranslationCache::iterator, bool> result =
+ cache_.insert(make_pair(m, trans));
BOOST_ASSERT(result.second);
BOOST_ASSERT(result.second);
// libstdc++ that is distributed with GNU G++.
class Messages::Pimpl {
public:
// libstdc++ that is distributed with GNU G++.
class Messages::Pimpl {
public:
- typedef std::messages<char>::catalog catalog;
+ typedef messages<char>::catalog catalog;
Pimpl(string const & l)
: lang_(l),
loc_gl(lang_.c_str()),
Pimpl(string const & l)
: lang_(l),
loc_gl(lang_.c_str()),
- mssg_gl(std::use_facet<std::messages<char> >(loc_gl))
+ mssg_gl(use_facet<messages<char> >(loc_gl))
{
//LYXERR("Messages: language(" << l << ") in dir(" << dir << ")");
{
//LYXERR("Messages: language(" << l << ") in dir(" << dir << ")");
- std::messages<char> const & mssg_gl;
+ messages<char> const & mssg_gl;
if (exe_name != exe_path)
return FileName();
if (exe_name != exe_path)
return FileName();
- std::vector<string> const path = getEnvPath("PATH");
- std::vector<string>::const_iterator it = path.begin();
- std::vector<string>::const_iterator const end = path.end();
+ vector<string> const path = getEnvPath("PATH");
+ vector<string>::const_iterator it = path.begin();
+ vector<string>::const_iterator const end = path.end();
for (; it != end; ++it) {
// This will do nothing if *it is already absolute.
string const exe_dir = makeAbsPath(*it).absFilename();
for (; it != end; ++it) {
// This will do nothing if *it is already absolute.
string const exe_dir = makeAbsPath(*it).absFilename();
// searched_dirs is used for diagnostic purposes only in the case
// that "chkconfig.ltx" is not found.
// searched_dirs is used for diagnostic purposes only in the case
// that "chkconfig.ltx" is not found.
- std::list<FileName> searched_dirs;
+ list<FileName> searched_dirs;
// 1. Use the -sysdir command line parameter.
FileName path = abs_path_from_command_line(command_line_system_support_dir);
// 1. Use the -sysdir command line parameter.
FileName path = abs_path_from_command_line(command_line_system_support_dir);
// Everything has failed :-(
// So inform the user and exit.
string searched_dirs_str;
// Everything has failed :-(
// So inform the user and exit.
string searched_dirs_str;
- typedef std::list<FileName>::const_iterator iterator;
+ typedef list<FileName>::const_iterator iterator;
iterator const begin = searched_dirs.begin();
iterator const end = searched_dirs.end();
for (iterator it = begin; it != end; ++it) {
iterator const begin = searched_dirs.begin();
iterator const end = searched_dirs.end();
for (iterator it = begin; it != end; ++it) {
-using std::string;
-
-#ifndef CXX_GLOBAL_CSTD
-using std::system;
-#endif
namespace lyx {
namespace support {
namespace lyx {
namespace support {
#include <QObject>
#include <QTimerEvent>
#include <QObject>
#include <QTimerEvent>
void Timeout::Impl::start()
{
if (running())
void Timeout::Impl::start()
{
if (running())
- lyxerr << "Timeout::start: already running!" << std::endl;
+ lyxerr << "Timeout::start: already running!" << endl;
timeout_id = startTimer(timeout_ms());
}
timeout_id = startTimer(timeout_ms());
}
{ if (l.enabled()) l.stream() << t; return l; }
LyXErr & operator<<(LyXErr & l, double t)
{ if (l.enabled()) l.stream() << t; return l; }
{ if (l.enabled()) l.stream() << t; return l; }
LyXErr & operator<<(LyXErr & l, double t)
{ if (l.enabled()) l.stream() << t; return l; }
-LyXErr & operator<<(LyXErr & l, std::string const & t)
+LyXErr & operator<<(LyXErr & l, string const & t)
{ if (l.enabled()) l.stream() << t; return l; }
LyXErr & operator<<(LyXErr & l, docstring const & t)
{ if (l.enabled()) l.stream() << to_utf8(t); return l; }
LyXErr & operator<<(LyXErr & l, support::FileName const & t)
{ if (l.enabled()) l.stream() << t; return l; }
{ if (l.enabled()) l.stream() << t; return l; }
LyXErr & operator<<(LyXErr & l, docstring const & t)
{ if (l.enabled()) l.stream() << to_utf8(t); return l; }
LyXErr & operator<<(LyXErr & l, support::FileName const & t)
{ if (l.enabled()) l.stream() << t; return l; }
-LyXErr & operator<<(LyXErr & l, std::ostream &(*t)(std::ostream &))
+LyXErr & operator<<(LyXErr & l, ostream &(*t)(ostream &))
{ if (l.enabled()) l.stream() << t; return l; }
{ if (l.enabled()) l.stream() << t; return l; }
-LyXErr & operator<<(LyXErr & l, std::ios_base &(*t)(std::ios_base &))
+LyXErr & operator<<(LyXErr & l, ios_base &(*t)(ios_base &))
{ if (l.enabled()) l.stream() << t; return l; }
{ if (l.enabled()) l.stream() << t; return l; }
/// codecvt facet for conversion of UCS4 (internal representation) to UTF8
/// (external representation) or vice versa
/// codecvt facet for conversion of UCS4 (internal representation) to UTF8
/// (external representation) or vice versa
-class iconv_codecvt_facet : public std::codecvt<lyx::char_type, char, std::mbstate_t>
+class iconv_codecvt_facet : public codecvt<lyx::char_type, char, mbstate_t>
- typedef std::codecvt<lyx::char_type, char, std::mbstate_t> base;
+ typedef codecvt<lyx::char_type, char, mbstate_t> base;
public:
/// Constructor. You have to specify with \p inout whether you want
/// to use this facet only for input, only for output or for both.
explicit iconv_codecvt_facet(string const & encoding = "UTF-8",
public:
/// Constructor. You have to specify with \p inout whether you want
/// to use this facet only for input, only for output or for both.
explicit iconv_codecvt_facet(string const & encoding = "UTF-8",
- std::ios_base::openmode inout = std::ios_base::in | std::ios_base::out,
+ ios_base::openmode inout = ios_base::in | ios_base::out,
size_t refs = 0)
: base(refs), encoding_(encoding)
{
size_t refs = 0)
: base(refs), encoding_(encoding)
{
- if (inout & std::ios_base::in) {
+ if (inout & ios_base::in) {
in_cd_ = iconv_open(ucs4_codeset, encoding.c_str());
if (in_cd_ == (iconv_t)(-1)) {
fprintf(stderr, "Error %d returned from iconv_open(in_cd_): %s\n",
in_cd_ = iconv_open(ucs4_codeset, encoding.c_str());
if (in_cd_ == (iconv_t)(-1)) {
fprintf(stderr, "Error %d returned from iconv_open(in_cd_): %s\n",
}
} else
in_cd_ = (iconv_t)(-1);
}
} else
in_cd_ = (iconv_t)(-1);
- if (inout & std::ios_base::out) {
+ if (inout & ios_base::out) {
out_cd_ = iconv_open(encoding.c_str(), ucs4_codeset);
if (out_cd_ == (iconv_t)(-1)) {
fprintf(stderr, "Error %d returned from iconv_open(out_cd_): %s\n",
out_cd_ = iconv_open(encoding.c_str(), ucs4_codeset);
if (out_cd_ == (iconv_t)(-1)) {
fprintf(stderr, "Error %d returned from iconv_open(out_cd_): %s\n",
return to_next - to;
#else
size_t const length = end - from;
return to_next - to;
#else
size_t const length = end - from;
- return std::min(length, max);
+ return min(length, max);
#endif
}
virtual int do_max_length() const throw()
#endif
}
virtual int do_max_length() const throw()
iconv_t in_cd_;
iconv_t out_cd_;
/// The narrow encoding
iconv_t in_cd_;
iconv_t out_cd_;
/// The narrow encoding
namespace lyx {
template<class Ios>
namespace lyx {
template<class Ios>
-void setEncoding(Ios & ios, string const & encoding, std::ios_base::openmode mode)
+void setEncoding(Ios & ios, string const & encoding, ios_base::openmode mode)
{
// We must imbue the stream before openening the file
{
// We must imbue the stream before openening the file
- std::locale global;
- std::locale locale(global, new iconv_codecvt_facet(encoding, mode));
+ locale global;
+ locale locale(global, new iconv_codecvt_facet(encoding, mode));
-idocfstream::idocfstream(const char* s, std::ios_base::openmode mode,
+idocfstream::idocfstream(const char* s, ios_base::openmode mode,
string const & encoding)
: base()
{
string const & encoding)
: base()
{
-odocfstream::odocfstream(const char* s, std::ios_base::openmode mode,
+odocfstream::odocfstream(const char* s, ios_base::openmode mode,
string const & encoding)
: base()
{
string const & encoding)
: base()
{
odocstream & operator<<(odocstream & os, SetEnc e)
{
odocstream & operator<<(odocstream & os, SetEnc e)
{
- if (std::has_facet<iconv_codecvt_facet>(os.rdbuf()->getloc())) {
+ if (has_facet<iconv_codecvt_facet>(os.rdbuf()->getloc())) {
// This stream must be a file stream, since we never imbue
// any other stream with a locale having a iconv_codecvt_facet.
// Flush the stream so that all pending output is written
// with the old encoding.
os.flush();
// This stream must be a file stream, since we never imbue
// any other stream with a locale having a iconv_codecvt_facet.
// Flush the stream so that all pending output is written
// with the old encoding.
os.flush();
- std::locale locale(os.rdbuf()->getloc(),
- new iconv_codecvt_facet(e.encoding, std::ios_base::out));
+ locale locale(os.rdbuf()->getloc(),
+ new iconv_codecvt_facet(e.encoding, ios_base::out));
// FIXME Does changing the codecvt facet of an open file
// stream always work? It does with gcc 4.1, but I have read
// somewhere that it does not with MSVC.
// FIXME Does changing the codecvt facet of an open file
// stream always work? It does with gcc 4.1, but I have read
// somewhere that it does not with MSVC.
#include <boost/assert.hpp>
#include <boost/assert.hpp>
-docstring const from_ascii(std::string const & ascii)
+docstring const from_ascii(string const & ascii)
{
int const len = ascii.length();
for (int i = 0; i < len; ++i)
{
int const len = ascii.length();
for (int i = 0; i < len; ++i)
-std::string const to_ascii(docstring const & ucs4)
+string const to_ascii(docstring const & ucs4)
{
int const len = ucs4.length();
{
int const len = ucs4.length();
ascii.resize(len);
for (int i = 0; i < len; ++i) {
BOOST_ASSERT(ucs4[i] < 0x80);
ascii.resize(len);
for (int i = 0; i < len; ++i) {
BOOST_ASSERT(ucs4[i] < 0x80);
-void utf8_to_ucs4(std::string const & utf8, docstring & ucs4)
+void utf8_to_ucs4(string const & utf8, docstring & ucs4)
{
size_t n = utf8.size();
// as utf8 is a multi-byte encoding, there would be at most
{
size_t n = utf8.size();
// as utf8 is a multi-byte encoding, there would be at most
-docstring const from_utf8(std::string const & utf8)
+docstring const from_utf8(string const & utf8)
{
docstring ucs4;
utf8_to_ucs4(utf8, ucs4);
{
docstring ucs4;
utf8_to_ucs4(utf8, ucs4);
-std::string const to_utf8(docstring const & ucs4)
+string const to_utf8(docstring const & ucs4)
- std::vector<char> const utf8 =
+ vector<char> const utf8 =
ucs4_to_utf8(ucs4.data(), ucs4.size());
ucs4_to_utf8(ucs4.data(), ucs4.size());
- return std::string(utf8.begin(), utf8.end());
+ return string(utf8.begin(), utf8.end());
-docstring const from_local8bit(std::string const & s)
+docstring const from_local8bit(string const & s)
{
return qstring_to_ucs4(QString::fromLocal8Bit(s.data(), s.length()));
}
/// Exception thrown by to_local8bit if the string could not be converted
{
return qstring_to_ucs4(QString::fromLocal8Bit(s.data(), s.length()));
}
/// Exception thrown by to_local8bit if the string could not be converted
-class to_local8bit_failure : public std::bad_cast {
+class to_local8bit_failure : public bad_cast {
- to_local8bit_failure() throw() : std::bad_cast() {}
+ to_local8bit_failure() throw() : bad_cast() {}
virtual ~to_local8bit_failure() throw() {}
virtual const char* what() const throw()
{
virtual ~to_local8bit_failure() throw() {}
virtual const char* what() const throw()
{
-std::string const to_local8bit(docstring const & s)
+string const to_local8bit(docstring const & s)
{
// This conversion can fail, depending on input.
if (s.empty())
{
// This conversion can fail, depending on input.
if (s.empty())
QByteArray const local = toqstr(s).toLocal8Bit();
if (local.size() == 0)
throw to_local8bit_failure();
QByteArray const local = toqstr(s).toLocal8Bit();
if (local.size() == 0)
throw to_local8bit_failure();
- return std::string(local.begin(), local.end());
+ return string(local.begin(), local.end());
-docstring const from_filesystem8bit(std::string const & s)
+docstring const from_filesystem8bit(string const & s)
{
QByteArray const encoded(s.c_str(), s.length());
return qstring_to_ucs4(QFile::decodeName(encoded));
}
{
QByteArray const encoded(s.c_str(), s.length());
return qstring_to_ucs4(QFile::decodeName(encoded));
}
-std::string const to_filesystem8bit(docstring const & s)
+string const to_filesystem8bit(docstring const & s)
{
QByteArray const encoded = QFile::encodeName(toqstr(s));
{
QByteArray const encoded = QFile::encodeName(toqstr(s));
- return std::string(encoded.begin(), encoded.end());
+ return string(encoded.begin(), encoded.end());
-class ctype_failure : public std::bad_cast {
+class ctype_failure : public bad_cast {
- ctype_failure() throw() : std::bad_cast() {}
+ ctype_failure() throw() : bad_cast() {}
virtual ~ctype_failure() throw() {}
virtual const char* what() const throw()
{
virtual ~ctype_failure() throw() {}
virtual const char* what() const throw()
{
-class num_put_failure : public std::bad_cast {
+class num_put_failure : public bad_cast {
- num_put_failure() throw() : std::bad_cast() {}
+ num_put_failure() throw() : bad_cast() {}
virtual ~num_put_failure() throw() {}
virtual const char* what() const throw()
{
virtual ~num_put_failure() throw() {}
virtual const char* what() const throw()
{
/// ctype facet for UCS4 characters. The implementation does only support pure
/// ASCII, since we do not need anything else for now.
/// ctype facet for UCS4 characters. The implementation does only support pure
/// ASCII, since we do not need anything else for now.
-/// The code is partly stolen from std::ctype<wchar_t> from gcc.
-class ascii_ctype_facet : public std::ctype<lyx::char_type>
+/// The code is partly stolen from ctype<wchar_t> from gcc.
+class ascii_ctype_facet : public ctype<lyx::char_type>
{
public:
typedef lyx::char_type char_type;
typedef wctype_t wmask_type;
{
public:
typedef lyx::char_type char_type;
typedef wctype_t wmask_type;
- explicit ascii_ctype_facet(size_t refs = 0) : std::ctype<char_type>(refs)
+ explicit ascii_ctype_facet(size_t refs = 0) : ctype<char_type>(refs)
{
M_initialize_ctype();
}
{
M_initialize_ctype();
}
/// Facet for outputting numbers to odocstreams as ascii.
/// Here we simply need defining the virtual do_put functions.
/// Facet for outputting numbers to odocstreams as ascii.
/// Here we simply need defining the virtual do_put functions.
-class ascii_num_put_facet : public std::num_put<lyx::char_type, std::ostreambuf_iterator<lyx::char_type, std::char_traits<lyx::char_type> > >
+class ascii_num_put_facet : public num_put<lyx::char_type, ostreambuf_iterator<lyx::char_type, char_traits<lyx::char_type> > >
- typedef std::ostreambuf_iterator<lyx::char_type, std::char_traits<lyx::char_type> > iter_type;
+ typedef ostreambuf_iterator<lyx::char_type, char_traits<lyx::char_type> > iter_type;
- ascii_num_put_facet(size_t refs = 0) : std::num_put<lyx::char_type, iter_type>(refs) {}
+ ascii_num_put_facet(size_t refs = 0) : num_put<lyx::char_type, iter_type>(refs) {}
/// Facet for converting numbers to ascii strings.
/// Facet for converting numbers to ascii strings.
- class string_num_put_facet : public std::num_put<char, std::basic_string<char>::iterator>
+ class string_num_put_facet : public num_put<char, basic_string<char>::iterator>
- string_num_put_facet() : std::num_put<char, std::basic_string<char>::iterator>(1) {}
+ string_num_put_facet() : num_put<char, basic_string<char>::iterator>(1) {}
- do_put(iter_type oit, std::ios_base & b, char_type fill, bool v) const
+ do_put(iter_type oit, ios_base & b, char_type fill, bool v) const
{
return do_put_helper(oit, b, fill, v);
}
iter_type
{
return do_put_helper(oit, b, fill, v);
}
iter_type
- do_put(iter_type oit, std::ios_base & b, char_type fill, long v) const
+ do_put(iter_type oit, ios_base & b, char_type fill, long v) const
{
return do_put_helper(oit, b, fill, v);
}
iter_type
{
return do_put_helper(oit, b, fill, v);
}
iter_type
- do_put(iter_type oit, std::ios_base & b, char_type fill, unsigned long v) const
+ do_put(iter_type oit, ios_base & b, char_type fill, unsigned long v) const
{
return do_put_helper(oit, b, fill, v);
}
#ifdef _GLIBCXX_USE_LONG_LONG
iter_type
{
return do_put_helper(oit, b, fill, v);
}
#ifdef _GLIBCXX_USE_LONG_LONG
iter_type
- do_put(iter_type oit, std::ios_base & b, char_type fill, long long v) const
+ do_put(iter_type oit, ios_base & b, char_type fill, long long v) const
{
return do_put_helper(oit, b, fill, v);
}
iter_type
{
return do_put_helper(oit, b, fill, v);
}
iter_type
- do_put(iter_type oit, std::ios_base & b, char_type fill, unsigned long long v) const
+ do_put(iter_type oit, ios_base & b, char_type fill, unsigned long long v) const
{
return do_put_helper(oit, b, fill, v);
}
#endif
iter_type
{
return do_put_helper(oit, b, fill, v);
}
#endif
iter_type
- do_put(iter_type oit, std::ios_base & b, char_type fill, double v) const
+ do_put(iter_type oit, ios_base & b, char_type fill, double v) const
{
return do_put_helper(oit, b, fill, v);
}
iter_type
{
return do_put_helper(oit, b, fill, v);
}
iter_type
- do_put(iter_type oit, std::ios_base & b, char_type fill, long double v) const
+ do_put(iter_type oit, ios_base & b, char_type fill, long double v) const
{
return do_put_helper(oit, b, fill, v);
}
iter_type
{
return do_put_helper(oit, b, fill, v);
}
iter_type
- do_put(iter_type oit, std::ios_base & b, char_type fill, void const * v) const
+ do_put(iter_type oit, ios_base & b, char_type fill, void const * v) const
{
return do_put_helper(oit, b, fill, v);
}
{
return do_put_helper(oit, b, fill, v);
}
private:
template <typename ValueType>
iter_type
private:
template <typename ValueType>
iter_type
- do_put_helper(iter_type oit, std::ios_base & b, char_type fill, ValueType v) const
+ do_put_helper(iter_type oit, ios_base & b, char_type fill, ValueType v) const
{
if (fill >= 0x80)
throw num_put_failure();
{
if (fill >= 0x80)
throw num_put_failure();
- std::streamsize const sz = b.width() > b.precision() ?
+ streamsize const sz = b.width() > b.precision() ?
b.width() : b.precision();
// 64 is large enough, unless width or precision are bigger
b.width() : b.precision();
// 64 is large enough, unless width or precision are bigger
- std::streamsize const wd = (sz > 56 ? sz : 56) + 8;
- std::string s(wd, '\0');
+ streamsize const wd = (sz > 56 ? sz : 56) + 8;
+ string s(wd, '\0');
- std::string::const_iterator cit = s.begin();
- std::string::const_iterator end =
+ string::const_iterator cit = s.begin();
+ string::const_iterator end =
f.put(s.begin(), b, fill, v);
for (; cit != end; ++cit, ++oit)
*oit = *cit;
f.put(s.begin(), b, fill, v);
for (; cit != end; ++cit, ++oit)
*oit = *cit;
/// Facet for inputting ascii representations of numbers from idocstreams.
/// Here we simply need defining the virtual do_get functions.
/// Facet for inputting ascii representations of numbers from idocstreams.
/// Here we simply need defining the virtual do_get functions.
-class ascii_num_get_facet : public std::num_get<lyx::char_type, std::istreambuf_iterator<lyx::char_type, std::char_traits<lyx::char_type> > >
+class ascii_num_get_facet : public num_get<lyx::char_type, istreambuf_iterator<lyx::char_type, char_traits<lyx::char_type> > >
- typedef std::istreambuf_iterator<lyx::char_type, std::char_traits<lyx::char_type> > iter_type;
+ typedef istreambuf_iterator<lyx::char_type, char_traits<lyx::char_type> > iter_type;
- ascii_num_get_facet(size_t refs = 0) : std::num_get<lyx::char_type, iter_type>(refs) {}
+ ascii_num_get_facet(size_t refs = 0) : num_get<lyx::char_type, iter_type>(refs) {}
/// Facet for converting ascii representation of numbers to a value.
/// Facet for converting ascii representation of numbers to a value.
- class string_num_get_facet : public std::num_get<char, std::basic_string<char>::iterator>
+ class string_num_get_facet : public num_get<char, basic_string<char>::iterator>
- string_num_get_facet() : std::num_get<char, std::basic_string<char>::iterator>(1) {}
+ string_num_get_facet() : num_get<char, basic_string<char>::iterator>(1) {}
};
/// Numpunct facet defining the I/O format.
};
/// Numpunct facet defining the I/O format.
- class numpunct_facet : public std::numpunct<char>
+ class numpunct_facet : public numpunct<char>
- numpunct_facet() : std::numpunct<char>(1) {}
+ numpunct_facet() : numpunct<char>(1) {}
- do_get(iter_type iit, iter_type eit, std::ios_base & b,
- std::ios_base::iostate & err, bool & v) const
+ do_get(iter_type iit, iter_type eit, ios_base & b,
+ ios_base::iostate & err, bool & v) const
- if (b.flags() & std::ios_base::boolalpha) {
+ if (b.flags() & ios_base::boolalpha) {
numpunct_facet p;
lyx::docstring const truename = from_local8bit(p.truename());
lyx::docstring const falsename = from_local8bit(p.falsename());
numpunct_facet p;
lyx::docstring const truename = from_local8bit(p.truename());
lyx::docstring const falsename = from_local8bit(p.falsename());
- err = std::ios_base::goodbit;
+ err = ios_base::goodbit;
v = truename == s ? true : false;
} else
v = truename == s ? true : false;
} else
- err = std::ios_base::failbit;
+ err = ios_base::failbit;
- err |= std::ios_base::eofbit;
+ err |= ios_base::eofbit;
return iit;
} else {
long l;
iter_type end = this->do_get(iit, eit, b, err, l);
return iit;
} else {
long l;
iter_type end = this->do_get(iit, eit, b, err, l);
- if (!(err & std::ios_base::failbit)) {
+ if (!(err & ios_base::failbit)) {
if (l == 0)
v = false;
else if (l == 1)
v = true;
else
if (l == 0)
v = false;
else if (l == 1)
v = true;
else
- err |= std::ios_base::failbit;
+ err |= ios_base::failbit;
}
return end;
}
}
iter_type
}
return end;
}
}
iter_type
- do_get(iter_type iit, iter_type eit, std::ios_base & b,
- std::ios_base::iostate & err, long & v) const
+ do_get(iter_type iit, iter_type eit, ios_base & b,
+ ios_base::iostate & err, long & v) const
{
return do_get_integer(iit, eit, b, err, v);
}
iter_type
{
return do_get_integer(iit, eit, b, err, v);
}
iter_type
- do_get(iter_type iit, iter_type eit, std::ios_base & b,
- std::ios_base::iostate & err, unsigned short & v) const
+ do_get(iter_type iit, iter_type eit, ios_base & b,
+ ios_base::iostate & err, unsigned short & v) const
{
return do_get_integer(iit, eit, b, err, v);
}
iter_type
{
return do_get_integer(iit, eit, b, err, v);
}
iter_type
- do_get(iter_type iit, iter_type eit, std::ios_base & b,
- std::ios_base::iostate & err, unsigned int & v) const
+ do_get(iter_type iit, iter_type eit, ios_base & b,
+ ios_base::iostate & err, unsigned int & v) const
{
return do_get_integer(iit, eit, b, err, v);
}
iter_type
{
return do_get_integer(iit, eit, b, err, v);
}
iter_type
- do_get(iter_type iit, iter_type eit, std::ios_base & b,
- std::ios_base::iostate & err, unsigned long & v) const
+ do_get(iter_type iit, iter_type eit, ios_base & b,
+ ios_base::iostate & err, unsigned long & v) const
{
return do_get_integer(iit, eit, b, err, v);
}
#ifdef _GLIBCXX_USE_LONG_LONG
iter_type
{
return do_get_integer(iit, eit, b, err, v);
}
#ifdef _GLIBCXX_USE_LONG_LONG
iter_type
- do_get(iter_type iit, iter_type eit, std::ios_base & b,
- std::ios_base::iostate & err, long long & v) const
+ do_get(iter_type iit, iter_type eit, ios_base & b,
+ ios_base::iostate & err, long long & v) const
{
return do_get_integer(iit, eit, b, err, v);
}
iter_type
{
return do_get_integer(iit, eit, b, err, v);
}
iter_type
- do_get(iter_type iit, iter_type eit, std::ios_base & b,
- std::ios_base::iostate & err, unsigned long long & v) const
+ do_get(iter_type iit, iter_type eit, ios_base & b,
+ ios_base::iostate & err, unsigned long long & v) const
{
return do_get_integer(iit, eit, b, err, v);
}
#endif
iter_type
{
return do_get_integer(iit, eit, b, err, v);
}
#endif
iter_type
- do_get(iter_type iit, iter_type eit, std::ios_base & b,
- std::ios_base::iostate & err, float & v) const
+ do_get(iter_type iit, iter_type eit, ios_base & b,
+ ios_base::iostate & err, float & v) const
{
return do_get_float(iit, eit, b, err, v);
}
iter_type
{
return do_get_float(iit, eit, b, err, v);
}
iter_type
- do_get(iter_type iit, iter_type eit, std::ios_base & b,
- std::ios_base::iostate & err, double & v) const
+ do_get(iter_type iit, iter_type eit, ios_base & b,
+ ios_base::iostate & err, double & v) const
{
return do_get_float(iit, eit, b, err, v);
}
iter_type
{
return do_get_float(iit, eit, b, err, v);
}
iter_type
- do_get(iter_type iit, iter_type eit, std::ios_base & b,
- std::ios_base::iostate & err, long double & v) const
+ do_get(iter_type iit, iter_type eit, ios_base & b,
+ ios_base::iostate & err, long double & v) const
{
return do_get_float(iit, eit, b, err, v);
}
iter_type
{
return do_get_float(iit, eit, b, err, v);
}
iter_type
- do_get(iter_type iit, iter_type eit, std::ios_base & b,
- std::ios_base::iostate & err, void * & v) const
+ do_get(iter_type iit, iter_type eit, ios_base & b,
+ ios_base::iostate & err, void * & v) const
{
unsigned long val;
iter_type end = do_get_integer(iit, eit, b, err, val);
{
unsigned long val;
iter_type end = do_get_integer(iit, eit, b, err, val);
- if (!(err & std::ios_base::failbit))
+ if (!(err & ios_base::failbit))
v = reinterpret_cast<void *>(val);
return end;
}
v = reinterpret_cast<void *>(val);
return end;
}
private:
template <typename ValueType>
iter_type
private:
template <typename ValueType>
iter_type
- do_get_integer(iter_type iit, iter_type eit, std::ios_base & b,
- std::ios_base::iostate & err, ValueType & v) const
+ do_get_integer(iter_type iit, iter_type eit, ios_base & b,
+ ios_base::iostate & err, ValueType & v) const
s.reserve(64);
for (; iit != eit && isNumpunct(*iit); ++iit)
s += static_cast<char>(*iit);
s.reserve(64);
for (; iit != eit && isNumpunct(*iit); ++iit)
s += static_cast<char>(*iit);
string_num_get_facet f;
f.get(s.begin(), s.end(), b, err, v);
if (iit == eit)
string_num_get_facet f;
f.get(s.begin(), s.end(), b, err, v);
if (iit == eit)
- err |= std::ios_base::eofbit;
+ err |= ios_base::eofbit;
template <typename ValueType>
iter_type
template <typename ValueType>
iter_type
- do_get_float(iter_type iit, iter_type eit, std::ios_base & b,
- std::ios_base::iostate & err, ValueType & v) const
+ do_get_float(iter_type iit, iter_type eit, ios_base & b,
+ ios_base::iostate & err, ValueType & v) const
{
// Gather a string of the form
// [+-]? [0-9]* .? [0-9]* ([eE] [+-]? [0-9]+)?
{
// Gather a string of the form
// [+-]? [0-9]* .? [0-9]* ([eE] [+-]? [0-9]+)?
s.reserve(64);
char c;
numpunct_facet p;
s.reserve(64);
char c;
numpunct_facet p;
string_num_get_facet f;
f.get(s.begin(), s.end(), b, err, v);
if (iit == eit)
string_num_get_facet f;
f.get(s.begin(), s.end(), b, err, v);
if (iit == eit)
- err |= std::ios_base::eofbit;
+ err |= ios_base::eofbit;
public:
locale_initializer()
{
public:
locale_initializer()
{
- std::locale global;
- std::locale const loc1(global, new ascii_ctype_facet);
- std::locale const loc2(loc1, new ascii_num_put_facet);
- std::locale const loc3(loc2, new ascii_num_get_facet);
- std::locale::global(loc3);
+ locale global;
+ locale const loc1(global, new ascii_ctype_facet);
+ locale const loc2(loc1, new ascii_num_put_facet);
+ locale const loc3(loc2, new ascii_num_get_facet);
+ locale::global(loc3);
Tokenizer::const_iterator it = tokens.begin();
Tokenizer::const_iterator const end = tokens.end();
Tokenizer::const_iterator it = tokens.begin();
Tokenizer::const_iterator const end = tokens.end();
- std::vector<string> vars;
for (; it != end; ++it)
vars.push_back(os::internal_path(*it));
for (; it != end; ++it)
vars.push_back(os::internal_path(*it));
#if defined (HAVE_SETENV)
return ::setenv(name.c_str(), encoded.c_str(), true);
#elif defined (HAVE_PUTENV)
#if defined (HAVE_SETENV)
return ::setenv(name.c_str(), encoded.c_str(), true);
#elif defined (HAVE_PUTENV)
- static std::map<string, string> varmap;
+ static map<string, string> varmap;
varmap[name] = name + '=' + encoded;
return ::putenv(const_cast<char*>(varmap[name].c_str())) == 0;
#else
varmap[name] = name + '=' + encoded;
return ::putenv(const_cast<char*>(varmap[name].c_str())) == 0;
#else
void setEnvPath(string const & name, vector<string> const & env)
{
char const separator(os::path_separator());
void setEnvPath(string const & name, vector<string> const & env)
{
char const separator(os::path_separator());
vector<string>::const_iterator const begin = env.begin();
vector<string>::const_iterator const end = env.end();
vector<string>::const_iterator it = begin;
vector<string>::const_iterator const begin = env.begin();
vector<string>::const_iterator const end = env.end();
vector<string>::const_iterator it = begin;
token_iterator const end = reversed_tokens.rend();
for (; it != end; ++it) {
vector<string>::iterator remove_it =
token_iterator const end = reversed_tokens.rend();
for (; it != end; ++it) {
vector<string>::iterator remove_it =
- std::remove(env_var.begin(), env_var.end(), *it);
+ remove(env_var.begin(), env_var.end(), *it);
env_var.erase(remove_it, env_var.end());
env_var.insert(env_var.begin(), *it);
}
env_var.erase(remove_it, env_var.end());
env_var.insert(env_var.begin(), *it);
}
static boost::regex bbox_re(
"^%%BoundingBox:\\s*([[:digit:]]+)\\s+([[:digit:]]+)\\s+([[:digit:]]+)\\s+([[:digit:]]+)");
static boost::regex bbox_re(
"^%%BoundingBox:\\s*([[:digit:]]+)\\s+([[:digit:]]+)\\s+([[:digit:]]+)\\s+([[:digit:]]+)");
- std::ifstream is(file_.toFilesystemEncoding().c_str());
+ ifstream is(file_.toFilesystemEncoding().c_str());
while (is) {
string s;
getline(is,s);
while (is) {
string s;
getline(is,s);
# include <string.h> // for memcpy
#endif
# include <string.h> // for memcpy
#endif
#ifdef GZSTREAM_NAMESPACE
namespace GZSTREAM_NAMESPACE {
#endif
#ifdef GZSTREAM_NAMESPACE
namespace GZSTREAM_NAMESPACE {
#endif
return (gzstreambuf*)0;
mode = open_mode;
// no append nor read/write mode
return (gzstreambuf*)0;
mode = open_mode;
// no append nor read/write mode
- if ((mode & std::ios::ate) || (mode & std::ios::app)
- || ((mode & std::ios::in) && (mode & std::ios::out)))
+ if ((mode & ios::ate) || (mode & ios::app)
+ || ((mode & ios::in) && (mode & ios::out)))
return (gzstreambuf*)0;
char fmode[10];
char* fmodeptr = fmode;
return (gzstreambuf*)0;
char fmode[10];
char* fmodeptr = fmode;
- if ( mode & std::ios::in)
- else if ( mode & std::ios::out)
+ else if ( mode & ios::out)
*fmodeptr++ = 'w';
*fmodeptr++ = 'b';
*fmodeptr = '\0';
*fmodeptr++ = 'w';
*fmodeptr++ = 'b';
*fmodeptr = '\0';
if ( gptr() && ( gptr() < egptr()))
return * reinterpret_cast<unsigned char *>( gptr());
if ( gptr() && ( gptr() < egptr()))
return * reinterpret_cast<unsigned char *>( gptr());
- if ( ! (mode & std::ios::in) || ! opened)
+ if ( ! (mode & ios::in) || ! opened)
return EOF;
// Josuttis' implementation of inbuf
int n_putback = gptr() - eback();
return EOF;
// Josuttis' implementation of inbuf
int n_putback = gptr() - eback();
}
int gzstreambuf::overflow( int c) { // used for output buffer only
}
int gzstreambuf::overflow( int c) { // used for output buffer only
- if ( ! ( mode & std::ios::out) || ! opened)
+ if ( ! ( mode & ios::out) || ! opened)
return EOF;
if (c != EOF) {
*pptr() = c;
return EOF;
if (c != EOF) {
*pptr() = c;
int gzstreambuf::sync() {
// Changed to use flush_buffer() instead of overflow( EOF)
int gzstreambuf::sync() {
// Changed to use flush_buffer() instead of overflow( EOF)
- // which caused improper behavior with std::endl and flush(),
+ // which caused improper behavior with endl and flush(),
// bug reported by Vincent Ricard.
if ( pptr() && pptr() > pbase()) {
if ( flush_buffer() == EOF)
// bug reported by Vincent Ricard.
if ( pptr() && pptr() > pbase()) {
if ( flush_buffer() == EOF)
void gzstreambase::open( const char* name, int open_mode) {
if ( ! buf.open( name, open_mode))
void gzstreambase::open( const char* name, int open_mode) {
if ( ! buf.open( name, open_mode))
- clear( rdstate() | std::ios::badbit);
+ clear( rdstate() | ios::badbit);
}
void gzstreambase::close() {
if ( buf.is_open())
if ( ! buf.close())
}
void gzstreambase::close() {
if ( buf.is_open())
if ( ! buf.close())
- clear( rdstate() | std::ios::badbit);
+ clear( rdstate() | ios::badbit);
}
#ifdef GZSTREAM_NAMESPACE
}
#ifdef GZSTREAM_NAMESPACE
-// Using this allows us to have std::string default arguments in headers
+// Using this allows us to have string default arguments in headers
// without #include <string>
// without #include <string>
-std::string const & empty_string()
+string const & empty_string()
-// since we cannot use std::tolower and std::toupper directly in the
-// calls to std::transform yet, we use these helper clases. (Lgb)
+// since we cannot use tolower and toupper directly in the
+// calls to transform yet, we use these helper clases. (Lgb)
struct local_lowercase {
char_type operator()(char_type c) const {
struct local_lowercase {
char_type operator()(char_type c) const {
/// Substitute all \a oldchar with \a newchar
template<typename Ch> inline
/// Substitute all \a oldchar with \a newchar
template<typename Ch> inline
-std::basic_string<Ch> const subst_char(std::basic_string<Ch> const & a,
+basic_string<Ch> const subst_char(basic_string<Ch> const & a,
Ch oldchar, Ch newchar)
{
Ch oldchar, Ch newchar)
{
- typedef std::basic_string<Ch> String;
+ typedef basic_string<Ch> String;
String tmp(a);
typename String::iterator lit = tmp.begin();
typename String::iterator end = tmp.end();
String tmp(a);
typename String::iterator lit = tmp.begin();
typename String::iterator end = tmp.end();
unsigned long do_crc(InputIterator first, InputIterator last)
{
boost::crc_32_type crc;
unsigned long do_crc(InputIterator first, InputIterator last)
{
boost::crc_32_type crc;
- crc = std::for_each(first, last, crc);
+ crc = for_each(first, last, crc);
namespace support {
namespace os {
namespace support {
namespace os {
-std::string const python()
{
// Use the -tt switch so that mixed tab/whitespace indentation is
// an error
{
// Use the -tt switch so that mixed tab/whitespace indentation is
// an error
- static std::string const command("python -tt");
+ static string const command("python -tt");
// GetLongPathName needs the path in file system encoding.
// We can use to_local8bit, since file system encoding and the
// local 8 bit encoding are identical on windows.
// GetLongPathName needs the path in file system encoding.
// We can use to_local8bit, since file system encoding and the
// local 8 bit encoding are identical on windows.
- std::vector<char> long_path(MAX_PATH);
+ vector<char> long_path(MAX_PATH);
DWORD result = GetLongPathName(to_local8bit(from_utf8(short_path)).c_str(),
&long_path[0], long_path.size());
DWORD result = GetLongPathName(to_local8bit(from_utf8(short_path)).c_str(),
&long_path[0], long_path.size());
-void throw_exception(std::exception const & /*e*/)
+void throw_exception(exception const & /*e*/)
struct IconvProcessor::Impl
{
struct IconvProcessor::Impl
{
- Impl(std::string const & to, std::string const & from)
+ Impl(string const & to, string const & from)
: cd(invalid_cd), tocode_(to), fromcode_(from)
{}
: cd(invalid_cd), tocode_(to), fromcode_(from)
{}
- std::string tocode_;
- std::string fromcode_;
+ string tocode_;
+ string fromcode_;
int res = iconv(pimpl_->cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
int res = iconv(pimpl_->cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
//lyxerr << "Inbytesleft: " << inbytesleft << endl;
//lyxerr << "Outbytesleft: " << outbytesleft << endl;
//lyxerr << "Inbytesleft: " << inbytesleft << endl;
//lyxerr << "Outbytesleft: " << outbytesleft << endl;
<< " has been encountered in the input.\n"
<< "When converting from " << pimpl_->fromcode_
<< " to " << pimpl_->tocode_ << ".\n";
<< " has been encountered in the input.\n"
<< "When converting from " << pimpl_->fromcode_
<< " to " << pimpl_->tocode_ << ".\n";
- lyxerr << "Input:" << std::hex;
+ lyxerr << "Input:" << hex;
for (size_t i = 0; i < buflen; ++i) {
// char may be signed, avoid output of
// something like 0xffffffc2
for (size_t i = 0; i < buflen; ++i) {
// char may be signed, avoid output of
// something like 0xffffffc2
*reinterpret_cast<unsigned char const *>(buf + i);
lyxerr << " 0x" << (unsigned int)b;
}
*reinterpret_cast<unsigned char const *>(buf + i);
lyxerr << " 0x" << (unsigned int)b;
}
- lyxerr << std::dec << endl;
break;
case EINVAL:
lyxerr << "EINVAL An incomplete multibyte sequence"
<< " has been encountered in the input.\n"
<< "When converting from " << pimpl_->fromcode_
<< " to " << pimpl_->tocode_ << ".\n";
break;
case EINVAL:
lyxerr << "EINVAL An incomplete multibyte sequence"
<< " has been encountered in the input.\n"
<< "When converting from " << pimpl_->fromcode_
<< " to " << pimpl_->tocode_ << ".\n";
- lyxerr << "Input:" << std::hex;
+ lyxerr << "Input:" << hex;
for (size_t i = 0; i < buflen; ++i) {
// char may be signed, avoid output of
// something like 0xffffffc2
for (size_t i = 0; i < buflen; ++i) {
// char may be signed, avoid output of
// something like 0xffffffc2
*reinterpret_cast<unsigned char const *>(buf + i);
lyxerr << " 0x" << (unsigned int)b;
}
*reinterpret_cast<unsigned char const *>(buf + i);
lyxerr << " 0x" << (unsigned int)b;
}
- lyxerr << std::dec << endl;
break;
default:
lyxerr << "\tSome other error: " << errno << endl;
break;
default:
lyxerr << "\tSome other error: " << errno << endl;
Context::~Context()
{
if (!extra_stuff.empty())
Context::~Context()
{
if (!extra_stuff.empty())
- std::cerr << "Bug: Ignoring extra stuff '" << extra_stuff
- << '\'' << std::endl;
+ cerr << "Bug: Ignoring extra stuff '" << extra_stuff
+ << '\'' << endl;
-void Context::add_extra_stuff(std::string const & stuff)
+void Context::add_extra_stuff(string const & stuff)
{
if (!lyx::support::contains(extra_stuff, stuff))
extra_stuff += stuff;
{
if (!lyx::support::contains(extra_stuff, stuff))
extra_stuff += stuff;
// This is needed if a partial file ends with a command without arguments,
// e. g. \medskip
if (! good())
// This is needed if a partial file ends with a command without arguments,
// e. g. \medskip
if (! good())
- return std::make_pair(false, string());
+ return make_pair(false, string());
string result;
char c = getChar();
if (c != left) {
putback();
string result;
char c = getChar();
if (c != left) {
putback();
- return std::make_pair(false, string());
+ return make_pair(false, string());
} else
while ((c = getChar()) != right && good()) {
// Ignore comments
} else
while ((c = getChar()) != right && good()) {
// Ignore comments
result += curr_token().asInput();
}
result += curr_token().asInput();
}
- return std::make_pair(true, result);
+ return make_pair(true, result);
-void throw_exception(std::exception const & e)
+void throw_exception(exception const & e)
{
lyx::lyxerr << "Exception caught:\n"
<< e.what() << endl;
{
lyx::lyxerr << "Exception caught:\n"
<< e.what() << endl;
#include "support/gettext.h"
#include "../support/docstring.h"
#include "support/gettext.h"
#include "../support/docstring.h"
-docstring const _(std::string const & str)
+docstring const _(string const & str)
{
return from_ascii(str);
}
{
return from_ascii(str);
}
namespace lyx {
// special columntypes
namespace lyx {
// special columntypes
-extern std::map<char, int> special_columns;
+extern map<char, int> special_columns;
-std::map<string, vector<string> > used_packages;
+map<string, vector<string> > used_packages;
// needed to handle encodings with babel
bool one_language = true;
// needed to handle encodings with babel
bool one_language = true;
cmdmap["-userdir"] = parse_userdir;
for (int i = 1; i < argc; ++i) {
cmdmap["-userdir"] = parse_userdir;
for (int i = 1; i < argc; ++i) {
- std::map<string, cmd_helper>::const_iterator it
+ map<string, cmd_helper>::const_iterator it
= cmdmap.find(argv[i]);
// don't complain if not found - may be parsed later
= cmdmap.find(argv[i]);
// don't complain if not found - may be parsed later
* You must ensure that \p parentFilePath is properly set before calling
* this function!
*/
* You must ensure that \p parentFilePath is properly set before calling
* this function!
*/
-void tex2lyx(std::istream & is, std::ostream & os)
+void tex2lyx(istream & is, ostream & os)
{
Parser p(is);
//p.dump();
{
Parser p(is);
//p.dump();
/// convert TeX from \p infilename to LyX and write it to \p os
/// convert TeX from \p infilename to LyX and write it to \p os
-bool tex2lyx(FileName const & infilename, std::ostream & os)
+bool tex2lyx(FileName const & infilename, ostream & os)
{
ifstream is(infilename.toFilesystemEncoding().c_str());
if (!is.good()) {
{
ifstream is(infilename.toFilesystemEncoding().c_str());
if (!is.good()) {
- lyxerr.setStream(std::cerr);
+ lyxerr.setStream(cerr);
-class isLayout : public std::unary_function<LayoutPtr, bool> {
+class isLayout : public unary_function<LayoutPtr, bool> {
public:
isLayout(string const name) : name_(name) {}
bool operator()(LayoutPtr const & ptr) const {
public:
isLayout(string const name) : name_(name) {}
bool operator()(LayoutPtr const & ptr) const {
TextClass::const_iterator end = textclass.end();
TextClass::const_iterator
TextClass::const_iterator end = textclass.end();
TextClass::const_iterator
- it = std::find_if(beg, end, isLayout(name));
+ it = find_if(beg, end, isLayout(name));
return (it == end) ? LayoutPtr() : *it;
}
return (it == end) ? LayoutPtr() : *it;
}
if (!after.empty()) {
before = p.getFullOpt();
if (natbibOrder && !before.empty())
if (!after.empty()) {
before = p.getFullOpt();
if (natbibOrder && !before.empty())
- std::swap(before, after);
string const command = '\\' + t.cs();
char argumentOrder = '\0';
vector<string> const & options = used_packages["jurabib"];
string const command = '\\' + t.cs();
char argumentOrder = '\0';
vector<string> const & options = used_packages["jurabib"];
- if (std::find(options.begin(), options.end(),
+ if (find(options.begin(), options.end(),
"natbiborder") != options.end())
argumentOrder = 'n';
"natbiborder") != options.end())
argumentOrder = 'n';
- else if (std::find(options.begin(), options.end(),
+ else if (find(options.begin(), options.end(),
"jurabiborder") != options.end())
argumentOrder = 'j';
"jurabiborder") != options.end())
argumentOrder = 'j';