diff options
author | Tor Lillqvist <tml@collabora.com> | 2020-12-21 15:15:54 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2020-12-21 23:46:34 +0100 |
commit | b126def60fc5280d40bc25db86748ed798c8548d (patch) | |
tree | e1fffa609c593561c528641dfef47961fadc2c59 /vcl | |
parent | 160db4bf0fc391b2ded635d0bd998d5352541742 (diff) |
Add two debug output helper functions
Change-Id: I38a234e6f4a3fc5e0f17cfd9a0068d2081b6c654
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108099
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108100
Tested-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/quartz/utils.h | 2 | ||||
-rw-r--r-- | vcl/quartz/utils.cxx | 26 |
2 files changed, 28 insertions, 0 deletions
diff --git a/vcl/inc/quartz/utils.h b/vcl/inc/quartz/utils.h index a2a39f2605d2..759e47f72f2b 100644 --- a/vcl/inc/quartz/utils.h +++ b/vcl/inc/quartz/utils.h @@ -38,6 +38,8 @@ OUString GetOUString( CFStringRef ); OUString GetOUString( const NSString* ); CFStringRef CreateCFString( const OUString& ); NSString* CreateNSString( const OUString& ); +OUString NSStringArrayToOUString(NSArray* array); +OUString NSDictionaryKeysToOUString(NSDictionary* dict); std::ostream &operator <<(std::ostream& s, const CGRect &rRect); std::ostream &operator <<(std::ostream& s, const CGPoint &rPoint); diff --git a/vcl/quartz/utils.cxx b/vcl/quartz/utils.cxx index cc18eb0d409f..0182ec118886 100644 --- a/vcl/quartz/utils.cxx +++ b/vcl/quartz/utils.cxx @@ -85,6 +85,32 @@ NSString* CreateNSString( const OUString& rStr ) return [[NSString alloc] initWithCharacters: reinterpret_cast<unichar const *>(rStr.getStr()) length: rStr.getLength()]; } +OUString NSStringArrayToOUString(NSArray* array) +{ + OUString result = "["; + OUString sep; + for (unsigned i = 0; i < [array count]; i++) + { + result = result + sep + OUString::fromUtf8([[array objectAtIndex:i] UTF8String]); + sep = ","; + } + result = result + "]"; + return result; +} + +OUString NSDictionaryKeysToOUString(NSDictionary* dict) +{ + OUString result = "{"; + OUString sep; + for (NSString *key in dict) + { + result = result + sep + OUString::fromUtf8([key UTF8String]); + sep = ","; + } + result = result + "}"; + return result; +} + std::ostream &operator <<(std::ostream& s, const CGRect &rRect) { #ifndef SAL_LOG_INFO |