getting rid of superfluous std:: statements.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22104 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-12-12 19:28:07 +00:00
parent b89cc942eb
commit 9abb7db468
185 changed files with 803 additions and 768 deletions

View File

@ -30,14 +30,14 @@ bool operator==(Author const & l, Author const & r)
}
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;
}
std::istream & operator>>(std::istream & is, Author & a)
istream & operator>>(istream & is, Author & a)
{
string s;
getline(is, s);

View File

@ -202,8 +202,8 @@ docstring const BibTeXInfo::getInfo() const
//////////////////////////////////////////////////////////////////////
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 {
@ -219,7 +219,7 @@ vector<docstring> const BiblioInfo::getKeys() const
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());
return bibkeys;
}
@ -231,7 +231,7 @@ vector<docstring> const BiblioInfo::getFields() const
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());
return bibfields;
}
@ -243,7 +243,7 @@ vector<docstring> const BiblioInfo::getEntries() const
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());
return bibentries;
}
@ -482,7 +482,7 @@ CitationStyle::CitationStyle(string const & command)
}
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;
@ -496,13 +496,13 @@ string const CitationStyle::asLatexStr() const
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;
if (std::find(citeStylesUCase, last, style) != last)
if (find(citeStylesUCase, last, style) != last)
cite[0] = 'C';
}

View File

@ -41,7 +41,7 @@ ostream & operator<<(ostream & os, Box const & b)
{
return os << "x1,y1: " << b.x1 << ',' << b.y1
<< " x2,y2: " << b.x2 << ',' << b.y2
<< std::endl;
<< endl;
}

View File

@ -82,7 +82,7 @@ void Branch::setColor(string const & str)
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;
}
@ -90,7 +90,7 @@ Branch * BranchList::find(docstring const & name)
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;
}
@ -108,7 +108,7 @@ bool BranchList::add(docstring const & s)
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;

View File

@ -121,7 +121,7 @@ int const LYX_FORMAT = 307; // JSpitzm: support for \slash
} // namespace anon
typedef std::map<string, bool> DepClean;
typedef map<string, bool> DepClean;
class Buffer::Impl
{
@ -173,8 +173,8 @@ public:
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.
@ -606,14 +606,14 @@ void Buffer::insertStringAsLines(ParagraphList & pars,
}
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);
std::istringstream is(s);
istringstream is(s);
lex.setStream(is);
FileName const name(tempName());
switch (readFile(lex, name, true)) {
@ -621,7 +621,7 @@ bool Buffer::readString(std::string const & s)
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);
@ -905,7 +905,7 @@ bool Buffer::write(ostream & ofs) const
{
#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().
@ -995,7 +995,7 @@ bool Buffer::makeLaTeXFile(FileName const & fname,
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;
}
@ -1760,7 +1760,7 @@ void Buffer::updateMacros()
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();
@ -1813,7 +1813,7 @@ void Buffer::changeRefsIfUnique(docstring const & from, docstring const & to,
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) {
@ -1876,7 +1876,7 @@ void Buffer::getSourceCode(odocstream & os, pit_type par_begin,
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;
@ -1891,7 +1891,7 @@ void Buffer::structureChanged() const
}
void Buffer::errors(std::string const & err) const
void Buffer::errors(string const & err) const
{
if (gui_)
gui_->errors(err);

View File

@ -310,11 +310,11 @@ void BufferList::setCurrentAuthor(docstring const & name, docstring const & emai
}
int BufferList::bufferNum(std::string const & name) const
int BufferList::bufferNum(string const & name) const
{
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());

View File

@ -137,7 +137,7 @@ QuotesLangTranslator const & quoteslangtranslator()
// Paper size
typedef Translator<std::string, PAPER_SIZE> PaperSizeTranslator;
typedef Translator<string, PAPER_SIZE> PaperSizeTranslator;
PaperSizeTranslator const init_papersizetranslator()
@ -1348,7 +1348,7 @@ void BufferParams::makeTextClass()
}
std::vector<string> const & BufferParams::getModules() const {
vector<string> const & BufferParams::getModules() const {
return layoutModules_;
}
@ -1370,11 +1370,11 @@ bool BufferParams::addLayoutModule(string modName, bool makeClass) {
}
bool BufferParams::addLayoutModules(std::vector<string>modNames)
bool BufferParams::addLayoutModules(vector<string>modNames)
{
bool retval = true;
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();
@ -1590,7 +1590,7 @@ void BufferParams::writeEncodingPreamble(odocstream & os,
// 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
@ -1602,8 +1602,8 @@ void BufferParams::writeEncodingPreamble(odocstream & os,
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;

View File

@ -187,7 +187,7 @@ void gotoInset(BufferView * bv, InsetCode code, bool same_content)
/// 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,
@ -1363,7 +1363,7 @@ void BufferView::scrollDown(int offset)
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_)
@ -1387,7 +1387,7 @@ void BufferView::scrollUp(int offset)
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)
@ -1425,7 +1425,7 @@ void BufferView::gotoLabel(docstring const & label)
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;
@ -1532,7 +1532,7 @@ bool BufferView::mouseSetCursor(Cursor & cur, bool select)
// 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;
@ -1540,7 +1540,7 @@ bool BufferView::mouseSetCursor(Cursor & cur, bool select)
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());
@ -1797,7 +1797,7 @@ Point BufferView::coordOffset(DocIterator const & dit, bool boundary) const
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());
@ -1879,7 +1879,7 @@ void BufferView::draw(frontend::Painter & pain)
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);
@ -1897,22 +1897,22 @@ void BufferView::message(docstring const & msg)
}
void BufferView::showDialog(std::string const & name)
void BufferView::showDialog(string const & name)
{
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);
}
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);

View File

