summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2017-01-27 19:19:43 +0100
committerJan Holesovsky <kendy@collabora.com>2017-11-15 17:07:04 +0100
commit32f7e56c68e2ed6853714dfaefd60f097440f5e5 (patch)
tree35b120a318d90813b382b7a4a9e356586c821185
parentd9772f42da4f2f2aa2a1afbc83594889b5c3d5cf (diff)
Revert "Lok: support for batch API calls"
This was for the moment removed from the online.git, so let's disable the API bits too before it shows this is really necessary. Reverts also: Revert "Lok: unittest batch API" Change-Id: I7bf3fe62d1e73b6f233992d51f587868a78f4bec
-rw-r--r--desktop/inc/lib/init.hxx4
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx45
-rw-r--r--desktop/source/lib/init.cxx26
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.h10
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.hxx10
5 files changed, 0 insertions, 95 deletions
diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx
index 2dd4b51c8942..c8162c1fea2f 100644
--- a/desktop/inc/lib/init.hxx
+++ b/desktop/inc/lib/init.hxx
@@ -41,10 +41,6 @@ namespace desktop {
void setEventLatch(const bool bEventLatch)
{
m_bEventLatch = bEventLatch;
- if (!IsActive())
- {
- Start();
- }
}
bool isEventLatchOn() const { return m_bEventLatch; }
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 50cf4d633bd3..8684199da1ab 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -101,7 +101,6 @@ public:
void testContextMenuImpress();
void testNotificationCompression();
void testTileInvalidationCompression();
- void testBatching();
void testPartInInvalidation();
void testRedlineWriter();
void testTrackChanges();
@@ -142,7 +141,6 @@ public:
CPPUNIT_TEST(testContextMenuImpress);
CPPUNIT_TEST(testNotificationCompression);
CPPUNIT_TEST(testTileInvalidationCompression);
- CPPUNIT_TEST(testBatching);
CPPUNIT_TEST(testPartInInvalidation);
CPPUNIT_TEST(testRedlineWriter);
CPPUNIT_TEST(testTrackChanges);
@@ -1639,49 +1637,6 @@ void DesktopLOKTest::testPartInInvalidation()
}
}
-void DesktopLOKTest::testBatching()
-{
- LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
-
- comphelper::LibreOfficeKit::setPartInInvalidation(true);
- comphelper::ScopeGuard aGuard([]()
- {
- comphelper::LibreOfficeKit::setPartInInvalidation(false);
- });
-
- std::vector<std::tuple<int, std::string>> notifs;
- std::unique_ptr<CallbackFlushHandler> handler(new CallbackFlushHandler(pDocument, callbackCompressionTest, &notifs));
-
- // Enable Batch mode.
- handler->setEventLatch(true);
-
- handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "0, 0, 239, 239, 0");
- handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "EMPTY, 0");
-
- Scheduler::ProcessEventsToIdle();
-
- CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), notifs.size());
-
- handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "0, 0, 239, 240, 0");
- handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "-121, -121, 300, 300, 0");
- handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "0, 0, -32767, -32767, 0");
-
- Scheduler::ProcessEventsToIdle();
-
- CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), notifs.size());
-
- // Disable Batch mode.
- handler->setEventLatch(false);
-
- Scheduler::ProcessEventsToIdle();
-
- CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), notifs.size());
-
- size_t i = 0;
- CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_INVALIDATE_TILES, (int)std::get<0>(notifs[i]));
- CPPUNIT_ASSERT_EQUAL(std::string("0, 0, 1000000000, 1000000000, 0"), std::get<1>(notifs[i++]));
-}
-
void DesktopLOKTest::testRedlineWriter()
{
// Load a Writer document, enable change recording and press a key.
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 3bbb7b98043d..11cffe2a67f1 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -608,8 +608,6 @@ static unsigned char* doc_renderFont(LibreOfficeKitDocument* pThis,
int* pFontWidth,
int* pFontHeight);
static char* doc_getPartHash(LibreOfficeKitDocument* pThis, int nPart);
-static void doc_beginBatch(LibreOfficeKitDocument* pThis);
-static void doc_endBatch(LibreOfficeKitDocument* pThis);
LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XComponent> &xComponent)
: mxComponent(xComponent)
@@ -656,8 +654,6 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XCompone
m_pDocumentClass->renderFont = doc_renderFont;
m_pDocumentClass->getPartHash = doc_getPartHash;
- m_pDocumentClass->beginBatch = doc_beginBatch;
- m_pDocumentClass->endBatch = doc_endBatch;
gDocumentClass = m_pDocumentClass;
}
@@ -3033,28 +3029,6 @@ unsigned char* doc_renderFont(LibreOfficeKitDocument* /*pThis*/,
return nullptr;
}
-static void doc_beginBatch(LibreOfficeKitDocument* pThis)
-{
- SolarMutexGuard aGuard;
-
- LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
- for (const auto& pair : pDocument->mpCallbackFlushHandlers)
- {
- pair.second->setEventLatch(true);
- }
-}
-
-static void doc_endBatch(LibreOfficeKitDocument* pThis)
-{
- SolarMutexGuard aGuard;
-
- LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
- for (const auto& pair : pDocument->mpCallbackFlushHandlers)
- {
- pair.second->setEventLatch(false);
- }
-}
-
static char* lo_getError (LibreOfficeKit *pThis)
{
SolarMutexGuard aGuard;
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index da6bba917b6a..2a5dbcabb817 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -252,16 +252,6 @@ struct _LibreOfficeKitDocumentClass
int* pArray,
size_t nSize);
- /// Starts a batch of operations.
- /// Events are emmitted only after ending the batch.
- /// @see lok::Document::endBatch();
- void (*beginBatch) (LibreOfficeKitDocument* pThis);
-
- /// Ends a batch of operations.
- /// @see lok::Document::beginBatch();
- void (*endBatch) (LibreOfficeKitDocument* pThis);
-
-
#endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
};
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 72fb7c2b3882..b5daebbb107a 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -452,16 +452,6 @@ public:
return mpDoc->pClass->getViewIds(mpDoc, pArray, nSize);
}
- inline void beginBatch()
- {
- mpDoc->pClass->beginBatch(mpDoc);
- }
-
- inline void endBatch()
- {
- mpDoc->pClass->endBatch(mpDoc);
- }
-
#endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
};