Kaydet (Commit) 482eb7be authored tarafından Michael Stahl's avatar Michael Stahl

sw_redlinehide_3: adapt SwCursorShell::LRMargin/IsAtLRMargin

Change-Id: I4576a464b37e786178a3cb31a0be922f1b55db88
üst 2c7c8aa2
...@@ -159,8 +159,8 @@ public: ...@@ -159,8 +159,8 @@ public:
bool bAllowVisual, bool bSkipHidden, bool bInsertCursor, bool bAllowVisual, bool bSkipHidden, bool bInsertCursor,
SwRootFrame const* pLayout); SwRootFrame const* pLayout);
bool UpDown(bool bUp, sal_uInt16 nCnt, Point const * pPt, long nUpDownX, SwRootFrame & rLayout); bool UpDown(bool bUp, sal_uInt16 nCnt, Point const * pPt, long nUpDownX, SwRootFrame & rLayout);
bool LeftRightMargin( bool bLeftMargin, bool bAPI ); bool LeftRightMargin(SwRootFrame const& rLayout, bool bLeftMargin, bool bAPI);
bool IsAtLeftRightMargin( bool bLeftMargin, bool bAPI ) const; bool IsAtLeftRightMargin(SwRootFrame const& rLayout, bool bLeftMargin, bool bAPI) const;
bool SttEndDoc( bool bSttDoc ); bool SttEndDoc( bool bSttDoc );
bool GoPrevNextCell( bool bNext, sal_uInt16 nCnt ); bool GoPrevNextCell( bool bNext, sal_uInt16 nCnt );
......
...@@ -524,14 +524,14 @@ bool SwCursorShell::LRMargin( bool bLeft, bool bAPI) ...@@ -524,14 +524,14 @@ bool SwCursorShell::LRMargin( bool bLeft, bool bAPI)
if( m_pBlockCursor ) if( m_pBlockCursor )
m_pBlockCursor->clearPoints(); m_pBlockCursor->clearPoints();
const bool bWasAtLM = const bool bWasAtLM = GetCursor_()->IsAtLeftRightMargin(*GetLayout(), true, bAPI);
( 0 == GetCursor_()->GetPoint()->nContent.GetIndex() );
bool bRet = pTmpCursor->LeftRightMargin( bLeft, bAPI ); bool bRet = pTmpCursor->LeftRightMargin(*GetLayout(), bLeft, bAPI);
if ( bLeft && !bTableMode && bRet && bWasAtLM && !GetCursor_()->HasMark() ) if ( bLeft && !bTableMode && bRet && bWasAtLM && !GetCursor_()->HasMark() )
{ {
const SwTextNode * pTextNd = GetCursor_()->GetNode().GetTextNode(); const SwTextNode * pTextNd = GetCursor_()->GetNode().GetTextNode();
assert(sw::GetParaPropsNode(*GetLayout(), GetCursor_()->GetPoint()->nNode) == pTextNd);
if ( pTextNd && pTextNd->HasVisibleNumberingOrBullet() ) if ( pTextNd && pTextNd->HasVisibleNumberingOrBullet() )
SetInFrontOfLabel( true ); SetInFrontOfLabel( true );
} }
...@@ -550,7 +550,7 @@ bool SwCursorShell::LRMargin( bool bLeft, bool bAPI) ...@@ -550,7 +550,7 @@ bool SwCursorShell::LRMargin( bool bLeft, bool bAPI)
bool SwCursorShell::IsAtLRMargin( bool bLeft, bool bAPI ) const bool SwCursorShell::IsAtLRMargin( bool bLeft, bool bAPI ) const
{ {
const SwShellCursor* pTmpCursor = getShellCursor( true ); const SwShellCursor* pTmpCursor = getShellCursor( true );
return pTmpCursor->IsAtLeftRightMargin( bLeft, bAPI ); return pTmpCursor->IsAtLeftRightMargin(*GetLayout(), bLeft, bAPI);
} }
bool SwCursorShell::SttEndDoc( bool bStt ) bool SwCursorShell::SttEndDoc( bool bStt )
......
...@@ -2032,12 +2032,12 @@ bool SwCursor::UpDown( bool bUp, sal_uInt16 nCnt, ...@@ -2032,12 +2032,12 @@ bool SwCursor::UpDown( bool bUp, sal_uInt16 nCnt,
return bRet; return bRet;
} }
bool SwCursor::LeftRightMargin( bool bLeft, bool bAPI ) bool SwCursor::LeftRightMargin(SwRootFrame const& rLayout, bool bLeft, bool bAPI)
{ {
Point aPt; Point aPt;
std::pair<Point, bool> const tmp(aPt, true); std::pair<Point, bool> const tmp(aPt, true);
SwContentFrame *const pFrame = GetContentNode()->getLayoutFrame( SwContentFrame const*const pFrame = GetContentNode()->getLayoutFrame(
GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), GetPoint(), &tmp); &rLayout, GetPoint(), &tmp);
// calculate cursor bidi level // calculate cursor bidi level
if ( pFrame ) if ( pFrame )
...@@ -2049,13 +2049,13 @@ bool SwCursor::LeftRightMargin( bool bLeft, bool bAPI ) ...@@ -2049,13 +2049,13 @@ bool SwCursor::LeftRightMargin( bool bLeft, bool bAPI )
&& !IsSelOvr( SwCursorSelOverFlags::Toggle | SwCursorSelOverFlags::ChangePos ); && !IsSelOvr( SwCursorSelOverFlags::Toggle | SwCursorSelOverFlags::ChangePos );
} }
bool SwCursor::IsAtLeftRightMargin( bool bLeft, bool bAPI ) const bool SwCursor::IsAtLeftRightMargin(SwRootFrame const& rLayout, bool bLeft, bool bAPI) const
{ {
bool bRet = false; bool bRet = false;
Point aPt; Point aPt;
std::pair<Point, bool> const tmp(aPt, true); std::pair<Point, bool> const tmp(aPt, true);
SwContentFrame *const pFrame = GetContentNode()->getLayoutFrame( SwContentFrame const*const pFrame = GetContentNode()->getLayoutFrame(
GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), GetPoint(), &tmp); &rLayout, GetPoint(), &tmp);
if( pFrame ) if( pFrame )
{ {
SwPaM aPam( *GetPoint() ); SwPaM aPam( *GetPoint() );
...@@ -2063,7 +2063,9 @@ bool SwCursor::IsAtLeftRightMargin( bool bLeft, bool bAPI ) const ...@@ -2063,7 +2063,9 @@ bool SwCursor::IsAtLeftRightMargin( bool bLeft, bool bAPI ) const
--aPam.GetPoint()->nContent; --aPam.GetPoint()->nContent;
bRet = (bLeft ? pFrame->LeftMargin( &aPam ) bRet = (bLeft ? pFrame->LeftMargin( &aPam )
: pFrame->RightMargin( &aPam, bAPI )) : pFrame->RightMargin( &aPam, bAPI ))
&& *aPam.GetPoint() == *GetPoint(); && (!pFrame->IsTextFrame()
|| static_cast<SwTextFrame const*>(pFrame)->MapModelToViewPos(*aPam.GetPoint())
== static_cast<SwTextFrame const*>(pFrame)->MapModelToViewPos(*GetPoint()));
} }
return bRet; return bRet;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment