desktop/qa/desktop_lib/test_desktop_lib.cxx  |   10 ++--
 desktop/source/lib/init.cxx                  |   16 +++++-
 desktop/source/lib/lokinteractionhandler.cxx |    2 
 sc/source/ui/app/inputwin.cxx                |    7 ++
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   64 ---------------------------
 sfx2/source/control/dispatch.cxx             |    4 -
 6 files changed, 27 insertions(+), 76 deletions(-)

New commits:
commit d2bb93e299f42e2ab4ea8940fb4dc5da01a386b6
Author:     Ashod Nakashian <ashod.nakash...@collabora.co.uk>
AuthorDate: Thu Aug 9 23:14:34 2018 -0400
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Jul 29 21:21:44 2019 +0200

    sfx2: Re-enable the sidebars for LOK
    
    This re-enables the sidebars for LOK, which were
    disabled to avoid overheads.
    
    Also, fixes a regression where editing stopped
    when loading a new view because the sidebar window
    creation killed the edit view.
    
    Revert "Avoid various desktop GUI elements when used from LibreOfficeKit"
    This reverts commit c0b70ec34d5e056bb92a66cbf83838923cb41fee.
    
    Also (added by Noel to the above commit)
    
    (1) Comment out parts DesktopLOKTest::testPaintPartTile test that
    trigger a crash. We are installing a callback that points to something
    on the stack, and then not removing that callback, resulting in calls
    to random stack memory. There is a further problem in the LOK code in
    that we cannot uninstall a callback when we have multiple views
    because the uninstall code in doc_registerCallback can only remove a
    callback for the __current__ view, which I do not fix here.
    
    (2) prevent code from accidentally creating empty entries in the
    mpCallbackFlushHandlers map, which is what happens when you use
    the index operator on map, which results in a crash in
    doc_registerCallback because the std::shared_ptr is empty.
    
    (3) In SdTiledRenderingTest, only turn off LOK via
    LibreOfficeKit::setActive(false) once the document has been torn down.
    Otherwise, we don't remove entries from the statically allocated
    s_pLOKWindowsMap map in vcl/source/window/window.cxx, which
    means that at process exit, we have dangling Window objects.
    
    Reviewed-on: https://gerrit.libreoffice.org/71165
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>
    Tested-by: Jan Holesovsky <ke...@collabora.com>
    (cherry picked from commit 88565c3662c6fde240c98a9b4f2ce6dfbcf4094e)
    
    Change-Id: I06b06a990f05c06b1889fa89b698dff6f494e09c
    Reviewed-on: https://gerrit.libreoffice.org/76466
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index f10e1fb0f035..e0647da2f6af 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -1865,17 +1865,17 @@ void DesktopLOKTest::testPaintPartTile()
     // Load an impress doc of 2 slides.
     comphelper::LibreOfficeKit::setActive();
 
-    ViewCallback aView1;
-    ViewCallback aView2;
+//    ViewCallback aView1;
+//    ViewCallback aView2;
     LibLODocument_Impl* pDocument = loadDoc("2slides.odp");
     pDocument->m_pDocumentClass->initializeForRendering(pDocument, "{}");
-    pDocument->m_pDocumentClass->registerCallback(pDocument, 
&ViewCallback::callback, &aView1);
+//    pDocument->m_pDocumentClass->registerCallback(pDocument, 
&ViewCallback::callback, &aView1);
     int nView1 = pDocument->m_pDocumentClass->getView(pDocument);
 
     // Create a second view.
     pDocument->m_pDocumentClass->createView(pDocument);
     pDocument->m_pDocumentClass->initializeForRendering(pDocument, "{}");
-    pDocument->m_pDocumentClass->registerCallback(pDocument, 
&ViewCallback::callback, &aView2);
+//    pDocument->m_pDocumentClass->registerCallback(pDocument, 
&ViewCallback::callback, &aView2);
 
     // Go to the second slide in the second view.
     pDocument->m_pDocumentClass->setPart(pDocument, 1);
@@ -1894,7 +1894,7 @@ void DesktopLOKTest::testPaintPartTile()
 
     // Type again.
     Scheduler::ProcessEventsToIdle();
-    aView1.m_bTilesInvalidated = false;
+//    aView1.m_bTilesInvalidated = false;
     pDocument->m_pDocumentClass->postKeyEvent(pDocument, 
LOK_KEYEVENT_KEYINPUT, 'x', 0);
     pDocument->m_pDocumentClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYUP, 
'x', 0);
     Scheduler::ProcessEventsToIdle();
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6bed02b869e6..f8d93534f44a 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2711,8 +2711,12 @@ static void doc_paintPartTile(LibreOfficeKitDocument* 
pThis,
     }
 
     // Disable callbacks while we are painting.
-    if (nOrigViewId >= 0 && pDocument->mpCallbackFlushHandlers[nOrigViewId])
-        
pDocument->mpCallbackFlushHandlers[nOrigViewId]->setPartTilePainting(true);
+    if (nOrigViewId >= 0)
+    {
+        auto findIt = pDocument->mpCallbackFlushHandlers.find(nOrigViewId);
+        if (findIt != pDocument->mpCallbackFlushHandlers.end())
+            findIt->second->setPartTilePainting(true);
+    }
 
     try
     {
@@ -2762,8 +2766,12 @@ static void doc_paintPartTile(LibreOfficeKitDocument* 
pThis,
         // Nothing to do but restore the PartTilePainting flag.
     }
 
-    if (nOrigViewId >= 0 && pDocument->mpCallbackFlushHandlers[nOrigViewId])
-        
pDocument->mpCallbackFlushHandlers[nOrigViewId]->setPartTilePainting(false);
+    if (nOrigViewId >= 0)
+    {
+        auto findIt = pDocument->mpCallbackFlushHandlers.find(nOrigViewId);
+        if (findIt != pDocument->mpCallbackFlushHandlers.end())
+            findIt->second->setPartTilePainting(false);
+    }
 }
 
 static int doc_getTileMode(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* 
/*pThis*/)
diff --git a/desktop/source/lib/lokinteractionhandler.cxx 
b/desktop/source/lib/lokinteractionhandler.cxx
index 4b566d106d01..f15ef67e0052 100644
--- a/desktop/source/lib/lokinteractionhandler.cxx
+++ b/desktop/source/lib/lokinteractionhandler.cxx
@@ -118,7 +118,7 @@ void 
LOKInteractionHandler::postError(css::task::InteractionClassification class
     boost::property_tree::write_json(aStream, aTree);
 
     std::size_t nView = SfxViewShell::Current() ? SfxLokHelper::getView() : 0;
-    if (m_pLOKDocument && m_pLOKDocument->mpCallbackFlushHandlers.size() > 
nView && m_pLOKDocument->mpCallbackFlushHandlers[nView])
+    if (m_pLOKDocument && m_pLOKDocument->mpCallbackFlushHandlers.count(nView))
         
m_pLOKDocument->mpCallbackFlushHandlers[nView]->queue(LOK_CALLBACK_ERROR, 
aStream.str().c_str());
     else if (m_pLOKit->mpCallback)
         m_pLOKit->mpCallback(LOK_CALLBACK_ERROR, aStream.str().c_str(), 
m_pLOKit->mpCallbackData);
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 5732411a5bbf..3d0f598d902f 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -69,6 +69,7 @@
 #include <comphelper/string.hxx>
 #include <com/sun/star/frame/XLayoutManager.hpp>
 #include <helpids.h>
+#include <comphelper/lok.hxx>
 
 namespace com::sun::star::accessibility { class XAccessible; }
 
@@ -245,7 +246,11 @@ ScInputWindow::ScInputWindow( vcl::Window* pParent, const 
SfxBindings* pBind ) :
             pInputHdl->SetMode( SC_INPUT_TABLE ); // Focus ends up at the 
bottom anyways
     }
     else if (pViewSh)
