mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
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:
parent
1e3e8aaac9
commit
d481340f88
@ -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
|
||||
|
@ -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_;
|
||||
|
@ -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)) {
|
||||
|
@ -122,6 +122,8 @@ struct WriteStream {
|
||||
std::ostream & os;
|
||||
///
|
||||
bool fragile;
|
||||
/// are we at the beginning of an MathArray?
|
||||
bool firstitem;
|
||||
};
|
||||
|
||||
|
||||
|
@ -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_ << '}';
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user