summaryrefslogtreecommitdiffstats
path: root/sw
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedricbosdo@openoffice.org>2011-03-23 18:05:38 +0100
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2011-03-23 18:06:53 +0100
commit1aceb201bdbc44d1577638191782fc63d3ea50ec (patch)
tree9e7bf91094ca60b9a841e7d7e3536a7a0a599f92 /sw
parentMerge branch 'master' of git://anongit.freedesktop.org/libreoffice/writer (diff)
downloadcore-1aceb201bdbc44d1577638191782fc63d3ea50ec.tar.gz
core-1aceb201bdbc44d1577638191782fc63d3ea50ec.zip
Right click and clic-drag on a text over background image is weird n#676858
When there an image is wrapped as background under some text, the right click select the image and the click and drag doesn't do anything. This is fixed by matching the position with the fly frames after the text.
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/layout/trvlfrm.cxx92
1 files changed, 46 insertions, 46 deletions
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 17b9a29ee78b..2673082d5468 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -162,63 +162,63 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
aPoint.Y() = Min( aPoint.Y(), Frm().Bottom() );
}
- //Koennte ein Freifliegender gemeint sein?
- //Wenn sein Inhalt geschuetzt werden soll, so ist nix mit Crsr
- //hineinsetzen, dadurch sollten alle Aenderungen unmoeglich sein.
- if ( GetSortedObjs() )
+ //Wenn kein Cntnt unterhalb der Seite 'antwortet', so korrigieren
+ //wir den StartPoint und fangen nochmal eine Seite vor der
+ //aktuellen an. Mit Flys ist es dann allerdings vorbei.
+ if ( SwLayoutFrm::GetCrsrOfst( pPos, aPoint, pCMS ) )
+ bRet = sal_True;
+ else
{
- SwOrderIter aIter( this );
- aIter.Top();
- while ( aIter() )
+ if ( pCMS && (pCMS->bStop || pCMS->bExactOnly) )
{
- const SwVirtFlyDrawObj* pObj =
- static_cast<const SwVirtFlyDrawObj*>(aIter());
- const SwFlyFrm* pFly = pObj ? pObj->GetFlyFrm() : 0;
- if ( pFly &&
- ( ( pCMS ? pCMS->bSetInReadOnly : sal_False ) ||
- !pFly->IsProtected() ) &&
- pFly->GetCrsrOfst( pPos, aPoint, pCMS ) )
- {
- bRet = sal_True;
- break;
- }
+ ((SwCrsrMoveState*)pCMS)->bStop = sal_True;
+ return sal_False;
+ }
+ const SwCntntFrm *pCnt = GetCntntPos( aPoint, sal_False, sal_False, sal_False, pCMS, sal_False );
+ if ( pCMS && pCMS->bStop )
+ return sal_False;
- if ( pCMS && pCMS->bStop )
- return sal_False;
- aIter.Prev();
+ OSL_ENSURE( pCnt, "Crsr is gone to a Black hole" );
+ if( pCMS && pCMS->pFill && pCnt->IsTxtFrm() )
+ bRet = pCnt->GetCrsrOfst( pPos, rPoint, pCMS );
+ else
+ bRet = pCnt->GetCrsrOfst( pPos, aPoint, pCMS );
+
+ if ( !bRet )
+ {
+ // Set point to pCnt, delete mark
+ // this may happen, if pCnt is hidden
+ *pPos = SwPosition( *pCnt->GetNode(), SwIndex( (SwTxtNode*)pCnt->GetNode(), 0 ) );
+ bRet = sal_True;
}
}
if ( !bRet )
{
- //Wenn kein Cntnt unterhalb der Seite 'antwortet', so korrigieren
- //wir den StartPoint und fangen nochmal eine Seite vor der
- //aktuellen an. Mit Flys ist es dann allerdings vorbei.
- if ( SwLayoutFrm::GetCrsrOfst( pPos, aPoint, pCMS ) )
- bRet = sal_True;
- else
+ //Koennte ein Freifliegender gemeint sein?
+ //Wenn sein Inhalt geschuetzt werden soll, so ist nix mit Crsr
+ //hineinsetzen, dadurch sollten alle Aenderungen unmoeglich sein.
+ if ( GetSortedObjs() )
{
- if ( pCMS && (pCMS->bStop || pCMS->bExactOnly) )
+ SwOrderIter aIter( this );
+ aIter.Top();
+ while ( aIter() )
{
- ((SwCrsrMoveState*)pCMS)->bStop = sal_True;
- return sal_False;
- }
- const SwCntntFrm *pCnt = GetCntntPos( aPoint, sal_False, sal_False, sal_False, pCMS, sal_False );
- if ( pCMS && pCMS->bStop )
- return sal_False;
-
- OSL_ENSURE( pCnt, "Crsr is gone to a Black hole" );
- if( pCMS && pCMS->pFill && pCnt->IsTxtFrm() )
- bRet = pCnt->GetCrsrOfst( pPos, rPoint, pCMS );
- else
- bRet = pCnt->GetCrsrOfst( pPos, aPoint, pCMS );
+ const SwVirtFlyDrawObj* pObj =
+ static_cast<const SwVirtFlyDrawObj*>(aIter());
+ const SwFlyFrm* pFly = pObj ? pObj->GetFlyFrm() : 0;
+ if ( pFly &&
+ ( ( pCMS ? pCMS->bSetInReadOnly : sal_False ) ||
+ !pFly->IsProtected() ) &&
+ pFly->GetCrsrOfst( pPos, aPoint, pCMS ) )
+ {
+ bRet = sal_True;
+ break;
+ }
- if ( !bRet )
- {
- // Set point to pCnt, delete mark
- // this may happen, if pCnt is hidden
- *pPos = SwPosition( *pCnt->GetNode(), SwIndex( (SwTxtNode*)pCnt->GetNode(), 0 ) );
- bRet = sal_True;
+ if ( pCMS && pCMS->bStop )
+ return sal_False;
+ aIter.Prev();
}
}
}