@ -24,6 +24,8 @@
#include <ostream>
using namespace std;
namespace lyx {
/*
@ -270,7 +272,7 @@ void Changes::merge()
<< (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
@ -318,7 +320,7 @@ int Changes::latexMarkChange(odocstream & os, BufferParams const & bparams,
}
void Changes::lyxMarkChange(std::ostream & os, int & column,
void Changes::lyxMarkChange(ostream & os, int & column,
Change const & old, Change const & change)
{
if (old == change)

View File

@ -49,7 +49,7 @@ static int hexstrToInt(string const & str)
{
int val = 0;
istringstream is(str);
is >> std::setbase(16) >> val;
is >> setbase(16) >> val;
return val;
}
@ -65,7 +65,7 @@ string const X11hexname(RGBColor const & col)
{
ostringstream ostr;
ostr << '#' << std::setbase(16) << std::setfill('0')
ostr << '#' << setbase(16) << setfill('0')
<< setw(2) << col.r
<< setw(2) << col.g
<< setw(2) << col.b;
@ -220,7 +220,7 @@ bool ColorSet::setColor(ColorCode col, string const & x11name)
InfoTab::iterator it = infotab.find(col);
if (it == infotab.end()) {
lyxerr << "Color " << col << " not found in database."
<< std::endl;
<< endl;
return false;
}

View File

@ -626,8 +626,8 @@ void Converters::buildGraph()
}
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());

View File

@ -45,7 +45,7 @@ namespace {
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);
return crc.checksum();
}
@ -60,8 +60,8 @@ public:
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
@ -80,7 +80,7 @@ public:
/** 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
@ -88,7 +88,7 @@ public:
/// 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 {
@ -107,7 +107,7 @@ void ConverterCache::Impl::readIndex()
{
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()) {
@ -167,7 +167,7 @@ void ConverterCache::Impl::readIndex()
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;
@ -242,7 +242,7 @@ void ConverterCache::init()
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();

View File

@ -79,7 +79,7 @@ bool positionable(DocIterator const & cursor, DocIterator const & anchor)
// 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();
DocIterator result;
@ -91,9 +91,9 @@ DocIterator bruteFind2(Cursor const & c, int x, int y)
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();
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
@ -150,7 +150,7 @@ bool bruteFind(Cursor & cursor,
else
++et.pit();
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)) {
@ -207,7 +207,7 @@ bool bruteFind3(Cursor & cur, int x, int y, bool up)
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()) {
@ -590,7 +590,7 @@ bool Cursor::selHandle(bool sel)
}
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) {
@ -1269,18 +1269,18 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded)
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());
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())) {
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();
top().pos() = std::min(tm.x2pos(pit(), 0, xo), top().lastpos());
top().pos() = min(tm.x2pos(pit(), 0, xo), top().lastpos());
}
}

View File

@ -29,6 +29,7 @@
#include <ostream>
using namespace std;
namespace lyx {
@ -205,7 +206,7 @@ bool operator<=(CursorSlice const & p, CursorSlice const & q)
}
std::ostream & operator<<(std::ostream & os, CursorSlice const & item)
ostream & operator<<(ostream & os, CursorSlice const & item)
{
return os
<< "inset: " << (void *)&item.inset()

View File

@ -65,7 +65,7 @@ namespace lyx {
namespace {
typedef std::pair<pit_type, int> PitPosPair;
typedef pair<pit_type, int> PitPosPair;
typedef limited_stack<pair<ParagraphList, TextClassPtr> > CutStack;
@ -87,11 +87,11 @@ void region(CursorSlice const & i1, CursorSlice const & i2,
c1 = p.col(i1.idx());
c2 = p.col(i2.idx());
if (c1 > c2)
std::swap(c1, c2);
swap(c1, c2);
r1 = p.row(i1.idx());
r2 = p.row(i2.idx());
if (r1 > r2)
std::swap(r1, r2);
swap(r1, r2);
}
@ -331,7 +331,7 @@ void putClipboard(ParagraphList const & paragraphs, TextClassPtr textclass,
buffer.setUnnamed(true);
buffer.paragraphs() = paragraphs;
buffer.params().setTextClass(textclass);
std::ostringstream lyx;
ostringstream lyx;
if (buffer.write(lyx))
theClipboard().put(lyx.str(), plaintext);
else
@ -462,7 +462,7 @@ void switchBetweenClasses(TextClassPtr const & c1,
}
std::vector<docstring> const availableSelections(Buffer const & buffer)
vector<docstring> const availableSelections(Buffer const & buffer)
{
vector<docstring> selList;
@ -877,7 +877,7 @@ docstring grabSelection(Cursor const & cur)
// FIXME: What is wrong with the following?
#if 0
std::ostringstream os;
ostringstream os;
for (DocIterator dit = cur.selectionBegin();
dit != cur.selectionEnd(); dit.forwardPos())
os << asString(dit.cell());

View File

@ -28,6 +28,7 @@
#include <ostream>
using namespace std;
namespace lyx {
@ -496,9 +497,9 @@ DocIterator::idx_type DocIterator::find(InsetMath const * inset) const
}
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);
}
@ -509,7 +510,7 @@ void DocIterator::cutOff(DocIterator::idx_type above)
}
void DocIterator::append(std::vector<CursorSlice> const & x)
void DocIterator::append(vector<CursorSlice> const & x)
{
slices_.insert(slices_.end(), x.begin(), x.end());
}
@ -523,7 +524,7 @@ void DocIterator::append(DocIterator::idx_type idx, pos_type pos)
}
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";
@ -533,7 +534,7 @@ std::ostream & operator<<(std::ostream & os, DocIterator const & dit)
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];
@ -592,7 +593,7 @@ DocIterator StableDocIterator::asDocIterator(Inset * inset) const
}
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";

View File

@ -293,7 +293,7 @@ bool EmbeddedFiles::writeFile(DocFileName const & filename)
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();

View File

@ -237,7 +237,7 @@ struct CharInfo {
};
typedef std::map<char_type, CharInfo> CharInfoMap;
typedef map<char_type, CharInfo> CharInfoMap;
CharInfoMap unicodesymbols;
@ -275,7 +275,7 @@ void Encoding::init() const
// 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);
@ -289,7 +289,7 @@ void Encoding::init() const
// 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)
@ -322,7 +322,7 @@ docstring const Encoding::latexChar(char_type c) const
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
<< hex << c << dec
<< ".\nLaTeX export will fail."
<< endl;
else
@ -428,7 +428,7 @@ Encoding const * Encodings::getFromLyXName(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
@ -458,11 +458,11 @@ void Encodings::read(FileName const & encfile, FileName const & symbolsfile)
string flags;
if (symbolslex.next(true)) {
std::istringstream is(symbolslex.getString());
istringstream is(symbolslex.getString());
// reading symbol directly does not work if
// char_type == std::wchar_t.
// char_type == wchar_t.
boost::uint32_t tmp;
if(!(is >> std::hex >> tmp))
if(!(is >> hex >> tmp))
break;
symbol = tmp;
} else
@ -493,7 +493,7 @@ void Encodings::read(FileName const & encfile, FileName const & symbolsfile)
else
lyxerr << "Ignoring unknown flag `" << flag
<< "' for symbol `0x"
<< std::hex << symbol << std::dec
<< hex << symbol << dec
<< "'." << endl;
}

View File

@ -639,7 +639,7 @@ int Font::latexWriteEndChanges(odocstream & os, BufferParams const & bparams,
}
std::string Font::toString(bool const toggle) const
string Font::toString(bool const toggle) const
{
string lang = "ignore";
if (language())
@ -780,7 +780,7 @@ ostream & operator<<(ostream & os, FontState fms)
}
ostream & operator<<(std::ostream & os, FontInfo const & f)
ostream & operator<<(ostream & os, FontInfo const & f)
{
return os << "font:"
<< " family " << f.family()
@ -797,7 +797,7 @@ ostream & operator<<(std::ostream & os, FontInfo const & f)
}
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);

View File

@ -40,7 +40,7 @@ string const token_path_format("$$p");
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) {}
@ -53,7 +53,7 @@ private:
};
class FormatExtensionsEqual : public std::unary_function<Format, bool> {
class FormatExtensionsEqual : public unary_function<Format, bool> {
public:
FormatExtensionsEqual(string const & extension)
: extension_(extension) {}

View File

@ -104,7 +104,7 @@ bool operator==(FuncRequest const & lhs, FuncRequest const & rhs)
}
std::ostream & operator<<(std::ostream & os, FuncRequest const & cmd)
ostream & operator<<(ostream & os, FuncRequest const & cmd)
{
return os
<< " action: " << cmd.action

View File

@ -25,7 +25,7 @@ int Graph::bfs_init(int s, bool clear_visited)
if (s < 0)
return s;
Q_ = std::queue<int>();
Q_ = queue<int>();
if (clear_visited)
fill(visited_.begin(), visited_.end(), false);

View File

@ -184,7 +184,7 @@ int LaunchIspell::generateChild()
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());
}
@ -196,7 +196,7 @@ string const to_iconv_encoding(docstring const & s, string const & 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());
}

View File

@ -51,13 +51,13 @@ public:
///
Pimpl(keyword_item * tab, int num);
///
std::string const getString() const;
string const getString() 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);
///
@ -65,7 +65,7 @@ public:
///
bool setFile(support::FileName const & filename);
///
void setStream(std::istream & i);
void setStream(istream & i);
///
void setCommentChar(char c);
///
@ -81,29 +81,29 @@ public:
/// 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.
std::filebuf fb_;
filebuf fb_;
/// gz_ is only used to open files, the stream is accessed through is.
gz::gzstreambuf gz_;
/// the stream that we use.
std::istream is;
istream is;
///
std::string name;
string name;
///
keyword_item * table;
///
int no_items;
///
std::string buff;
string buff;
///
int status;
///
int lineno;
///
std::string pushTok;
string pushTok;
///
char commentChar;
private:
@ -124,7 +124,7 @@ private:
int table_siz;
};
///
std::stack<pushed_table> pushed;
stack<pushed_table> pushed;
};
@ -132,7 +132,7 @@ private:
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
@ -840,7 +840,7 @@ void Lexer::pushToken(string const & pt)
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.
@ -854,7 +854,7 @@ bool Lexer::operator!() const
}
Lexer & Lexer::operator>>(std::string & s)
Lexer & Lexer::operator>>(string & s)
{
if (isOK()) {
next();
@ -929,7 +929,7 @@ Lexer & Lexer::operator>>(bool & 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)
{
std::ostringstream os;
ostringstream os;
os << '"' << subst(subst(arg, "\\", "\\\\"), "\"", "\\\"") << '"';
return os.str();
}

View File

@ -93,7 +93,7 @@ namespace {
string cl_system_support;
string cl_user_support;
std::string geometryArg;
string geometryArg;
LyX * singleton_ = 0;
@ -166,7 +166,7 @@ struct LyX::Impl
/// has this user started lyx for the first time?
bool first_start;
/// the parsed command line batch command if any
std::string batch_command;
string batch_command;
};
///
@ -317,15 +317,15 @@ KeyMap const & LyX::topLevelKeymap() const
}
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;
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;
@ -338,7 +338,7 @@ Messages & LyX::getGuiMessages()
}
void LyX::setGuiLanguage(std::string const & language)
void LyX::setGuiLanguage(string const & language)
{
pimpl_->messages_["GUI"] = Messages(language);
}
@ -522,7 +522,7 @@ int LyX::init(int & argc, char * argv[])
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);
@ -740,7 +740,7 @@ void LyX::printError(ErrorItem const & ei)
{
docstring tmp = _("LyX: ") + ei.error + char_type(':')
+ ei.description;
std::cerr << to_utf8(tmp) << std::endl;
cerr << to_utf8(tmp) << endl;
}
@ -1037,10 +1037,10 @@ bool LyX::readUIFile(string const & name, bool include)
};
// 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?");
@ -1295,7 +1295,7 @@ int parse_geometry(string const & arg1, string const &)
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;
@ -1313,7 +1313,7 @@ void LyX::easyParse(int & argc, char * argv[])
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
@ -1405,13 +1405,13 @@ Movers & theMovers()
}
Mover const & getMover(std::string const & fmt)
Mover const & getMover(string const & 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);
}
@ -1423,7 +1423,7 @@ Movers & theSystemMovers()
}
Messages & getMessages(std::string const & language)
Messages & getMessages(string const & language)
{
return LyX::ref().getMessages(language);
}

View File

@ -622,7 +622,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
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);
@ -765,13 +765,13 @@ void showPrintError(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."
<< std::endl;
<< endl;
return;
}
@ -945,7 +945,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
if (!format) {
lyxerr << "Format \"" << format_name
<< "\" not recognized!"
<< std::endl;
<< endl;
break;
}
@ -1331,7 +1331,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
}
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)
@ -1672,7 +1672,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
loadTextClass(argument);
std::pair<bool, textclass_type> const tc_pair =
pair<bool, textclass_type> const tc_pair =
textclasslist.numberOfClass(argument);
if (!tc_pair.first)

View File

@ -304,7 +304,7 @@ int LyXRC::read(FileName const & filename)
}
int LyXRC::read(std::istream & is)
int LyXRC::read(istream & is)
{
Lexer lexrc(lyxrcTags, lyxrcCount);
if (lyxerr.debugging(Debug::PARSER))
@ -1193,7 +1193,7 @@ void LyXRC::print() const
class SameMover {
public:
typedef std::pair<std::string, SpecialisedMover> Data;
typedef pair<string, SpecialisedMover> Data;
SameMover(Data const & comparison)
: comparison_(comparison) {}
@ -2215,7 +2215,7 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
<< cit->shortcut() << "\" \""
<< cit->viewer() << "\" \""
<< cit->editor() << "\" \"";
std::vector<string> flags;
vector<string> flags;
if (cit->documentFormat())
flags.push_back("document");
if (cit->vectorFormat())
@ -2281,10 +2281,10 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
for (; it != end; ++it) {
Movers::const_iterator const sysit =
std::find_if(sysbegin, sysend, SameMover(*it));
find_if(sysbegin, sysend, SameMover(*it));
if (sysit == sysend) {
std::string const & fmt = it->first;
std::string const & command =
string const & fmt = it->first;
string const & command =
it->second.command();
os << "\\copier " << fmt

View File

@ -56,7 +56,7 @@ namespace lyx {
namespace {
class MenuNamesEqual : public std::unary_function<Menu, bool> {
class MenuNamesEqual : public unary_function<Menu, bool> {
public:
MenuNamesEqual(docstring const & name)
: name_(name) {}
@ -375,7 +375,7 @@ MenuItem const & Menu::operator[](size_type i) const
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();
}
@ -630,7 +630,7 @@ void expandFloatInsert(Menu & tomenu, Buffer const * buf)
}
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,
@ -664,7 +664,7 @@ void expandToc2(Menu & tomenu,
// 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;

View File

@ -114,7 +114,7 @@ bool ModuleList::load()
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 true;
}

View File

@ -61,7 +61,7 @@ bool SpecialisedMover::do_copy(support::FileName const & from, support::FileName
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();

View File

@ -165,7 +165,7 @@ public:
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_;
@ -1164,7 +1164,7 @@ void Paragraph::write(Buffer const & buf, ostream & os,
// 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
@ -1212,7 +1212,7 @@ void Paragraph::appendString(docstring const & s, Font const & font,
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);
@ -1304,11 +1304,11 @@ FontSpan Paragraph::fontSpan(pos_type pos) const
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,
std::min(beginOfBody() - 1,
min(beginOfBody() - 1,
cit->pos()));
}
start = cit->pos() + 1;
@ -1960,7 +1960,7 @@ bool Paragraph::latex(Buffer const & buf,
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) {

View File

@ -169,9 +169,9 @@ void ParagraphParameters::leftIndent(Length const & li)
}
void ParagraphParameters::read(std::string str, bool merge)
void ParagraphParameters::read(string str, bool merge)
{
std::istringstream is(str);
istringstream is(str);
Lexer lex(0, 0);
lex.setStream(is);
read(lex, merge);

View File

@ -72,7 +72,7 @@ namespace lyx {
#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()
@ -107,7 +107,7 @@ void LyXComm::send(string const & msg)
#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;
@ -344,7 +344,7 @@ void ServerCallback(Server * server, string const & msg)
server->callback(msg);
}
Server::Server(LyXFunc * f, std::string const & pipes)
Server::Server(LyXFunc * f, string const & pipes)
: numclients_(0), func_(f), pipes_(pipes, this, &ServerCallback)
{}

View File

@ -190,8 +190,8 @@ void ServerSocket::writeln(string const & line)
// 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';
// }

View File

@ -329,7 +329,7 @@ void ToolbarSection::read(istream & is)
}
} while (is.good());
// sort the toolbars by location, line and position
std::sort(toolbars.begin(), toolbars.end());
sort(toolbars.begin(), toolbars.end());
}

View File

@ -78,7 +78,7 @@ int TexStreamBuffer::sync()
////////////////////////////////////////////////////////////////
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))
{}
@ -104,13 +104,13 @@ int TexStream::line() const
int main(int argc, char *argv[])
{
TexStream out(std::cout.rdbuf());
TexStream out(cout.rdbuf());
char c;
while (std::cin) {
if (std::cin.get(c))
while (cin) {
if (cin.get(c))
out.put(c);
}
std::cout << "line count: " << out.line() << std::endl;
cout << "line count: " << out.line() << endl;
return 0;
}

View File

@ -245,7 +245,7 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex,
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;
@ -258,7 +258,7 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex,
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;
@ -1064,8 +1064,8 @@ bool Text::dissolveInset(Cursor & cur) {
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();
@ -1112,7 +1112,7 @@ void Text::getWord(CursorSlice & from, CursorSlice & to,
}
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();
@ -1245,7 +1245,7 @@ docstring Text::currentState(Cursor & cur)
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();

View File

@ -298,8 +298,8 @@ static void outline(OutlineOp mode, Cursor & cur)
// 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);
@ -331,8 +331,8 @@ static void outline(OutlineOp mode, Cursor & cur)
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);
@ -413,7 +413,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
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();
@ -424,7 +424,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
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;
@ -945,7 +945,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
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;
@ -1155,7 +1155,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
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);

View File

@ -42,7 +42,7 @@ namespace lyx {
namespace {
class LayoutNamesEqual : public std::unary_function<LayoutPtr, bool> {
class LayoutNamesEqual : public unary_function<LayoutPtr, bool> {
public:
LayoutNamesEqual(docstring const & name)
: name_(name)
@ -68,7 +68,7 @@ bool layout2layout(FileName const & filename, FileName const & tempfile)
return false;
}
std::ostringstream command;
ostringstream command;
command << support::os::python() << ' ' << quoteName(script.toFilesystemEncoding())
<< ' ' << quoteName(filename.toFilesystemEncoding())
<< ' ' << quoteName(tempfile.toFilesystemEncoding());
@ -466,9 +466,9 @@ bool TextClass::read(FileName const & filename, ReadType rt)
if (min_toclevel_ == Layout::NOT_IN_TOC)
min_toclevel_ = toclevel;
else
min_toclevel_ = std::min(min_toclevel_,
min_toclevel_ = min(min_toclevel_,
toclevel);
max_toclevel_ = std::max(max_toclevel_,
max_toclevel_ = max(max_toclevel_,
toclevel);
}
}

View File

@ -63,7 +63,7 @@ TextClassList::operator[](textclass_type textclass) const
// 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,
@ -173,8 +173,8 @@ void TextClassList::reset(textclass_type const textclass) {
}
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

View File

@ -473,7 +473,7 @@ bool TextMetrics::redoParagraph(pit_type const pit)
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());
@ -755,7 +755,7 @@ pit_type TextMetrics::rowBreakPoint(int width, pit_type const pit,
if (par.isLineSeparator(i - 1))
add -= singleWidth(pit, i - 1);
add = std::max(add, label_end - x);
add = max(add, label_end - x);
thiswidth += add;
}
@ -1537,7 +1537,7 @@ int TextMetrics::cursorX(CursorSlice const & sl,
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;
@ -1932,7 +1932,7 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type pit, int x, int y) co
// 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

View File

@ -83,7 +83,7 @@ FuncRequest TocItem::action() const
//
///////////////////////////////////////////////////////////////////////////
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);
@ -189,7 +189,7 @@ void TocBackend::update()
}
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);

View File

@ -114,7 +114,7 @@ static docstring const doAccent(docstring const & s, tex_accent 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());

View File

@ -146,7 +146,7 @@ bool Undo::hasRedoStack() const
namespace {
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
@ -172,7 +172,7 @@ void Undo::Private::doRecordUndo(UndoKind kind,
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;
@ -223,7 +223,7 @@ void Undo::Private::doRecordUndo(UndoKind kind,
// 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;
@ -243,7 +243,7 @@ void Undo::Private::recordUndo(UndoKind kind, DocIterator & cur,
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;
}
@ -281,7 +281,7 @@ bool Undo::Private::textUndoOrRedo(DocIterator & cur, bool isUndoOperation)
// 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()) {

View File

@ -27,7 +27,7 @@ using lyx::LyX;
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);

View File

@ -223,7 +223,7 @@ depth_type getItemDepth(ParIterator const & it)
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)

View File

@ -34,15 +34,15 @@ namespace lyx {
// 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()),
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 << ")" << 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());
@ -62,9 +62,9 @@ private:
///
string lang_;
///
std::locale loc_gl;
locale loc_gl;
///
std::messages<char> const & mssg_gl;
messages<char> const & mssg_gl;
///
catalog cat_gl;
};
@ -87,7 +87,7 @@ public:
: lang_(l)
{
//lyxerr << "Messages: language(" << l
// << ") in dir(" << dir << ")" << std::endl;
// << ") in dir(" << dir << ")" << endl;
}

View File

@ -19,11 +19,11 @@
#include <exception>
#include <ostream>
using std::endl;
using endl;
namespace boost {
void throw_exception(std::exception const & e)
void throw_exception(exception const & e)
{
lyx::lyxerr << "Exception caught:\n" << e.what() << endl;
BOOST_ASSERT(false);

View File

@ -341,8 +341,8 @@ void LyXDataSocket::writeln(string const & line)
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;
};

View File

@ -122,7 +122,7 @@ bool LyXErr::debugging(Debug::Type t) const
void LyXErr::endl()
{
stream() << std::endl;
stream() << endl;
}
@ -142,15 +142,15 @@ LyXErr & operator<<(LyXErr & l, unsigned long t)
{ 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; }
LyXErr & operator<<(LyXErr & l, std::ostream &(*t)(std::ostream &))
LyXErr & operator<<(LyXErr & l, ostream &(*t)(ostream &))
{ 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;

View File

@ -185,7 +185,7 @@ Inset * createInset(Buffer & buf, FuncRequest const & cmd)
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)
@ -323,7 +323,7 @@ Inset * createInset(Buffer & buf, FuncRequest const & cmd)
default:
lyxerr << "Inset '" << name << "' not permitted with LFUN_INSET_INSERT."
<< std::endl;
<< endl;
return 0;
}
@ -450,7 +450,7 @@ Inset * readInset(Lexer & lex, Buffer const & buf)
case NO_CODE:
default:
lyxerr << "unknown CommandInset '" << insetType
<< "'" << std::endl;
<< "'" << endl;
while (lex.isOK() && lex.getString() != "\\end_inset")
lex.next();
return 0;
@ -527,7 +527,7 @@ Inset * readInset(Lexer & lex, Buffer const & buf)
inset.reset(new InsetInfo(buf.params()));
} else {
lyxerr << "unknown Inset type '" << tmptok
<< "'" << std::endl;
<< "'" << endl;
while (lex.isOK() && lex.getString() != "\\end_inset")
lex.next();
return 0;

View File

@ -16,6 +16,7 @@
#include <QPixmap>
#include <QPainter>
using namespace std;
namespace lyx {
@ -51,7 +52,7 @@ BulletsModule::BulletsModule(QWidget * , char const * , Qt::WFlags)
void BulletsModule::setupPanel(QListWidget * lw, QString const & panelname,
std::string const & fname)
string const & fname)
{
connect(lw, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),
this, SLOT(bulletSelected(QListWidgetItem *, QListWidgetItem*)));

View File

@ -15,6 +15,8 @@
#include <iostream>
using namespace std;
namespace lyx {
namespace frontend {
@ -203,7 +205,7 @@ void ButtonPolicy::nextState(SMInput input)
<< printInput(input)
<< " from state "
<< printState(state_)
<< std::endl;
<< endl;
}
}
@ -566,13 +568,13 @@ void ButtonPolicy::initNoRepeatedApply()
}
std::ostream & operator<<(std::ostream & os, ButtonPolicy::State st)
ostream & operator<<(ostream & os, ButtonPolicy::State 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);
}

View File

@ -34,7 +34,7 @@ namespace lyx {
namespace frontend {
Dialog::Dialog(GuiView & lv, std::string const & name)
Dialog::Dialog(GuiView & lv, string const & name)
: name_(name), lyxview_(&lv)
{}
@ -43,7 +43,7 @@ Dialog::~Dialog()
{}
std::string const & Dialog::name() const
string const & Dialog::name() const
{
return name_;
}
@ -89,7 +89,7 @@ bool Dialog::isBufferReadonly() const
}
std::string const Dialog::bufferFilepath() const
string const Dialog::bufferFilepath() const
{
return buffer().filePath();
}

View File

@ -18,11 +18,12 @@
#include <QCloseEvent>
#include <QShowEvent>
using namespace std;
namespace lyx {
namespace frontend {
DialogView::DialogView(GuiView & lv, std::string const & name)
DialogView::DialogView(GuiView & lv, string const & name)
: QDialog(&lv), Dialog(lv, name)
{}

View File

@ -52,7 +52,7 @@ static docstring const formatted(docstring const & text)
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 ?

View File

@ -444,7 +444,7 @@ bool GuiApplication::notify(QObject * receiver, QEvent * event)
return false;
}
}
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: ");

View File

@ -401,7 +401,7 @@ void GuiBibtex::getBibStyles(vector<string> & data) const
*it = onlyFilename(*it);
}
// sort on filename only (no path)
std::sort(data.begin(), data.end());
sort(data.begin(), data.end());
}
@ -421,7 +421,7 @@ void GuiBibtex::getBibFiles(vector<string> & data) const
*it = onlyFilename(*it);
}
// sort on filename only (no path)
std::sort(data.begin(), data.end());
sort(data.begin(), data.end());
}

View File

@ -379,9 +379,9 @@ void GuiCharacter::closeEvent(QCloseEvent * e)
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)

View File

@ -125,7 +125,7 @@ void GuiCitation::closeEvent(QCloseEvent * e)
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();

View File

@ -167,7 +167,7 @@ void GuiCommandBuffer::complete()
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());
list->move(pos.x(), y);

View File

@ -82,7 +82,7 @@ GuiDelimiter::GuiDelimiter(GuiView & lv)
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;

View File

@ -26,7 +26,7 @@ using namespace std;
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)
{}

View File

@ -59,11 +59,11 @@ using namespace std;
///
template<class Pair>
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;
}
@ -1294,10 +1294,10 @@ void GuiDocument::apply(BufferParams & params)
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);

View File

@ -20,6 +20,7 @@
#include <QPushButton>
#include <QCloseEvent>
using namespace std;
namespace lyx {
namespace frontend {
@ -72,7 +73,7 @@ void GuiERT::updateContents()
}
bool GuiERT::initialiseParams(std::string const & data)
bool GuiERT::initialiseParams(string const & data)
{
InsetERTMailer::string2params(data, status_);
return true;

View File

@ -119,9 +119,9 @@ void GuiErrorList::goTo(int item)
// 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())
: 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);

View File

@ -199,9 +199,9 @@ GuiExternal::GuiExternal(GuiView & lv)
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));
}
@ -286,7 +286,7 @@ void GuiExternal::editClicked()
void GuiExternal::extraChanged(const QString& text)
{
std::string const format = fromqstr(extraFormatCO->currentText());
string const format = fromqstr(extraFormatCO->currentText());
extra_[format] = text;
changed();
}
@ -439,7 +439,7 @@ static void setSize(QLineEdit & widthED, QComboBox & widthUnitCO,
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;

View File

@ -27,6 +27,7 @@
#include <QFontInfo>
#include <QFontDatabase>
using namespace std;
QString const math_fonts[] = {"cmex10", "cmmi10", "cmr10", "cmsy10",
"eufm10", "msam10", "msbm10", "wasy10", "esint10"};
@ -333,8 +334,8 @@ GuiFontInfo::GuiFontInfo(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])

View File

@ -107,10 +107,10 @@ getSecond(vector<Pair> const & pr)
return tmp;
}
/// 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)
@ -672,7 +672,7 @@ void GuiGraphics::applyView()
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);
}

View File

@ -26,8 +26,8 @@
#include <QImage>
#include <QImageReader>
using lyx::support::ascii_lowercase;
using namespace std;
using namespace lyx::support;
namespace lyx {
namespace graphics {
@ -70,7 +70,7 @@ Image::FormatList GuiImage::loadableFormats()
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")

View File

@ -32,7 +32,7 @@ namespace frontend {
/////////////////////////////////////////////////////////////////
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;

View File

@ -433,7 +433,7 @@ void GuiListings::applyView()
}
static string plainParam(std::string const & par)
static string plainParam(string const & par)
{
// remove enclosing braces
if (prefixIs(par, "{") && suffixIs(par, "}"))

View File

@ -131,7 +131,7 @@ void GuiLog::updateContents()
{
setViewTitle(title());
std::ostringstream ss;
ostringstream ss;
getContents(ss);
logTB->setPlainText(toqstr(ss.str()));
@ -193,9 +193,9 @@ docstring GuiLog::title() const
}
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());
bool success = false;

View File

@ -19,7 +19,7 @@ using namespace std;
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
@ -54,8 +54,8 @@ GuiMath::GuiMath(GuiView & lv, std::string const & name)
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;
}
@ -136,7 +136,7 @@ MathSymbol const & GuiMath::mathSymbol(string tex_name) const
}
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);

View File

@ -370,7 +370,7 @@ int GuiPainter::text(int x, int y, docstring const & s,
// 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;
}
@ -383,7 +383,7 @@ int GuiPainter::text(int x, int y, docstring const & s,
// 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

View File

@ -80,21 +80,21 @@ namespace frontend {
/////////////////////////////////////////////////////////////////////
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;
return std::distance(vec.begin(), it);
return distance(vec.begin(), it);
}
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;
@ -579,7 +579,7 @@ PrefColors::PrefColors(GuiPreferences * form, QWidget * parent)
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) {
@ -1030,7 +1030,7 @@ void PrefConverters::updateGui()
Converters::const_iterator ccit = form_->converters().begin();
Converters::const_iterator cend = form_->converters().end();
for (; ccit != cend; ++ccit) {
std::string const name =
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);
@ -1204,7 +1204,7 @@ FormatNameValidator::FormatNameValidator(QWidget * parent, Formats const & f)
{
}
std::string FormatNameValidator::str(Formats::const_iterator it) const
string FormatNameValidator::str(Formats::const_iterator it) const
{
return it->name();
}
@ -1216,7 +1216,7 @@ FormatPrettynameValidator::FormatPrettynameValidator(QWidget * parent, Formats c
}
std::string FormatPrettynameValidator::str(Formats::const_iterator it) const
string FormatPrettynameValidator::str(Formats::const_iterator it) const
{
return it->prettyname();
}
@ -1450,9 +1450,9 @@ PrefLanguage::PrefLanguage(QWidget * parent)
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));
@ -2227,7 +2227,7 @@ void GuiPreferences::updateContents()
}
bool GuiPreferences::initialiseParams(std::string const &)
bool GuiPreferences::initialiseParams(string const &)
{
rc_ = lyxrc;
formats_ = lyx::formats;

View File

@ -180,7 +180,7 @@ void GuiPrint::applyView()
}
bool GuiPrint::initialiseParams(std::string const &)
bool GuiPrint::initialiseParams(string const &)
{
/// get global printer parameters
string const name = support::changeExtension(buffer().absFileName(),

View File

@ -298,7 +298,7 @@ void GuiRef::redoRefs()
// 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));
}

View File

@ -124,7 +124,7 @@ bool GuiSendTo::isValid()
}
bool GuiSendTo::initialiseParams(std::string const &)
bool GuiSendTo::initialiseParams(string const &)
{
format_ = 0;
command_ = lyxrc.custom_export_command;
@ -181,8 +181,8 @@ vector<Format const *> GuiSendTo::allFormats() const
}
// 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());
return to;
}

View File

@ -20,6 +20,7 @@
#include <QPushButton>
#include <QCloseEvent>
using namespace std;
namespace lyx {
namespace frontend {
@ -59,7 +60,7 @@ void GuiShowFile::updateContents()
}
bool GuiShowFile::initialiseParams(std::string const & data)
bool GuiShowFile::initialiseParams(string const & data)
{
filename_ = FileName(data);
return true;

View File

@ -231,7 +231,7 @@ static SpellBase * getSpeller(BufferParams const & bp)
}
bool GuiSpellchecker::initialiseParams(std::string const &)
bool GuiSpellchecker::initialiseParams(string const &)
{
LYXERR(Debug::GUI, "Spellchecker::initialiseParams");

View File

@ -179,7 +179,7 @@ void GuiTexInfo::updateStyles(TexFileType type)
*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();
@ -210,7 +210,7 @@ string GuiTexInfo::classOptions(string const & classname) const
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;

View File

@ -121,7 +121,7 @@ void GuiThesaurus::updateLists()
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));

View File

@ -139,7 +139,7 @@ string const find_png(string const & name)
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)

View File

@ -90,7 +90,7 @@ void GuiToolbars::initFlags(ToolbarInfo & tbinfo)
TurnOnFlag(AUTO);
}
/*
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)
@ -101,7 +101,7 @@ void GuiToolbars::initFlags(ToolbarInfo & tbinfo)
<< " RE:" << (flags & ToolbarBackend::REVIEW)
<< " TB:" << (flags & ToolbarBackend::TABLE)
<< " AU:" << (flags & ToolbarBackend::AUTO)
<< std::endl;
<< endl;
*/
// now set the flags
tbinfo.flags = static_cast<lyx::ToolbarInfo::Flags>(flags);
@ -248,7 +248,7 @@ void GuiToolbars::update(bool in_math, bool in_table, bool review)
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;

View File

@ -258,10 +258,10 @@ public:
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;
@ -410,7 +410,7 @@ void GuiView::closeEvent(QCloseEvent * close_event)
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();
}
@ -873,7 +873,7 @@ void GuiView::updateDialog(string const & name, string const & data)
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;
@ -1580,7 +1580,7 @@ private:
bool isValidName(string const & name)
{
return std::find_if(dialognames, end_dialognames,
return find_if(dialognames, end_dialognames,
cmpCStr(name.c_str())) != end_dialognames;
}
@ -1606,7 +1606,7 @@ Dialog * GuiView::find_or_build(string const & name)
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();
@ -1638,7 +1638,7 @@ void GuiView::showDialog(string const & name, string const & data,
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();
@ -1654,7 +1654,7 @@ void GuiView::hideDialog(string const & name, Inset * inset)
if (quitting)
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;
@ -1683,15 +1683,15 @@ Inset * GuiView::getOpenInset(string const & name) const
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
{
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();
@ -1700,8 +1700,8 @@ void GuiView::hideAll() 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();
@ -1713,8 +1713,8 @@ void GuiView::hideBufferDependent() 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();
@ -1737,8 +1737,8 @@ void GuiView::updateBufferDependent(bool switched) const
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();

View File

@ -132,7 +132,7 @@ QString GuiViewSource::getContent(bool fullSource)
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());

View File

@ -465,7 +465,7 @@ void GuiWorkArea::updateScrollbar()
// 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);

View File

@ -22,6 +22,7 @@
#include <vector>
using namespace std;
namespace lyx {
namespace frontend {
@ -214,7 +215,7 @@ void TocWidget::updateView()
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();

View File

@ -153,7 +153,7 @@ public:
Sorter() : loc_ok(true)
{
try {
loc_ = std::locale("");
loc_ = locale("");
} catch (...) {
loc_ok = false;
}
@ -167,7 +167,7 @@ public:
return lhs.first < rhs.first;
}
private:
std::locale loc_;
locale loc_;
bool loc_ok;
#endif
};
@ -201,7 +201,7 @@ vector<LanguagePair> const getLanguageData(bool character_dlg)
vector<LanguagePair>::iterator begin = character_dlg ?
langs.begin() + 2 : langs.begin();
std::sort(begin, langs.end(), Sorter());
sort(begin, langs.end(), Sorter());
return langs;
}
@ -320,7 +320,7 @@ void rescanTexStyles()
}
void getTexFileList(string const & filename, std::vector<string> & list)
void getTexFileList(string const & filename, vector<string> & list)
{
list.clear();
FileName const file = libFileSearch("", filename);
@ -328,18 +328,18 @@ void getTexFileList(string const & filename, std::vector<string> & list)
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,}");
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
list.erase(std::remove(list.begin(), list.end(), ""), list.end());
list.erase(remove(list.begin(), list.end(), ""), list.end());
eliminate_duplicates(list);
}

