X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathAMSArray.cpp;h=4ec493f03fcf7eb5156c3bf3916a2e4531d485ea;hb=12314897982e07afd8926c997f66d7bb08e7e1fd;hp=3febc45cb1c0a603bc6d79e2aff335640ce8ffa7;hpb=f497296c30e6da2f97b16da8ad1c9e96feffb16b;p=lyx.git diff --git a/src/mathed/InsetMathAMSArray.cpp b/src/mathed/InsetMathAMSArray.cpp index 3febc45cb1..4ec493f03f 100644 --- a/src/mathed/InsetMathAMSArray.cpp +++ b/src/mathed/InsetMathAMSArray.cpp @@ -17,14 +17,13 @@ #include "MathStream.h" #include "MathSupport.h" -#include "funcrequest.h" +#include "FuncRequest.h" #include "FuncStatus.h" #include "gettext.h" #include "support/lstrings.h" #include "support/std_ostream.h" -using std::auto_ptr; namespace lyx { @@ -41,9 +40,9 @@ InsetMathAMSArray::InsetMathAMSArray(docstring const & name) {} -auto_ptr InsetMathAMSArray::doClone() const +Inset * InsetMathAMSArray::clone() const { - return auto_ptr(new InsetMathAMSArray(*this)); + return new InsetMathAMSArray(*this); } @@ -79,29 +78,35 @@ char const * InsetMathAMSArray::name_right() const } -bool InsetMathAMSArray::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathAMSArray::metrics(MetricsInfo & mi, Dimension & dim) const { ArrayChanger dummy(mi.base); InsetMathGrid::metrics(mi, dim); dim.wid += 14; - bool const changed = dim_ != dim; - dim_ = dim; - return changed; +} + + +Dimension const InsetMathAMSArray::dimension(BufferView const & bv) const +{ + Dimension dim = InsetMathGrid::dimension(bv); + dim.wid += 14; + return dim; } void InsetMathAMSArray::draw(PainterInfo & pi, int x, int y) const { - int const yy = y - dim_.ascent(); + Dimension const dim = dimension(*pi.base.bv); + int const yy = y - dim.ascent(); // Drawing the deco after an ArrayChanger does not work - mathed_draw_deco(pi, x + 1, yy, 5, dim_.height(), from_ascii(name_left())); - mathed_draw_deco(pi, x + dim_.width() - 8, yy, 5, dim_.height(), from_ascii(name_right())); + mathed_draw_deco(pi, x + 1, yy, 5, dim.height(), from_ascii(name_left())); + mathed_draw_deco(pi, x + dim.width() - 8, yy, 5, dim.height(), from_ascii(name_right())); ArrayChanger dummy(pi.base); InsetMathGrid::drawWithMargin(pi, x, y, 6, 8); } -bool InsetMathAMSArray::getStatus(LCursor & cur, FuncRequest const & cmd, +bool InsetMathAMSArray::getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus & flag) const { switch (cmd.action) {