From 21e96548719b77310da5e2bae91de52cc468960b Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 21 Dec 2020 15:18:21 +0200 Subject: Improve SAL_INFO output for clipboard operations on iOS Change-Id: Id9ed115067655c62346f765ddc3ed9bdce05ab9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108101 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tor Lillqvist Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108103 Tested-by: Tor Lillqvist --- vcl/ios/DataFlavorMapping.cxx | 5 ++++- vcl/ios/clipboard.cxx | 1 + vcl/ios/iOSTransferable.cxx | 13 +++---------- 3 files changed, 8 insertions(+), 11 deletions(-) (limited to 'vcl/ios') diff --git a/vcl/ios/DataFlavorMapping.cxx b/vcl/ios/DataFlavorMapping.cxx index 88b0e6199818..037939b2c57c 100644 --- a/vcl/ios/DataFlavorMapping.cxx +++ b/vcl/ios/DataFlavorMapping.cxx @@ -560,8 +560,11 @@ DataFlavorMapper::typesArrayToFlavorSequence(NSArray* types) const { flavors.realloc(flavors.getLength() + 1); flavors[flavors.getLength() - 1] = oOOFlavor; + } + else + { SAL_INFO("vcl.ios.clipboard", - "Mapped " << [sysFormat UTF8String] << " to " << oOOFlavor.MimeType); + "Was not able to map " << [sysFormat UTF8String] << " to an internal flavour"); } } diff --git a/vcl/ios/clipboard.cxx b/vcl/ios/clipboard.cxx index b60cda1bef4d..ad0af57e3995 100644 --- a/vcl/ios/clipboard.cxx +++ b/vcl/ios/clipboard.cxx @@ -74,6 +74,7 @@ void SAL_CALL iOSClipboard::setContents( dict[types[i]] = pBoardData; } } + SAL_INFO("vcl.ios.clipboard", "Setting pasteboard items: " << NSDictionaryKeysToOUString(dict)); [mPasteboard setItems:array options:@{}]; // We don't keep a copy of the clipboard contents around in-process, so fire the lost clipboard diff --git a/vcl/ios/iOSTransferable.cxx b/vcl/ios/iOSTransferable.cxx index 9ec27867fb0b..1ae2277014b6 100644 --- a/vcl/ios/iOSTransferable.cxx +++ b/vcl/ios/iOSTransferable.cxx @@ -25,6 +25,8 @@ #include #include +#include + #include "iOSTransferable.hxx" #include "DataFlavorMapping.hxx" @@ -143,16 +145,7 @@ void iOSTransferable::initClipboardItemList() throw RuntimeException("Cannot get clipboard data", static_cast(this)); } -#ifdef SAL_LOG_INFO - NSString* types = @""; - for (unsigned i = 0; i < [pboardFormats count]; i++) - { - if ([types length] > 0) - types = [types stringByAppendingString:@", "]; - types = [types stringByAppendingString:[pboardFormats objectAtIndex:i]]; - } - SAL_INFO("vcl.ios.clipboard", "Types on clipboard: " << [types UTF8String]); -#endif + SAL_INFO("vcl.ios.clipboard", "Types on clipboard: " << NSStringArrayToOUString(pboardFormats)); mFlavorList = mDataFlavorMapper->typesArrayToFlavorSequence(pboardFormats); } -- cgit