#include <config.h>
#include "InsetMathGrid.h"
+
#include "MathData.h"
#include "MathParser.h"
#include "MathStream.h"
+#include "MetricsInfo.h"
#include "BufferView.h"
#include "CutAndPaste.h"
#include "FuncStatus.h"
#include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
#include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
#include "frontends/Clipboard.h"
#include "frontends/Painter.h"
#include "support/lstrings.h"
+#include "support/docstream.h"
#include <sstream>
+using namespace std;
+using namespace lyx::support;
namespace lyx {
-using support::bformat;
-
-using std::endl;
-using std::max;
-using std::min;
-using std::swap;
-
-using std::string;
-using std::istream;
-using std::istringstream;
-using std::vector;
-
-
namespace {
docstring verboseHLine(int n)
InsetMathGrid::RowInfo::RowInfo()
- : lines_(0), skip_(0), allow_pagebreak_(true)
+ : lines_(0), skip_(0), allow_newpage_(true)
{}
}
--it;
if (newcolumn) {
- colinfo_[col].lines_ = std::count(
+ colinfo_[col].lines_ = count(
colinfo_[col].special_.begin(),
colinfo_[col].special_.end(), '|');
- LYXERR(Debug::MATHED)
- << "special column separator: `"
- << to_utf8(colinfo_[col].special_)
- << '\'' << endl;
+ LYXERR(Debug::MATHED, "special column separator: `"
+ << to_utf8(colinfo_[col].special_) << '\'');
++col;
colinfo_[col].lines_ = 0;
colinfo_[col].special_.clear();
colinfo_[col].align_ = static_cast<char>(c);
if (!colinfo_[col].special_.empty()) {
colinfo_[col].special_ += c;
- colinfo_[col].lines_ = std::count(
+ colinfo_[col].lines_ = count(
colinfo_[col].special_.begin(),
colinfo_[col].special_.end(), '|');
- LYXERR(Debug::MATHED)
- << "special column separator: `"
- << to_utf8(colinfo_[col].special_)
- << '\'' << endl;
+ LYXERR(Debug::MATHED, "special column separator: `"
+ << to_utf8(colinfo_[col].special_) << '\'');
}
++col;
colinfo_[col].lines_ = 0;
void InsetMathGrid::draw(PainterInfo & pi, int x, int y) const
{
- drawWithMargin(pi, x, y, 0, 0);
+ drawWithMargin(pi, x, y, 1, 1);
}
}
-void InsetMathGrid::drawT(TextPainter & pain, int x, int y) const
+void InsetMathGrid::drawT(TextPainter & /*pain*/, int /*x*/, int /*y*/) const
{
// for (idx_type idx = 0; idx < nargs(); ++idx)
// cell(idx).drawT(pain, x + cellXOffset(idx), y + cellYOffset(idx));
if (!rowinfo_[row].crskip_.zero())
eol += '[' + from_utf8(rowinfo_[row].crskip_.asLatexString()) + ']';
- else if(!rowinfo_[row].allow_pagebreak_)
+ else if(!rowinfo_[row].allow_newpage_)
eol += '*';
// make sure an upcoming '[' does not break anything
}
-void InsetMathGrid::appendRow(row_type row)
+void InsetMathGrid::addRow(row_type row)
{
rowinfo_.insert(rowinfo_.begin() + row + 1, RowInfo());
cells_.insert
void InsetMathGrid::copyRow(row_type row)
{
- appendRow(row);
+ addRow(row);
for (col_type col = 0; col < ncols(); ++col)
cells_[(row + 1) * ncols() + col] = cells_[row * ncols() + col];
}
return false;
cur.idx() += ncols();
}
- cur.pos() = cur.cell().x2pos(cur.x_target() - cur.cell().xo(cur.bv()));
+ cur.pos() = cur.cell().x2pos(&cur.bv(), cur.x_target() - cur.cell().xo(cur.bv()));
return true;
}
}
break;
- case LFUN_BREAK_LINE: {
+ case LFUN_NEW_LINE: {
cur.recordUndoInset();
row_type const r = cur.row();
- appendRow(r);
+ addRow(r);
// split line
for (col_type c = col(cur.idx()) + 1; c < ncols(); ++c)
halign('c', cur.col());
else if (s == "append-row")
for (int i = 0, n = extractInt(is); i < n; ++i)
- appendRow(cur.row());
+ addRow(cur.row());
else if (s == "delete-row") {
cur.clearSelection(); // bug 4323
for (int i = 0, n = extractInt(is); i < n; ++i) {
status.enable(false);
break;
}
- if (!support::contains("tcb", cmd.argument()[0])) {
+ if (!contains("tcb", cmd.argument()[0])) {
status.enable(false);
break;
}