[Libreoffice-commits] .: sw/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Wed Mar 23 10:07:53 PDT 2011


 sw/source/core/layout/trvlfrm.cxx |   92 +++++++++++++++++++-------------------
 1 file changed, 46 insertions(+), 46 deletions(-)

New commits:
commit 4e035a1932446c8805c75841ea1db08f863254e6
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Wed Mar 23 18:05:38 2011 +0100

    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.

diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index daea08b..48cff95 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();
             }
         }
     }


More information about the Libreoffice-commits mailing list