X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLength.cpp;h=a4d77f34ed041cbb049a20c858e2cddde8c94f25;hb=0a8ec32a3bbcefc5ce7d7772fec82b85ba58f2d1;hp=5c4dfc5ae148276bc7d481e0e5c86ada5d511aa4;hpb=b3b7675f544128ea4bbff564262774533af3598f;p=lyx.git diff --git a/src/Length.cpp b/src/Length.cpp index 5c4dfc5ae1..a4d77f34ed 100644 --- a/src/Length.cpp +++ b/src/Length.cpp @@ -17,9 +17,6 @@ #include "Length.h" #include "LyXRC.h" -#include "MetricsInfo.h" - -#include "frontends/FontMetrics.h" #include "support/debug.h" #include "support/docstream.h" @@ -52,7 +49,7 @@ Length::Length(double v, Length::UNIT u) Length::Length(string const & data) - : val_(0), unit_(Length::PT) + : val_(0), unit_(Length::UNIT_NONE) { Length tmp; @@ -202,7 +199,7 @@ bool Length::empty() const int Length::inPixels(int text_width, int em_width_base) const { // Zoom factor specified by user in percent - double const zoom = lyxrc.zoom / 100.0; // [percent] + double const zoom = lyxrc.currentZoom / 100.0; // [percent] // DPI setting for monitor: pixels/inch double const dpi = lyxrc.dpi; // screen resolution [pixels/inch] @@ -309,19 +306,6 @@ double Length::inInch(double text_width, double em_width) const } -int Length::inPixels(MetricsBase const & base) const -{ - FontInfo fi = base.font; - if (unit_ == Length::MU) - // mu is 1/18th of an em in the math symbol font - fi.setFamily(SYMBOL_FAMILY); - else - // Math style is only taken into account in the case of mu - fi.setStyle(LM_ST_TEXT); - return inPixels(base.textwidth, theFontMetrics(fi).em()); -} - - int Length::inBP() const { // return any Length value as a one with