[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source
Tor Lillqvist
tml at collabora.com
Sun Nov 3 16:54:29 CET 2013
sw/inc/swrect.hxx | 18 ++++++++++++++----
sw/source/core/bastyp/swrect.cxx | 12 ------------
2 files changed, 14 insertions(+), 16 deletions(-)
New commits:
commit 58ec629939bc0e31dc8fe8bfba6fba4f27e5bcc9
Author: Tor Lillqvist <tml at collabora.com>
Date: Sun Nov 3 17:39:20 2013 +0200
Add operator<< for SAL_INFO and SAL_DEBUG use
Change-Id: I1da8d2fcf503f60ef7947e8956009e09c4b5c867
diff --git a/sw/inc/swrect.hxx b/sw/inc/swrect.hxx
index b74a491..5218224 100644
--- a/sw/inc/swrect.hxx
+++ b/sw/inc/swrect.hxx
@@ -18,8 +18,12 @@
*/
#ifndef _SWRECT_HXX
#define _SWRECT_HXX
+
+#include <ostream>
+
#include <sal/log.hxx>
#include <tools/gen.hxx>
+
class SvStream;
class SAL_WARN_UNUSED SwRect
@@ -346,6 +350,16 @@ inline SwRect::SwRect( long X, long Y, long W, long H ) :
{
}
+template< typename charT, typename traits >
+inline std::basic_ostream<charT, traits> & operator <<(
+ std::basic_ostream<charT, traits> & stream, const SwRect& rectangle )
+{
+ if (rectangle.IsEmpty())
+ return stream << "EMPTY";
+ else
+ return stream << rectangle.SSize()
+ << "@(" << rectangle.Pos() << ")";
+}
#endif //_SWRECT_HXX
commit 51c2b2fc1edbfc5c04ae60d3989c0b62329dbd2b
Author: Tor Lillqvist <tml at collabora.com>
Date: Sun Nov 3 17:41:55 2013 +0200
Bin the unused SvStream &operator<<
Change-Id: I3971f46a14d96770660f7b0060df305248f9ec91
diff --git a/sw/inc/swrect.hxx b/sw/inc/swrect.hxx
index efe7edf..b74a491 100644
--- a/sw/inc/swrect.hxx
+++ b/sw/inc/swrect.hxx
@@ -98,10 +98,6 @@ public:
//SV-SS e.g. pWin->DrawRect( aSwRect.SVRect() );
inline Rectangle SVRect() const;
- // Output operator for debugging.
- friend SvStream &operator<<( SvStream &rStream, const SwRect &rRect );
-
-
void _Top( const long nTop );
void _Bottom( const long nBottom );
void _Left( const long nLeft );
diff --git a/sw/source/core/bastyp/swrect.cxx b/sw/source/core/bastyp/swrect.cxx
index e37f0cf..0d79ded 100644
--- a/sw/source/core/bastyp/swrect.cxx
+++ b/sw/source/core/bastyp/swrect.cxx
@@ -223,16 +223,4 @@ void SwRect::SetUpperRightCorner( const Point& rNew )
void SwRect::SetLowerLeftCorner( const Point& rNew )
{ m_Point = Point(rNew.A(), rNew.B() - m_Size.getHeight()); }
-#ifdef DBG_UTIL
-SvStream &operator<<( SvStream &rStream, const SwRect &rRect )
-{
- rStream << '[' << static_cast<sal_Int32>(rRect.Top())
- << '/' << static_cast<sal_Int32>(rRect.Left())
- << ',' << static_cast<sal_Int32>(rRect.Width())
- << 'x' << static_cast<sal_Int32>(rRect.Height())
- << "] ";
- return rStream;
-}
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list