vcl/inc/quartz/utils.h |    2 ++
 vcl/quartz/utils.cxx   |   26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)

New commits:
commit 4b4eb3c365bebdaa6b07551dd5f5db28d40b7f31
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Mon Dec 21 15:15:54 2020 +0200
Commit:     Tor Lillqvist <t...@iki.fi>
CommitDate: Mon Apr 5 18:17:40 2021 +0300

    Add two debug output helper functions
    
    Change-Id: I38a234e6f4a3fc5e0f17cfd9a0068d2081b6c654
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108099
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Tor Lillqvist <t...@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
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to