using lyx::support::bformat;
using lyx::support::MakeAbsPath;
+using std::distance;
using std::find;
using std::string;
+using std::swap;
using std::vector;
if (find(labels.begin(),labels.end(),label) != labels.end()) {
cursor().clearSelection();
text()->setCursor(
- std::distance(text()->paragraphs().begin(), it.getPar()),
+ distance(text()->paragraphs().begin(), it.getPar()),
it.getPos());
cursor().resetAnchor();
update();
int length, bool backwards)
{
ParIterator par(cur);
-
+
cursor().clearSelection();
LyXText * text = par.text(*buffer());
text->setSelectionRange(length);
cursor().setSelection();
if (backwards)
- std::swap(cursor().cursor_, cursor().anchor_);
+ swap(cursor().cursor_, cursor().anchor_);
}
fitCursor();
{
return pimpl_->cursor_;
}
-
+2004-01-28 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * text.C: add using statements for std::advance and std::distance
+
+ * paragraph.C: add using statement for std::distance
+
+ * lyxfind.C: add using statement for std::advance
+
+ * cursor.C (region): remove std:: from swap
+ (openable): use nucleus in stead of operator->
+
+ * BufferView.C: add using statements for std::distance and std::swap
+
2004-01-27 Lars Gullik Bjonnes <larsbj@gullik.net>
* iterators.C: Remove the pimple, move the needed structures to
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);
}
}
// we can't move into anything new during selection
if (depth() == anchor_.size())
return false;
- if (t.operator->() != anchor_[depth()].inset())
+ if (t.nucleus() != anchor_[depth()].inset())
return false;
return true;
void LCursor::adjust(pos_type from, int diff)
-{
+{
if (pos() > from)
pos() += diff;
if (anchor().pos_ > from)
+2004-01-28 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * ControlSpellchecker.C: add using statements for std::advance and
+ std::distance
+
+ * ControlExternal.C: add using statement for std::advance
+
2004-01-26 Lars Gullik Bjonnes <larsbj@gullik.net>
* ControlSpellchecker.C (check): use std::distance and
using lyx::support::MakeAbsPath;
using lyx::support::readBB_from_PSFile;
+using std::advance;
using std::vector;
using std::string;
external::TemplateManager::Templates::const_iterator i1
= external::TemplateManager::get().getTemplates().begin();
- std::advance(i1, i);
+ advance(i1, i);
return i1->second;
}
using lyx::support::bformat;
+using std::advance;
+using std::distance;
using std::endl;
using std::string;
PosIterator const beg = buffer()->pos_iterator_begin();
PosIterator const end = buffer()->pos_iterator_end();
- int start = std::distance(beg, cur);
- int const total = start + std::distance(cur, end);
+ int start = distance(beg, cur);
+ int const total = start + distance(cur, end);
if (cur != buffer()->pos_iterator_begin())
for (; cur != end && isLetter(cur); ++cur, ++start);
if (!word_.word().empty()) {
int const size = word_.word().size();
- std::advance(cur, -size);
+ advance(cur, -size);
bufferview()->putSelectionAt(cur, size, false);
- std::advance(cur, size);
+ advance(cur, size);
} else {
showSummary();
endSession();
+2004-01-28 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * QPrefs.C: add using statement for std::distance
+ (findPos): add a typedef for the const_iterator.
+
+ * QLPopupMenu.C: add using statement for std::distance
+
+ * QDocument.C: add using statement for std::distance
+
2004-01-25 Angus Leeming <leeming@lyx.org>
* Dialog.C (build): add the "findreplace" dialog.
* QExternalDialog.C (browseClicked):
* QGraphicsDialog.C (browse_clicked):
- * QInclude.C (browse):
+ * QInclude.C (browse):
changes doe to the name change controller().Browse() to
controller().browse().
2003-12-15 Ronald Florence <ron@18james.com>
* qfont_loader.C: fixed headers to compile w/o X11
-
- * QWorkArea.C (checkAppleEventForMissingParams)
+
+ * QWorkArea.C (checkAppleEventForMissingParams)
(handleOpenDocuments): add support for OpenDocuments apple event
* lyx_gui.C (macEventFilter): handle apple events
-
+
2004-01-05 Angus Leeming <leeming@lyx.org>
* FileDialog_private.C (c-tor): invoke convert_brace_glob to convert
2003-12-14 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* QMinipage.[Ch]:
- * QMinipageDialog.[Ch]:
+ * QMinipageDialog.[Ch]:
* ui/QMinipageDialogBase.ui: remove from repository.
* Dialogs.C:
* Makefile.am:
2003-11-24 Alfredo Braunstein <abraunst@lyx.org>
- * QContentpane.[Ch] (trackScrollbar): add
+ * QContentpane.[Ch] (trackScrollbar): add
* QWorkarea.C (setScrollbarParams): do not track scrollbar signals
when manually setting the scrollbar position
* lyx_gui.C: {set,remove}_{server,data}socket_callback(): replace
dummy functions with working ones
- * socket_callback.[Ch] ():
+ * socket_callback.[Ch] ():
new files with a class to connect sockets.
* Makefile.am: add the above
using lyx::support::bformat;
using lyx::support::getVectorFromString;
+using std::distance;
using std::vector;
using std::string;
std::find(vec.begin(), vec.end(), val);
if (it == vec.end())
return 0;
- return std::distance(vec.begin(), it);
+ return distance(vec.begin(), it);
}
} // namespace anom
using lyx::support::subst;
+using std::distance;
using std::make_pair;
using std::string;
using std::pair;
Funcs::iterator fit =
funcs_.insert(funcs_.end(), m->func());
- int const index = std::distance(funcs_.begin(), fit);
+ int const index = distance(funcs_.begin(), fit);
insertItem(toqstr(getLabel(*m)), index);
setItemEnabled(index, !status.disabled());
using lyx::support::compare_no_case;
using lyx::support::strToDbl;
+using std::distance;
using std::endl;
using std::setfill;
using std::setw;
typename std::vector<A>::size_type
findPos(std::vector<A> const & vec, A const & val)
{
- typename std::vector<A>::const_iterator it =
- std::find(vec.begin(), vec.end(), val);
+ typedef typename std::vector<A>::const_iterator Cit;
+
+ Cit it = std::find(vec.begin(), vec.end(), val);
if (it == vec.end())
return 0;
- return std::distance(vec.begin(), it);
+ return distance(vec.begin(), it);
}
void setComboxFont(QComboBox * cb, string const & family, string const & foundry)
+2004-01-28 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * XFormsToolbar.C: add using statement for std::distance
+
+ * XFormsMenubar.C: add using statement for std::distance
+
2004-01-25 Angus Leeming <leeming@lyx.org>
* Dialog.C (build): add the "findreplace" dialog.
* QExternalDialog.C (browseClicked):
* QGraphicsDialog.C (browse_clicked):
- * QInclude.C (browse):
+ * QInclude.C (browse):
changes doe to the name change controller().Browse() to
controller().browse().
using lyx::support::lowercase;
using lyx::support::subst;
+using std::distance;
using std::endl;
using std::for_each;
using std::string;
Funcs::iterator fit =
funcs.insert(funcs.end(), item.func());
int const action_count =
- std::distance(funcs.begin(), fit);
+ distance(funcs.begin(), fit);
label += "%x" + tostr(action_count + action_offset);
lyxerr[Debug::GUI] << "Action: \""
#include "lyx_forms.h"
#include "combox.h"
+using std::distance;
using std::endl;
using std::string;
NorthWestGravity);
Funcs::iterator fit = funcs.insert(funcs.end(), func);
- int const index = std::distance(funcs.begin(), fit);
+ int const index = distance(funcs.begin(), fit);
fl_set_object_callback(obj, C_Toolbar_ToolbarCB, index);
// Remove the blue feedback rectangle
fl_set_pixmapbutton_focus_outline(obj, 0);
+2004-01-28 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * insettabular.C: add using statement for std::vector, remove
+ std:: where using was already used.
+
2004-01-19 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* insetgraphics.C, insetinclude.C: use runparams.nice instead of
using lyx::support::strToInt;
using lyx::support::strToDbl;
+using std::auto_ptr;
using std::endl;
using std::max;
-using std::swap;
using std::string;
-using std::auto_ptr;
using std::istringstream;
using std::ostream;
using std::ostringstream;
+using std::swap;
+using std::vector;
namespace {
}
if (!tablemode) {
-
+
int cell = cur.idx();
lyxerr << "# InsetTabular::dispatch: A " << cur << endl;
result = tabular.getCellInset(cell).dispatch(cur, cmd);
clearSelection();
int column = tabular.column_of_cell(cur.idx());
if (yo_ < 0) {
- cur.bv().scrollDocView(
+ cur.bv().scrollDocView(
cur.bv().top_y() - cur.bv().painter().paperHeight());
if (yo_ > 0)
cur.idx() = column;
}
-bool InsetTabular::tabularFeatures(LCursor & cur, std::string const & what)
+bool InsetTabular::tabularFeatures(LCursor & cur, string const & what)
{
LyXTabular::Feature action = LyXTabular::LAST_ACTION;
string const tmp = tabularFeature[i].feature;
if (tmp == what.substr(0, tmp.length())) {
//if (!compare(tabularFeatures[i].feature.c_str(), what.c_str(),
- // tabularFeatures[i].feature.length()))
+ // tabularFeatures[i].feature.length()))
action = tabularFeature[i].action;
break;
}
void InsetTabular::getLabelList(Buffer const & buffer,
- std::vector<string> & list) const
+ vector<string> & list) const
{
tabular.getLabelList(buffer, list);
}
using lyx::support::uppercase;
using lyx::support::split;
+using std::advance;
using std::ostringstream;
using std::string;
= cur.pit()->getFontSettings(buf.params(), pos);
int striked = ssize - cur.pit()->erase(pos, pos + ssize);
cur.pit()->insert(pos, replacestr, font);
- std::advance(cur, rsize + striked);
+ advance(cur, rsize + striked);
++num;
}
+2004-01-28 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * math_hullinset.C: add using statements for std::ostream,
+ std::swap and std::vector
+
+ * math_gridinset.C (idxDelete): remove std:: from swap.
+ (priv_dispatch): ditto
+
+ * math_extern.C: add using statement for std::swap and std::vector
+
+ * math_cursor.C: remove std:: from string
+ (openable): use nucleus instead of operator->
+
+ * math_atom.h: add a const variant of nucleus
+
+ * math_atom.C: add using statement for std::swap
2004-01-15 André Pönitz <poenitz@gmx.net>
2004-01-15 André Pönitz <poenitz@gmx.net>
- * *.[Ch]: change signature of priv_dispatch to prepare
+ * *.[Ch]: change signature of priv_dispatch to prepare
inset unification
2003-12-15 Ronald Florence <ron@18james.com>
* math_pos.[Ch]: remove (it's now cursor_slice.[Ch])
- * Makefile.am:
+ * Makefile.am:
* math_cursor.[Ch]:
* math_iterator.[Ch]: adjust
2003-11-10 André Pönitz <poenitz@gmx.net>
* formula.C:
- * formulabase.C: adjust to removed inset locking
+ * formulabase.C: adjust to removed inset locking
2003-11-05 José Matos <jamatos@lyx.org>
#include "math_atom.h"
#include "math_inset.h"
+using std::swap;
MathAtom::MathAtom()
if (&at == this)
return;
MathAtom tmp(at);
- std::swap(tmp.nucleus_, nucleus_);
+ swap(tmp.nucleus_, nucleus_);
}
void operator=(MathAtom const &);
/// access to the inset (checked with gprof)
MathInset * nucleus() { return nucleus_; }
+ MathInset const * nucleus() const { return nucleus_; }
/// access to the inset
MathInset const * operator->() const { return nucleus_; }
void eraseSelection(LCursor & cur);
/// the name of the macro we are currently inputting
- std::string macroName(LCursor & cur);
+ string macroName(LCursor & cur);
/// where in the curent cell does the macro name start?
difference_type macroNamePos(LCursor & cur);
/// can we enter the inset?
// we can't move into anything new during selection
if (cur.depth() == Anchor_.size())
return false;
- if (t.operator->() != Anchor_[cur.depth()].asMathInset())
+ if (t.nucleus() != Anchor_[cur.depth()].asMathInset())
return false;
}
#else
void adjust(LCursor & cur, pos_type from, difference_type diff)
-{
+{
if (cur.pos() > from)
cur.pos() += diff;
if (cur.anchor().pos_ > from)
using std::istringstream;
using std::ostream;
using std::ostringstream;
+using std::swap;
+using std::vector;
ostream & operator<<(ostream & os, MathArray const & ar)
// create extra script inset and move superscript over
MathScriptInset * p = ar[i].nucleus()->asScriptInset();
auto_ptr<MathScriptInset> q(new MathScriptInset(true));
- std::swap(q->up(), p->up());
+ swap(q->up(), p->up());
p->removeScript(true);
// insert new inset behind
expr.insert(pos, "*");
}
- std::vector<string> tmp = getVectorFromString(out, "$$");
+ vector<string> tmp = getVectorFromString(out, "$$");
if (tmp.size() < 2)
return MathArray();
// move cells if necessary
for (idx_type i = index(row(idx), 0); i < idx; ++i)
- std::swap(cell(i), cell(i + ncols()));
+ swap(cell(i), cell(i + ncols()));
delRow(row(idx));
// split line
for (col_type c = col(cur.idx()) + 1; c < ncols(); ++c)
- std::swap(cell(index(r, c)), cell(index(r + 1, c)));
+ swap(cell(index(r, c)), cell(index(r + 1, c)));
// split cell
splitCell(cur);
- std::swap(cell(cur.idx()), cell(cur.idx() + ncols() - 1));
+ swap(cell(cur.idx()), cell(cur.idx() + ncols() - 1));
if (cur.idx() > 0)
--cur.idx();
cur.idx() = cur.lastpos();
using std::string;
using std::auto_ptr;
using std::istringstream;
+using std::ostream;
using std::ostringstream;
using std::pair;
+using std::swap;
+using std::vector;
namespace {
}
-void MathHullInset::getLabelList(Buffer const &,
- std::vector<string> & labels) const
+void MathHullInset::getLabelList(Buffer const &, vector<string> & labels) const
{
for (row_type row = 0; row < nrows(); ++row)
if (!label_[row].empty() && nonum_[row] != 1)
return;
if (row + 1 == nrows())
--row;
- std::swap(nonum_[row], nonum_[row + 1]);
- std::swap(label_[row], label_[row + 1]);
+ swap(nonum_[row], nonum_[row + 1]);
+ swap(label_[row], label_[row + 1]);
MathGridInset::swapRow(row);
}
}
-void MathHullInset::infoize(std::ostream & os) const
+void MathHullInset::infoize(ostream & os) const
{
os << "Type: " << type_;
}
using lyx::support::contains;
using lyx::support::subst;
+using std::distance;
using std::endl;
using std::list;
using std::stack;
if (it->pos() >= pos)
break;
}
- unsigned int i = std::distance(beg, it);
+ unsigned int i = distance(beg, it);
bool notfound = (it == endit);
if (!notfound && pimpl_->fontlist[i].font() == font)
namespace {
// paragraphs inside floats need different alignment tags to avoid
-// unwanted space
+// unwanted space
bool noTrivlistCentering(UpdatableInset const * inset)
{
int char_line_count = depth;
bool label_closed = true;
bool para_closed = true;
-
+
if (style->latextype == LATEX_ITEM_ENVIRONMENT) {
string ls = "";
Counters & counters = buf.params().getLyXTextClass().counters();
if (!defaultstyle->latexparam().empty()) {
counters.step("para");
ls = tostr(counters.value("para"));
- ls = " id=\""
+ ls = " id=\""
+ subst(defaultstyle->latexparam(), "#", ls) + '"';
}
- os << "<" << style->itemtag() << ">\n"
- << string(depth, ' ') << "<"
+ os << "<" << style->itemtag() << ">\n"
+ << string(depth, ' ') << "<"
<< defaultstyle->latexname() << ls << ">\n";
para_closed = false;
}
os << str;
} else if (!style->labeltag().empty() && !label_closed) {
++char_line_count;
- os << "\n</" << style->labeltag() << "><"
- << style->itemtag() << "><"
+ os << "\n</" << style->labeltag() << "><"
+ << style->itemtag() << "><"
<< defaultstyle->latexname() << ">";
label_closed = true;
para_closed = false;
// resets description flag correctly
if (!label_closed) {
// <term> not closed...
- os << "</" << style->labeltag() << ">\n<"
- << style->itemtag() << "><"
+ os << "</" << style->labeltag() << ">\n<"
+ << style->itemtag() << "><"
<< defaultstyle->latexname() << "> ";
}
if (!para_closed) {
- os << "\n" << string(depth, ' ') << "</"
+ os << "\n" << string(depth, ' ') << "</"
<< defaultstyle->latexname() << ">\n";
}
if (style->free_spacing)
+2004-01-28 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * globbing.C: add using statement for std::distance, remove std::
+ from string.
+
2004-01-08 Angus Leeming <leeming@lyx.org>
* globbing.[Ch]: add a new class FileFilterList to parse a Qt-style
2003-12-14 Ronald Florence <ron@18james.com>
* tostr.[hC]: added tostr(long unsigned int i).
-
+
* path_defines.C.in: determine system directory and set PATH for
relocatable LyX/Mac bundle.
-
+
2004-01-06 Angus Leeming <leeming@lyx.org>
* globbing.C (glob): compilation fix for cygwin.
#include "glob.h"
+using std::distance;
using std::ostringstream;
using std::string;
using std::vector;
pattern += boost::regex_merge(tail, block_re, fmt);
// Increment the iterator to the end of the match.
- it += std::distance(it, what[0].second);
+ it += distance(it, what[0].second);
}
return pattern;
vector<string> const expand_globs(string const & mask,
- std::string const & directory)
+ string const & directory)
{
typedef boost::tokenizer<boost::char_separator<char> > Tokenizer;
boost::char_separator<char> const separator(" ");
parse_filter(string(what[-1].first, what[-1].second));
// Increment the iterator to the end of the match.
- it += std::distance(it, what[0].second);
+ it += distance(it, what[0].second);
}
}
using lyx::support::lowercase;
using lyx::support::uppercase;
+using std::advance;
+using std::distance;
using std::max;
using std::endl;
using std::string;
{
LyXTextClass const & tclass = bv()->buffer()->params().getLyXTextClass();
- return
+ return
RIGHT_MARGIN
+ font_metrics::signedWidth(tclass.rightmargin(),
tclass.defaultfont())
BOOST_ASSERT(par >= 0);
BOOST_ASSERT(par < int(paragraphs().size()));
ParagraphList::iterator pit = paragraphs().begin();
- std::advance(pit, par);
+ advance(pit, par);
return pit;
}
int LyXText::parOffset(ParagraphList::iterator pit) const
{
- return std::distance(paragraphs().begin(), pit);
+ return distance(paragraphs().begin(), pit);
}
bool LyXText::read(Buffer const & buf, LyXLex & lex)
-{
+{
static Change current_change;
bool the_end_read = false;