]> git.lyx.org Git - lyx.git/commitdiff
suppress the {} indication an empty base of a scriptinset if at the very
authorAndré Pönitz <poenitz@gmx.net>
Tue, 13 Nov 2001 14:45:08 +0000 (14:45 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 13 Nov 2001 14:45:08 +0000 (14:45 +0000)
beginning of a cell

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3018 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_cursor.C
src/mathed/math_cursor.h
src/mathed/math_extern.C
src/mathed/math_mathmlstream.h
src/mathed/math_scriptinset.C
src/mathed/math_scriptinset.h

index 30cae1143744c8388ac1465ac085360b8cd9281b..7526a637e971448eb4c98bd3225cc9263da3220a 100644 (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
index 97f5ef97ccda3f90da38b4fd70eb011b70bdfdb6..0df0c4ee612a8938548fc37d178a6795245349fe 100644 (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_;
index e3064c107ee41ff4ef0deab3772d01e9d2f95117..cfdc432cbd027cc547d6b0fbb613bb4694f652c6 100644 (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)) {
index 245d6dc0848d8dcf6321b176eef57cad1e5941a3..9382b8d524859a01604865058a7f6b167c4ff14f 100644 (file)
@@ -122,6 +122,8 @@ struct WriteStream {
        std::ostream & os;
        ///
        bool fragile;
+       /// are we at the beginning of an MathArray?
+       bool firstitem;
 };
 
 
index cb7eed1f1cac3e1a71948efe27aa9076978e573e..1180becf75817479e758cc4578f3c8406ab040c3 100644 (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_ << '}';
index fe9630a518a76fd606037adf0256e63adfb39a7f..32424933e9ae003eb08f8e3eaa913644b9e5e49e 100644 (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;