summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2021-01-18 19:39:07 +0100
committerTamás Zolnai <zolnaitamas2000@gmail.com>2021-01-19 11:45:29 +0100
commit2413e5edc15c8f23d2937d4c2692f4f9e8e91362 (patch)
tree068cf2fdfa3435e8881bdb2d3dab5e167964a19c
parentBump package version to 6.4.4-1 (diff)
downloadonline-2413e5edc15c8f23d2937d4c2692f4f9e8e91362.tar.gz
online-2413e5edc15c8f23d2937d4c2692f4f9e8e91362.zip
Switch to the correct view before calling getSelectionType() method.
This method needs to be called with having the correct view activated. It caused a crash in writer/simultaneous_typing multi-user cypress test. Signed-off-by: Tamás Zolnai <tamas.zolnai@collabora.com> Change-Id: I57dd58a635ce7ea127200a6a3f0cadc8c0861aaf (cherry picked from commit 218e47e65a5e59871b9670e4bad020cf389d17fc)
-rw-r--r--kit/ChildSession.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index 97ef7ced7b..03759cb9c7 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -1031,6 +1031,7 @@ bool ChildSession::getTextSelection(const char* /*buffer*/, int /*length*/, cons
}
std::string selection;
+ getLOKitDocument()->setView(_viewId);
const int selectionType = getLOKitDocument()->getSelectionType();
if (selectionType == LOK_SELTYPE_LARGE_TEXT || selectionType == LOK_SELTYPE_COMPLEX ||
(selection = getTextSelectionInternal(mimeType)).size() >= 1024 * 1024) // Don't return huge data.