From d75505faccc9a86d9e76932ae022b660e01ad1a5 Mon Sep 17 00:00:00 2001
From: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Date: Tue, 8 Sep 2015 13:38:41 +0200
Subject: [PATCH] iOS: silence compiler warning about unimplemented
 'selectionRectsForRange'
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Implement a dummy method to silence the compiler.
After testing, this method seems to never be called. Which is
good, since the current IM API in Qt have little to offer to resolve
what is being asked. Until a need arise, we just return
an empty array.

Change-Id: I573eb8205a7e635a46d487ae175fb46e3a602001
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
---
 src/plugins/platforms/ios/qiostextresponder.mm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/plugins/platforms/ios/qiostextresponder.mm b/src/plugins/platforms/ios/qiostextresponder.mm
index 4e109f69214..c9120e848c9 100644
--- a/src/plugins/platforms/ios/qiostextresponder.mm
+++ b/src/plugins/platforms/ios/qiostextresponder.mm
@@ -738,6 +738,15 @@
     return toCGRect(startRect.united(endRect));
 }
 
+- (NSArray *)selectionRectsForRange:(UITextRange *)range
+{
+    Q_UNUSED(range);
+    // This method is supposed to return a rectangle for each line with selection. Since we don't
+    // expose an API in Qt/IM for getting this information, and since we never seems to be getting
+    // a call from UIKit for this, we return an empty array until a need arise.
+    return [[NSArray new] autorelease];
+}
+
 - (CGRect)caretRectForPosition:(UITextPosition *)position
 {
     Q_UNUSED(position);
-- 
GitLab