X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathGrid.cpp;h=d3eb677197dcd2535d717745dae7c2caf3f5f7ba;hb=66fa801e74e1775b31008df548332436ce79e2e1;hp=16e519c11f42544fbdae3e64b479221c9fb3af9b;hpb=e7a1cce5513b93c5c53077e6571da4a978a6a9d1;p=lyx.git diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp index 16e519c11f..d3eb677197 100644 --- a/src/mathed/InsetMathGrid.cpp +++ b/src/mathed/InsetMathGrid.cpp @@ -20,6 +20,7 @@ #include "MetricsInfo.h" #include "Buffer.h" +#include "BufferParams.h" #include "BufferView.h" #include "CutAndPaste.h" #include "FuncStatus.h" @@ -27,7 +28,6 @@ #include "FuncRequest.h" #include "frontends/Clipboard.h" -#include "frontends/FontMetrics.h" #include "frontends/Painter.h" #include "support/debug.h" @@ -97,9 +97,7 @@ InsetMathGrid::RowInfo::RowInfo() int InsetMathGrid::RowInfo::skipPixels(MetricsInfo const & mi) const { - frontend::FontMetrics const & fm = theFontMetrics(mi.base.font); - return crskip_.inPixels(mi.base.textwidth, - fm.width(char_type('M'))); + return crskip_.inPixels(mi.base); } @@ -1339,7 +1337,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd) idocstringstream is(cmd.argument()); int n = 0; is >> n; - topaste = cap::selection(n); + topaste = cap::selection(n, buffer().params().documentClassPtr()); } InsetMathGrid grid(buffer_, 1, 1); if (!topaste.empty())