sw/source/core/text/itrcrsr.cxx |    1 +
 sw/source/core/text/porfly.cxx  |    5 +++++
 sw/source/core/text/porfly.hxx  |    1 +
 3 files changed, 7 insertions(+)

New commits:
commit 2b3112b30a8dea8a009c11ddb209e12697f72e32
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Aug 4 09:15:15 2016 +0100

    the sole caller is ok with rPoint being modified, so change to non-const arg
    
    Change-Id: I40a24502e2e8ad312e13e0c47ee1fde3118d2251

diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index 633c7b5..e38e99d 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -414,14 +414,9 @@ void SwFlyCntPortion::SetBase( const SwTextFrame& rFrame, 
const Point &rBase,
     }
 }
 
-void SwFlyCntPortion::GetFlyCursorOfst(const Point &rPoint, SwPosition &rPos, 
SwCursorMoveState* pCMS) const
+void SwFlyCntPortion::GetFlyCursorOfst(Point &rPoint, SwPosition &rPos, 
SwCursorMoveState* pCMS) const
 {
-    // As the FlyCnt are not attached to the side, their GetCursorOfst() will
-    // not be called.
-    // In order to reduce management overhead for the layout page, the 
paragraph
-    // calls the FlyFrame's GetCursorOfst() only when needed
-    Point aPoint(rPoint);
-    GetFlyFrame()->GetCursorOfst(&rPos, aPoint, pCMS);
+    GetFlyFrame()->GetCursorOfst(&rPos, rPoint, pCMS);
 }
 
 sal_Int32 SwFlyCntPortion::GetCursorOfst( const sal_uInt16 nOfst ) const
diff --git a/sw/source/core/text/porfly.hxx b/sw/source/core/text/porfly.hxx
index 9204edb..129bf39 100644
--- a/sw/source/core/text/porfly.hxx
+++ b/sw/source/core/text/porfly.hxx
@@ -79,7 +79,7 @@ public:
                   long nLnAscent, long nLnDescent,
                   long nFlyAscent, long nFlyDescent,
                   AsCharFlags nFlags );
-    void GetFlyCursorOfst(const Point &rPoint, SwPosition& rPos, 
SwCursorMoveState* pCMS) const;
+    void GetFlyCursorOfst(Point &rPoint, SwPosition& rPos, SwCursorMoveState* 
pCMS) const;
     virtual bool Format( SwTextFormatInfo &rInf ) override;
     virtual void Paint( const SwTextPaintInfo &rInf ) const override;
     OUTPUT_OPERATOR_OVERRIDE
commit cc7a55450658696009fe01e94632e80bb3785d5b
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Aug 4 09:07:03 2016 +0100

    only called if !bDraw
    
    Change-Id: I7310b5f8cbbc4176e76d92ce2bcd49168470843c

diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index 40663a2..633c7b5 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -420,8 +420,6 @@ void SwFlyCntPortion::GetFlyCursorOfst(const Point &rPoint, 
SwPosition &rPos, Sw
     // not be called.
     // In order to reduce management overhead for the layout page, the 
paragraph
     // calls the FlyFrame's GetCursorOfst() only when needed
-    if (bDraw)
-        return;
     Point aPoint(rPoint);
     GetFlyFrame()->GetCursorOfst(&rPos, aPoint, pCMS);
 }
commit 35f4248206e844cabd83757ec57ddde1c2ef66b4
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Aug 4 08:58:59 2016 +0100

    SwLinePortion::GetCursorOfst is const and its ret is ignored here
    
    so nOfst is unnecessary
    
    Change-Id: I27f73057b55ebdf30eb69a19ee1b0647ba25583e

diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index e087d77..3e871f1 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -1713,8 +1713,7 @@ sal_Int32 SwTextCursor::GetCursorOfst( SwPosition *pPos, 
const Point &rPoint,
                 if( bChgNodeInner && pTmp->Frame().IsInside( aTmpPoint ) &&
                     !( pTmp->IsProtected() ) )
                 {
-                    static_cast<SwFlyCntPortion*>(pPor)->
-                        GetFlyCursorOfst( nX, aTmpPoint, *pPos, pCMS );
+                    
static_cast<SwFlyCntPortion*>(pPor)->GetFlyCursorOfst(aTmpPoint, *pPos, pCMS);
                     // After a change of the frame, our font must be still
                     // available for/in the OutputDevice.
                     // For comparison: Paint and new SwFlyCntPortion !
diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index 079d9af..40663a2 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -414,16 +414,16 @@ void SwFlyCntPortion::SetBase( const SwTextFrame& rFrame, 
const Point &rBase,
     }
 }
 
-void SwFlyCntPortion::GetFlyCursorOfst( const sal_uInt16 nOfst,
-    const Point &rPoint, SwPosition &rPos, SwCursorMoveState* pCMS ) const
+void SwFlyCntPortion::GetFlyCursorOfst(const Point &rPoint, SwPosition &rPos, 
SwCursorMoveState* pCMS) const
 {
     // As the FlyCnt are not attached to the side, their GetCursorOfst() will
     // not be called.
     // In order to reduce management overhead for the layout page, the 
paragraph
     // calls the FlyFrame's GetCursorOfst() only when needed
-    Point aPoint( rPoint );
-    if( bDraw || !( GetFlyFrame()->GetCursorOfst(&rPos, aPoint, pCMS) ) )
-        SwLinePortion::GetCursorOfst(nOfst);
+    if (bDraw)
+        return;
+    Point aPoint(rPoint);
+    GetFlyFrame()->GetCursorOfst(&rPos, aPoint, pCMS);
 }
 
 sal_Int32 SwFlyCntPortion::GetCursorOfst( const sal_uInt16 nOfst ) const
diff --git a/sw/source/core/text/porfly.hxx b/sw/source/core/text/porfly.hxx
index 3aaf6ad..9204edb 100644
--- a/sw/source/core/text/porfly.hxx
+++ b/sw/source/core/text/porfly.hxx
@@ -79,8 +79,7 @@ public:
                   long nLnAscent, long nLnDescent,
                   long nFlyAscent, long nFlyDescent,
                   AsCharFlags nFlags );
-    void GetFlyCursorOfst( const sal_uInt16 nOfst, const Point &rPoint,
-                        SwPosition& rPos, SwCursorMoveState* pCMS ) const;
+    void GetFlyCursorOfst(const Point &rPoint, SwPosition& rPos, 
SwCursorMoveState* pCMS) const;
     virtual bool Format( SwTextFormatInfo &rInf ) override;
     virtual void Paint( const SwTextPaintInfo &rInf ) const override;
     OUTPUT_OPERATOR_OVERRIDE
commit 2702796806cae2b28ae78e78d29c3559bf97607e
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Aug 4 08:57:20 2016 +0100

    pPos can never be null
    
    Change-Id: Ib7b57d628fbd80a1d2214917cd439e09d4803d91

diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index c903af9..e087d77 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -1713,8 +1713,8 @@ sal_Int32 SwTextCursor::GetCursorOfst( SwPosition *pPos, 
const Point &rPoint,
                 if( bChgNodeInner && pTmp->Frame().IsInside( aTmpPoint ) &&
                     !( pTmp->IsProtected() ) )
                 {
-                    nLength = static_cast<SwFlyCntPortion*>(pPor)->
-                              GetFlyCursorOfst( nX, aTmpPoint, pPos, pCMS );
+                    static_cast<SwFlyCntPortion*>(pPor)->
+                        GetFlyCursorOfst( nX, aTmpPoint, *pPos, pCMS );
                     // After a change of the frame, our font must be still
                     // available for/in the OutputDevice.
                     // For comparison: Paint and new SwFlyCntPortion !
diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index ca37415..079d9af 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -414,18 +414,16 @@ void SwFlyCntPortion::SetBase( const SwTextFrame& rFrame, 
const Point &rBase,
     }
 }
 
-sal_Int32 SwFlyCntPortion::GetFlyCursorOfst( const sal_uInt16 nOfst,
-    const Point &rPoint, SwPosition *pPos, SwCursorMoveState* pCMS ) const
+void SwFlyCntPortion::GetFlyCursorOfst( const sal_uInt16 nOfst,
+    const Point &rPoint, SwPosition &rPos, SwCursorMoveState* pCMS ) const
 {
     // As the FlyCnt are not attached to the side, their GetCursorOfst() will
     // not be called.
     // In order to reduce management overhead for the layout page, the 
paragraph
     // calls the FlyFrame's GetCursorOfst() only when needed
     Point aPoint( rPoint );
-    if( !pPos || bDraw || !( GetFlyFrame()->GetCursorOfst( pPos, aPoint, pCMS 
) ) )
-        return SwLinePortion::GetCursorOfst( nOfst );
-    else
-        return 0;
+    if( bDraw || !( GetFlyFrame()->GetCursorOfst(&rPos, aPoint, pCMS) ) )
+        SwLinePortion::GetCursorOfst(nOfst);
 }
 
 sal_Int32 SwFlyCntPortion::GetCursorOfst( const sal_uInt16 nOfst ) const
diff --git a/sw/source/core/text/porfly.hxx b/sw/source/core/text/porfly.hxx
index b51efd9..3aaf6ad 100644
--- a/sw/source/core/text/porfly.hxx
+++ b/sw/source/core/text/porfly.hxx
@@ -79,8 +79,8 @@ public:
                   long nLnAscent, long nLnDescent,
                   long nFlyAscent, long nFlyDescent,
                   AsCharFlags nFlags );
-    sal_Int32 GetFlyCursorOfst( const sal_uInt16 nOfst, const Point &rPoint,
-                        SwPosition *pPos, SwCursorMoveState* pCMS ) const;
+    void GetFlyCursorOfst( const sal_uInt16 nOfst, const Point &rPoint,
+                        SwPosition& rPos, SwCursorMoveState* pCMS ) const;
     virtual bool Format( SwTextFormatInfo &rInf ) override;
     virtual void Paint( const SwTextPaintInfo &rInf ) const override;
     OUTPUT_OPERATOR_OVERRIDE
commit 24c009de4d6d27233027e9bcd86ea181d230be8f
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Aug 4 08:50:57 2016 +0100

    Resolves: tdf#101269 cannot click/edit text inside a frame
    
    regression from...
    
    commit b0c0a074a2318a231f3f635784da494f1b713c53
    Date:   Mon Apr 18 11:03:43 2016 +0200
    
        clang-tidy clang-analyzer-deadcode.DeadStores
    
        suspect that some of these may reveal latent bugs....
    
    and restore method then removed by
    
    commit 47f62540bd2c2f107313bb0c6f141cd4460b6379
    Date:   Thu May 19 10:31:47 2016 +0200
    
        loplugin:unusedmethods in sw
    
    Change-Id: I14826eecadbc1a74e408f8907eea8746debe4db4

diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index dbb67b8..c903af9 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -1713,6 +1713,8 @@ sal_Int32 SwTextCursor::GetCursorOfst( SwPosition *pPos, 
const Point &rPoint,
                 if( bChgNodeInner && pTmp->Frame().IsInside( aTmpPoint ) &&
                     !( pTmp->IsProtected() ) )
                 {
+                    nLength = static_cast<SwFlyCntPortion*>(pPor)->
+                              GetFlyCursorOfst( nX, aTmpPoint, pPos, pCMS );
                     // After a change of the frame, our font must be still
                     // available for/in the OutputDevice.
                     // For comparison: Paint and new SwFlyCntPortion !
diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index 0eca9ca..ca37415 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -414,6 +414,20 @@ void SwFlyCntPortion::SetBase( const SwTextFrame& rFrame, 
const Point &rBase,
     }
 }
 
+sal_Int32 SwFlyCntPortion::GetFlyCursorOfst( const sal_uInt16 nOfst,
+    const Point &rPoint, SwPosition *pPos, SwCursorMoveState* pCMS ) const
+{
+    // As the FlyCnt are not attached to the side, their GetCursorOfst() will
+    // not be called.
+    // In order to reduce management overhead for the layout page, the 
paragraph
+    // calls the FlyFrame's GetCursorOfst() only when needed
+    Point aPoint( rPoint );
+    if( !pPos || bDraw || !( GetFlyFrame()->GetCursorOfst( pPos, aPoint, pCMS 
) ) )
+        return SwLinePortion::GetCursorOfst( nOfst );
+    else
+        return 0;
+}
+
 sal_Int32 SwFlyCntPortion::GetCursorOfst( const sal_uInt16 nOfst ) const
 {
     // OSL_FAIL("SwFlyCntPortion::GetCursorOfst: use GetFlyCursorOfst()");
diff --git a/sw/source/core/text/porfly.hxx b/sw/source/core/text/porfly.hxx
index 417c347..b51efd9 100644
--- a/sw/source/core/text/porfly.hxx
+++ b/sw/source/core/text/porfly.hxx
@@ -79,6 +79,8 @@ public:
                   long nLnAscent, long nLnDescent,
                   long nFlyAscent, long nFlyDescent,
                   AsCharFlags nFlags );
+    sal_Int32 GetFlyCursorOfst( const sal_uInt16 nOfst, const Point &rPoint,
+                        SwPosition *pPos, SwCursorMoveState* pCMS ) const;
     virtual bool Format( SwTextFormatInfo &rInf ) override;
     virtual void Paint( const SwTextPaintInfo &rInf ) const override;
     OUTPUT_OPERATOR_OVERRIDE
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to