// FIXME UNICODE
os << a.buffer_id_ << " \"" << to_utf8(a.name_)
<< "\" " << to_utf8(a.email_);
-
+
return os;
}
// If we record an author which equals the current
// author, we copy the buffer_id, so that it will
// keep the same id in the file.
- if (authors_.size() > 0 && a == authors_[0])
+ if (!authors_.empty() && a == authors_[0])
authors_[0].setBufferId(a.bufferId());
Authors::const_iterator it(authors_.begin());
// try previous macro if there is one
if (it == nameIt->second.begin())
break;
- it--;
+ --it;
}
}
}
os << "\\begin_removed_modules" << '\n';
list<string>::const_iterator it = removed_modules_.begin();
list<string>::const_iterator en = removed_modules_.end();
- for (; it != en; it++)
+ for (; it != en; ++it)
os << *it << '\n';
os << "\\end_removed_modules" << '\n';
}
os << "\\begin_modules" << '\n';
LayoutModuleList::const_iterator it = layout_modules_.begin();
LayoutModuleList::const_iterator en = layout_modules_.end();
- for (; it != en; it++)
+ for (; it != en; ++it)
os << *it << '\n';
os << "\\end_modules" << '\n';
}
os << "\\begin_includeonly" << '\n';
list<string>::const_iterator it = included_children_.begin();
list<string>::const_iterator en = included_children_.end();
- for (; it != en; it++)
+ for (; it != en; ++it)
os << *it << '\n';
os << "\\end_includeonly" << '\n';
}
{
LayoutModuleList::const_iterator it = layout_modules_.begin();
LayoutModuleList::const_iterator end = layout_modules_.end();
- for (; it != end; it++)
- if (*it == modName)
+ for (; it != end; ++it)
+ if (*it == modName)
return false;
layout_modules_.push_back(modName);
return true;
// start of the read.
list<string>::const_iterator rit = removed_modules_.begin();
list<string>::const_iterator const ren = removed_modules_.end();
- for (; rit != ren; rit++) {
+ for (; rit != ren; ++rit) {
LayoutModuleList::iterator const mit = layout_modules_.begin();
LayoutModuleList::iterator const men = layout_modules_.end();
LayoutModuleList::iterator found = find(mit, men, *rit);
ParagraphList::iterator it = copy_pars.begin();
ParagraphList::iterator it_end = copy_pars.end();
- for (; it != it_end; it++) {
+ for (; it != it_end; ++it) {
// Since we have a copy of the paragraphs, the insets
// do not have a proper buffer reference. It makes
// sense to add them temporarily, because the
// do some final cleanup now, to make sure that the paragraphs
// are not linked to something else.
it = copy_pars.begin();
- for (; it != it_end; it++) {
+ for (; it != it_end; ++it) {
it->setBuffer(*static_cast<Buffer *>(0));
it->setInsetOwner(0);
}
// Is the module already present?
const_iterator it = begin();
const_iterator const en = end();
- for (; it != en; it++)
+ for (; it != en; ++it)
if (*it == modName)
return false;
iterator insertpos = begin();
int numinserts = 0;
- for (; mit != men; mit++) {
+ for (; mit != men; ++mit) {
string const & modName = *mit;
// make sure the user hasn't removed it
if (find(removedModules.begin(), removedModules.end(), modName) !=
vector<string>::const_iterator bcit = pimpl_->batch_commands.begin();
vector<string>::const_iterator bcend = pimpl_->batch_commands.end();
DispatchResult dr;
- for (; bcit != bcend; bcit++) {
+ for (; bcit != bcend; ++bcit) {
LYXERR(Debug::ACTION, "Buffer::dispatch: cmd: " << *bcit);
buf->dispatch(*bcit, dr);
final_success |= !dr.error();
vector<string>::const_iterator bcit = pimpl_->batch_commands.begin();
vector<string>::const_iterator bcend = pimpl_->batch_commands.end();
- for (; bcit != bcend; bcit++) {
+ for (; bcit != bcend; ++bcit) {
LYXERR(Debug::INIT, "About to handle -x '" << *bcit << '\'');
lyx::dispatch(lyxaction.lookupFunc(*bcit));
}
current_change_number_ = 0;
}
- void setRange(FontSpan const fp, SpellChecker::Result state)
+ void setRange(FontSpan const & fp, SpellChecker::Result state)
{
Ranges result;
RangesIterator et = ranges_.end();
// change it to the buffer language.
ParagraphList::iterator it = plist.begin();
ParagraphList::iterator it_end = plist.end();
- for (; it != it_end; it++)
+ for (; it != it_end; ++it)
it->changeLanguage(b.params(), latex_language, b.language());
pasteParagraphList(cur, plist, b.params().documentClassPtr(),
DocumentClass & doc_class = newClass(baseClass);
LayoutModuleList::const_iterator it = modlist.begin();
LayoutModuleList::const_iterator en = modlist.end();
- for (; it != en; it++) {
+ for (; it != en; ++it) {
string const modName = *it;
LyXModule * lm = theModuleList[modName];
if (!lm) {
int yy = -1;
ParMetricsCache::const_iterator it = par_metrics_.begin();
ParMetricsCache::const_iterator et = par_metrics_.end();
- ParMetricsCache::const_iterator last = et; last--;
+ ParMetricsCache::const_iterator last = et;
+ --last;
ParagraphMetrics const & pm = it->second;
docstring formatStrVec(vector<string> const & v, docstring const & s)
{
//this mess formats the list as "v[0], v[1], ..., [s] v[n]"
- if (v.size() == 0)
+ if (v.empty())
return docstring();
if (v.size() == 1)
return translateIfPossible(from_utf8(v[0]));
list<string>::const_iterator ren = reqmods.end();
// check each of the default modules
- for (; rit != ren; rit++) {
+ for (; rit != ren; ++rit) {
list<string>::const_iterator mit = bp.getModules().begin();
list<string>::const_iterator men = bp.getModules().end();
bool found = false;
- for (; mit != men; mit++) {
+ for (; mit != men; ++mit) {
if (*rit == *mit) {
found = true;
break;
set<string>::const_iterator end = grp.end();
groupCO->blockSignals(true);
groupCO->clear();
- for (; it != end; it++)
+ for (; it != end; ++it)
groupCO->addItem(toqstr(*it), toqstr(*it));
groupCO->insertItem(0, qt_("None"), QString());
if (igp.groupId.empty())
}
-void LengthCombo::setCurrentItem(QString const item)
+void LengthCombo::setCurrentItem(QString const & item)
{
int num = QComboBox::count();
for (int i = 0; i < num; i++) {
/// set the current item from unit
virtual void setCurrentItem(lyx::Length::UNIT unit);
/// set the current item from length string
- virtual void setCurrentItem(QString const item);
+ virtual void setCurrentItem(QString const & item);
/// set the current item from int
virtual void setCurrentItem(int item);
/// get the current item
set<string>::const_iterator end = grp.end();
add(MenuItem(MenuItem::Command, qt_("No Group"),
FuncRequest(LFUN_SET_GRAPHICS_GROUP)));
- for (; it != end; it++) {
+ for (; it != end; ++it) {
addWithStatusCheck(MenuItem(MenuItem::Command, toqstr(*it) + '|',
FuncRequest(LFUN_SET_GRAPHICS_GROUP, *it)));
}
}
-LengthAutoValidator::LengthAutoValidator(QWidget * parent, QString const autotext)
+LengthAutoValidator::LengthAutoValidator(QWidget * parent, QString const & autotext)
: LengthValidator(parent),
autotext_(autotext)
{}
}
-LengthAutoValidator * unsignedLengthAutoValidator(QLineEdit * ed, QString const autotext)
+LengthAutoValidator * unsignedLengthAutoValidator(QLineEdit * ed, QString const & autotext)
{
LengthAutoValidator * v = new LengthAutoValidator(ed, autotext);
v->setBottom(Length());
}
-DoubleAutoValidator::DoubleAutoValidator(QWidget * parent, QString const autotext)
+DoubleAutoValidator::DoubleAutoValidator(QWidget * parent, QString const & autotext)
: QDoubleValidator(parent),
autotext_(autotext)
{}
Q_OBJECT
public:
/// Define a validator for widget @c parent.
- LengthAutoValidator(QWidget * parent, QString const autotext);
+ LengthAutoValidator(QWidget * parent, QString const & autotext);
/** @returns QValidator::Acceptable if @c data is a GlueLength
* or is "auto". If not, returns QValidator::Intermediate.
};
/// @returns a new @c LengthAutoValidator that does not accept negative lengths.
-LengthAutoValidator * unsignedLengthAutoValidator(QLineEdit *, QString const autotext);
+LengthAutoValidator * unsignedLengthAutoValidator(QLineEdit *, QString const & autotext);
/**
{
Q_OBJECT
public:
- DoubleAutoValidator(QWidget * parent, QString const autotext);
+ DoubleAutoValidator(QWidget * parent, QString const & autotext);
DoubleAutoValidator(double bottom, double top, int decimals,
QObject * parent);
QValidator::State validate(QString & input, int & pos) const;
if (ptr->status() == WaitingToLoad)
ptr->startLoading();
}
- if (cache_queue_.size()) {
+ if (!cache_queue_.empty()) {
startLoader();
} else {
stopLoader();
istringstream ls(line);
typedef istream_iterator<string> iter;
vector<string> v = vector<string>(iter(ls), iter());
- if (v.size())
+ if (!v.empty())
dat.push_back(v);
}
}
sort(locals.begin(), locals.end());
- if (globals.size() > 0)
+ if (!globals.empty())
return;
// fill in global macros
// This is for debugging purpose at the end.
pit_type const par_begin = pit;
for (; pit < runparams.par_end; ++pit) {
-
ParagraphList::const_iterator par = paragraphs.constIterator(pit);
// check first if this is an higher depth paragraph.
// be two for Standard paragraphs that are depth-increment'ed to be
// output correctly. However, tables can also be paragraphs so
// don't adjust them.
- //
// FIXME (Lgb): Will it ever harm to have one '\n' too
// many? i.e. that we sometimes will have
}
}
- if (!reqargs && ilist.size() == 0)
+ if (!reqargs && ilist.empty())
return;
bool const have_optional_args = ilist.size() > reqargs;
// (ii) We didn't open it and html_in_par is true,
// but we are in the first par, and there is a next par.
ParagraphList::const_iterator nextpar = par;
- nextpar++;
+ ++nextpar;
bool const needclose =
(opened && (!runparams.html_in_par || nextpar != pend))
|| (!opened && runparams.html_in_par && par == pbegin && nextpar != pend);
{
Author author(from_utf8(name), empty_docstring());
for (AuthorList::Authors::const_iterator it = authors_.begin();
- it != authors_.end(); it++)
+ it != authors_.end(); ++it)
if (*it == author)
return *it;
static Author const dummy;
os << "\\begin_modules\n";
vector<string>::const_iterator const end = used_modules.end();
vector<string>::const_iterator it = used_modules.begin();
- for (; it != end; it++)
+ for (; it != end; ++it)
os << *it << '\n';
os << "\\end_modules\n";
}
DocumentClassBundle & bundle = DocumentClassBundle::get();
LyXModuleList::const_iterator const end = theModuleList.end();
LyXModuleList::const_iterator it = theModuleList.begin();
- for (; it != end; it++) {
+ for (; it != end; ++it) {
string const module = it->getID();
LayoutModuleList m;
// FIXME this excludes all modules that depend on another one
// needed since it is not unlikely that two different modules define a
// command with the same name.
ModuleMap::iterator const end = modules.end();
- for (ModuleMap::iterator it = modules.begin(); it != end; it++) {
+ for (ModuleMap::iterator it = modules.begin(); it != end; ++it) {
string const module = it->first;
if (!used_modules.moduleCanBeAdded(module, &baseClass))
continue;
if (!used_modules.empty()) {
LayoutModuleList::const_iterator const end = used_modules.end();
LayoutModuleList::const_iterator it = used_modules.begin();
- for (; it != end; it++)
+ for (; it != end; ++it)
preamble.addModule(*it);
}
if (!preamble.writeLyXHeader(os, !active_environments.empty())) {
if (!preamble.titleLayoutFound())
preamble.titleLayoutFound(newlayout->intitle);
set<string> const & req = newlayout->requires();
- for (set<string>::const_iterator it = req.begin(); it != req.end(); it++)
+ for (set<string>::const_iterator it = req.begin(); it != req.end(); ++it)
preamble.registerAutomaticallyLoadedPackage(*it);
}
preamble.titleLayoutFound(newlayout->intitle);
set<string> const & req = newlayout->requires();
for (set<string>::const_iterator it = req.begin();
- it != req.end(); it++)
+ it != req.end(); ++it)
preamble.registerAutomaticallyLoadedPackage(*it);
} else
handle_ert(os,
if (!preamble.titleLayoutFound())
preamble.titleLayoutFound(newlayout->intitle);
set<string> const & req = newlayout->requires();
- for (set<string>::const_iterator it = req.begin(); it != req.end(); it++)
+ for (set<string>::const_iterator it = req.begin(); it != req.end(); ++it)
preamble.registerAutomaticallyLoadedPackage(*it);
}
if (!preamble.titleLayoutFound())
preamble.titleLayoutFound(newlayout->intitle);
set<string> const & req = newlayout->requires();
- for (set<string>::const_iterator it = req.begin(); it != req.end(); it++)
+ for (set<string>::const_iterator it = req.begin(); it != req.end(); ++it)
preamble.registerAutomaticallyLoadedPackage(*it);
}