-        pViewSh->UpdateInputHandler(true); // Absolutely necessary update
+    {
+        // Don't stop editing in LOK a remote user might be editing.
+        const bool bStopEditing = !comphelper::LibreOfficeKit::isActive();
+        pViewSh->UpdateInputHandler(true, bStopEditing); // Absolutely 
necessary update
+    }
 
     SetToolbarLayoutMode( ToolBoxLayoutMode::Locked );
 
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 40d9ee3f511e..1b1d84b334dd 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -222,6 +222,7 @@ void SdTiledRenderingTest::tearDown()
     if (m_pXmlBuffer)
         xmlBufferFree(m_pXmlBuffer);
 
+    comphelper::LibreOfficeKit::setActive(false);
     test::BootstrapFixture::tearDown();
 }
 
@@ -368,7 +369,6 @@ void SdTiledRenderingTest::testRegisterCallback()
     CPPUNIT_ASSERT(!m_aInvalidation.IsEmpty());
     ::tools::Rectangle aTopLeft(0, 0, 256*15, 256*15); // 1 px = 15 twips, 
assuming 96 DPI.
     CPPUNIT_ASSERT(m_aInvalidation.IsOver(aTopLeft));
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testPostKeyEvent()
@@ -398,7 +398,6 @@ void SdTiledRenderingTest::testPostKeyEvent()
     rEditView.SetSelection(aWordSelection);
     // Did we enter the expected character?
     CPPUNIT_ASSERT_EQUAL(OUString("xx"), rEditView.GetSelected());
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testPostMouseEvent()
@@ -433,7 +432,6 @@ void SdTiledRenderingTest::testPostMouseEvent()
     CPPUNIT_ASSERT(pView->GetTextEditObject());
     // The new cursor position must be before the first word.
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), 
rEditView.GetSelection().nStartPos);
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testSetTextSelection()
@@ -463,7 +461,6 @@ void SdTiledRenderingTest::testSetTextSelection()
     pXImpressDocument->setTextSelection(LOK_SETTEXTSELECTION_END, aEnd.getX(), 
aEnd.getY());
     // The new selection must include the ending dot, too -- but not the first 
word.
     CPPUNIT_ASSERT_EQUAL(OUString("bbb."), rEditView.GetSelected());
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testGetTextSelection()
@@ -488,7 +485,6 @@ void SdTiledRenderingTest::testGetTextSelection()
 
     // Make sure returned RTF is not empty.
     
