]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathGrid.h
Revert "XHTML: remove DOCTYPE, as the document is then understood as HTML4/XHTML1...
[lyx.git] / src / mathed / InsetMathGrid.h
index 29f00fa179c58af01c8577c99a090de727742afa..fa7c2f2691636d3b96da1a6ce93c16ac6645c7a5 100644 (file)
 #define MATH_GRID_H
 
 #include "InsetMathNest.h"
-#include "Length.h"
 
+#include "support/Length.h"
+
+#include <map>
 
 namespace lyx {
 
 class BufferParams;
-
+class BufferView;
 
 /** Gridded math inset base class.
  *  This is the base to all grid-like editable math objects
@@ -44,7 +46,7 @@ public:
                CellInfo();
                /// multicolumn flag
                Multicolumn multi;
-               /// special multi colums alignment
+               /// special multi columns alignment
                docstring align;
        };
 
@@ -59,8 +61,8 @@ public:
                mutable int descent;
                /// cached ascent
                mutable int ascent;
-               /// cached offset
-               mutable int offset;
+               /// cached offset for each bufferview
+               mutable std::map<BufferView const *, int> offset;
                /// how many hlines above this row?
                unsigned int lines;
                /// parameter to the line break
@@ -94,8 +96,8 @@ public:
        };
 
 public:
-       /// sets nrows and ncols to 1, vertical alingment to 'c'
-       InsetMathGrid(Buffer * buf);
+       /// sets nrows and ncols to 1, vertical alignment to 'c'
+       explicit InsetMathGrid(Buffer * buf);
        /// Note: columns first!
        InsetMathGrid(Buffer * buf, col_type m, row_type n);
        ///
@@ -112,7 +114,7 @@ public:
        ///
        void drawT(TextPainter & pi, int x, int y) const;
        ///
-       void updateBuffer(ParIterator const &, UpdateType);
+       void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false);
        /// extract number of columns from alignment string
        static col_type guessColumns(docstring const & halign);
        /// accepts some LaTeX column codes: p,m,!,@,M,<,>
@@ -245,7 +247,7 @@ protected:
        /// returns x offset of cell compared to inset
        int cellXOffset(BufferView const &, idx_type idx) const;
        /// returns y offset of cell compared to inset
-       int cellYOffset(idx_type idx) const;
+       int cellYOffset(BufferView const &, idx_type idx) const;
        /// Width of cell, taking combined columns into account
        int cellWidth(idx_type idx) const;
        ///
@@ -271,13 +273,13 @@ protected:
        // InsetMathSplit.
        /// The value of a fixed col align for a certain hull type (can
        /// depend on the "indent math" setting).
-       static char colAlign(HullType type, col_type col,  BufferParams const &);
+       char colAlign(HullType type, col_type col) const;
        /// The value of a fixed col spacing for a certain hull type
        static int colSpace(HullType type, col_type col);
 
        /// positions of vertical and horizontal lines
        int vLineHOffset(col_type col, unsigned int line) const;
-       int hLineVOffset(row_type row, unsigned int line) const;
+       int hLineVOffset(BufferView const &, row_type row, unsigned int line) const;
 
        ///
        InsetCode lyxCode() const { return MATH_GRID_CODE; }