suppress the {} indication an empty base of a scriptinset if at the very

beginning of a cell


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3018 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2001-11-13 14:45:08 +00:00
parent 1e3e8aaac9
commit d481340f88
6 changed files with 9 additions and 28 deletions

View File

@ -1164,24 +1164,6 @@ MathCursorPos const & MathCursor::cursor() const
}
int MathCursor::cellXOffset() const
{
return par()->cellXOffset(idx());
}
int MathCursor::cellYOffset() const
{
return par()->cellYOffset(idx());
}
void MathCursor::gotoX(int x)
{
pos() = xarray().x2pos(x - cellXOffset());
}
bool MathCursor::goUp()
{
// first ask the inset if it knows better then we

View File

@ -285,12 +285,6 @@ private:
pos_type & pos();
/// write access to cursor cell index
idx_type & idx();
/// x-offset of current cell relative to par xo
int cellXOffset() const;
/// y-offset of current cell relative to par yo
int cellYOffset() const;
/// adjust position in current cell according to x. idx is not changed.
void gotoX(int x);
///
InsetFormulaBase * const formula_;

View File

@ -419,6 +419,7 @@ void write(MathArray const & dat, WriteStream & wi)
MathArray ar = dat;
extractStrings(ar);
for (MathArray::const_iterator it = ar.begin(); it != ar.end(); ++it) {
wi.firstitem = (it == ar.begin());
MathInset const * p = it->nucleus();
if (it + 1 != ar.end()) {
if (MathScriptInset const * q = asScript(it)) {

View File

@ -122,6 +122,8 @@ struct WriteStream {
std::ostream & os;
///
bool fragile;
/// are we at the beginning of an MathArray?
bool firstitem;
};

View File

@ -289,9 +289,11 @@ void MathScriptInset::write(MathInset const * nuc, WriteStream & os) const
if (limits_ == 1)
os << "\\limits ";
}
}
else
os << "{}";
} else
if (os.firstitem)
lyxerr << "suppressing {} \n";
else
os << "{}";
if (hasDown() && down().data_.size())
os << "_{" << down().data_ << '}';

View File

@ -77,7 +77,7 @@ public:
///
void ensure(bool up);
///
/// suppresses empty braces if necessary
void write(MathInset const * nuc, WriteStream & os) const;
///
void normalize(MathInset const * nuc, NormalStream & os) const;