Kaydet (Commit) 1fdd9b3f authored tarafından Pranav Kant's avatar Pranav Kant Kaydeden (comit) Jan Holesovsky

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/45527Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJan Holesovsky <kendy@collabora.com>
üst 1a3b7229
...@@ -529,6 +529,7 @@ void DesktopLOKTest::testPasteWriter() ...@@ -529,6 +529,7 @@ void DesktopLOKTest::testPasteWriter()
CPPUNIT_ASSERT(pDocument->pClass->paste(pDocument, "text/plain;charset=utf-8", aText.getStr(), aText.getLength())); CPPUNIT_ASSERT(pDocument->pClass->paste(pDocument, "text/plain;charset=utf-8", aText.getStr(), aText.getLength()));
pDocument->pClass->postUnoCommand(pDocument, ".uno:SelectAll", nullptr, false); pDocument->pClass->postUnoCommand(pDocument, ".uno:SelectAll", nullptr, false);
Scheduler::ProcessEventsToIdle();
char* pText = pDocument->pClass->getTextSelection(pDocument, "text/plain;charset=utf-8", nullptr); char* pText = pDocument->pClass->getTextSelection(pDocument, "text/plain;charset=utf-8", nullptr);
CPPUNIT_ASSERT_EQUAL(OString("hello"), OString(pText)); CPPUNIT_ASSERT_EQUAL(OString("hello"), OString(pText));
free(pText); free(pText);
...@@ -902,6 +903,7 @@ void DesktopLOKTest::testSheetOperations() ...@@ -902,6 +903,7 @@ void DesktopLOKTest::testSheetOperations()
pDocument->pClass->postUnoCommand(pDocument, ".uno:Remove", pDocument->pClass->postUnoCommand(pDocument, ".uno:Remove",
"{ \"Index\": { \"type\": \"long\", \"value\": 3 } }", false); "{ \"Index\": { \"type\": \"long\", \"value\": 3 } }", false);
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(pDocument->pClass->getParts(pDocument), 6); CPPUNIT_ASSERT_EQUAL(pDocument->pClass->getParts(pDocument), 6);
std::vector<OString> aExpected = { "FirstSheet", "Renamed", "Sheet3", "Sheet4", "Sheet5", "LastSheet" }; std::vector<OString> aExpected = { "FirstSheet", "Renamed", "Sheet3", "Sheet4", "Sheet5", "LastSheet" };
......
...@@ -2329,6 +2329,12 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma ...@@ -2329,6 +2329,12 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma
LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis); LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
std::vector<beans::PropertyValue> aPropertyValuesVector(jsonToPropertyValuesVector(pArguments)); std::vector<beans::PropertyValue> aPropertyValuesVector(jsonToPropertyValuesVector(pArguments));
beans::PropertyValue aSynchronMode;
aSynchronMode.Name = "SynchronMode";
aSynchronMode.Value <<= false;
aPropertyValuesVector.push_back(aSynchronMode);
int nView = SfxLokHelper::getView(); int nView = SfxLokHelper::getView();
if (nView < 0) if (nView < 0)
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment