Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3791

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/91/3791/1

coverity#1000604: Dereference after null check

Change-Id: Id9c3b7eb29c58c55c100db6da644b232ada550ee
---
M sw/source/core/layout/trvlfrm.cxx
1 file changed, 11 insertions(+), 11 deletions(-)



diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index eee460f..0d9fd9c 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -283,6 +283,7 @@
             SwCntntNode* pTextNd = aTextPos.nNode.GetNode( ).GetCntntNode( );
             double nTextDistance = 0;
             bool bValidTextDistance = false;
+            bool bConsiderBackground = true;
             if ( pTextNd )
             {
                 SwCntntFrm* pTextFrm = pTextNd->getLayoutFrm( getRootFrm( ) );
@@ -291,19 +292,18 @@
 
                 nTextDistance = lcl_getDistance( rTextRect, rPoint );
                 bValidTextDistance = true;
-            }
 
-            bool bConsiderBackground = true;
-            // If the text position is a clickable field, then that should have priority.
-            if (pTextNd->IsTxtNode())
-            {
-                SwTxtNode* pTxtNd = pTextNd->GetTxtNode();
-                SwTxtAttr* pTxtAttr = pTxtNd->GetTxtAttrForCharAt(aTextPos.nContent.GetIndex(), 
RES_TXTATR_FIELD);
-                if (pTxtAttr)
+                // If the text position is a clickable field, then that should have priority.
+                if (pTextNd->IsTxtNode())
                 {
-                    const SwField* pField = pTxtAttr->GetFld().GetFld();
-                    if (pField->IsClickable())
-                        bConsiderBackground = false;
+                    SwTxtNode* pTxtNd = pTextNd->GetTxtNode();
+                    SwTxtAttr* pTxtAttr = 
pTxtNd->GetTxtAttrForCharAt(aTextPos.nContent.GetIndex(), RES_TXTATR_FIELD);
+                    if (pTxtAttr)
+                    {
+                        const SwField* pField = pTxtAttr->GetFld().GetFld();
+                        if (pField->IsClickable())
+                            bConsiderBackground = false;
+                    }
                 }
             }
 

-- 
To view, visit https://gerrit.libreoffice.org/3791
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id9c3b7eb29c58c55c100db6da644b232ada550ee
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Julien Nabet <serval2412@yahoo.fr>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.