From 5927128c94ebbfdd03fe3947c52687ac0a367491 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Mon, 29 Sep 2003 21:42:13 +0000 Subject: [PATCH] Operator<< for BoundingBox. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7837 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/graphics/ChangeLog | 5 +++++ src/graphics/GraphicsParams.C | 15 +++++++-------- src/graphics/GraphicsParams.h | 7 ++++--- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/graphics/ChangeLog b/src/graphics/ChangeLog index baf4d93cf7..d4bf1089b6 100644 --- a/src/graphics/ChangeLog +++ b/src/graphics/ChangeLog @@ -1,3 +1,8 @@ +2003-09-29 Angus Leeming + + * GraphicsParams.[Ch] (asString): removed. Replaced with + operator<<(std::ostream &, BoundingBox const &). + 2003-09-25 Angus Leeming * GraphicsParams.[Ch] (asString): new member function. diff --git a/src/graphics/GraphicsParams.C b/src/graphics/GraphicsParams.C index bf163b26a9..f2a1d23970 100644 --- a/src/graphics/GraphicsParams.C +++ b/src/graphics/GraphicsParams.C @@ -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) {} diff --git a/src/graphics/GraphicsParams.h b/src/graphics/GraphicsParams.h index 6da48f8843..338b300ae4 100644 --- a/src/graphics/GraphicsParams.h +++ b/src/graphics/GraphicsParams.h @@ -16,6 +16,7 @@ #include "GraphicsTypes.h" #include "support/std_string.h" +#include 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();