+2003-08-02 Lars Gullik Bjønnes <larsbj@lyx.org>
+
+ * Always use std::endl with lyxerr
+
2003-08-01 Lars Gullik Bjønnes <larsbj@lyx.org>
* BufferView_pimpl.C: _Always_ use std::endl with lyxerr
return ici->second.x11name;
lyxerr << "LyX internal error: Missing color"
- " entry in LColor.C for " << int(c) << '\n';
- lyxerr << "Using black.\n";
+ " entry in LColor.C for " << int(c) << endl;
+ lyxerr << "Using black." << endl;
return "black";
}
iti->second.x11name = x11name;
return;
}
- lyxerr << "LyX internal error: color and such.\n";
+ lyxerr << "LyX internal error: color and such." << endl;
Assert(false);
}
if (pit != lyx_pseudo_map.end()) {
lyxerr[Debug::ACTION] << "Found the pseudoaction: ["
<< pit->second.action << '|'
- << pit->second.argument << "]\n";
+ << pit->second.argument << "]" << endl;
return pit->second;
} else {
lyxerr << "Lyx Error: Unrecognized pseudo-action "
// split action and arg
string actstr;
string const argstr = split(func2, actstr, ' ');
- lyxerr[Debug::ACTION] << "Action: " << actstr << '\n';
- lyxerr[Debug::ACTION] << "Arg : " << argstr << '\n';
+ lyxerr[Debug::ACTION] << "Action: " << actstr << '\n'
+ << "Arg : " << argstr << endl;
func_map::const_iterator fit = lyx_func_map.find(actstr);
updating_(false),
file_(name + ".glade"),
title_(name),
- widget_name_(name),
+ widget_name_(name),
xml_(0),
dialog_(0)
{
string const file = FileOpenSearch(path, file_, "glade");
if (file.empty()) {
- lyxerr << "Cannot find glade file. Aborting." << std::endl;
+ lyxerr << "Cannot find glade file. Aborting." << endl;
lyx::Assert(true);
}
- lyxerr[Debug::GUI] << "Glade file to open is " << file << '\n';
+ lyxerr[Debug::GUI] << "Glade file to open is " << file << endl;
xml_ = Gnome::Glade::Xml::create (file, widget_name_);
}
void GView::OKClicked()
{
- lyxerr[Debug::GUI] << "GView::OKClicked()\n";
+ lyxerr[Debug::GUI] << "GView::OKClicked()" << endl;
getController().OKButton();
}
void GView::CancelClicked()
{
- lyxerr[Debug::GUI] << "GView::CancelClicked()\n";
+ lyxerr[Debug::GUI] << "GView::CancelClicked()" << endl;
getController().CancelButton();
}
void GView::ApplyClicked()
{
- lyxerr[Debug::GUI] << "GView::ApplyClicked()\n";
+ lyxerr[Debug::GUI] << "GView::ApplyClicked()" << endl;
getController().ApplyButton();
}
void GView::RestoreClicked()
{
- lyxerr[Debug::GUI] << "GView::RestoreClicked()\n";
+ lyxerr[Debug::GUI] << "GView::RestoreClicked()" << endl;
getController().RestoreButton();
}
lyx::Assert(true);
}
- lyxerr[Debug::GUI] << "Glade file to open is " << file << '\n';
+ lyxerr[Debug::GUI] << "Glade file to open is " << file << endl;
xml_ = Gnome::Glade::Xml::create (file, widget_name_);
}
void GnomeBase::OKClicked()
{
- lyxerr[Debug::GUI] << "GnomeBase::OKClicked()\n";
+ lyxerr[Debug::GUI] << "GnomeBase::OKClicked()" << endl;
getController().OKButton();
}
void GnomeBase::CancelClicked()
{
- lyxerr[Debug::GUI] << "GnomeBase::CancelClicked()\n";
+ lyxerr[Debug::GUI] << "GnomeBase::CancelClicked()" << endl;
getController().CancelButton();
}
void GnomeBase::ApplyClicked()
{
- lyxerr[Debug::GUI] << "GnomeBase::ApplyClicked()\n";
+ lyxerr[Debug::GUI] << "GnomeBase::ApplyClicked()" << endl;
getController().ApplyButton();
}
void GnomeBase::RestoreClicked()
{
- lyxerr[Debug::GUI] << "GnomeBase::RestoreClicked()\n";
+ lyxerr[Debug::GUI] << "GnomeBase::RestoreClicked()" << endl;
getController().RestoreButton();
}
+2003-08-02 Lars Gullik Bjønnes <larsbj@lyx.org>
+
+ * Always use std::endl with lyxerr
+
2003-07-30 Martin Vermeer <martin.vermeer@hut.fi>
(with help from Juergen Spitzmueller)
Spacing tmpSpacing = params.spacing;
switch (fl_get_choice(class_->choice_spacing)) {
case 1:
- lyxerr[Debug::INFO] << "Spacing: SINGLE\n";
+ lyxerr[Debug::INFO] << "Spacing: SINGLE" << endl;
params.spacing.set(Spacing::Single);
break;
case 2:
- lyxerr[Debug::INFO] << "Spacing: ONEHALF\n";
+ lyxerr[Debug::INFO] << "Spacing: ONEHALF" << endl;
params.spacing.set(Spacing::Onehalf);
break;
case 3:
- lyxerr[Debug::INFO] << "Spacing: DOUBLE\n";
+ lyxerr[Debug::INFO] << "Spacing: DOUBLE" << endl;
params.spacing.set(Spacing::Double);
break;
case 4:
- lyxerr[Debug::INFO] << "Spacing: OTHER\n";
+ lyxerr[Debug::INFO] << "Spacing: OTHER" << endl;
params.spacing.set(Spacing::Other,
getString(class_->input_spacing));
break;
using std::vector;
using std::getline;
+using std::endl;
FuncRequest::FuncRequest()
if (view_)
view_->owner()->getLyXFunc().setMessage(msg);
else
- lyxerr << "Dropping message '" << msg << "'\n";
+ lyxerr << "Dropping message '" << msg << "'" << endl;
}
if (view_)
view_->owner()->getLyXFunc().setErrorMessage(msg);
else
- lyxerr << "Dropping error message '" << msg << "'\n";
+ lyxerr << "Dropping error message '" << msg << "'" << endl;
}
+2003-08-02 Lars Gullik Bjønnes <larsbj@lyx.org>
+
+ * Always use std::endl with lyxerr
+
2003-08-01 Martin Vermeer <martin.vermeer@hut.fi>
* insetnote.C: update \author list
* insetert.C (write): \layout -> \begin_layout.
Add missing \end_layout.
-
+
2003-07-28 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* insetquotes.C: document a bit the format
* insetnote.C: Umpf. Hope I *now* get it right :-(
2003-07-28 Martin Vermeer <martin.vermeer@hut.fi>
- *insetnote.C: did the right fix to greyedout: \color
+ *insetnote.C: did the right fix to greyedout: \color
instead of \textcolor.
2003-07-28 Angus Leeming <leeming@lyx.org>
* insetbibtex.h: remove extraneous forward declaration.
* insetbibitem.h:
- * insetbibtex.h: Also remove long-dead Holder member class
+ * insetbibtex.h: Also remove long-dead Holder member class
and variable.
2003-07-27 Martin Vermeer <martin.vermeer@hut.fi>
void InsetCollapsable::metrics(MetricsInfo & mi, Dimension & dim) const
{
- //lyxerr << "InsetCollapsable::metrics: width: " << mi.base.textwidth << "\n";
+ //lyxerr << "InsetCollapsable::metrics: width: " << mi.base.textwidth << endl;
dimension_collapsed(dim);
if (!collapsed_) {
Dimension insetdim;
if (!cmd.argument.empty()) {
UpdatableInset::localDispatch(cmd);
if (collapsed_) {
- lyxerr << "branch collapsed_\n";
+ lyxerr << "branch collapsed_" << endl;
collapsed_ = false;
if (bv->lockInset(this)) {
inset.setUpdateStatus(InsetText::FULL);
first_after_edit = true;
}
} else {
- lyxerr << "branch not collapsed_\n";
+ lyxerr << "branch not collapsed_" << endl;
if (bv->lockInset(this))
inset.localDispatch(cmd);
}
{
// Are we using latex or pdflatex).
if (runparams.flavor == LatexRunParams::PDFLATEX) {
- lyxerr[Debug::GRAPHICS] << "findTargetFormat: PDF mode\n";
+ lyxerr[Debug::GRAPHICS] << "findTargetFormat: PDF mode" << endl;
if (contains(suffix, "ps") || suffix == "pdf")
return "pdf";
if (suffix == "jpg") // pdflatex can use jpeg
return "png"; // and also png
}
// If it's postscript, we always do eps.
- lyxerr[Debug::GRAPHICS] << "findTargetFormat: PostScript mode\n";
+ lyxerr[Debug::GRAPHICS] << "findTargetFormat: PostScript mode" << endl;
if (suffix != "ps") // any other than ps
return "eps"; // is changed to eps
return suffix; // let ps untouched
if (token == "Graphics")
readInsetGraphics(lex, buf->filePath());
else
- lyxerr[Debug::GRAPHICS] << "Not a Graphics inset!\n";
+ lyxerr[Debug::GRAPHICS] << "Not a Graphics inset!" << endl;
graphic_->update(params().as_grfxParams());
}
string const token = lex.getString();
lyxerr[Debug::GRAPHICS] << "Token: '" << token << '\''
- << std::endl;
+ << endl;
if (token.empty()) {
continue;
<< "This document was created with a newer Graphics widget"
", You should use a newer version of LyX to read this"
" file."
- << std::endl;
+ << endl;
// TODO: Possibly open up a dialog?
}
else {
//lyxerr << "InsetTabular::metrics: " << mi.base.bv << " width: " <<
// mi.base.textwidth << "\n";
if (!mi.base.bv) {
- lyxerr << "InsetTabular::metrics: need bv\n";
+ lyxerr << "InsetTabular::metrics: need bv" << endl;
Assert(0);
}
void InsetTabular::draw(PainterInfo & pi, int x, int y) const
{
- //lyxerr << "InsetTabular::draw: " << x << " " << y << "\n";
+ //lyxerr << "InsetTabular::draw: " << x << " " << y << endl;
BufferView * bv = pi.base.bv;
void InsetTabular::updateLocal(BufferView * bv, UpdateCodes what) const
{
- lyxerr << "InsetTabular::updateLocal: " << what << "\n";
+ lyxerr << "InsetTabular::updateLocal: " << what << endl;
if (!locked && what == CELL)
what = FULL;
if (need_update < what) // only set this if it has greater update
if (owner())
return owner()->forceDefaultParagraphs(in);
- // if we're here there is really something strange going on!!!
- lyxerr << "if we're here there is really something strange going on!\n";
+ lyxerr << "If we're here there is really something strange going on!"
+ << endl;
return false;
}
void InsetText::metrics(MetricsInfo & mi, Dimension & dim) const
{
- //lyxerr << "InsetText::metrics: width: " << mi.base.textwidth << "\n";
+ //lyxerr << "InsetText::metrics: width: " << mi.base.textwidth << endl;
textwidth_ = mi.base.textwidth;
BufferView * bv = mi.base.bv;
bool InsetText::lockInsetInInset(BufferView * bv, UpdatableInset * inset)
{
lyxerr[Debug::INSETS] << "InsetText::LockInsetInInset("
- << inset << "): ";
+ << inset << "): " << endl;
if (!inset)
return false;
if (!the_locking_inset) {
InsetList::iterator const end = pit->insetlist.end();
for (; it != end; ++it) {
if (it->inset == inset) {
- lyxerr << "InsetText::lockInsetInInset: 1 a\n";
+ lyxerr << "InsetText::lockInsetInInset: 1 a" << endl;
text_.setCursorIntern(pit, it->pos);
- lyxerr << "InsetText::lockInsetInInset: 1 b\n";
- lyxerr << "bv: " << bv << " inset: " << inset << "\n";
+ lyxerr << "InsetText::lockInsetInInset: 1 b" << endl;
+ lyxerr << "bv: " << bv << " inset: " << inset << endl;
lockInset(bv, inset);
lyxerr << "InsetText::lockInsetInInset: 1 c" << endl;
return true;
}
if (it->inset->getInsetFromID(id)) {
- lyxerr << "InsetText::lockInsetInInset: 2\n";
+ lyxerr << "InsetText::lockInsetInInset: 2" << endl;
text_.setCursorIntern(pit, it->pos);
it->inset->localDispatch(FuncRequest(bv, LFUN_INSET_EDIT));
return the_locking_inset->lockInsetInInset(bv, inset);
}
}
}
- lyxerr << "InsetText::lockInsetInInset: 3\n";
+ lyxerr << "InsetText::lockInsetInInset: 3" << endl;
return false;
}
if (inset == cpar()->getInset(cpos())) {
void LyXLex::Pimpl::printTable(ostream & os)
{
- os << "\nNumber of tags: " << no_items << '\n';
+ os << "\nNumber of tags: " << no_items << endl;
for (int i= 0; i < no_items; ++i)
os << "table[" << i
<< "]: tag: `" << table[i].tag
lyxerr << "The table passed to LyXLex is not sorted!\n"
<< "Tell the developers to fix it!" << endl;
// We sort it anyway to avoid problems.
- lyxerr << "\nUnsorted:\n";
+ lyxerr << "\nUnsorted:" << endl;
printTable(lyxerr);
sort(table, table + no_items, compare_tags());
- lyxerr << "\nSorted:\n";
+ lyxerr << "\nSorted:" << endl;
printTable(lyxerr);
}
}
// Global variable: textclass table.
LyXTextClassList textclasslist;
+
// Reads the style files
void LyXSetStyle()
{
- lyxerr[Debug::TCLASS] << "LyXSetStyle: parsing configuration...\n";
+ lyxerr[Debug::TCLASS] << "LyXSetStyle: parsing configuration..." << endl;
if (!textclasslist.Read()) {
lyxerr[Debug::TCLASS] << "LyXSetStyle: an error occured "
+2003-08-02 Lars Gullik Bjønnes <larsbj@lyx.org>
+
+ * always use std::endl with lyxerr, and <config.h> in some places.
+
2003-07-25 Lars Gullik Bjønnes <larsbj@gullik.net>
* rename Inset to InsetOld
using std::ostream;
using std::vector;
using std::auto_ptr;
+using std::endl;
class InsetFormula::PreviewImpl : public lyx::graphics::PreviewedInset {
if (!data.size())
return;
if (!mathed_parse_normal(par_, data))
- lyxerr << "cannot interpret '" << data << "' as math\n";
+ lyxerr << "cannot interpret '" << data << "' as math" << endl;
}
// remove extra 'mathrm' for chemistry stuff.
// will be re-added on write
if (par_->asHullInset()->getType() =="chemistry") {
- lyxerr << "this is chemistry\n";
+ lyxerr << "this is chemistry" << endl;
if (par_->cell(0).size() == 1) {
- lyxerr << "this is size 1\n";
- if (par_->cell(0)[0]->asFontInset()) {
- lyxerr << "this is a font inset \n";
- lyxerr << "replacing " << par_.nucleus()->cell(0) <<
- " with " << par_->cell(0)[0]->cell(0) << "\n";
+ lyxerr << "this is size 1" << endl;
+ if (par_->cell(0)[0]->asFontInset()) {
+ lyxerr << "this is a font inset "
+ << "replacing " << par_.nucleus()->cell(0) <<
+ " with " << par_->cell(0)[0]->cell(0) << endl;
}
}
}
}
-void InsetFormula::getLabelList(std::vector<string> & res) const
+void InsetFormula::getLabelList(vector<string> & res) const
{
par()->getLabelList(res);
}
{
// This is needed as long the math parser is not re-entrant
initMath();
- //lyxerr << "sizeof MathInset: " << sizeof(MathInset) << "\n";
- //lyxerr << "sizeof MetricsInfo: " << sizeof(MetricsInfo) << "\n";
- //lyxerr << "sizeof MathCharInset: " << sizeof(MathCharInset) << "\n";
- //lyxerr << "sizeof LyXFont: " << sizeof(LyXFont) << "\n";
+ //lyxerr << "sizeof MathInset: " << sizeof(MathInset) << endl;
+ //lyxerr << "sizeof MetricsInfo: " << sizeof(MetricsInfo) << endl;
+ //lyxerr << "sizeof MathCharInset: " << sizeof(MathCharInset) << endl;
+ //lyxerr << "sizeof LyXFont: " << sizeof(LyXFont) << endl;
}
switch (cmd.action) {
case LFUN_INSET_EDIT:
- lyxerr << "Called EDIT with '" << cmd.argument << "'\n";
+ lyxerr << "Called EDIT with '" << cmd.argument << "'" << endl;
if (!bv->lockInset(this))
- lyxerr << "Cannot lock math inset in edit call!\n";
+ lyxerr << "Cannot lock math inset in edit call!" << endl;
releaseMathCursor(bv);
if (!cmd.argument.empty()) {
mathcursor = new MathCursor(this, cmd.argument == "left");
return DISPATCHED;
case LFUN_MOUSE_PRESS:
- //lyxerr << "Mouse single press\n";
+ //lyxerr << "Mouse single press" << endl;
return lfunMousePress(cmd);
case LFUN_MOUSE_MOTION:
- //lyxerr << "Mouse motion\n";
+ //lyxerr << "Mouse motion" << endl;
return lfunMouseMotion(cmd);
case LFUN_MOUSE_RELEASE:
- //lyxerr << "Mouse single release\n";
+ //lyxerr << "Mouse single release" << endl;
return lfunMouseRelease(cmd);
case LFUN_MOUSE_DOUBLE:
- //lyxerr << "Mouse double\n";
+ //lyxerr << "Mouse double" << endl;
return localDispatch(FuncRequest(LFUN_WORDSEL));
default:
break;
sel = true; // fall through...
case LFUN_RIGHT:
result = mathcursor->right(sel) ? DISPATCHED : FINISHED_RIGHT;
- //lyxerr << "calling scroll 20\n";
+ //lyxerr << "calling scroll 20" << endl;
//scroll(bv, 20);
// write something to the minibuffer
//bv->owner()->message(mathcursor->info());
// dispatch_result = dispatch_buffer;
// break;
case LFUN_SETXY: {
- lyxerr << "LFUN_SETXY broken!\n";
+ lyxerr << "LFUN_SETXY broken!" << endl;
int x = 0;
int y = 0;
istringstream is(cmd.argument.c_str());
case LFUN_MATH_DELIM:
{
- //lyxerr << "formulabase::LFUN_MATH_DELIM, arg: '" << arg << "'\n";
+ //lyxerr << "formulabase::LFUN_MATH_DELIM, arg: '" << arg << "'" << endl;
string ls;
string rs = split(cmd.argument, ls, ' ');
// Reasonable default values
static string laststr;
if (lastformula != this || laststr != str) {
- //lyxerr << "reset lastformula to " << this << "\n";
+ //lyxerr << "reset lastformula to " << this << endl;
lastformula = this;
laststr = str;
current = ibegin(par().nucleus());
}
}
- //lyxerr << "not found!\n";
+ //lyxerr << "not found!" << endl;
lastformula = 0;
return false;
}
bool InsetFormulaBase::searchBackward(BufferView * bv, string const & what,
bool a, bool b)
{
- lyxerr[Debug::MATHED] << "searching backward not implemented in mathed\n";
+ lyxerr[Debug::MATHED] << "searching backward not implemented in mathed" << endl;
return searchForward(bv, what, a, b);
}
mathed_char_dim(font_, char_, dim_);
if (isBinaryOp(char_, code_))
width_ += 2 * font_metrics::width(' ', font_);
- lyxerr << "MathCharInset::metrics: " << dim << "\n";
+ lyxerr << "MathCharInset::metrics: " << dim << endl;
#endif
}
void MathCursor::pushLeft(MathAtom & t)
{
- //lyxerr << "Entering atom " << t << " left\n";
+ //lyxerr << "Entering atom " << t << " left" << endl;
push(t);
t->idxFirst(idx(), pos());
}
void MathCursor::pushRight(MathAtom & t)
{
- //lyxerr << "Entering atom " << t << " right\n";
+ //lyxerr << "Entering atom " << t << " right" << endl;
posLeft();
push(t);
t->idxLast(idx(), pos());
bool MathCursor::popLeft()
{
- //lyxerr << "Leaving atom to the left\n";
+ //lyxerr << "Leaving atom to the left" << endl;
if (depth() <= 1) {
if (depth() == 1)
inset()->notifyCursorLeaves(idx());
bool MathCursor::popRight()
{
- //lyxerr << "Leaving atom "; inset()->write(cerr, false); cerr << " right\n";
+ //lyxerr << "Leaving atom "; inset()->write(cerr, false); cerr << " right" << endl;
if (depth() <= 1) {
if (depth() == 1)
inset()->notifyCursorLeaves(idx());
void MathCursor::markInsert()
{
- //lyxerr << "inserting mark\n";
+ //lyxerr << "inserting mark" << endl;
array().insert(pos(), MathAtom(new MathCharInset(0)));
}
void MathCursor::markErase()
{
- //lyxerr << "deleting mark\n";
+ //lyxerr << "deleting mark" << endl;
array().erase(pos());
}
void MathCursor::insert(string const & str)
{
- //lyxerr << "inserting '" << str << "'\n";
+ //lyxerr << "inserting '" << str << "'" << endl;
selClearOrDel();
for (string::const_iterator it = str.begin(); it != str.end(); ++it)
plainInsert(MathAtom(new MathCharInset(*it)));
void MathCursor::insert(char c)
{
- //lyxerr << "inserting '" << c << "'\n";
+ //lyxerr << "inserting '" << c << "'" << endl;
selClearOrDel();
plainInsert(MathAtom(new MathCharInset(c)));
}
// prevent entering of recursive macros
if (formula()->lyxCode() == InsetOld::MATHMACRO_CODE
&& formula()->getInsetName() == name)
- lyxerr << "can't enter recursive macro\n";
+ lyxerr << "can't enter recursive macro" << endl;
niceInsert(createMathInset(name));
}
static MathArray dummy;
if (idx() >= inset()->nargs()) {
- lyxerr << "############ idx_ " << idx() << " not valid\n";
+ lyxerr << "############ idx_ " << idx() << " not valid" << endl;
return dummy;
}
if (depth() == 0) {
- lyxerr << "############ depth() == 0 not valid\n";
+ lyxerr << "############ depth() == 0 not valid" << endl;
return dummy;
}
push(nextAtom());
idx() = up; // the superscript has index 1
pos() = size();
- ///lyxerr << "updown: handled by scriptinset to the left\n";
+ ///lyxerr << "updown: handled by scriptinset to the left" << endl;
return true;
}
}
push(nextAtom());
idx() = up;
pos() = 0;
- ///lyxerr << "updown: handled by scriptinset to the right\n";
+ ///lyxerr << "updown: handled by scriptinset to the right" << endl;
return true;
}
}
//else
// ylow = yo + 4;
//if (bruteFind(xo, yo, xlow, xhigh, ylow, yhigh)) {
- // lyxerr << "updown: handled by brute find in the same cell\n";
+ // lyxerr << "updown: handled by brute find in the same cell" << endl;
// return true;
//}
// try to find an inset that knows better then we
while (1) {
- ///lyxerr << "updown: We are in " << *inset() << " idx: " << idx() << '\n';
+ ///lyxerr << "updown: We are in " << *inset() << " idx: " << idx() << endl;
// ask inset first
if (inset()->idxUpDown(idx(), pos(), up, targetx_)) {
// try to find best position within this inset
}
// no such inset found, just take something "above"
- ///lyxerr << "updown: handled by strange case\n";
+ ///lyxerr << "updown: handled by strange case" << endl;
if (!popLeft())
return
bruteFind(xo, yo,
bool MathCursor::interpret(char c)
{
- //lyxerr << "interpret 2: '" << c << "'\n";
+ //lyxerr << "interpret 2: '" << c << "'" << endl;
targetx_ = -1; // "no target"
if (inMacroArgMode()) {
--pos();
// handle macroMode
if (inMacroMode()) {
string name = macroName();
- //lyxerr << "interpret name: '" << name << "'\n";
+ //lyxerr << "interpret name: '" << name << "'" << endl;
if (isalpha(c)) {
activeMacro()->setName(activeMacro()->name() + c);
selClearOrDel();
if (c == '\\') {
- //lyxerr << "starting with macro\n";
+ //lyxerr << "starting with macro" << endl;
insert(MathAtom(new MathUnknownInset("\\", false)));
return true;
}
{
if (Anchor_.size() < depth()) {
Anchor_ = Cursor_;
- lyxerr << "unusual Anchor size\n";
+ lyxerr << "unusual Anchor size" << endl;
}
//lyx::Assert(Anchor_.size() >= cursor.depth());
// use Anchor on the same level as Cursor
using std::max;
using std::min;
using std::abs;
+using std::endl;
MathArray::MathArray()
for (size_type i = 0; i < size(); ++i) {
if (find1(rep.from, i)) {
// match found
- lyxerr << "match found!\n";
+ lyxerr << "match found!" << endl;
erase(i, i + rep.from.size());
insert(i, rep.to);
}
bool MathArray::find1(MathArray const & ar, size_type pos) const
{
- //lyxerr << "finding '" << ar << "' in '" << *this << "'\n";
+ //lyxerr << "finding '" << ar << "' in '" << *this << "'" << endl;
for (size_type i = 0, n = ar.size(); i < n; ++i)
if (!operator[](pos + i)->match(ar[i]))
return false;
+#include <config.h>
+
#include "math_diffinset.h"
#include "math_support.h"
#include "math_mathmlstream.h"
#include "debug.h"
using std::auto_ptr;
+using std::endl;
MathDiffInset::MathDiffInset()
void MathDiffInset::metrics(MetricsInfo &, Dimension &) const
{
- lyxerr << "should not happen\n";
+ lyxerr << "should not happen" << endl;
}
void MathDiffInset::draw(PainterInfo &, int, int) const
{
- lyxerr << "should not happen\n";
+ lyxerr << "should not happen" << endl;
}
void MathDiffInset::write(WriteStream &) const
{
- lyxerr << "should not happen\n";
+ lyxerr << "should not happen" << endl;
}
#include <boost/scoped_ptr.hpp>
using std::auto_ptr;
+using std::endl;
MathExIntInset::MathExIntInset(string const & name)
void MathExIntInset::metrics(MetricsInfo &, Dimension &) const
{
- lyxerr << "should not happen\n";
+ lyxerr << "should not happen" << endl;
}
void MathExIntInset::draw(PainterInfo &, int, int) const
{
- lyxerr << "should not happen\n";
+ lyxerr << "should not happen" << endl;
}
void MathExIntInset::write(WriteStream &) const
{
- lyxerr << "should not happen\n";
+ lyxerr << "should not happen" << endl;
}
void extractStrings(MathArray & ar)
{
- //lyxerr << "\nStrings from: " << ar << "\n";
+ //lyxerr << "\nStrings from: " << ar << endl;
for (MathArray::size_type i = 0; i < ar.size(); ++i) {
if (!ar[i]->asCharInset())
continue;
ar[i] = MathAtom(new MathStringInset(s));
ar.erase(i + 1, i + s.size());
}
- //lyxerr << "\nStrings to: " << ar << "\n";
+ //lyxerr << "\nStrings to: " << ar << endl;
}
void extractMatrices(MathArray & ar)
{
- //lyxerr << "\nMatrices from: " << ar << "\n";
+ //lyxerr << "\nMatrices from: " << ar << endl;
// first pass for explicitly delimited stuff
for (MathArray::size_type i = 0; i < ar.size(); ++i) {
if (!ar[i]->asDelimInset())
for (MathArray::size_type i = 0; i < ar.size(); ++i)
if (ar[i]->asAMSArrayInset())
ar[i] = MathAtom(new MathMatrixInset(*(ar[i]->asGridInset())));
- //lyxerr << "\nMatrices to: " << ar << "\n";
+ //lyxerr << "\nMatrices to: " << ar << endl;
}
void splitScripts(MathArray & ar)
{
- //lyxerr << "\nScripts from: " << ar << "\n";
+ //lyxerr << "\nScripts from: " << ar << endl;
for (MathArray::size_type i = 0; i < ar.size(); ++i) {
// is this script inset?
if (!ar[i]->asScriptInset())
++i;
ar.insert(i, MathAtom(q));
}
- //lyxerr << "\nScripts to: " << ar << "\n";
+ //lyxerr << "\nScripts to: " << ar << endl;
}
void extractExps(MathArray & ar)
{
- //lyxerr << "\nExps from: " << ar << "\n";
+ //lyxerr << "\nExps from: " << ar << endl;
for (MathArray::size_type i = 0; i + 1 < ar.size(); ++i) {
// is this 'e'?
if (ar[i]->getChar() != 'e')
ar[i] = MathAtom(new MathExFuncInset("exp", sup->cell(1)));
ar.erase(i + 1);
}
- //lyxerr << "\nExps to: " << ar << "\n";
+ //lyxerr << "\nExps to: " << ar << endl;
}
//
void extractDets(MathArray & ar)
{
- //lyxerr << "\ndet from: " << ar << "\n";
+ //lyxerr << "\ndet from: " << ar << endl;
for (MathArray::iterator it = ar.begin(); it != ar.end(); ++it) {
MathDelimInset const * del = (*it)->asDelimInset();
if (!del)
continue;
*it = MathAtom(new MathExFuncInset("det", del->cell(0)));
}
- //lyxerr << "\ndet to: " << ar << "\n";
+ //lyxerr << "\ndet to: " << ar << endl;
}
void extractNumbers(MathArray & ar)
{
- //lyxerr << "\nNumbers from: " << ar << "\n";
+ //lyxerr << "\nNumbers from: " << ar << endl;
for (MathArray::size_type i = 0; i < ar.size(); ++i) {
if (!ar[i]->asCharInset())
continue;
ar[i] = MathAtom(new MathNumberInset(s));
ar.erase(i + 1, i + s.size());
}
- //lyxerr << "\nNumbers to: " << ar << "\n";
+ //lyxerr << "\nNumbers to: " << ar << endl;
}
// replace '('...')' sequences by a real MathDelimInset
void extractDelims(MathArray & ar)
{
- //lyxerr << "\nDelims from: " << ar << "\n";
+ //lyxerr << "\nDelims from: " << ar << endl;
replaceNested(ar, testOpenParan, testCloseParan, replaceDelims);
- //lyxerr << "\nDelims to: " << ar << "\n";
+ //lyxerr << "\nDelims to: " << ar << endl;
}
if (ar.size() < 2)
return;
- //lyxerr << "\nFunctions from: " << ar << "\n";
+ //lyxerr << "\nFunctions from: " << ar << endl;
for (MathArray::size_type i = 0; i + 1 < ar.size(); ++i) {
MathArray::iterator it = ar.begin() + i;
MathArray::iterator jt = it + 1;
// re-insert exponent
ar.insert(i + 1, exp);
- //lyxerr << "\nFunctions to: " << ar << "\n";
+ //lyxerr << "\nFunctions to: " << ar << endl;
}
}
if (ar.size() < 3)
return;
- //lyxerr << "\nIntegrals from: " << ar << "\n";
+ //lyxerr << "\nIntegrals from: " << ar << endl;
for (MathArray::size_type i = 0; i + 1 < ar.size(); ++i) {
MathArray::iterator it = ar.begin() + i;
ar.erase(it + 1, tt);
*it = MathAtom(p);
}
- //lyxerr << "\nIntegrals to: " << ar << "\n";
+ //lyxerr << "\nIntegrals to: " << ar << endl;
}
if (ar.size() < 2)
return;
- //lyxerr << "\nSums from: " << ar << "\n";
+ //lyxerr << "\nSums from: " << ar << endl;
for (MathArray::size_type i = 0; i + 1 < ar.size(); ++i) {
MathArray::iterator it = ar.begin() + i;
ar.erase(it + 1, tt);
*it = MathAtom(p);
}
- //lyxerr << "\nSums to: " << ar << "\n";
+ //lyxerr << "\nSums to: " << ar << endl;
}
void extractDiff(MathArray & ar)
{
- //lyxerr << "\nDiffs from: " << ar << "\n";
+ //lyxerr << "\nDiffs from: " << ar << endl;
for (MathArray::size_type i = 0; i < ar.size(); ++i) {
MathArray::iterator it = ar.begin() + i;
MathFracInset const * f = (*it)->asFracInset();
if (!f) {
- lyxerr << "should not happen\n";
+ lyxerr << "should not happen" << endl;
continue;
}
ar.erase(it + 1, jt);
*it = MathAtom(diff);
}
- //lyxerr << "\nDiffs to: " << ar << "\n";
+ //lyxerr << "\nDiffs to: " << ar << endl;
}
if (ar.size() < 3)
return;
- //lyxerr << "\nLimits from: " << ar << "\n";
+ //lyxerr << "\nLimits from: " << ar << endl;
for (MathArray::size_type i = 0; i + 2 < ar.size(); ++i) {
MathArray::iterator it = ar.begin() + i;
// create a proper inset as replacement
*it = MathAtom(new MathLimInset(f, x, x0));
}
- //lyxerr << "\nLimits to: " << ar << "\n";
+ //lyxerr << "\nLimits to: " << ar << endl;
}
void extractStructure(MathArray & ar)
{
- //lyxerr << "\nStructure from: " << ar << "\n";
+ //lyxerr << "\nStructure from: " << ar << endl;
extractIntegrals(ar);
extractSums(ar);
splitScripts(ar);
extractExps(ar);
extractLims(ar);
extractStrings(ar);
- //lyxerr << "\nStructure to: " << ar << "\n";
+ //lyxerr << "\nStructure to: " << ar << endl;
}
// 2x;
// ^
//
- lyxerr << "checking expr: '" << expr << "'\n";
+ lyxerr << "checking expr: '" << expr << "'" << endl;
string full = header + "tex(" + expr + ");";
out = captureOutput("maxima", full);
getline(is, line);
getline(is, line);
string::size_type pos = line.find('^');
- lyxerr << "found caret at pos: '" << pos << "'\n";
+ lyxerr << "found caret at pos: '" << pos << "'" << endl;
if (pos == string::npos || pos < 4)
break; // caret position not found
pos -= 4; // skip the "tex(" part
return MathArray();
out = subst(tmp[1],"\\>", "");
- lyxerr << "out: '" << out << "'\n";
+ lyxerr << "out: '" << out << "'" << endl;
// Ugly code that tries to make the result prettier
MapleStream ms(os);
ms << ar;
string expr = STRCONV(os.str());
- lyxerr << "ar: '" << ar << "'\n";
- lyxerr << "ms: '" << os.str() << "'\n";
+ lyxerr << "ar: '" << ar << "'\n"
+ << "ms: '" << os.str() << "'" << endl;
for (int i = 0; i < 100; ++i) { // at most 100 attempts
// try to fix missing '*' the hard way by using mint
// ^ syntax error -
// Probably missing an operator such as * p
//
- lyxerr << "checking expr: '" << expr << "'\n";
+ lyxerr << "checking expr: '" << expr << "'" << endl;
string out = captureOutput("mint -i 1 -S -s -q -q", expr + ';');
if (out.empty())
break; // expression syntax is ok
string expr = STRCONV(os.str());
string out;
- lyxerr << "pipe: ar: '" << ar << "'\n";
- lyxerr << "pipe: expr: '" << expr << "'\n";
+ lyxerr << "pipe: ar: '" << ar << "'\n"
+ << "pipe: expr: '" << expr << "'" << endl;
for (int i = 0; i < 100; ++i) { // at most 100 attempts
//
// >>> ([[1 2 3 ];[2 3 1 ];[3 1 2 ]])([[1 2 3 ];[2 3 1 ];[3 1 2 ]])
// ^
//
- lyxerr << "checking expr: '" << expr << "'\n";
+ lyxerr << "checking expr: '" << expr << "'" << endl;
out = captureOutput("octave -q 2>&1", expr);
- lyxerr << "checking out: '" << out << "'\n";
+ lyxerr << "checking out: '" << out << "'" << endl;
// leave loop if expression syntax is probably ok
if (out.find("parse error:") == string::npos)
string line;
while (is) {
getline(is, line);
- lyxerr << "skipping line: '" << line << "'\n";
+ lyxerr << "skipping line: '" << line << "'" << endl;
if (line.find(">>> ") != string::npos)
break;
}
// found line with error, next line is the one with caret
getline(is, line);
string::size_type pos = line.find('^');
- lyxerr << "caret line: '" << line << "'\n";
- lyxerr << "found caret at pos: '" << pos << "'\n";
+ lyxerr << "caret line: '" << line << "'" << endl;
+ lyxerr << "found caret at pos: '" << pos << "'" << endl;
if (pos == string::npos || pos < 4)
break; // caret position not found
pos -= 4; // skip the ">>> " part
+#include <config.h>
+
#include "math_gridinset.h"
#include "math_mathmlstream.h"
#include "math_streamstr.h"
using std::vector;
using std::istream;
using std::auto_ptr;
+using std::endl;
class GridInsetMailer : public MailInset {
setDefaults();
valign(v);
halign(h);
- //lyxerr << "created grid with " << ncols() << " columns\n";
+ //lyxerr << "created grid with " << ncols() << " columns" << endl;
}
void MathGridInset::setDefaults()
{
if (ncols() <= 0)
- lyxerr << "positive number of columns expected\n";
+ lyxerr << "positive number of columns expected" << endl;
//if (nrows() <= 0)
- // lyxerr << "positive number of rows expected\n";
+ // lyxerr << "positive number of rows expected" << endl;
for (col_type col = 0; col < ncols(); ++col) {
colinfo_[col].align_ = defaultColAlign(col);
colinfo_[col].skip_ = defaultColSpace(col);
++col;
colinfo_[col].lines_ = 0;
} else {
- lyxerr << "unknown column separator: '" << c << "'\n";
+ lyxerr << "unknown column separator: '" << c << "'" << endl;
}
}
}
case LFUN_TABULAR_FEATURE: {
- //lyxerr << "handling tabular-feature " << cmd.argument << "\n";
+ //lyxerr << "handling tabular-feature " << cmd.argument << endl;
istringstream is(STRCONV(cmd.argument));
string s;
is >> s;
swapCol(col(idx));
else
return UNDISPATCHED;
- lyxerr << "returning DISPATCHED_POP\n";
+ lyxerr << "returning DISPATCHED_POP" << endl;
return DISPATCHED_POP;
}
case LFUN_PASTE: {
- //lyxerr << "pasting '" << cmd.argument << "'\n";
+ //lyxerr << "pasting '" << cmd.argument << "'" << endl;
MathGridInset grid(1, 1);
mathed_parse_normal(grid, cmd.argument);
if (grid.nargs() == 1) {
if (s == "multline") return 8;
if (s == "gather") return 9;
if (s == "flalign") return 10;
- lyxerr << "unknown hull type '" << s << "'\n";
+ lyxerr << "unknown hull type '" << s << "'" << endl;
return 0;
}
if (colChangeOK())
MathGridInset::addCol(col);
else
- lyxerr << "Can't change number of columns in '" << type_ << "'\n";
+ lyxerr << "Can't change number of columns in '" << type_ << "'" << endl;
}
if (colChangeOK())
MathGridInset::delCol(col);
else
- lyxerr << "Can't change number of columns in '" << type_ << "'\n";
+ lyxerr << "Can't change number of columns in '" << type_ << "'" << endl;
}
void MathHullInset::mutate(string const & newtype)
{
- //lyxerr << "mutating from '" << type_ << "' to '" << newtype << "'\n";
+ //lyxerr << "mutating from '" << type_ << "' to '" << newtype << "'" << endl;
// we try to move along the chain
// none <-> simple <-> equation <-> eqnarray
//if (selection()) {
// MathArray ar;
// selGet(ar);
- // lyxerr << "use selection: " << ar << "\n";
+ // lyxerr << "use selection: " << ar << endl;
// insert(pipeThroughExtern(lang, extra, ar));
// return;
//}
asArray(mathcursor->grabAndEraseSelection(), ar);
} else if (pos == cell(idx).size()) {
ar = cell(idx);
- lyxerr << "use whole cell: " << ar << "\n";
+ lyxerr << "use whole cell: " << ar << endl;
} else {
ar = MathArray(cell(idx).begin() + pos + 1, cell(idx).end());
- lyxerr << "use partial cell form pos: " << pos << "\n";
+ lyxerr << "use partial cell form pos: " << pos << endl;
}
cell(idx).append(eq);
cell(idx).append(pipeThroughExtern(lang, extra, ar));
}
if (getType() == "equation") {
- lyxerr << "use equation inset\n";
+ lyxerr << "use equation inset" << endl;
mutate("eqnarray");
MathArray & ar = cell(idx);
- lyxerr << "use cell: " << ar << "\n";
+ lyxerr << "use cell: " << ar << endl;
cell(idx + 1) = eq;
cell(idx + 2) = pipeThroughExtern(lang, extra, ar);
// move to end of line
}
{
- lyxerr << "use eqnarray\n";
+ lyxerr << "use eqnarray" << endl;
idx -= idx % ncols();
idx += 2;
pos = 0;
MathArray ar = cell(idx);
- lyxerr << "use cell: " << ar << "\n";
+ lyxerr << "use cell: " << ar << endl;
#ifdef WITH_WARNINGS
#warning temporarily disabled
#endif
return MathGridInset::dispatch(cmd, idx, pos);
case LFUN_MATH_NUMBER:
- //lyxerr << "toggling all numbers\n";
+ //lyxerr << "toggling all numbers" << endl;
if (display()) {
//recordUndo(bv, Undo::INSERT);
bool old = numberedType();
#include "formulabase.h"
using std::ostream;
+using std::endl;
BufferView * MathInset::view() const
MathArray & MathInset::cell(idx_type)
{
- lyxerr << "I don't have a cell 1\n";
+ lyxerr << "I don't have a cell 1" << endl;
return dummyCell;
}
MathArray const & MathInset::cell(idx_type) const
{
- lyxerr << "I don't have a cell 2\n";
+ lyxerr << "I don't have a cell 2" << endl;
return dummyCell;
}
MathInset::idx_type MathInset::index(row_type row, col_type col) const
{
if (row != 0)
- lyxerr << "illegal row: " << row << "\n";
+ lyxerr << "illegal row: " << row << endl;
if (col != 0)
- lyxerr << "illegal col: " << col << "\n";
+ lyxerr << "illegal col: " << col << endl;
return 0;
}
void MathInset::getPos(idx_type, pos_type, int & x, int & y) const
{
- lyxerr << "MathInset::getPos() called directly!\n";
+ lyxerr << "MathInset::getPos() called directly!" << endl;
x = y = 0;
}
void MathInset::dump() const
{
- lyxerr << "---------------------------------------------\n";
+ lyxerr << "---------------------------------------------" << endl;
WriteStream wi(lyxerr, false, true);
write(wi);
- lyxerr << "\n---------------------------------------------\n";
+ lyxerr << "\n---------------------------------------------" << endl;
}
void MathInset::drawSelection(PainterInfo &,
idx_type, pos_type, idx_type, pos_type) const
{
- lyxerr << "MathInset::drawSelection() called directly!\n";
+ lyxerr << "MathInset::drawSelection() called directly!" << endl;
}
void MathInset::metricsT(TextMetricsInfo const &, Dimension &) const
{
#ifdef WITH_WARNINGS
- lyxerr << "MathInset::metricsT(Text) called directly!\n";
+ lyxerr << "MathInset::metricsT(Text) called directly!" << endl;
#endif
}
void MathInset::drawT(TextPainter &, int, int) const
{
#ifdef WITH_WARNINGS
- lyxerr << "MathInset::drawT(Text) called directly!\n";
+ lyxerr << "MathInset::drawT(Text) called directly!" << endl;
#endif
}
+#include <config.h>
+
#include "math_liminset.h"
#include "math_support.h"
#include "math_mathmlstream.h"
#include "debug.h"
using std::auto_ptr;
+using std::endl;
MathLimInset::MathLimInset
void MathLimInset::metrics(MetricsInfo &, Dimension &) const
{
- lyxerr << "should not happen\n";
+ lyxerr << "should not happen" << endl;
}
void MathLimInset::draw(PainterInfo &, int, int) const
{
- lyxerr << "should not happen\n";
+ lyxerr << "should not happen" << endl;
}
void MathLimInset::write(WriteStream &) const
{
- lyxerr << "should not happen\n";
+ lyxerr << "should not happen" << endl;
}
* This code is under the GNU General Public Licence version 2 or later.
*/
+#include <config.h>
#include "math_macro.h"
#include "math_support.h"
using std::max;
using std::auto_ptr;
+using std::endl;
MathMacro::MathMacro(string const & name)
void MathMacro::dump() const
{
MathMacroTable::dump();
- lyxerr << "\n macro: '" << this << "'\n";
- lyxerr << " name: '" << name() << "'\n";
- lyxerr << " template: '";
+ lyxerr << "\n macro: '" << this << "'\n"
+ << " name: '" << name() << "'\n"
+ << " template: '";
WriteStream wi(lyxerr);
tmplate_->write(wi);
- lyxerr << "'\n";
+ lyxerr << "'" << endl;
}
#include <config.h>
-#include <iostream>
-
-
#include "math_macrotable.h"
#include "math_macro.h"
#include "math_macrotemplate.h"
#include "debug.h"
#include "math_support.h" // math_font_available
+#include <iostream>
+
+using std::endl;
+
MathMacroTable::table_type MathMacroTable::macro_table;
void MathMacroTable::dump()
{
/*
- lyxerr << "\n------------------------------------------\n";
+ lyxerr << "\n------------------------------------------" << endl;
table_type::const_iterator it;
for (it = macro_table.begin(); it != macro_table.end(); ++it)
lyxerr << it->first
<< " [" << it->second->asMacroTemplate()->nargs() << "] : "
- << it->second->cell(0) << "\n";
- lyxerr << "------------------------------------------\n";
+ << it->second->cell(0) << endl;
+ lyxerr << "------------------------------------------" << endl;
*/
}
table_type::iterator pos = macro_table.find(name);
if (pos == macro_table.end()) {
lyxerr << "MathMacroTable::provideTemplate: no template with name '"
- << name << "' available.\n";
+ << name << "' available." << endl;
}
return pos->second;
}
+#include <config.h>
+
#include "math_macrotemplate.h"
#include "math_mathmlstream.h"
#include "math_parser.h"
#include "debug.h"
using std::auto_ptr;
+using std::endl;
MathMacroTemplate::MathMacroTemplate()
MathArray ar;
mathed_parse_cell(ar, is);
if (ar.size() != 1 || !ar[0]->asMacroTemplate()) {
- lyxerr << "cannot read macro from '" << ar << "'\n";
+ lyxerr << "cannot read macro from '" << ar << "'" << endl;
return;
}
operator=( *(ar[0]->asMacroTemplate()) );
auto_ptr<InsetBase> MathMacroTemplate::clone() const
{
- //lyxerr << "cloning MacroTemplate!\n";
+ //lyxerr << "cloning MacroTemplate!" << endl;
return auto_ptr<InsetBase>(new MathMacroTemplate(*this));
}
+#include <config.h>
+
#include "math_parboxinset.h"
#include "math_mathmlstream.h"
#include "math_streamstr.h"
#include "debug.h"
using std::auto_ptr;
+using std::endl;
MathParboxInset::MathParboxInset()
: lyx_width_(0), tex_width_("0mm"), position_('c')
{
- lyxerr << "constructing MathParboxInset\n";
+ lyxerr << "constructing MathParboxInset" << endl;
}
{
tex_width_ = w;
lyx_width_ = LyXLength(w).inBP();
- lyxerr << "setting " << w << " to " << lyx_width_ << " pixel\n";
+ lyxerr << "setting " << w << " to " << lyx_width_ << " pixel" << endl;
}
MathInset::mode_type asMode(MathInset::mode_type oldmode, string const & str)
{
- //lyxerr << "handling mode: '" << str << "'\n";
+ //lyxerr << "handling mode: '" << str << "'" << endl;
if (str == "mathmode")
return MathInset::MATH_MODE;
if (str == "textmode" || str == "forcetext")
Token const & Parser::getToken()
{
static const Token dummy;
- //lyxerr << "looking at token " << tokens_[pos_] << " pos: " << pos_ << '\n';
+ //lyxerr << "looking at token " << tokens_[pos_] << " pos: " << pos_ << endl;
return good() ? tokens_[pos_++] : dummy;
}
while (catcode(c) == catSpace || catcode(c) == catNewline)
if (!is.get(c))
break;
- //lyxerr << "putting back: " << c << "\n";
+ //lyxerr << "putting back: " << c << endl;
is.putback(c);
}
char c;
while (is.get(c)) {
- //lyxerr << "reading c: " << c << "\n";
+ //lyxerr << "reading c: " << c << endl;
switch (catcode(c)) {
case catNewline: {
}
case catIgnore: {
- lyxerr << "ignoring a char: " << int(c) << "\n";
+ lyxerr << "ignoring a char: " << int(c) << endl;
break;
}
lyxerr << " <#> ";
lyxerr << tokens_[i];
}
- lyxerr << " pos: " << pos_ << "\n";
+ lyxerr << " pos: " << pos_ << endl;
}
grid.asHullInset()->numbered(cellrow, numbered);
//dump();
- //lyxerr << " flags: " << flags << "\n";
- //lyxerr << " mode: " << mode << "\n";
+ //lyxerr << " flags: " << flags << endl;
+ //lyxerr << " mode: " << mode << endl;
//lyxerr << "grid: " << grid << endl;
while (good()) {
Token const & t = getToken();
#ifdef FILEDEBUG
- lyxerr << "t: " << t << " flags: " << flags << "\n";
- lyxerr << "mode: " << mode << "\n";
+ lyxerr << "t: " << t << " flags: " << flags << endl;
+ lyxerr << "mode: " << mode << endl;
cell->dump();
- lyxerr << "\n";
+ lyxerr << endl;
#endif
if (flags & FLAG_ITEM) {
}
else {
- error("something strange in the parser\n");
+ error("something strange in the parser");
break;
}
}
else if (t.cat() == catAlign) {
++cellcol;
- //lyxerr << " column now " << cellcol << " max: " << grid.ncols() << "\n";
+ //lyxerr << " column now " << cellcol << " max: " << grid.ncols() << endl;
if (cellcol == grid.ncols()) {
- //lyxerr << "adding column " << cellcol << "\n";
+ //lyxerr << "adding column " << cellcol << endl;
grid.addCol(cellcol - 1);
}
cell = &grid.cell(grid.index(cellrow, cellcol));
}
else if (t.character() == ']' && (flags & FLAG_BRACK_LAST)) {
- //lyxerr << "finished reading option\n";
+ //lyxerr << "finished reading option" << endl;
return;
}
++nargs;
}
nargs /= 2;
- //lyxerr << "read \\def parameter list '" << pars << "'\n";
+ //lyxerr << "read \\def parameter list '" << pars << "'" << endl;
} else { // t.cs() == "newcommand" || t.cs() == "renewcommand"
if (getToken().cat() != catBegin) {
- error("'{' in \\newcommand expected (1) \n");
+ error("'{' in \\newcommand expected (1) ");
return;
}
name = getToken().cs();
if (getToken().cat() != catEnd) {
- error("'}' in \\newcommand expected\n");
+ error("'}' in \\newcommand expected");
return;
}
//MathArray test;
//test.push_back(createMathInset(name));
//if (ar1.contains(test)) {
- // error("we cannot handle recursive macros at all.\n");
+ // error("we cannot handle recursive macros at all.");
// return;
//}
parse(count, FLAG_ITEM, mode);
int cols = 1;
if (!extractNumber(count, cols)) {
- lyxerr << " can't extract number of cells from " << count << "\n";
+ lyxerr << " can't extract number of cells from " << count << endl;
}
// resize the table if necessary
for (int i = 0; i < cols; ++i) {
++cellcol;
if (cellcol == grid.ncols()) {
- //lyxerr << "adding column " << cellcol << "\n";
+ //lyxerr << "adding column " << cellcol << endl;
grid.addCol(cellcol - 1);
}
cell = &grid.cell(grid.index(cellrow, cellcol));
else if (t.cs() == "right") {
if (flags & FLAG_RIGHT)
return;
- //lyxerr << "got so far: '" << cell << "'\n";
+ //lyxerr << "got so far: '" << cell << "'" << endl;
error("Unmatched right delimiter");
return;
}
else {
dump();
- lyxerr << "found unknown math environment '" << name << "'\n";
+ lyxerr << "found unknown math environment '" << name << "'" << endl;
// create generic environment inset
cell->push_back(MathAtom(new MathEnvInset(name)));
parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode);
p->up_ = nextToken().cat() == catSuper;
getToken();
parse(p->cell(1), FLAG_ITEM, mode);
- //lyxerr << "read label: " << p->cell(1) << "\n";
+ //lyxerr << "read label: " << p->cell(1) << endl;
}
cell->push_back(MathAtom(p));
- //lyxerr << "read cell: " << cell << "\n";
+ //lyxerr << "read cell: " << cell << endl;
}
#endif
MathAtom at = createMathInset(t.cs());
MathInset::mode_type m = mode;
//if (m == MathInset::UNDECIDED_MODE)
- //lyxerr << "default creation: m1: " << m << "\n";
+ //lyxerr << "default creation: m1: " << m << endl;
if (at->currentMode() != MathInset::UNDECIDED_MODE)
m = at->currentMode();
- //lyxerr << "default creation: m2: " << m << "\n";
+ //lyxerr << "default creation: m2: " << m << endl;
MathInset::idx_type start = 0;
// this fails on \bigg[...\bigg]
//MathArray opt;
-#include "config.h"
+#include <config.h>
+
#include "math_pos.h"
#include "math_inset.h"
#include "debug.h"
using namespace lyx::support;
+using std::endl;
+
+
CursorPos::CursorPos()
: inset_(0), idx_(0), pos_(0)
{}
bool operator<(CursorPos const & p, CursorPos const & q)
{
if (p.inset_ != q.inset_) {
- lyxerr << "can't compare cursor and anchor in different insets\n";
+ lyxerr << "can't compare cursor and anchor in different insets"
+ << endl;
return true;
}
if (p.idx_ != q.idx_)
+#include <config.h>
+
#include "math_scriptinset.h"
#include "math_support.h"
#include "math_symbolinset.h"
using std::max;
using std::auto_ptr;
+using std::endl;
MathScriptInset::MathScriptInset()
//}
} else {
if (os.firstitem())
- lyxerr[Debug::MATHED] << "suppressing {} when writing\n";
+ lyxerr[Debug::MATHED] << "suppressing {} when writing"
+ << endl;
else
os << "{}";
}
#include <map>
using std::max;
+using std::endl;
///
deco_struct const * mds = search_deco(name);
if (!mds) {
- lyxerr << "Deco was not found. Programming error?\n";
- lyxerr << "name: '" << name << "'\n";
+ lyxerr << "Deco was not found. Programming error?" << endl;
+ lyxerr << "name: '" << name << "'" << endl;
return;
}
fontinfo * lookupFont(string const & name)
{
- //lyxerr << "searching font '" << name << "'\n";
+ //lyxerr << "searching font '" << name << "'" << endl;
int const n = sizeof(fontinfos) / sizeof(fontinfo);
for (int i = 0; i < n; ++i)
if (fontinfos[i].cmd_ == name) {
- //lyxerr << "found '" << i << "'\n";
+ //lyxerr << "found '" << i << "'" << endl;
return fontinfos + i;
}
return 0;
forig->shape_ = ffake->shape_;
forig->color_ = ffake->color_;
} else {
- lyxerr << "Can't fake font '" << orig << "' with '" << fake << "'\n";
+ lyxerr << "Can't fake font '" << orig << "' with '"
+ << fake << "'" << endl;
}
}
+#include <config.h>
+
#include "math_textinset.h"
#include "metricsinfo.h"
#include "debug.h"
using std::auto_ptr;
+using std::endl;
MathTextInset::MathTextInset()
for (pos_type r = 0, n = cache_.nargs(); r < n; ++r)
if (pos >= cache_.cellinfo_[r].begin_ && pos <= cache_.cellinfo_[r].end_)
return r;
- lyxerr << "illegal row for pos " << pos << "\n";
+ lyxerr << "illegal row for pos " << pos << endl;
return 0;
}
// Special handling of spaces. We reached a safe position for breaking.
char const c = cell(0)[i]->getChar();
if (c == ' ') {
- //lyxerr << "reached safe pos\n";
+ //lyxerr << "reached safe pos" << endl;
// we don't count the space into the safe pos
safe += curr;
// we reset to this safepos if the next chunk does not fit
}
// We passed the limit. Create a row entry.
- //lyxerr << "passed limit\n";
+ //lyxerr << "passed limit" << endl;
cache_.appendRow();
MathArray & ar = cache_.cell(cache_.nargs() - 1);
MathGridInset::CellInfo & row = cache_.cellinfo_.back();
} else if (spaces) {
// but we had a space break before this position.
// so retreat to this position
- //lyxerr << "... but had safe pos.\n";
+ //lyxerr << "... but had safe pos." << endl;
row.begin_ = begin;
row.end_ = safepos; // this is position of the safe space
i = safepos; // i gets incremented at end of loop
} else {
// This item is too large and it is the only one.
// We have no choice but to produce an overfull box.
- lyxerr << "... without safe pos\n";
+ lyxerr << "... without safe pos" << endl;
row.begin_ = begin;
row.end_ = i + 1;
begin = i + 1;
}
ar = MathArray(cell(0).begin() + row.begin_, cell(0).begin() + row.end_);
- //lyxerr << "line: " << ar << "\n";
+ //lyxerr << "line: " << ar << endl;
// in any case, start the new row with empty boxes
curr = 0;
safe = 0;
row.begin_ = begin;
row.end_ = cell(0).size();
ar = MathArray(cell(0).begin() + row.begin_, cell(0).begin() + row.end_);
- //lyxerr << "last line: " << ar.data() << "\n";
+ //lyxerr << "last line: " << ar.data() << endl;
// what to report?
cache_.metrics(mi, dim_);
case 'd': ++y; break;
}
}
- //lyxerr << "target: x: " << x << " y: " << y << "\n";
+ //lyxerr << "target: x: " << x << " y: " << y << endl;
MathInset::idx_type n = mi_.idx + p->ncols() * y + x;
if (n >= p->nargs()) {
- lyxerr << "source: n: " << mi_.idx << "\n";
- lyxerr << "target: n: " << n << " out of range\n";
+ lyxerr << "source: n: " << mi_.idx << "\n"
+ << "target: n: " << n << " out of range" << endl;
n = 0;
}
return p->cell(n);
#include "support/LOstream.h"
using std::auto_ptr;
+using std::endl;
RefInset::RefInset()
switch (cmd.action) {
case LFUN_MOUSE_RELEASE:
if (cmd.button() == mouse_button::button3) {
- lyxerr << "trying to goto ref" << cell(0) << "\n";
+ lyxerr << "trying to goto ref" << cell(0) << endl;
cmd.view()->dispatch(FuncRequest(LFUN_REF_GOTO, asString(cell(0))));
return DISPATCHED;
}
// needed as we will destroy the pimpl_ before copying it
if (&lp != this)
return;
- lyxerr << "Paragraph::operator=()\n";
+
+ lyxerr << "Paragraph::operator=()" << endl;
+
delete pimpl_;
pimpl_ = new Pimpl(*lp.pimpl_, this);
return cit->pos();
// This should not happen, but if so, we take no chances.
- lyxerr << "Pararaph::getEndPosOfFontSpan: This should not happen!\n";
+ lyxerr << "Pararaph::getEndPosOfFontSpan: This should not happen!"
+ << endl;
return pos;
}
void LyXText::fullRebreak()
{
- lyxerr << "fullRebreak\n";
+ lyxerr << "fullRebreak" << endl;
redoParagraphs(ownerParagraphs().begin(), ownerParagraphs().end());
setCursorIntern(cursor.par(), cursor.pos());
selection.cursor = cursor;
void LyXText::metrics(MetricsInfo & mi, Dimension & dim)
{
- //lyxerr << "LyXText::metrics: width: " << mi.base.textwidth << "\n";
+ //lyxerr << "LyXText::metrics: width: " << mi.base.textwidth << endl;
//Assert(mi.base.textwidth);
// rebuild row cache
Dimension dim;
MetricsInfo m = mi;
#warning FIXME: pos != 0
- m.base.font = getFont(pit, 0);
+ m.base.font = getFont(pit, 0);
ii->inset->metrics(m, dim);
}
}
// compute height
- //lyxerr << "height 0: " << height << "\n";
+ //lyxerr << "height 0: " << height << endl;
//for (RowList::iterator rit = rows().begin(); rit != rows().end(); ++rit) {
// height += rit->height();
//}
- //lyxerr << "height 1: " << height << "\n";
+ //lyxerr << "height 1: " << height << endl;
// final dimension
dim.asc = rows().begin()->ascent_of_text();
using lyx::pos_type;
using lyx::word_location;
+using std::endl;
+
bool transposeChars(LyXCursor const & cursor)
{
cursorLeftOneWord(from, pars);
break;
case lyx::NEXT_WORD:
- lyxerr << "LyXText::getWord: NEXT_WORD not implemented yet\n";
+ lyxerr << "LyXText::getWord: NEXT_WORD not implemented yet"
+ << endl;
break;
case lyx::PARTIAL_WORD:
break;