diff options
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 |