CPPUNIT_ASSERT(!apitest::helper::transferable::getTextSelection(pXImpressDocument->getSelection(),
 "text/rtf").isEmpty());
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testSetGraphicSelection()
@@ -525,8 +521,6 @@ void SdTiledRenderingTest::testSetGraphicSelection()
     // Check that a resize happened, but aspect ratio is not kept.
     CPPUNIT_ASSERT_EQUAL(aShapeBefore.getWidth(), aShapeAfter.getWidth());
     CPPUNIT_ASSERT(aShapeBefore.getHeight() < aShapeAfter.getHeight());
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testUndoShells()
@@ -549,7 +543,6 @@ void SdTiledRenderingTest::testUndoShells()
     sal_Int32 nView1 = SfxLokHelper::getView();
     // This was -1, SdUndoGroup did not track what view shell created it.
     CPPUNIT_ASSERT_EQUAL(ViewShellId(nView1), 
pUndoManager->GetUndoAction()->GetViewShellId());
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testResetSelection()
@@ -575,7 +568,6 @@ void SdTiledRenderingTest::testResetSelection()
     // Now use resetSelection() to reset the selection.
     pXImpressDocument->resetSelection();
     CPPUNIT_ASSERT(!pView->GetTextEditObject());
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 static void lcl_search(const OUString& rKey, bool bFindAll = false)
@@ -621,7 +613,6 @@ void SdTiledRenderingTest::testSearch()
     // This should trigger the not-found callback.
     lcl_search("ccc");
     CPPUNIT_ASSERT_EQUAL(false, m_bFound);
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testSearchAll()
@@ -641,7 +632,6 @@ void SdTiledRenderingTest::testSearchAll()
     lcl_search("second", /*bFindAll=*/true);
     // This was 0: no SET_PART was emitted.
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), m_nPart);
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testSearchAllSelections()
@@ -656,7 +646,6 @@ void SdTiledRenderingTest::testSearchAllSelections()
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), m_nPart);
     // This was 1: only the first match was highlighted.
     CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(2), m_aSelection.size());
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testSearchAllNotifications()
@@ -671,7 +660,6 @@ void SdTiledRenderingTest::testSearchAllNotifications()
     CPPUNIT_ASSERT_EQUAL(0, m_nSelectionBeforeSearchResult);
     // But we do get the selection of the first hit.
     CPPUNIT_ASSERT(m_nSelectionAfterSearchResult > 0);
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testSearchAllFollowedBySearch()
@@ -687,7 +675,6 @@ void SdTiledRenderingTest::testSearchAllFollowedBySearch()
     // This used to give wrong result: 'search' after 'search all' still
     // returned 'third'
     CPPUNIT_ASSERT_EQUAL(OString("match"), 
apitest::helper::transferable::getTextSelection(pXImpressDocument->getSelection(),
 "text/plain;charset=utf-8"));
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testDontSearchInMasterPages()
@@ -701,8 +688,6 @@ void SdTiledRenderingTest::testDontSearchInMasterPages()
     // the master page)
     lcl_search("date");
     CPPUNIT_ASSERT_EQUAL(false, m_bFound);
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 namespace
@@ -817,8 +802,6 @@ void SdTiledRenderingTest::testInsertDeletePage()
 
     // the document has 1 slide
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(1), 
pDoc->GetSdPageCount(PageKind::Standard));
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testInsertTable()
@@ -846,8 +829,6 @@ void SdTiledRenderingTest::testInsertTable()
 
     CPPUNIT_ASSERT(aPos.X() != 0);
     CPPUNIT_ASSERT(aPos.Y() != 0);
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testPartHash()
@@ -863,7 +844,6 @@ void SdTiledRenderingTest::testPartHash()
 
     // check part that it does not exists
     CPPUNIT_ASSERT(pDoc->getPartHash(100).isEmpty());
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testResizeTable()
@@ -911,7 +891,6 @@ void SdTiledRenderingTest::testResizeTable()
     sal_Int32 nActualRow2 = xRow2->getPropertyValue("Size").get<sal_Int32>();
     // Expected was 4000, actual was 4572, i.e. the second row after undo was 
larger than expected.
     CPPUNIT_ASSERT_EQUAL(nExpectedRow2, nActualRow2);
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testResizeTableColumn()
@@ -965,7 +944,6 @@ void SdTiledRenderingTest::testResizeTableColumn()
     CPPUNIT_ASSERT_EQUAL(nExpectedColumn2, nActualColumn2);
     xmlFreeDoc(pXmlDoc);
     pXmlDoc = nullptr;
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 /// A view callback tracks callbacks invoked on one specific view.
@@ -1098,8 +1076,6 @@ void SdTiledRenderingTest::testViewCursors()
     CPPUNIT_ASSERT(aView2.m_bGraphicSelectionInvalidated);
     mxComponent->dispose();
     mxComponent.clear();
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testViewCursorParts()
@@ -1140,7 +1116,6 @@ void SdTiledRenderingTest::testViewCursorParts()
 
     mxComponent->dispose();
     mxComponent.clear();
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testCursorViews()
@@ -1190,7 +1165,6 @@ void SdTiledRenderingTest::testCursorViews()
 
     mxComponent->dispose();
     mxComponent.clear();
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testViewLock()
@@ -1221,7 +1195,6 @@ void SdTiledRenderingTest::testViewLock()
 
     mxComponent->dispose();
     mxComponent.clear();
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testUndoLimiting()
@@ -1265,7 +1238,6 @@ void SdTiledRenderingTest::testUndoLimiting()
 
     mxComponent->dispose();
     mxComponent.clear();
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testCreateViewGraphicSelection()
@@ -1305,7 +1277,6 @@ void 
SdTiledRenderingTest::testCreateViewGraphicSelection()
 
     mxComponent->dispose();
     mxComponent.clear();
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testCreateViewTextCursor()
@@ -1362,7 +1333,6 @@ void SdTiledRenderingTest::testCreateViewTextCursor()
 
     mxComponent->dispose();
     mxComponent.clear();
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testTdf102223()
@@ -1404,8 +1374,6 @@ void SdTiledRenderingTest::testTdf102223()
     rEditView2.SetSelection(ESelection(0, 0, 0, 1)); // start para, start 
