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

Caolán McNamara caolanm at redhat.com
Fri May 13 12:41:29 UTC 2016


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

New commits:
commit 833029e751432e9e736c4f38f23654511d26e8f9
Author: Caolán McNamara <caolanm at 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 <orw at 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

diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index 91ada90..428303d 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -887,12 +887,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();


More information about the Libreoffice-commits mailing list