Operator<< for BoundingBox.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7837 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2003-09-29 21:42:13 +00:00
parent c90c9b7a2a
commit 5927128c94
3 changed files with 16 additions and 11 deletions

View 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.

View 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)
{}

View 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();