[Libreoffice-commits] core.git: vcl/inc vcl/quartz
Tor Lillqvist (via logerrit)
logerrit at kemper.freedesktop.org
Mon Dec 21 22:47:18 UTC 2020
vcl/inc/quartz/utils.h | 2 ++
vcl/quartz/utils.cxx | 26 ++++++++++++++++++++++++++
2 files changed, 28 insertions(+)
New commits:
commit b126def60fc5280d40bc25db86748ed798c8548d
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Mon Dec 21 15:15:54 2020 +0200
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Dec 21 23:46:34 2020 +0100
Add two debug output helper functions
Change-Id: I38a234e6f4a3fc5e0f17cfd9a0068d2081b6c654
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108099
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tor Lillqvist <tml at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108100
Tested-by: Tor Lillqvist <tml at collabora.com>
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
More information about the Libreoffice-commits
mailing list