View File

@ -28,13 +28,13 @@ string const escape_special_chars(string const & expr)
}
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.
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.

View File

@ -18,7 +18,7 @@
namespace boost {
void throw_exception(std::exception const & /*e*/)
void throw_exception(exception const & /*e*/)
{
BOOST_ASSERT(false);
}

View File

@ -31,7 +31,7 @@ namespace graphics {
/** 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:
@ -59,7 +59,7 @@ Cache::~Cache()
}
std::vector<string> Cache::loadableFormats() const
vector<string> Cache::loadableFormats() const
{
return Image::loadableFormats();
}

View File

@ -143,12 +143,12 @@ Converter::Impl::Impl(FileName const & from_file, string const & to_file_base,
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."
<< std::endl;
<< endl;
return;
}

View File

@ -50,11 +50,11 @@ private:
/// 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.
std::set<Cache::ItemPtr> cache_set_;
set<Cache::ItemPtr> cache_set_;
/// Newly touched elements go here. loadNext moves them to cache_queue_
std::queue<Cache::ItemPtr> bucket_;
queue<Cache::ItemPtr> bucket_;
///
Timeout timer;
///
@ -142,7 +142,7 @@ void LoaderQueue::touch(Cache::ItemPtr const & item)
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);
}

View File

@ -44,7 +44,7 @@ bool operator!=(Params const & a, Params const & b)
}
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;
@ -62,7 +62,7 @@ BoundingBox::BoundingBox(string const & bb)
if (bb.empty())
return;
std::istringstream is(bb.c_str());
istringstream is(bb.c_str());
string a, b, c, d;
is >> a >> b >> c >> d;

View File

@ -361,7 +361,7 @@ InProgress::InProgress(string const & filename_base,
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));
}
@ -516,7 +516,7 @@ void PreviewLoader::Impl::remove(string const & latex_snippet)
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++;
@ -639,7 +639,7 @@ void PreviewLoader::Impl::finishedGenerating(pid_t pid, int retval)
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) {
@ -657,9 +657,9 @@ void PreviewLoader::Impl::finishedGenerating(pid_t pid, int retval)
in_progress_.erase(git);
// Tell the outside world
std::list<PreviewImagePtr>::const_reverse_iterator
list<PreviewImagePtr>::const_reverse_iterator
nit = newimages.rbegin();
std::list<PreviewImagePtr>::const_reverse_iterator
list<PreviewImagePtr>::const_reverse_iterator
nend = newimages.rend();
for (; nit != nend; ++nit) {
imageReady(*nit->get());

View File

@ -19,6 +19,7 @@
#include "insets/Inset.h"
using namespace std;
namespace lyx {
@ -42,7 +43,7 @@ public:
///
typedef boost::shared_ptr<PreviewLoader> PreviewLoaderPtr;
///
typedef std::map<Buffer const *, PreviewLoaderPtr> CacheType;
typedef map<Buffer const *, PreviewLoaderPtr> CacheType;
///
CacheType cache;
};

View File

@ -373,7 +373,7 @@ int writeExternal(InsetExternalParams const & params,
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'));
}
namespace {
@ -394,7 +394,7 @@ string const substituteIt<TransformCommand>(string const & input,
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;
@ -423,7 +423,7 @@ string const substituteIt<TransformOption>(string const & input,
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;

View File

@ -136,7 +136,7 @@ public:
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';
}
@ -299,7 +299,7 @@ void add(vector<TransformID> & ids, string const & name)
if (int(id) == -1) {
lyxerr << "external::Template::readTemplate\n"
<< "Transform " << name << " is not recognized"
<< std::endl;
<< endl;
} else {
ids.push_back(id);
}
@ -385,17 +385,17 @@ void Template::readTemplate(Lexer & lex)
namespace {
void transform_not_found(std::ostream & os, string const & transform)
void transform_not_found(ostream & os, string const & transform)
{
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 \""
<< tclass << "\" is unrecognized." << std::endl;
<< tclass << "\" is unrecognized." << endl;
}

Some files were not shown because too many files have changed in this diff Show More