From e1165d62aa33624c4beae0b2eada4db8c38f9c22 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 8 Apr 2013 00:38:58 +0300 Subject: Add SAL_INFO output operator for CGColorRef Change-Id: Ie14e6ab19e43961559de21e6e82bd13f647f4e1f --- vcl/inc/quartz/utils.h | 1 + vcl/quartz/utils.cxx | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) (limited to 'vcl') diff --git a/vcl/inc/quartz/utils.h b/vcl/inc/quartz/utils.h index a3d8a3647559..28cc508573e2 100644 --- a/vcl/inc/quartz/utils.h +++ b/vcl/inc/quartz/utils.h @@ -42,6 +42,7 @@ NSString* CreateNSString( const OUString& ); std::ostream &operator <<(std::ostream& s, CGRect &rRect); std::ostream &operator <<(std::ostream& s, CGPoint &rPoint); std::ostream &operator <<(std::ostream& s, CGSize &rSize); +std::ostream &operator <<(std::ostream& s, CGColorRef pSize); #endif // INCLUDED_QUARTZ_UTILS_HXX diff --git a/vcl/quartz/utils.cxx b/vcl/quartz/utils.cxx index 9c76adc92a17..e0c49e84e43b 100644 --- a/vcl/quartz/utils.cxx +++ b/vcl/quartz/utils.cxx @@ -97,4 +97,20 @@ std::ostream &operator <<(std::ostream& s, CGSize &rSize) return s; } +std::ostream &operator <<(std::ostream& s, CGColorRef pColor) +{ +#ifndef SAL_LOG_INFO + (void) pColor; +#else + CFStringRef colorString = CFCopyDescription(pColor); + if (colorString) { + s << GetOUString(colorString); + CFRelease(colorString); + } else { + s << "NULL"; + } +#endif + return s; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit