summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2013-05-05 18:26:51 +0200
committerNorbert Thiebaud <nthiebaud@gmail.com>2013-05-05 20:34:46 +0000
commit81870e5333722ceb33e9a326af5faa7bc08f89d6 (patch)
tree2768c1a0cddd6a5037233b2d298f717dcf84d1c8
parent3805ee5f21ad30e02159769e914e250314335bae (diff)
coverity#1000604: Dereference after null check
Change-Id: Id9c3b7eb29c58c55c100db6da644b232ada550ee Reviewed-on: https://gerrit.libreoffice.org/3791 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
-rw-r--r--sw/source/core/layout/trvlfrm.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index eee460fa5041..0d9fd9c85150 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -283,6 +283,7 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
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 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
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;
+ }
}
}