X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLength.cpp;h=90da83a74ca7080a9fbc2b75762ce761f13501f0;hb=2455bc258f3b62c29ec4a41cb88070ff8518e842;hp=c9d6be2a4e32843e35f17714792c8f303fc304f6;hpb=8c622e4ff04765c786cbe9ccc9824f4429aee4e7;p=lyx.git diff --git a/src/Length.cpp b/src/Length.cpp index c9d6be2a4e..90da83a74c 100644 --- a/src/Length.cpp +++ b/src/Length.cpp @@ -16,19 +16,17 @@ #include #include "Length.h" -#include "lengthcommon.h" #include "LyXRC.h" #include "support/docstream.h" + #include #include +using namespace std; namespace lyx { -using std::ostringstream; -using std::string; - ///////////////////////////////////////////////////////////////////// // @@ -59,6 +57,13 @@ Length::Length(string const & data) } +void Length::swap(Length & rhs) +{ + std::swap(val_, rhs.val_); + std::swap(unit_, rhs.unit_); +} + + string const Length::asString() const { ostringstream os; @@ -153,7 +158,7 @@ int Length::inPixels(int text_width, int em_width_base) const ? em_width_base : 10*(dpi/72.27)*zoom; // A different estimate for em_width is - // theFontMetrics(LyXFont(LyXFont::ALL_SANE)).width('M') + // theFontMetrics(FontInfo(sane_font)).width('M') // but this estimate might not be more accurate as the screen font // is different then the latex font.