summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/trvlfrm.cxx
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2011-12-13 17:25:51 +0100
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2011-12-14 11:16:28 +0100
commit8e17c11e25d7e0ecd3a8a5ab4a4a3bd98d8c81b7 (patch)
tree9743cb4d085060457e2f8040a325cbacc21a2f58 /sw/source/core/layout/trvlfrm.cxx
parent3c1bc2311c297bbabba45e62e123d44061bd348c (diff)
n#676858: Fix selection of background pictures vs text
Diffstat (limited to 'sw/source/core/layout/trvlfrm.cxx')
-rw-r--r--sw/source/core/layout/trvlfrm.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 4b54a68efbd5..d2c3d4ea8eec 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -31,6 +31,7 @@
#include <hintids.hxx>
#include <hints.hxx>
#include <tools/bigint.hxx>
+#include <editeng/opaqitem.hxx>
#include <editeng/protitem.hxx>
#include <vcl/settings.hxx>
#include <vcl/outdev.hxx>
@@ -78,7 +79,8 @@ namespace {
static_cast<const SwVirtFlyDrawObj*>(aIter());
const SwAnchoredObject* pAnchoredObj = GetUserCall( aIter() )->GetAnchoredObj( aIter() );
const SwFmtSurround& rSurround = pAnchoredObj->GetFrmFmt().GetSurround();
- bool bInBackground = ( rSurround.GetSurround() == SURROUND_THROUGHT );
+ const SvxOpaqueItem& rOpaque = pAnchoredObj->GetFrmFmt().GetOpaque();
+ bool bInBackground = ( rSurround.GetSurround() == SURROUND_THROUGHT ) && !rOpaque.GetValue();
bool bBackgroundMatches = ( bInBackground && bSearchBackground ) ||
( !bInBackground && !bSearchBackground );
@@ -274,7 +276,7 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
}
// TODO Pick up the best approaching selection
- if ( bTextRet && bBackRet && ( nTextSurface < nBackSurface ) )
+ if ( bTextRet && bBackRet && ( nTextSurface > nBackSurface ) )
{
bRet = bBackRet;
pPos->nNode = aBackPos.nNode;