|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r51056 - sandbox/SOC/2007/visualization/boost/svg_plot
From: pbristow_at_[hidden]
Date: 2009-02-06 12:10:36
Author: pbristow
Date: 2009-02-06 12:10:36 EST (Fri, 06 Feb 2009)
New Revision: 51056
URL: http://svn.boost.org/trac/boost/changeset/51056
Log:
added text_style operator== and !=
Text files modified:
sandbox/SOC/2007/visualization/boost/svg_plot/svg_style.hpp | 35 ++++++++++++++++++++---------------
1 files changed, 20 insertions(+), 15 deletions(-)
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/svg_style.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/svg_style.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/svg_style.hpp 2009-02-06 12:10:36 EST (Fri, 06 Feb 2009)
@@ -478,21 +478,26 @@
|| (ts.decoration_ != decoration_);
} // operator!=
- //bool text_style::operator==(const text_style& lhs, const text_style& rhs)
- //{ // Note operator== and operator << both needed to use Boost.text.
- // return (lhs.font_size_ == rhs.font_size_)
- // && (lhs.font_family() == rhs.font_family())
- // && (lhs.stretch_ == rhs.stretch_)
- // && (lhs.style_ == rhs.style_)
- // && (lhs.weight_ == rhs.weight_)
- // && (lhs.decoration_ == rhs.decoration_);
- //} // operator==
-
-//bool operator!= (const text_style& lhs, const text_style& rhs)
-//{ // Note operator== and operator << both needed to use Boost.Test.
-// But can be avoided with a macro whose name I forget.
-// return false;
-//}
+ bool operator==(const text_style& lhs, const text_style& rhs)
+ { // Note operator== and operator << both needed to use Boost.text.
+ return (lhs.font_size_ == rhs.font_size_)
+ && (lhs.font_family() == rhs.font_family())
+ && (lhs.stretch_ == rhs.stretch_)
+ && (lhs.style_ == rhs.style_)
+ && (lhs.weight_ == rhs.weight_)
+ && (lhs.decoration_ == rhs.decoration_);
+ } // bool operator==(const text_style& lhs, const text_style& rhs)
+
+ bool operator!= (const text_style& lhs, const text_style& rhs)
+ { // Note operator== and operator << both needed to use Boost.Test.
+ // But can be avoided with a macro .
+ return (lhs.font_size_ != rhs.font_size_)
+ && (lhs.font_family() != rhs.font_family())
+ && (lhs.stretch_ != rhs.stretch_)
+ && (lhs.style_ != rhs.style_)
+ && (lhs.weight_ != rhs.weight_)
+ && (lhs.decoration_ != rhs.decoration_);
+ } // bool operator!= (const text_style& lhs, const text_style& rhs)
std::ostream& operator<< (std::ostream& os, const text_style& ts)
{ //! Output a text style as a text string (mainly useful for diagnostic use).
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk