[Libreoffice-commits] core.git: sw/source
Miklos Vajna
vmiklos at suse.cz
Tue Mar 19 05:44:45 PDT 2013
sw/source/core/layout/trvlfrm.cxx | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
New commits:
commit a996678ed30804e16103e1cfdc439c8546e5d3b0
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Tue Mar 19 13:41:19 2013 +0100
bnc#802888 SwPageFrm: let macro fields have priority over background objects
The intention is to get similar behavior as
61f467c8974d6b6face41e7027d75ae4ddb6fdb2, except this applies to single
clicks, while that one affected only double-click.
Change-Id: Idddc26aa8cd064f89fb4f99b3ad7a5430ac455bc
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 7728a98..a1ace40 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -50,6 +50,9 @@
#include <dcontact.hxx>
// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
+#include <txatbase.hxx>
+#include <fmtfld.hxx>
+#include <fldbas.hxx>
// FLT_MAX
#include <cfloat>
@@ -290,10 +293,24 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
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;
bool bValidBackDistance = false;
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.
SwCntntFrm* pBackFrm = pBackNd->getLayoutFrm( getRootFrm( ) );
More information about the Libreoffice-commits
mailing list