Kaydet (Commit) e76e2c4c authored tarafından Miklos Vajna's avatar Miklos Vajna

add SwField::IsClickable and use it from SwWrtShell and SwPageFrm

Change-Id: I3d856dc11297b2ad73859ff9c2d529e8cd4727b2
üst 5bb4a2ba
......@@ -343,6 +343,8 @@ public:
void SetAutomaticLanguage(sal_Bool bSet){bIsAutomaticLanguage = bSet;}
virtual String GetDescription() const;
/// Is this field clickable?
bool IsClickable() const;
};
inline SwFieldType* SwField::GetTyp() const
......
......@@ -756,6 +756,21 @@ String SwField::GetDescription() const
return SW_RES(STR_FIELD);
}
bool SwField::IsClickable() const
{
switch (Which())
{
case RES_JUMPEDITFLD:
case RES_MACROFLD:
case RES_GETREFFLD:
case RES_INPUTFLD:
case RES_SETEXPFLD:
case RES_DROPDOWN:
return true;
}
return false;
}
sal_uInt16 SwFldTypes::GetPos(const SwFieldType* pFieldType) const
{
const_iterator it = std::find(begin(), end(), pFieldType);
......
......@@ -294,7 +294,7 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
}
bool bConsiderBackground = true;
// If the text position if a macro field, then that should have priority.
// If the text position is a clickable field, then that should have priority.
if (pTextNd->IsTxtNode())
{
SwTxtNode* pTxtNd = pTextNd->GetTxtNode();
......@@ -302,7 +302,7 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
if (pTxtAttr)
{
const SwField* pField = pTxtAttr->GetFld().GetFld();
if (pField->Which() == RES_MACROFLD)
if (pField->IsClickable())
bConsiderBackground = false;
}
}
......
......@@ -315,6 +315,8 @@ void SwWrtShell::ClickToField( const SwField& rFld )
case RES_DROPDOWN :
StartDropDownFldDlg( (SwField*)&rFld, sal_False );
break;
default:
SAL_WARN_IF(rFld.IsClickable(), "sw", "unhandled clickable field!");
}
bIsInClickToEdit = 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