]> git.lyx.org Git - features.git/commitdiff
Operator<< for BoundingBox.
authorAngus Leeming <leeming@lyx.org>
Mon, 29 Sep 2003 21:42:13 +0000 (21:42 +0000)
committerAngus Leeming <leeming@lyx.org>
Mon, 29 Sep 2003 21:42:13 +0000 (21:42 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7837 a592a061-630c-0410-9148-cb99ea01b6c8

src/graphics/ChangeLog
src/graphics/GraphicsParams.C
src/graphics/GraphicsParams.h

index baf4d93cf730e8a8f69d0eda0107a2ccbca0a785..d4bf1089b68d44054e2fc24975282ccfe788bfa3 100644 (file)
@@ -1,3 +1,8 @@
+2003-09-29  Angus Leeming  <leeming@lyx.org>
+
+       * GraphicsParams.[Ch] (asString): removed. Replaced with
+       operator<<(std::ostream &, BoundingBox const &).
+
 2003-09-25  Angus Leeming  <leeming@lyx.org>
 
        * GraphicsParams.[Ch] (asString): new member function.
index bf163b26a9d7d85c2535e6b56e6c7a08ea6430f0..f2a1d239707789d1c09ec19ff01efbf8a6798368 100644 (file)
@@ -22,14 +22,6 @@ using std::abs;
 namespace lyx {
 namespace graphics {
 
-string const BoundingBox::asString() const
-{
-       std::ostringstream os;
-       os << xl << ' ' << yb << ' ' << xr << ' ' << yt;
-       return os.str();
-}
-
-
 Params::Params()
        : display(ColorDisplay),
          scale(100),
@@ -53,6 +45,13 @@ bool operator!=(Params const & a, Params const & b)
 }
 
 
+std::ostream & operator<<(std::ostream & os, BoundingBox const & bb)
+{
+       os << bb.xl << ' ' << bb.yb << ' ' << bb.xr << ' ' << bb.yt;
+       return os;
+}
+
+
 BoundingBox::BoundingBox()
        : xl(0), yb(0), xr(0), yt(0)
 {}
index 6da48f884389d8342a29fdcd0f482c6414ff3674..338b300ae463c0ee35f378c907bf437113be568b 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "GraphicsTypes.h"
 #include "support/std_string.h"
+#include <iosfwd>
 
 
 namespace lyx {
@@ -33,9 +34,6 @@ struct BoundingBox {
        /// 0 0 0 0 is empty!
        bool empty() const;
 
-       /// The bounding box as "xl yb xr yr"
-       string const asString() const;
-
        unsigned int xl;
        unsigned int yb;
        unsigned int xr;
@@ -45,6 +43,9 @@ struct BoundingBox {
 bool operator==(BoundingBox const &, BoundingBox const &);
 bool operator!=(BoundingBox const &, BoundingBox const &);
 
+std::ostream & operator<<(std::ostream &, BoundingBox const &);
+
+
 struct Params
 {
        Params();