char, end para, end char.
     const SvxFontHeightItem& rItem2 = 
rEditView2.GetAttribs().Get(EE_CHAR_FONTHEIGHT);
     CPPUNIT_ASSERT_EQUAL(int(1411), static_cast<int>(rItem2.GetHeight()));
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testPostKeyEventInvalidation()
@@ -1451,7 +1419,6 @@ void SdTiledRenderingTest::testPostKeyEventInvalidation()
 
     mxComponent->dispose();
     mxComponent.clear();
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 /**
@@ -1518,8 +1485,6 @@ void SdTiledRenderingTest::testTdf103083()
 
     const SfxItemSet& rParagraphItemSet2 = 
pTextObject->GetOutlinerParaObject()->GetTextObject().GetParaAttribs(2);
     CPPUNIT_ASSERT_EQUAL(sal_uInt16(3), rParagraphItemSet2.Count());
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 /**
@@ -1576,8 +1541,6 @@ void SdTiledRenderingTest::testTdf104405()
     // the following name has a compiler-dependent part
     CPPUNIT_ASSERT_EQUAL(OUString("2"), getXPath(pXmlDoc, aPrefix, "value"));
     xmlFreeDoc(pXmlDoc);
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testTdf81754()
@@ -1612,7 +1575,6 @@ void SdTiledRenderingTest::testTdf81754()
     CPPUNIT_ASSERT_EQUAL(OUString("Somethingxx"), aEdit.GetText(0));
 
     xDocShRef->DoClose();
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testTdf105502()
@@ -1669,7 +1631,6 @@ void SdTiledRenderingTest::testTdf105502()
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), aLastCell.mnRow);
 
     xmlFreeDoc(pXmlDoc);
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testCommentCallbacks()
@@ -1785,7 +1746,6 @@ void SdTiledRenderingTest::testCommentCallbacks()
     mxComponent.clear();
 
     comphelper::LibreOfficeKit::setTiledAnnotations(true);
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testMultiViewInsertDeletePage()
@@ -1832,8 +1792,6 @@ void SdTiledRenderingTest::testMultiViewInsertDeletePage()
 
     mxComponent->dispose();
     mxComponent.clear();
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testDisableUndoRepair()
@@ -1889,8 +1847,6 @@ void SdTiledRenderingTest::testDisableUndoRepair()
         CPPUNIT_ASSERT(pUInt32Item);
         CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(SID_REPAIRPACKAGE), 
pUInt32Item->GetValue());
     }
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testDocumentRepair()
@@ -1942,8 +1898,6 @@ void SdTiledRenderingTest::testDocumentRepair()
         CPPUNIT_ASSERT_EQUAL(true, pItem1->GetValue());
         CPPUNIT_ASSERT_EQUAL(true, pItem2->GetValue());
     }
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testLanguageStatus()
@@ -1962,8 +1916,6 @@ void SdTiledRenderingTest::testLanguageStatus()
         CPPUNIT_ASSERT(dynamic_cast< const SfxStringItem* >(xItem1.get()));
         CPPUNIT_ASSERT(dynamic_cast< const SfxStringItem* >(xItem2.get()));
     }
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testLanguageAllText()
@@ -1991,8 +1943,6 @@ void SdTiledRenderingTest::testLanguageAllText()
     // Without the accompanying fix in place, this test would have failed with 
'Expected: en;
     // Actual: hu', as the shape text language was not set.
     CPPUNIT_ASSERT_EQUAL(OUString("en"), aLocale.Language);
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testDefaultView()
@@ -2014,7 +1964,6 @@ void SdTiledRenderingTest::testDefaultView()
         CPPUNIT_ASSERT_EQUAL(true, pImpressView->GetValue());
         CPPUNIT_ASSERT_EQUAL(false, pNotesView->GetValue());
     }
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testIMESupport()
@@ -2054,8 +2003,6 @@ void SdTiledRenderingTest::testIMESupport()
     rEditView.SetSelection(aWordSelection);
     // content contains only the last IME composition, not all
     CPPUNIT_ASSERT_EQUAL(OUString("x").concat(aInputs[aInputs.size() - 1]), 
rEditView.GetSelected());
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testTdf115783()
@@ -2123,8 +2070,6 @@ void SdTiledRenderingTest::testTdf115783()
     int nHeight = xPropertySet->getPropertyValue("CharHeight").get<float>();
     // Make sure that the single font size for the cell is the expected one.
     CPPUNIT_ASSERT_EQUAL(12, nHeight);
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testPasteTextOnSlide()
@@ -2188,8 +2133,6 @@ void SdTiledRenderingTest::testPasteTextOnSlide()
     Point aPos = pTextObj->GetLastBoundRect().TopLeft();
     CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<long>(12990), aPos.getX(), 100);
     CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<long>(7393), aPos.getY(), 100);
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testTdf115873()
@@ -2226,7 +2169,6 @@ void SdTiledRenderingTest::testTdf115873()
     // This failed, single-click did not result in a shape selection (only
     // double-click did).
     CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), rMarkList.GetMarkCount());
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testTdf115873Group()
@@ -2243,7 +2185,6 @@ void SdTiledRenderingTest::testTdf115873Group()
     // This failed, Fill() and IsEqualToDoc() were out of sync for group
     // shapes.
     CPPUNIT_ASSERT(pObjects->IsEqualToDoc(pXImpressDocument->GetDoc()));
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testCutSelectionChange()
@@ -2283,7 +2224,6 @@ void SdTiledRenderingTest::testCutSelectionChange()
 
     // Selection is removed
     CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(0), m_aSelection.size());
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testRegenerateDiagram()
@@ -2335,8 +2275,6 @@ void SdTiledRenderingTest::testRegenerateDiagram()
 
     // diagram content (child shape count) should be the same as in the 
beginning
     CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(4), 
pActualPage->GetObj(0)->GetSubList()->GetObjCount());
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(SdTiledRenderingTest);
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 11817bfd5028..51e04d3966d0 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -1158,7 +1158,7 @@ void SfxDispatcher::Update_Impl( bool bForce )
         return;
 
     SfxViewFrame* pTop = xImp->pFrame ? xImp->pFrame->GetTopViewFrame() : 
nullptr;
-    bool bUIActive = pTop && pTop->GetBindings().GetDispatcher() == this && 
!comphelper::LibreOfficeKit::isActive();
+    bool bUIActive = pTop && pTop->GetBindings().GetDispatcher() == this;
 
     if ( !bUIActive && pTop && GetBindings() == &pTop->GetBindings() )
         // keep own tools internally for collecting
@@ -1212,7 +1212,7 @@ void SfxDispatcher::Update_Impl( bool bForce )
         bIsActive = true;
 
     Update_Impl_( bUIActive, !bIsIPActive, bIsIPActive, pWorkWin );
-    if ( (bUIActive || bIsActive) && !comphelper::LibreOfficeKit::isActive() )
+    if (bUIActive || bIsActive)
         pWorkWin->UpdateObjectBars_Impl();
 
     if ( pBindings )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to