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

bnc#802888 SwPageFrm: let macro fields have priority over background objects

The intention is to get similar behavior as
61f467c8, except this applies to single
clicks, while that one affected only double-click.

Change-Id: Idddc26aa8cd064f89fb4f99b3ad7a5430ac455bc
üst 5c0dd406
...@@ -50,6 +50,9 @@ ...@@ -50,6 +50,9 @@
#include <dcontact.hxx> #include <dcontact.hxx>
// OD 2004-05-24 #i28701# // OD 2004-05-24 #i28701#
#include <sortedobjs.hxx> #include <sortedobjs.hxx>
#include <txatbase.hxx>
#include <fmtfld.hxx>
#include <fldbas.hxx>
// FLT_MAX // FLT_MAX
#include <cfloat> #include <cfloat>
...@@ -290,10 +293,24 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint, ...@@ -290,10 +293,24 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
bValidTextDistance = true; bValidTextDistance = true;
} }
bool bConsiderBackground = true;
// If the text position if a macro 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)
{
const SwField* pField = pTxtAttr->GetFld().GetFld();
if (pField->Which() == RES_MACROFLD)
bConsiderBackground = false;
}
}
double nBackDistance = 0; double nBackDistance = 0;
bool bValidBackDistance = false; bool bValidBackDistance = false;
SwCntntNode* pBackNd = aBackPos.nNode.GetNode( ).GetCntntNode( ); SwCntntNode* pBackNd = aBackPos.nNode.GetNode( ).GetCntntNode( );
if ( pBackNd ) if ( pBackNd && bConsiderBackground)
{ {
// FIXME There are still cases were we don't have the proper node here. // FIXME There are still cases were we don't have the proper node here.
SwCntntFrm* pBackFrm = pBackNd->getLayoutFrm( getRootFrm( ) ); SwCntntFrm* pBackFrm = pBackNd->getLayoutFrm( getRootFrm( ) );
......
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