[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/qa sw/source

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Mon Apr 12 21:02:46 UTC 2021


 desktop/qa/desktop_lib/test_desktop_lib.cxx |   36 ----------------------------
 sw/source/uibase/docvw/AnnotationWin2.cxx   |    5 ---
 2 files changed, 41 deletions(-)

New commits:
commit fa42f20dfa298370c6c4a01b6ee481e6c87d1fa9
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Tue Feb 2 11:57:23 2021 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Mon Apr 12 23:02:11 2021 +0200

    lok: remove annotation viewshell notifier
    
    Unfortunately the Annotation window sends cursor position
    to client side and it causes horrible effects like
    scrolling document due to different coordinates with the
    document.
    
    This patch will disable any notification to client side,
    also it removes a unit test related to check annotation
    cursor position.
    
    Change-Id: Ib432ef020c48bb1a9c82acc43ffccdb4230589c8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110328
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114021
    Tested-by: Henry Castro <hcastro at collabora.com>
    Reviewed-by: Henry Castro <hcastro at collabora.com>

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index ce99a9356d11..74d7668cd2e6 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -169,7 +169,6 @@ public:
     void testTrackChanges();
     void testRedlineCalc();
     void testPaintPartTile();
-    void testWriterCommentInsertCursor();
 #if HAVE_MORE_FONTS
     void testGetFontSubset();
 #endif
@@ -231,7 +230,6 @@ public:
     CPPUNIT_TEST(testTrackChanges);
     CPPUNIT_TEST(testRedlineCalc);
     CPPUNIT_TEST(testPaintPartTile);
-    CPPUNIT_TEST(testWriterCommentInsertCursor);
 #if HAVE_MORE_FONTS
     CPPUNIT_TEST(testGetFontSubset);
 #endif
@@ -2047,40 +2045,6 @@ void DesktopLOKTest::testPaintPartTile()
     //CPPUNIT_ASSERT(aView1.m_bTilesInvalidated);
 }
 
-void DesktopLOKTest::testWriterCommentInsertCursor()
-{
-    // Load a document and type a character into the body text of the second view.
-    LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
-    pDocument->m_pDocumentClass->initializeForRendering(pDocument, "{}");
-    ViewCallback aView1(pDocument);
-    pDocument->m_pDocumentClass->createView(pDocument);
-    pDocument->m_pDocumentClass->initializeForRendering(pDocument, "{}");
-    ViewCallback aView2(pDocument);
-    pDocument->m_pDocumentClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 'x', 0);
-    pDocument->m_pDocumentClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYUP, 'x', 0);
-    Scheduler::ProcessEventsToIdle();
-    tools::Rectangle aBodyCursor = aView2.m_aOwnCursor;
-
-    // Now insert a comment and make sure that the comment's cursor is shown,
-    // not the body text's one.
-    aView1.m_aOwnCursor.SetEmpty();
-    const int nCtrlAltC = KEY_MOD1 + KEY_MOD2 + 512 + 'c' - 'a';
-    pDocument->m_pDocumentClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 'c', nCtrlAltC);
-    pDocument->m_pDocumentClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYUP, 'c', nCtrlAltC);
-    Scheduler::ProcessEventsToIdle();
-    // Wait for SfxBindings to actually update the state, which updated the
-    // cursor as well.
-    osl::Thread::wait(std::chrono::seconds(1));
-    Scheduler::ProcessEventsToIdle();
-    // This failed: the body cursor was shown right after inserting a comment.
-    CPPUNIT_ASSERT(aView2.m_aOwnCursor.getX() > aBodyCursor.getX());
-    // This failed, the first view's cursor also jumped when the second view
-    // inserted the comment.
-    CPPUNIT_ASSERT(aView1.m_aOwnCursor.IsEmpty());
-
-    Scheduler::ProcessEventsToIdle();
-}
-
 #if HAVE_MORE_FONTS
 void DesktopLOKTest::testGetFontSubset()
 {
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 54ea5e58dc68..893ae51c0330 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -926,11 +926,6 @@ void SwAnnotationWin::DoResize()
 
     mpOutliner->SetPaperSize( PixelToLogic( Size(aWidth,aHeight) ) ) ;
 
-    if (comphelper::LibreOfficeKit::isActive() && !mpOutlinerView->GetViewShell())
-    {
-        mpOutlinerView->RegisterViewShell(&mrView);
-    }
-
     if (!mpVScrollbar->IsVisible())
     {   // if we do not have a scrollbar anymore, we want to see the complete text
         mpOutlinerView->SetVisArea( PixelToLogic( tools::Rectangle(0,0,aWidth,aHeight) ) );


More information about the Libreoffice-commits mailing list