sw/source/uibase/docvw/SidebarWin.cxx |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit c767b5534eaea688138a49653f51df7bc321181e
Author: Caolán McNamara <caol...@redhat.com>
Date:   Fri May 13 13:37:02 2016 +0100

    Resolves: tdf#99692 crash in SwPostItMgr with change tracking
    
    and annotations
    
    presumably since the original
    
    commit 0761f81643a6890457e9ef7d913ab5c88c2593a4
    Author: Oliver-Rainer Wittmann <o...@apache.org>
    Date:   Thu Dec 19 18:50:58 2013 +0000
    
        - rely annotations on text ranges on new annotation marks
        - support arbitrary text ranges for annotations
        - fix undo/redo regarding annotations an text ranges
        - support annotations on overlapping text ranges
        - fix *.docx import for annotations on overlapping text ranges
        - fix ODF import of annotations on text ranges
    
    Change-Id: If2aa4ba74f03d0af11def55c2bd299211b3d5d77
    (cherry picked from commit 833029e751432e9e736c4f38f23654511d26e8f9)
    Reviewed-on: https://gerrit.libreoffice.org/24964
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Michael Stahl <mst...@redhat.com>
    Tested-by: Michael Stahl <mst...@redhat.com>

diff --git a/sw/source/uibase/docvw/SidebarWin.cxx 
b/sw/source/uibase/docvw/SidebarWin.cxx
index c0ec62d1..400a464 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -891,12 +891,15 @@ void SwSidebarWin::SetPosAndSize()
         {
             const SwTextAnnotationField* pTextAnnotationField =
                 dynamic_cast< const SwTextAnnotationField* >( 
mrSidebarItem.GetFormatField().GetTextField() );
-            if ( pTextAnnotationField != nullptr
-                 && pTextAnnotationField->GetpTextNode() != nullptr )
+            SwTextNode* pTextNode = pTextAnnotationField ? 
pTextAnnotationField->GetpTextNode() : nullptr;
+            SwContentNode* pContentNd = nullptr;
+            if (pTextNode)
             {
-                SwTextNode* pTextNode = pTextAnnotationField->GetpTextNode();
                 SwNodes& rNds = pTextNode->GetDoc()->GetNodes();
-                SwContentNode* const pContentNd = 
rNds[mrSidebarItem.maLayoutInfo.mnStartNodeIdx]->GetContentNode();
+                pContentNd = 
rNds[mrSidebarItem.maLayoutInfo.mnStartNodeIdx]->GetContentNode();
+            }
+            if (pContentNd)
+            {
                 SwPosition aStartPos( *pContentNd, 
mrSidebarItem.maLayoutInfo.mnStartContent );
                 SwShellCursor* pTmpCursor = nullptr;
                 const bool bTableCursorNeeded = 
pTextNode->FindTableBoxStartNode() != pContentNd->FindTableBoxStartNode();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to