]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathGrid.cpp
Improve support for on screen length calculation
[lyx.git] / src / mathed / InsetMathGrid.cpp
index 16e519c11f42544fbdae3e64b479221c9fb3af9b..d3eb677197dcd2535d717745dae7c2caf3f5f7ba 100644 (file)
@@ -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())