Kaydet (Commit) 81870e53 authored tarafından Julien Nabet's avatar Julien Nabet Kaydeden (comit) Norbert Thiebaud

coverity#1000604: Dereference after null check

Change-Id: Id9c3b7eb29c58c55c100db6da644b232ada550ee
Reviewed-on: https://gerrit.libreoffice.org/3791Reviewed-by: 's avatarNorbert Thiebaud <nthiebaud@gmail.com>
Tested-by: 's avatarNorbert Thiebaud <nthiebaud@gmail.com>
üst 3805ee5f
......@@ -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;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment