summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-11-30 01:22:33 +0530
committerJan Holesovsky <kendy@collabora.com>2017-12-04 11:19:05 +0100
commit1fdd9b3fbfac165e944516d87f02d2f9ff6e3a58 (patch)
tree94bc243e21980aaa8a9c38bc6ed607c8d77c856c /desktop
parent1a3b7229b87901c8bc6cf3f86d79d68ddfba735b (diff)
lokdialog: Execute all UNO commands asynchronously for LOK
Especially in case of dialogs, Online cannot afford to wait till the call to UNO command returns as the same thread is responsible for doing many more tasks as well. And just adding this check doesn't seem to have any repurcussions, so I guess we are fine. Change-Id: Iac7c1413d90e8a264502dcf2bc280e09fd52683b Reviewed-on: https://gerrit.libreoffice.org/45527 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx2
-rw-r--r--desktop/source/lib/init.cxx6
2 files changed, 8 insertions, 0 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 2a995277081a..81a9f11e7eb5 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -529,6 +529,7 @@ void DesktopLOKTest::testPasteWriter()
CPPUNIT_ASSERT(pDocument->pClass->paste(pDocument, "text/plain;charset=utf-8", aText.getStr(), aText.getLength()));
pDocument->pClass->postUnoCommand(pDocument, ".uno:SelectAll", nullptr, false);
+ Scheduler::ProcessEventsToIdle();
char* pText = pDocument->pClass->getTextSelection(pDocument, "text/plain;charset=utf-8", nullptr);
CPPUNIT_ASSERT_EQUAL(OString("hello"), OString(pText));
free(pText);
@@ -902,6 +903,7 @@ void DesktopLOKTest::testSheetOperations()
pDocument->pClass->postUnoCommand(pDocument, ".uno:Remove",
"{ \"Index\": { \"type\": \"long\", \"value\": 3 } }", false);
+ Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(pDocument->pClass->getParts(pDocument), 6);
std::vector<OString> aExpected = { "FirstSheet", "Renamed", "Sheet3", "Sheet4", "Sheet5", "LastSheet" };
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index c4b922c75332..1c4922eacacf 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2329,6 +2329,12 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma
LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
std::vector<beans::PropertyValue> aPropertyValuesVector(jsonToPropertyValuesVector(pArguments));
+
+ beans::PropertyValue aSynchronMode;
+ aSynchronMode.Name = "SynchronMode";
+ aSynchronMode.Value <<= false;
+ aPropertyValuesVector.push_back(aSynchronMode);
+
int nView = SfxLokHelper::getView();
if (nView < 0)
return;