diff options
-rw-r--r-- | tools/inc/tools/gen.hxx | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tools/inc/tools/gen.hxx b/tools/inc/tools/gen.hxx index 6c93e2b36926..acbf75a0983f 100644 --- a/tools/inc/tools/gen.hxx +++ b/tools/inc/tools/gen.hxx @@ -190,6 +190,13 @@ inline Point operator/( const Point &rVal1, const long nVal2 ) return Point( rVal1.nA/nVal2, rVal1.nB/nVal2 ); } +template< typename charT, typename traits > +inline std::basic_ostream<charT, traits> & operator <<( + std::basic_ostream<charT, traits> & stream, const Point& point ) +{ + return stream << point.X() << ',' << point.Y(); +} + // Size class SAL_WARN_UNUSED Size : public Pair @@ -219,6 +226,13 @@ inline Size::Size( long nWidth, long nHeight ) : { } +template< typename charT, typename traits > +inline std::basic_ostream<charT, traits> & operator <<( + std::basic_ostream<charT, traits> & stream, const Size& size ) +{ + return stream << size.Width() << 'x' << size.Height(); +} + // Range #define RANGE_MAX LONG_MAX @@ -264,6 +278,13 @@ inline void Range::Justify() } } +template< typename charT, typename traits > +inline std::basic_ostream<charT, traits> & operator <<( + std::basic_ostream<charT, traits> & stream, const Range& range ) +{ + return stream << range.Min() << '-' << range.Max(); +} + // Selection #define SELECTION_MIN LONG_MIN @@ -323,6 +344,12 @@ inline void Selection::Justify() } } +template< typename charT, typename traits > +inline std::basic_ostream<charT, traits> & operator <<( + std::basic_ostream<charT, traits> & stream, const Selection& selection ) +{ + return stream << selection.Min() << '-' << selection.Max(); +} // Rectangle #define RECT_EMPTY ((short)-32767) @@ -647,6 +674,14 @@ inline Rectangle operator - ( const Rectangle& rRect, const Point& rPt ) return aRect; } +template< typename charT, typename traits > +inline std::basic_ostream<charT, traits> & operator <<( + std::basic_ostream<charT, traits> & stream, const Rectangle& rectangle ) +{ + return stream << rectangle.getX() << ',' << rectangle.getY() << ' ' + << rectangle.getWidth() << 'x' << rectangle.getHeight(); +} + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |