X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLength.cpp;h=c6e46066af8a2081319b57667d23e8c636ab0637;hb=f1cba8ff64b369792fd49f5ddf90e8126ab476ac;hp=4627f8bf47104e3101df88970131353d9411b922;hpb=e7aa8ce683718fc217ceffca647a94e202fc7e91;p=features.git diff --git a/src/Length.cpp b/src/Length.cpp index 4627f8bf47..c6e46066af 100644 --- a/src/Length.cpp +++ b/src/Length.cpp @@ -4,7 +4,7 @@ * Licence details can be found in the file COPYING. * * \author Matthias Ettrich - * \author Lars Gullik Bjønnes + * \author Lars Gullik Bjønnes * \author Jean-Marc Lasgouttes * \author Angus Leeming * \author John Levon @@ -23,12 +23,10 @@ #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(Font(Font::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.