X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fvspace.h;h=92ae53231921fe919f4e2c881f4f9f16a6ed63d5;hb=946895278050e4a464c9591e99232a72f5f4dec9;hp=c4cde2fbcecac9623a9657a4416340ad6efd4b9d;hpb=76938908d7da15b92bad3908e71eb969c9449c0e;p=lyx.git diff --git a/src/vspace.h b/src/vspace.h index c4cde2fbce..92ae532319 100644 --- a/src/vspace.h +++ b/src/vspace.h @@ -73,9 +73,6 @@ public: LyXLength::UNIT unit() const { return uni; }; //@} - /// - bool operator== (LyXLength const &) const; - /// conversion virtual string asString() const; /// @@ -94,6 +91,15 @@ protected: LyXLength::UNIT uni; }; + +inline +bool operator==(LyXLength const & l1, LyXLength const & l2) +{ + return l1.value() == l2.value() + && l1.unit() == l2.unit(); +} + + extern LyXLength::UNIT unitFromString (string const & data); extern bool isValidLength(string const & data, LyXLength * result); @@ -135,9 +141,6 @@ public: LyXLength::UNIT minusUnit() const { return minus_uni; }; //@} - /// - bool operator == (LyXGlueLength const &) const; - /// conversion virtual string asString() const; /// @@ -156,6 +159,20 @@ protected: LyXLength::UNIT plus_uni, minus_uni; }; +/// +inline +bool operator==(LyXGlueLength const & l1, LyXGlueLength const & l2) +{ + return l1.value() == l2.value() + && l1.unit() == l2.unit() + && l1.plusValue() == l2.plusValue() + && l1.plusUnit() == l2.plusUnit() + && l1.minusValue() == l2.minusValue() + && l1.minusUnit() == l2.minusUnit(); +} + + + extern bool isValidGlueLength(string const & data, LyXGlueLength * result); /// VSpace class @@ -183,6 +200,8 @@ public: len (l), kp (false) {} + /// + explicit VSpace(float v, LyXLength::UNIT u) : kin (LENGTH), len (v, u), @@ -211,6 +230,8 @@ public: string asLatexCommand(BufferParams const & params) const; /// int inPixels(BufferView * bv) const; + /// + int inPixels(int default_height, int default_skip) const; private: /// vspace_kind kin;