diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx index dbb67b832d84..c903af9e9aed 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(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 0eca9ca5ace0..ca374158e84f 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 417c347fd68d..b51efd9dc259 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