editeng/source/editeng/editview.cxx       |    5 +++++
 editeng/source/outliner/outlvw.cxx        |    5 +++++
 include/editeng/editview.hxx              |    1 +
 include/editeng/outliner.hxx              |    1 +
 sw/source/uibase/docvw/AnnotationWin2.cxx |   12 ++++++------
 5 files changed, 18 insertions(+), 6 deletions(-)

New commits:
commit aadfeaff158316af1a868c66fa2fd78fb473c802
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Fri Jan 15 10:14:50 2021 -0400
Commit:     Henry Castro <hcas...@collabora.com>
CommitDate: Thu Jan 21 12:49:35 2021 +0100

    lok: fix incorrect invalidate cursor position
    
    When the comment is created and it's shown in the "Writer"
    application, it creates an initial output area:
    
    mpOutlinerView->SetOutputArea( PixelToLogic( tools::Rectangle(0,0,1,1) ) );
    
    Unfortunately, it causes that send to client side cursor position
    and scroll to the beginning of the document.
    
    Change-Id: I13e21c71328b7f05781e7cdeed082d6cc2b9d679
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109371
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>
    (cherry picked from commit 4618849a1cbba4e249ee13c3b6412337160a2816)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109732
    Tested-by: Jenkins
    Reviewed-by: Henry Castro <hcas...@collabora.com>

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index f044671e1c17..901e29e756c6 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -701,6 +701,11 @@ void EditView::RegisterViewShell(OutlinerViewShell* 
pViewShell)
     pImpEditView->RegisterViewShell(pViewShell);
 }
 
+const OutlinerViewShell* EditView::GetViewShell()
+{
+    return pImpEditView->GetViewShell();
+}
+
 void EditView::RegisterOtherShell(OutlinerViewShell* pOtherShell)
 {
     pImpEditView->RegisterOtherShell(pOtherShell);
diff --git a/editeng/source/outliner/outlvw.cxx 
b/editeng/source/outliner/outlvw.cxx
index 8ba3a28c87f0..487431995636 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -1382,6 +1382,11 @@ void OutlinerView::RegisterViewShell(OutlinerViewShell* 
pViewShell)
     pEditView->RegisterViewShell(pViewShell);
 }
 
+const OutlinerViewShell* OutlinerView::GetViewShell()
+{
+    return pEditView->GetViewShell();
+}
+
 Color const & OutlinerView::GetBackgroundColor() const
 {
     return pEditView->GetBackgroundColor();
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index debc7b6efe71..bcf031559bed 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -258,6 +258,7 @@ public:
 
     /// Informs this edit view about which view shell contains it.
     void RegisterViewShell(OutlinerViewShell* pViewShell);
+    const OutlinerViewShell* GetViewShell();
     /// Informs this edit view about which other shell listens to it.
     void RegisterOtherShell(OutlinerViewShell* pOtherShell);
 
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 0ffa5721c203..cfcfe85191d6 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -258,6 +258,7 @@ public:
 
     /// Informs this edit view about which view shell contains it.
     void RegisterViewShell(OutlinerViewShell* pViewShell);
+    const OutlinerViewShell* GetViewShell();
 
     SfxItemSet  GetAttribs();
 
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx 
b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 3fe30564cc44..9a067038d773 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -530,12 +530,6 @@ void SwAnnotationWin::InitControls()
 
     mpOutlinerView->SetAttribs(DefaultItem());
 
-    if (comphelper::LibreOfficeKit::isActive())
-    {
-        // If there is a callback already registered, inform the new outliner 
view about it.
-        mpOutlinerView->RegisterViewShell(&mrView);
-    }
-
     //create Scrollbars
     mpVScrollbar = VclPtr<SidebarScrollBar>::Create(*this, WB_3DLOOK 
|WB_VSCROLL|WB_DRAG, mrView);
     mpVScrollbar->EnableNativeWidget(false);
@@ -931,6 +925,12 @@ 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) ) );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to