[Libreoffice-commits] core.git: sw/inc sw/source

Jim MacArthur (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 10 10:20:11 UTC 2019


 sw/inc/AnnotationWin.hxx                  |    4 ++++
 sw/source/uibase/docvw/AnnotationWin2.cxx |    7 ++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 03263d6fffb711f4cf3527c77949253c97ff40fb
Author:     Jim MacArthur <jim-github at mode7.co.uk>
AuthorDate: Sun Jul 7 11:10:30 2019 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Jul 10 12:19:30 2019 +0200

    AnnotationWin: Restore lines from annotations to comment anchor
    
    This changes all the uses of GetTopReplyNote, which were using
    nullptr to indicate the top reply.
    
    Change-Id: Ibb9b5fac5644a5d6d283e8ea2fa80b988ca0693e
    Reviewed-on: https://gerrit.libreoffice.org/75174
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx
index e4c509641851..6002ac615660 100644
--- a/sw/inc/AnnotationWin.hxx
+++ b/sw/inc/AnnotationWin.hxx
@@ -203,7 +203,11 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin : public vcl::Window
         DECL_LINK(DeleteHdl, void*, void);
 
         sal_uInt32 CountFollowing();
+
+        /// Find the first annotation for the thread which this annotation is in.
+        /// This may be the same annotation as this one.
         SwAnnotationWin*   GetTopReplyNote();
+
         SvxLanguageItem GetLanguage();
 
         VclBuilder      maBuilder;
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx
index eed1976e9b20..e02420809b93 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -747,7 +747,7 @@ void SwAnnotationWin::SetPosAndSize()
             }
             SwAnnotationWin* pWin = GetTopReplyNote();
             // #i111964#
-            if ( pWin && pWin->Anchor() )
+            if ( pWin != this && pWin->Anchor() )
             {
                 pWin->Anchor()->SetAnchorState(AnchorState::End);
             }
@@ -1352,7 +1352,7 @@ void SwAnnotationWin::SetViewState(ViewState bViewState)
                 mpAnchor->SetAnchorState(AnchorState::All);
                 SwAnnotationWin* pWin = GetTopReplyNote();
                 // #i111964#
-                if ( pWin && pWin->Anchor() )
+                if ( pWin != this && pWin->Anchor() )
                 {
                     pWin->Anchor()->SetAnchorState(AnchorState::End);
                 }
@@ -1394,7 +1394,8 @@ void SwAnnotationWin::SetViewState(ViewState bViewState)
                                                   ? mrMgr.GetActiveSidebarWin()->GetTopReplyNote()
                                                   : nullptr;
                     // #i111964#
-                    if ( pTopWinSelf && ( pTopWinSelf != pTopWinActive ) &&
+                    if ( ( pTopWinSelf != this ) &&
+                         ( pTopWinSelf != pTopWinActive ) &&
                          pTopWinSelf->Anchor() )
                     {
                         if ( pTopWinSelf != mrMgr.GetActiveSidebarWin() )


More information about the Libreoffice-commits mailing list