summaryrefslogtreecommitdiff
path: root/sw/source/core/text/frmcrsr.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/text/frmcrsr.cxx')
-rw-r--r--sw/source/core/text/frmcrsr.cxx530
1 files changed, 265 insertions, 265 deletions
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index 5323eec7bd88..346aed608ac4 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -55,82 +55,82 @@ using namespace ::com::sun::star;
* - RightMargin abstains from adjusting position with -1
* - GetCharRect returns a GetEndCharRect for MV_RIGHTMARGIN
* - GetEndCharRect sets bRightMargin to true
- * - SwTextCursor::bRightMargin is set to false by CharCrsrToLine
+ * - SwTextCursor::bRightMargin is set to false by CharCursorToLine
*/
namespace
{
-SwTextFrm *GetAdjFrmAtPos( SwTextFrm *pFrm, const SwPosition &rPos,
+SwTextFrame *GetAdjFrameAtPos( SwTextFrame *pFrame, const SwPosition &rPos,
const bool bRightMargin, const bool bNoScroll = true )
{
// RightMargin in the last master line
const sal_Int32 nOffset = rPos.nContent.GetIndex();
- SwTextFrm *pFrmAtPos = pFrm;
- if( !bNoScroll || pFrm->GetFollow() )
+ SwTextFrame *pFrameAtPos = pFrame;
+ if( !bNoScroll || pFrame->GetFollow() )
{
- pFrmAtPos = pFrm->GetFrmAtPos( rPos );
- if( nOffset < pFrmAtPos->GetOfst() &&
- !pFrmAtPos->IsFollow() )
+ pFrameAtPos = pFrame->GetFrameAtPos( rPos );
+ if( nOffset < pFrameAtPos->GetOfst() &&
+ !pFrameAtPos->IsFollow() )
{
sal_Int32 nNew = nOffset;
if( nNew < MIN_OFFSET_STEP )
nNew = 0;
else
nNew -= MIN_OFFSET_STEP;
- sw_ChangeOffset( pFrmAtPos, nNew );
+ sw_ChangeOffset( pFrameAtPos, nNew );
}
}
- while( pFrm != pFrmAtPos )
+ while( pFrame != pFrameAtPos )
{
- pFrm = pFrmAtPos;
- pFrm->GetFormatted();
- pFrmAtPos = pFrm->GetFrmAtPos( rPos );
+ pFrame = pFrameAtPos;
+ pFrame->GetFormatted();
+ pFrameAtPos = pFrame->GetFrameAtPos( rPos );
}
if( nOffset && bRightMargin )
{
- while( pFrmAtPos && pFrmAtPos->GetOfst() == nOffset &&
- pFrmAtPos->IsFollow() )
+ while( pFrameAtPos && pFrameAtPos->GetOfst() == nOffset &&
+ pFrameAtPos->IsFollow() )
{
- pFrmAtPos->GetFormatted();
- pFrmAtPos = pFrmAtPos->FindMaster();
+ pFrameAtPos->GetFormatted();
+ pFrameAtPos = pFrameAtPos->FindMaster();
}
- OSL_ENSURE( pFrmAtPos, "+GetCharRect: no frame with my rightmargin" );
+ OSL_ENSURE( pFrameAtPos, "+GetCharRect: no frame with my rightmargin" );
}
- return pFrmAtPos ? pFrmAtPos : pFrm;
+ return pFrameAtPos ? pFrameAtPos : pFrame;
}
}
-bool sw_ChangeOffset( SwTextFrm* pFrm, sal_Int32 nNew )
+bool sw_ChangeOffset( SwTextFrame* pFrame, sal_Int32 nNew )
{
// Do not scroll in areas and outside of flies
- OSL_ENSURE( !pFrm->IsFollow(), "Illegal Scrolling by Follow!" );
- if( pFrm->GetOfst() != nNew && !pFrm->IsInSct() )
+ OSL_ENSURE( !pFrame->IsFollow(), "Illegal Scrolling by Follow!" );
+ if( pFrame->GetOfst() != nNew && !pFrame->IsInSct() )
{
- SwFlyFrm *pFly = pFrm->FindFlyFrm();
+ SwFlyFrame *pFly = pFrame->FindFlyFrame();
// Attention: if e.g. in a column frame the size is still invalid
// we must not scroll around just like that
if ( ( pFly && pFly->IsValid() &&
!pFly->GetNextLink() && !pFly->GetPrevLink() ) ||
- ( !pFly && pFrm->IsInTab() ) )
+ ( !pFly && pFrame->IsInTab() ) )
{
- SwViewShell* pVsh = pFrm->getRootFrm()->GetCurrShell();
+ SwViewShell* pVsh = pFrame->getRootFrame()->GetCurrShell();
if( pVsh )
{
if( pVsh->GetRingContainer().size() > 1 ||
- ( pFrm->GetDrawObjs() && pFrm->GetDrawObjs()->size() ) )
+ ( pFrame->GetDrawObjs() && pFrame->GetDrawObjs()->size() ) )
{
- if( !pFrm->GetOfst() )
+ if( !pFrame->GetOfst() )
return false;
nNew = 0;
}
- pFrm->SetOfst( nNew );
- pFrm->SetPara( nullptr );
- pFrm->GetFormatted();
- if( pFrm->Frm().HasArea() )
- pFrm->getRootFrm()->GetCurrShell()->InvalidateWindows( pFrm->Frm() );
+ pFrame->SetOfst( nNew );
+ pFrame->SetPara( nullptr );
+ pFrame->GetFormatted();
+ if( pFrame->Frame().HasArea() )
+ pFrame->getRootFrame()->GetCurrShell()->InvalidateWindows( pFrame->Frame() );
return true;
}
}
@@ -138,17 +138,17 @@ bool sw_ChangeOffset( SwTextFrm* pFrm, sal_Int32 nNew )
return false;
}
-SwTextFrm& SwTextFrm::GetFrmAtOfst( const sal_Int32 nWhere )
+SwTextFrame& SwTextFrame::GetFrameAtOfst( const sal_Int32 nWhere )
{
- SwTextFrm* pRet = this;
+ SwTextFrame* pRet = this;
while( pRet->HasFollow() && nWhere >= pRet->GetFollow()->GetOfst() )
pRet = pRet->GetFollow();
return *pRet;
}
-SwTextFrm *SwTextFrm::GetFrmAtPos( const SwPosition &rPos )
+SwTextFrame *SwTextFrame::GetFrameAtPos( const SwPosition &rPos )
{
- SwTextFrm *pFoll = this;
+ SwTextFrame *pFoll = this;
while( pFoll->GetFollow() )
{
if( rPos.nContent.GetIndex() > pFoll->GetFollow()->GetOfst() )
@@ -167,15 +167,15 @@ SwTextFrm *SwTextFrm::GetFrmAtPos( const SwPosition &rPos )
/*
* GetCharRect() returns the char's char line described by aPos.
- * GetCrsrOfst() does the reverse: It goes from a document coordinate to
+ * GetCursorOfst() does the reverse: It goes from a document coordinate to
* a Pam.
* Both are virtual in the frame base class and thus are redefined here.
*/
-bool SwTextFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos,
- SwCrsrMoveState *pCMS ) const
+bool SwTextFrame::GetCharRect( SwRect& rOrig, const SwPosition &rPos,
+ SwCursorMoveState *pCMS ) const
{
- OSL_ENSURE( ! IsVertical() || ! IsSwapped(),"SwTextFrm::GetCharRect with swapped frame" );
+ OSL_ENSURE( ! IsVertical() || ! IsSwapped(),"SwTextFrame::GetCharRect with swapped frame" );
if( IsLocked() || IsHiddenNow() )
return false;
@@ -186,29 +186,29 @@ bool SwTextFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos,
// - the Follow chain grows dynamically; the one we end up in
// needs to be formatted
- // Optimisation: reading ahead saves us a GetAdjFrmAtPos
+ // Optimisation: reading ahead saves us a GetAdjFrameAtPos
const bool bRightMargin = pCMS && ( MV_RIGHTMARGIN == pCMS->m_eState );
const bool bNoScroll = pCMS && pCMS->m_bNoScroll;
- SwTextFrm *pFrm = GetAdjFrmAtPos( const_cast<SwTextFrm*>(this), rPos, bRightMargin,
+ SwTextFrame *pFrame = GetAdjFrameAtPos( const_cast<SwTextFrame*>(this), rPos, bRightMargin,
bNoScroll );
- pFrm->GetFormatted();
- const SwFrm* pTmpFrm = static_cast<SwFrm*>(pFrm->GetUpper());
+ pFrame->GetFormatted();
+ const SwFrame* pTmpFrame = static_cast<SwFrame*>(pFrame->GetUpper());
- SWRECTFN ( pFrm )
- const SwTwips nUpperMaxY = (pTmpFrm->*fnRect->fnGetPrtBottom)();
- const SwTwips nFrmMaxY = (pFrm->*fnRect->fnGetPrtBottom)();
+ SWRECTFN ( pFrame )
+ const SwTwips nUpperMaxY = (pTmpFrame->*fnRect->fnGetPrtBottom)();
+ const SwTwips nFrameMaxY = (pFrame->*fnRect->fnGetPrtBottom)();
// nMaxY is an absolute value
SwTwips nMaxY = bVert ?
- ( bVertL2R ? std::min( nFrmMaxY, nUpperMaxY ) : std::max( nFrmMaxY, nUpperMaxY ) ) :
- std::min( nFrmMaxY, nUpperMaxY );
+ ( bVertL2R ? std::min( nFrameMaxY, nUpperMaxY ) : std::max( nFrameMaxY, nUpperMaxY ) ) :
+ std::min( nFrameMaxY, nUpperMaxY );
bool bRet = false;
- if ( pFrm->IsEmpty() || ! (pFrm->Prt().*fnRect->fnGetHeight)() )
+ if ( pFrame->IsEmpty() || ! (pFrame->Prt().*fnRect->fnGetHeight)() )
{
- Point aPnt1 = pFrm->Frm().Pos() + pFrm->Prt().Pos();
- SwTextNode* pTextNd = const_cast<SwTextFrm*>(this)->GetTextNode();
+ Point aPnt1 = pFrame->Frame().Pos() + pFrame->Prt().Pos();
+ SwTextNode* pTextNd = const_cast<SwTextFrame*>(this)->GetTextNode();
short nFirstOffset;
pTextNd->GetFirstLineOfsWithNum( nFirstOffset );
@@ -219,7 +219,7 @@ bool SwTextFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos,
aPnt1.Y() += nFirstOffset;
if ( aPnt1.X() < nMaxY && !bVertL2R )
aPnt1.X() = nMaxY;
- aPnt2.X() = aPnt1.X() + pFrm->Prt().Width();
+ aPnt2.X() = aPnt1.X() + pFrame->Prt().Width();
aPnt2.Y() = aPnt1.Y();
if( aPnt2.X() < nMaxY )
aPnt2.X() = nMaxY;
@@ -232,7 +232,7 @@ bool SwTextFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos,
if( aPnt1.Y() > nMaxY )
aPnt1.Y() = nMaxY;
aPnt2.X() = aPnt1.X();
- aPnt2.Y() = aPnt1.Y() + pFrm->Prt().Height();
+ aPnt2.Y() = aPnt1.Y() + pFrame->Prt().Height();
if( aPnt2.Y() > nMaxY )
aPnt2.Y() = nMaxY;
}
@@ -245,19 +245,19 @@ bool SwTextFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos,
pCMS->m_aRealHeight.Y() = bVert ? -rOrig.Width() : rOrig.Height();
}
- if ( pFrm->IsRightToLeft() )
- pFrm->SwitchLTRtoRTL( rOrig );
+ if ( pFrame->IsRightToLeft() )
+ pFrame->SwitchLTRtoRTL( rOrig );
bRet = true;
}
else
{
- if( !pFrm->HasPara() )
+ if( !pFrame->HasPara() )
return false;
- SwFrmSwapper aSwapper( pFrm, true );
+ SwFrameSwapper aSwapper( pFrame, true );
if ( bVert )
- nMaxY = pFrm->SwitchVerticalToHorizontal( nMaxY );
+ nMaxY = pFrame->SwitchVerticalToHorizontal( nMaxY );
bool bGoOn = true;
const sal_Int32 nOffset = rPos.nContent.GetIndex();
@@ -266,28 +266,28 @@ bool SwTextFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos,
do
{
{
- SwTextSizeInfo aInf( pFrm );
- SwTextCursor aLine( pFrm, &aInf );
+ SwTextSizeInfo aInf( pFrame );
+ SwTextCursor aLine( pFrame, &aInf );
nNextOfst = aLine.GetEnd();
- // See comment in AdjustFrm
+ // See comment in AdjustFrame
// Include the line's last char?
bRet = bRightMargin ? aLine.GetEndCharRect( &rOrig, nOffset, pCMS, nMaxY )
: aLine.GetCharRect( &rOrig, nOffset, pCMS, nMaxY );
}
- if ( pFrm->IsRightToLeft() )
- pFrm->SwitchLTRtoRTL( rOrig );
+ if ( pFrame->IsRightToLeft() )
+ pFrame->SwitchLTRtoRTL( rOrig );
if ( bVert )
- pFrm->SwitchHorizontalToVertical( rOrig );
+ pFrame->SwitchHorizontalToVertical( rOrig );
- if( pFrm->IsUndersized() && pCMS && !pFrm->GetNext() &&
+ if( pFrame->IsUndersized() && pCMS && !pFrame->GetNext() &&
(rOrig.*fnRect->fnGetBottom)() == nUpperMaxY &&
- pFrm->GetOfst() < nOffset &&
- !pFrm->IsFollow() && !bNoScroll &&
- pFrm->GetTextNode()->GetText().getLength() != nNextOfst)
+ pFrame->GetOfst() < nOffset &&
+ !pFrame->IsFollow() && !bNoScroll &&
+ pFrame->GetTextNode()->GetText().getLength() != nNextOfst)
{
- bGoOn = sw_ChangeOffset( pFrm, nNextOfst );
+ bGoOn = sw_ChangeOffset( pFrame, nNextOfst );
}
else
bGoOn = false;
@@ -295,12 +295,12 @@ bool SwTextFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos,
if ( pCMS )
{
- if ( pFrm->IsRightToLeft() )
+ if ( pFrame->IsRightToLeft() )
{
if( pCMS->m_b2Lines && pCMS->m_p2Lines)
{
- pFrm->SwitchLTRtoRTL( pCMS->m_p2Lines->aLine );
- pFrm->SwitchLTRtoRTL( pCMS->m_p2Lines->aPortion );
+ pFrame->SwitchLTRtoRTL( pCMS->m_p2Lines->aLine );
+ pFrame->SwitchLTRtoRTL( pCMS->m_p2Lines->aPortion );
}
}
@@ -319,8 +319,8 @@ bool SwTextFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos,
}
if( pCMS->m_b2Lines && pCMS->m_p2Lines)
{
- pFrm->SwitchHorizontalToVertical( pCMS->m_p2Lines->aLine );
- pFrm->SwitchHorizontalToVertical( pCMS->m_p2Lines->aPortion );
+ pFrame->SwitchHorizontalToVertical( pCMS->m_p2Lines->aLine );
+ pFrame->SwitchHorizontalToVertical( pCMS->m_p2Lines->aPortion );
}
}
@@ -328,11 +328,11 @@ bool SwTextFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos,
}
if( bRet )
{
- SwPageFrm *pPage = pFrm->FindPageFrm();
+ SwPageFrame *pPage = pFrame->FindPageFrame();
OSL_ENSURE( pPage, "Text escaped from page?" );
const SwTwips nOrigTop = (rOrig.*fnRect->fnGetTop)();
- const SwTwips nPageTop = (pPage->Frm().*fnRect->fnGetTop)();
- const SwTwips nPageBott = (pPage->Frm().*fnRect->fnGetBottom)();
+ const SwTwips nPageTop = (pPage->Frame().*fnRect->fnGetTop)();
+ const SwTwips nPageBott = (pPage->Frame().*fnRect->fnGetBottom)();
// We have the following situation: if the frame is in an invalid
// sectionframe, it's possible that the frame is outside the page.
@@ -353,41 +353,41 @@ bool SwTextFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos,
* and is used by the auto-positioned frame.
*/
-bool SwTextFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const
+bool SwTextFrame::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const
{
if( IsHiddenNow() )
return false;
const sal_Int32 nOffset = rPos.nContent.GetIndex();
- SwTextFrm* pFrm = &(const_cast<SwTextFrm*>(this)->GetFrmAtOfst( nOffset ));
+ SwTextFrame* pFrame = &(const_cast<SwTextFrame*>(this)->GetFrameAtOfst( nOffset ));
- pFrm->GetFormatted();
- const SwFrm* pTmpFrm = static_cast<SwFrm*>(pFrm->GetUpper());
+ pFrame->GetFormatted();
+ const SwFrame* pTmpFrame = static_cast<SwFrame*>(pFrame->GetUpper());
- SWRECTFN( pTmpFrm )
- SwTwips nUpperMaxY = (pTmpFrm->*fnRect->fnGetPrtBottom)();
+ SWRECTFN( pTmpFrame )
+ SwTwips nUpperMaxY = (pTmpFrame->*fnRect->fnGetPrtBottom)();
// nMaxY is in absolute value
SwTwips nMaxY;
if ( bVert )
{
if ( bVertL2R )
- nMaxY = std::min( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY );
+ nMaxY = std::min( (pFrame->*fnRect->fnGetPrtBottom)(), nUpperMaxY );
else
- nMaxY = std::max( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY );
+ nMaxY = std::max( (pFrame->*fnRect->fnGetPrtBottom)(), nUpperMaxY );
}
else
- nMaxY = std::min( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY );
- if ( pFrm->IsEmpty() || ! (pFrm->Prt().*fnRect->fnGetHeight)() )
+ nMaxY = std::min( (pFrame->*fnRect->fnGetPrtBottom)(), nUpperMaxY );
+ if ( pFrame->IsEmpty() || ! (pFrame->Prt().*fnRect->fnGetHeight)() )
{
- Point aPnt1 = pFrm->Frm().Pos() + pFrm->Prt().Pos();
+ Point aPnt1 = pFrame->Frame().Pos() + pFrame->Prt().Pos();
Point aPnt2;
if ( bVert )
{
if ( aPnt1.X() < nMaxY && !bVertL2R )
aPnt1.X() = nMaxY;
- aPnt2.X() = aPnt1.X() + pFrm->Prt().Width();
+ aPnt2.X() = aPnt1.X() + pFrame->Prt().Width();
aPnt2.Y() = aPnt1.Y();
if( aPnt2.X() < nMaxY )
aPnt2.X() = nMaxY;
@@ -397,7 +397,7 @@ bool SwTextFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const
if( aPnt1.Y() > nMaxY )
aPnt1.Y() = nMaxY;
aPnt2.X() = aPnt1.X();
- aPnt2.Y() = aPnt1.Y() + pFrm->Prt().Height();
+ aPnt2.Y() = aPnt1.Y() + pFrame->Prt().Height();
if( aPnt2.Y() > nMaxY )
aPnt2.Y() = nMaxY;
}
@@ -406,16 +406,16 @@ bool SwTextFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const
}
else
{
- if( !pFrm->HasPara() )
+ if( !pFrame->HasPara() )
return false;
- SwFrmSwapper aSwapper( pFrm, true );
+ SwFrameSwapper aSwapper( pFrame, true );
if ( bVert )
- nMaxY = pFrm->SwitchVerticalToHorizontal( nMaxY );
+ nMaxY = pFrame->SwitchVerticalToHorizontal( nMaxY );
- SwTextSizeInfo aInf( pFrm );
- SwTextCursor aLine( pFrm, &aInf );
- SwCrsrMoveState aTmpState( MV_SETONLYTEXT );
+ SwTextSizeInfo aInf( pFrame );
+ SwTextCursor aLine( pFrame, &aInf );
+ SwCursorMoveState aTmpState( MV_SETONLYTEXT );
aTmpState.m_bRealHeight = true;
if( aLine.GetCharRect( &rOrig, nOffset, &aTmpState, nMaxY ) )
{
@@ -425,11 +425,11 @@ bool SwTextFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const
rOrig.Height( aTmpState.m_aRealHeight.Y() );
}
- if ( pFrm->IsRightToLeft() )
- pFrm->SwitchLTRtoRTL( rOrig );
+ if ( pFrame->IsRightToLeft() )
+ pFrame->SwitchLTRtoRTL( rOrig );
if ( bVert )
- pFrm->SwitchHorizontalToVertical( rOrig );
+ pFrame->SwitchHorizontalToVertical( rOrig );
return true;
}
@@ -443,7 +443,7 @@ bool SwTextFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const
- If a proportional line spacing is applied use top of anchor character as
top of the line.
*/
-bool SwTextFrm::GetTopOfLine( SwTwips& _onTopOfLine,
+bool SwTextFrame::GetTopOfLine( SwTwips& _onTopOfLine,
const SwPosition& _rPos ) const
{
bool bRet = true;
@@ -467,9 +467,9 @@ bool SwTextFrm::GetTopOfLine( SwTwips& _onTopOfLine,
else
{
// determine formatted text frame that contains the requested position
- SwTextFrm* pFrm = &(const_cast<SwTextFrm*>(this)->GetFrmAtOfst( nOffset ));
- pFrm->GetFormatted();
- SWREFRESHFN( pFrm )
+ SwTextFrame* pFrame = &(const_cast<SwTextFrame*>(this)->GetFrameAtOfst( nOffset ));
+ pFrame->GetFormatted();
+ SWREFRESHFN( pFrame )
// If proportional line spacing is applied
// to the text frame, the top of the anchor character is also the
// top of the line.
@@ -490,16 +490,16 @@ bool SwTextFrm::GetTopOfLine( SwTwips& _onTopOfLine,
else
{
// assure that text frame is in a horizontal layout
- SwFrmSwapper aSwapper( pFrm, true );
+ SwFrameSwapper aSwapper( pFrame, true );
// determine text line that contains the requested position
- SwTextSizeInfo aInf( pFrm );
- SwTextCursor aLine( pFrm, &aInf );
- aLine.CharCrsrToLine( nOffset );
+ SwTextSizeInfo aInf( pFrame );
+ SwTextCursor aLine( pFrame, &aInf );
+ aLine.CharCursorToLine( nOffset );
// determine top of line
_onTopOfLine = aLine.Y();
if ( bVert )
{
- _onTopOfLine = pFrm->SwitchHorizontalToVertical( _onTopOfLine );
+ _onTopOfLine = pFrame->SwitchHorizontalToVertical( _onTopOfLine );
}
}
}
@@ -513,8 +513,8 @@ bool SwTextFrm::GetTopOfLine( SwTwips& _onTopOfLine,
struct SwFillData
{
- SwRect aFrm;
- const SwCrsrMoveState *pCMS;
+ SwRect aFrame;
+ const SwCursorMoveState *pCMS;
SwPosition* pPos;
const Point& rPoint;
SwTwips nLineWidth;
@@ -522,66 +522,66 @@ struct SwFillData
bool bInner : 1;
bool bColumn : 1;
bool bEmpty : 1;
- SwFillData( const SwCrsrMoveState *pC, SwPosition* pP, const SwRect& rR,
- const Point& rPt ) : aFrm( rR ), pCMS( pC ), pPos( pP ), rPoint( rPt ),
+ SwFillData( const SwCursorMoveState *pC, SwPosition* pP, const SwRect& rR,
+ const Point& rPt ) : aFrame( rR ), pCMS( pC ), pPos( pP ), rPoint( rPt ),
nLineWidth( 0 ), bFirstLine( true ), bInner( false ), bColumn( false ),
bEmpty( true ){}
SwFillMode Mode() const { return pCMS->m_pFill->eMode; }
long X() const { return rPoint.X(); }
long Y() const { return rPoint.Y(); }
- long Left() const { return aFrm.Left(); }
- long Right() const { return aFrm.Right(); }
- long Bottom() const { return aFrm.Bottom(); }
- SwFillCrsrPos &Fill() const { return *pCMS->m_pFill; }
+ long Left() const { return aFrame.Left(); }
+ long Right() const { return aFrame.Right(); }
+ long Bottom() const { return aFrame.Bottom(); }
+ SwFillCursorPos &Fill() const { return *pCMS->m_pFill; }
void SetTab( sal_uInt16 nNew ) { pCMS->m_pFill->nTabCnt = nNew; }
void SetSpace( sal_uInt16 nNew ) { pCMS->m_pFill->nSpaceCnt = nNew; }
void SetOrient( const sal_Int16 eNew ){ pCMS->m_pFill->eOrient = eNew; }
};
-bool SwTextFrm::_GetCrsrOfst(SwPosition* pPos, const Point& rPoint,
- const bool bChgFrm, SwCrsrMoveState* pCMS ) const
+bool SwTextFrame::_GetCursorOfst(SwPosition* pPos, const Point& rPoint,
+ const bool bChgFrame, SwCursorMoveState* pCMS ) const
{
- // _GetCrsrOfst is called by GetCrsrOfst and GetKeyCrsrOfst.
+ // _GetCursorOfst is called by GetCursorOfst and GetKeyCursorOfst.
// Never just a return false.
if( IsLocked() || IsHiddenNow() )
return false;
- const_cast<SwTextFrm*>(this)->GetFormatted();
+ const_cast<SwTextFrame*>(this)->GetFormatted();
Point aOldPoint( rPoint );
if ( IsVertical() )
{
SwitchVerticalToHorizontal( (Point&)rPoint );
- const_cast<SwTextFrm*>(this)->SwapWidthAndHeight();
+ const_cast<SwTextFrame*>(this)->SwapWidthAndHeight();
}
if ( IsRightToLeft() )
SwitchRTLtoLTR( (Point&)rPoint );
SwFillData *pFillData = ( pCMS && pCMS->m_pFill ) ?
- new SwFillData( pCMS, pPos, Frm(), rPoint ) : nullptr;
+ new SwFillData( pCMS, pPos, Frame(), rPoint ) : nullptr;
if ( IsEmpty() )
{
- SwTextNode* pTextNd = const_cast<SwTextFrm*>(this)->GetTextNode();
+ SwTextNode* pTextNd = const_cast<SwTextFrame*>(this)->GetTextNode();
pPos->nNode = *pTextNd;
pPos->nContent.Assign( pTextNd, 0 );
if( pCMS && pCMS->m_bFieldInfo )
{
- SwTwips nDiff = rPoint.X() - Frm().Left() - Prt().Left();
+ SwTwips nDiff = rPoint.X() - Frame().Left() - Prt().Left();
if( nDiff > 50 || nDiff < 0 )
pCMS->m_bPosCorr = true;
}
}
else
{
- SwTextSizeInfo aInf( const_cast<SwTextFrm*>(this) );
- SwTextCursor aLine( const_cast<SwTextFrm*>(this), &aInf );
+ SwTextSizeInfo aInf( const_cast<SwTextFrame*>(this) );
+ SwTextCursor aLine( const_cast<SwTextFrame*>(this), &aInf );
- // See comment in AdjustFrm()
- SwTwips nMaxY = Frm().Top() + Prt().Top() + Prt().Height();
+ // See comment in AdjustFrame()
+ SwTwips nMaxY = Frame().Top() + Prt().Top() + Prt().Height();
aLine.TwipsToLine( rPoint.Y() );
while( aLine.Y() + aLine.GetLineHeight() > nMaxY )
{
@@ -594,25 +594,25 @@ bool SwTextFrm::_GetCrsrOfst(SwPosition* pPos, const Point& rPoint,
while( aLine.GetLineNr() > 1 )
aLine.Prev();
- sal_Int32 nOffset = aLine.GetCrsrOfst( pPos, rPoint, bChgFrm, pCMS );
+ sal_Int32 nOffset = aLine.GetCursorOfst( pPos, rPoint, bChgFrame, pCMS );
if( pCMS && pCMS->m_eState == MV_NONE && aLine.GetEnd() == nOffset )
pCMS->m_eState = MV_RIGHTMARGIN;
// pPos is a pure IN parameter and must not be evaluated.
- // pIter->GetCrsrOfst returns from a nesting with COMPLETE_STRING.
- // If SwTextIter::GetCrsrOfst calls GetCrsrOfst further by itself
+ // pIter->GetCursorOfst returns from a nesting with COMPLETE_STRING.
+ // If SwTextIter::GetCursorOfst calls GetCursorOfst further by itself
// nNode changes the position.
// In such cases, pPos must not be calculated.
if( COMPLETE_STRING != nOffset )
{
- SwTextNode* pTextNd = const_cast<SwTextFrm*>(this)->GetTextNode();
+ SwTextNode* pTextNd = const_cast<SwTextFrame*>(this)->GetTextNode();
pPos->nNode = *pTextNd;
pPos->nContent.Assign( pTextNd, nOffset );
if( pFillData )
{
if (pTextNd->GetText().getLength() > nOffset ||
- rPoint.Y() < Frm().Top() )
+ rPoint.Y() < Frame().Top() )
pFillData->bInner = true;
pFillData->bFirstLine = aLine.GetLineNr() < 2;
if (pTextNd->GetText().getLength())
@@ -624,22 +624,22 @@ bool SwTextFrm::_GetCrsrOfst(SwPosition* pPos, const Point& rPoint,
}
}
bool bChgFillData = false;
- if( pFillData && FindPageFrm()->Frm().IsInside( aOldPoint ) )
+ if( pFillData && FindPageFrame()->Frame().IsInside( aOldPoint ) )
{
- FillCrsrPos( *pFillData );
+ FillCursorPos( *pFillData );
bChgFillData = true;
}
if ( IsVertical() )
{
if ( bChgFillData )
- SwitchHorizontalToVertical( pFillData->Fill().aCrsr.Pos() );
- const_cast<SwTextFrm*>(this)->SwapWidthAndHeight();
+ SwitchHorizontalToVertical( pFillData->Fill().aCursor.Pos() );
+ const_cast<SwTextFrame*>(this)->SwapWidthAndHeight();
}
if ( IsRightToLeft() && bChgFillData )
{
- SwitchLTRtoRTL( pFillData->Fill().aCrsr.Pos() );
+ SwitchLTRtoRTL( pFillData->Fill().aCursor.Pos() );
const sal_Int16 eOrient = pFillData->pCMS->m_pFill->eOrient;
if ( text::HoriOrientation::LEFT == eOrient )
@@ -654,42 +654,42 @@ bool SwTextFrm::_GetCrsrOfst(SwPosition* pPos, const Point& rPoint,
return true;
}
-bool SwTextFrm::GetCrsrOfst(SwPosition* pPos, Point& rPoint,
- SwCrsrMoveState* pCMS, bool ) const
+bool SwTextFrame::GetCursorOfst(SwPosition* pPos, Point& rPoint,
+ SwCursorMoveState* pCMS, bool ) const
{
- const bool bChgFrm = !(pCMS && MV_UPDOWN == pCMS->m_eState);
- return _GetCrsrOfst( pPos, rPoint, bChgFrm, pCMS );
+ const bool bChgFrame = !(pCMS && MV_UPDOWN == pCMS->m_eState);
+ return _GetCursorOfst( pPos, rPoint, bChgFrame, pCMS );
}
/*
* Layout-oriented cursor movement to the line start.
*/
-bool SwTextFrm::LeftMargin(SwPaM *pPam) const
+bool SwTextFrame::LeftMargin(SwPaM *pPam) const
{
if( &pPam->GetNode() != GetNode() )
- pPam->GetPoint()->nNode = *const_cast<SwTextFrm*>(this)->GetTextNode();
+ pPam->GetPoint()->nNode = *const_cast<SwTextFrame*>(this)->GetTextNode();
- SwTextFrm *pFrm = GetAdjFrmAtPos( const_cast<SwTextFrm*>(this), *pPam->GetPoint(),
+ SwTextFrame *pFrame = GetAdjFrameAtPos( const_cast<SwTextFrame*>(this), *pPam->GetPoint(),
SwTextCursor::IsRightMargin() );
- pFrm->GetFormatted();
+ pFrame->GetFormatted();
sal_Int32 nIndx;
- if ( pFrm->IsEmpty() )
+ if ( pFrame->IsEmpty() )
nIndx = 0;
else
{
- SwTextSizeInfo aInf( pFrm );
- SwTextCursor aLine( pFrm, &aInf );
+ SwTextSizeInfo aInf( pFrame );
+ SwTextCursor aLine( pFrame, &aInf );
- aLine.CharCrsrToLine(pPam->GetPoint()->nContent.GetIndex());
+ aLine.CharCursorToLine(pPam->GetPoint()->nContent.GetIndex());
nIndx = aLine.GetStart();
- if( pFrm->GetOfst() && !pFrm->IsFollow() && !aLine.GetPrev() )
+ if( pFrame->GetOfst() && !pFrame->IsFollow() && !aLine.GetPrev() )
{
- sw_ChangeOffset( pFrm, 0 );
+ sw_ChangeOffset( pFrame, 0 );
nIndx = 0;
}
}
- pPam->GetPoint()->nContent = SwIndex( pFrm->GetTextNode(), nIndx );
+ pPam->GetPoint()->nContent = SwIndex( pFrame->GetTextNode(), nIndx );
SwTextCursor::SetRightMargin( false );
return true;
}
@@ -700,45 +700,45 @@ bool SwTextFrm::LeftMargin(SwPaM *pPam) const
* the last char in order to append text.
*/
-bool SwTextFrm::RightMargin(SwPaM *pPam, bool bAPI) const
+bool SwTextFrame::RightMargin(SwPaM *pPam, bool bAPI) const
{
if( &pPam->GetNode() != GetNode() )
- pPam->GetPoint()->nNode = *const_cast<SwTextFrm*>(this)->GetTextNode();
+ pPam->GetPoint()->nNode = *const_cast<SwTextFrame*>(this)->GetTextNode();
- SwTextFrm *pFrm = GetAdjFrmAtPos( const_cast<SwTextFrm*>(this), *pPam->GetPoint(),
+ SwTextFrame *pFrame = GetAdjFrameAtPos( const_cast<SwTextFrame*>(this), *pPam->GetPoint(),
SwTextCursor::IsRightMargin() );
- pFrm->GetFormatted();
+ pFrame->GetFormatted();
sal_Int32 nRightMargin;
if ( IsEmpty() )
nRightMargin = 0;
else
{
- SwTextSizeInfo aInf( pFrm );
- SwTextCursor aLine( pFrm, &aInf );
+ SwTextSizeInfo aInf( pFrame );
+ SwTextCursor aLine( pFrame, &aInf );
- aLine.CharCrsrToLine(pPam->GetPoint()->nContent.GetIndex());
+ aLine.CharCursorToLine(pPam->GetPoint()->nContent.GetIndex());
nRightMargin = aLine.GetStart() + aLine.GetCurr()->GetLen();
// We skip hard line brakes
if( aLine.GetCurr()->GetLen() &&
CH_BREAK == aInf.GetText()[nRightMargin - 1])
--nRightMargin;
- else if( !bAPI && (aLine.GetNext() || pFrm->GetFollow()) )
+ else if( !bAPI && (aLine.GetNext() || pFrame->GetFollow()) )
{
while( nRightMargin > aLine.GetStart() &&
' ' == aInf.GetText()[nRightMargin - 1])
--nRightMargin;
}
}
- pPam->GetPoint()->nContent = SwIndex( pFrm->GetTextNode(), nRightMargin );
+ pPam->GetPoint()->nContent = SwIndex( pFrame->GetTextNode(), nRightMargin );
SwTextCursor::SetRightMargin( !bAPI );
return true;
}
-// The following two methods try to put the Crsr into the next/succsessive
+// The following two methods try to put the Cursor into the next/succsessive
// line. If we do not have a preceding/successive line we forward the call
// to the base class.
-// The Crsr's horizontal justification is done afterwards by the CrsrShell.
+// The Cursor's horizontal justification is done afterwards by the CursorShell.
class SwSetToRightMargin
{
@@ -749,7 +749,7 @@ public:
inline void SetRight( const bool bNew ) { bRight = bNew; }
};
-bool SwTextFrm::_UnitUp( SwPaM *pPam, const SwTwips nOffset,
+bool SwTextFrame::_UnitUp( SwPaM *pPam, const SwTwips nOffset,
bool bSetInReadOnly ) const
{
// Set the RightMargin if needed
@@ -761,10 +761,10 @@ bool SwTextFrm::_UnitUp( SwPaM *pPam, const SwTwips nOffset,
{
// If the PaM is located within different boxes, we have a table selection,
// which is handled by the base class.
- return SwContentFrm::UnitUp( pPam, nOffset, bSetInReadOnly );
+ return SwContentFrame::UnitUp( pPam, nOffset, bSetInReadOnly );
}
- const_cast<SwTextFrm*>(this)->GetFormatted();
+ const_cast<SwTextFrame*>(this)->GetFormatted();
const sal_Int32 nPos = pPam->GetPoint()->nContent.GetIndex();
SwRect aCharBox;
@@ -774,14 +774,14 @@ bool SwTextFrm::_UnitUp( SwPaM *pPam, const SwTwips nOffset,
do
{
if( nFormat != COMPLETE_STRING && !IsFollow() )
- sw_ChangeOffset( const_cast<SwTextFrm*>(this), nFormat );
+ sw_ChangeOffset( const_cast<SwTextFrame*>(this), nFormat );
- SwTextSizeInfo aInf( const_cast<SwTextFrm*>(this) );
- SwTextCursor aLine( const_cast<SwTextFrm*>(this), &aInf );
+ SwTextSizeInfo aInf( const_cast<SwTextFrame*>(this) );
+ SwTextCursor aLine( const_cast<SwTextFrame*>(this), &aInf );
// Optimize away flys with no flow and IsDummy()
if( nPos )
- aLine.CharCrsrToLine( nPos );
+ aLine.CharCursorToLine( nPos );
else
aLine.Top();
@@ -821,16 +821,16 @@ bool SwTextFrm::_UnitUp( SwPaM *pPam, const SwTwips nOffset,
aCharBox.SSize().Width() /= 2;
aCharBox.Pos().X() = aCharBox.Pos().X() - 150;
- // See comment in SwTextFrm::GetCrsrOfst()
+ // See comment in SwTextFrame::GetCursorOfst()
#if OSL_DEBUG_LEVEL > 0
const sal_uLong nOldNode = pPam->GetPoint()->nNode.GetIndex();
#endif
// The node should not be changed
- sal_Int32 nTmpOfst = aLine.GetCrsrOfst( pPam->GetPoint(),
+ sal_Int32 nTmpOfst = aLine.GetCursorOfst( pPam->GetPoint(),
aCharBox.Pos(), false );
#if OSL_DEBUG_LEVEL > 0
OSL_ENSURE( nOldNode == pPam->GetPoint()->nNode.GetIndex(),
- "SwTextFrm::UnitUp: illegal node change" );
+ "SwTextFrame::UnitUp: illegal node change" );
#endif
// We make sure that we move up.
@@ -840,7 +840,7 @@ bool SwTextFrm::_UnitUp( SwPaM *pPam, const SwTwips nOffset,
aSet.SetRight( true );
}
pPam->GetPoint()->nContent =
- SwIndex( const_cast<SwTextFrm*>(this)->GetTextNode(), nTmpOfst );
+ SwIndex( const_cast<SwTextFrame*>(this)->GetTextNode(), nTmpOfst );
return true;
}
@@ -858,13 +858,13 @@ bool SwTextFrm::_UnitUp( SwPaM *pPam, const SwTwips nOffset,
*/
if ( IsFollow() )
{
- const SwTextFrm *pTmpPrev = FindMaster();
+ const SwTextFrame *pTmpPrev = FindMaster();
sal_Int32 nOffs = GetOfst();
if( pTmpPrev )
{
- SwViewShell *pSh = getRootFrm()->GetCurrShell();
+ SwViewShell *pSh = getRootFrame()->GetCurrShell();
const bool bProtectedAllowed = pSh && pSh->GetViewOptions()->IsCursorInProtectedArea();
- const SwTextFrm *pPrevPrev = pTmpPrev;
+ const SwTextFrame *pPrevPrev = pTmpPrev;
// We skip protected frames and frames without content here
while( pPrevPrev && ( pPrevPrev->GetOfst() == nOffs ||
( !bProtectedAllowed && pPrevPrev->IsProtected() ) ) )
@@ -877,12 +877,12 @@ bool SwTextFrm::_UnitUp( SwPaM *pPam, const SwTwips nOffset,
pPrevPrev = nullptr;
}
if ( !pPrevPrev )
- return pTmpPrev->SwContentFrm::UnitUp( pPam, nOffset, bSetInReadOnly );
- aCharBox.Pos().Y() = pPrevPrev->Frm().Bottom() - 1;
- return pPrevPrev->GetKeyCrsrOfst( pPam->GetPoint(), aCharBox.Pos() );
+ return pTmpPrev->SwContentFrame::UnitUp( pPam, nOffset, bSetInReadOnly );
+ aCharBox.Pos().Y() = pPrevPrev->Frame().Bottom() - 1;
+ return pPrevPrev->GetKeyCursorOfst( pPam->GetPoint(), aCharBox.Pos() );
}
}
- return SwContentFrm::UnitUp( pPam, nOffset, bSetInReadOnly );
+ return SwContentFrame::UnitUp( pPam, nOffset, bSetInReadOnly );
}
// Used for Bidi. nPos is the logical position in the string, bLeft indicates
@@ -892,7 +892,7 @@ bool SwTextFrm::_UnitUp( SwPaM *pPam, const SwTwips nOffset,
// current position
static void lcl_VisualMoveRecursion( const SwLineLayout& rCurrLine, sal_Int32 nIdx,
sal_Int32& nPos, bool& bRight,
- sal_uInt8& nCrsrLevel, sal_uInt8 nDefaultDir )
+ sal_uInt8& nCursorLevel, sal_uInt8 nDefaultDir )
{
const SwLinePortion* pPor = rCurrLine.GetFirstPortion();
const SwLinePortion* pLast = nullptr;
@@ -916,7 +916,7 @@ static void lcl_VisualMoveRecursion( const SwLineLayout& rCurrLine, sal_Int32 nI
nPos = nPos + pPor->GetLen();
// leave bidi portion
- if ( nCrsrLevel != nDefaultDir )
+ if ( nCursorLevel != nDefaultDir )
{
bRecurse = false;
}
@@ -925,7 +925,7 @@ static void lcl_VisualMoveRecursion( const SwLineLayout& rCurrLine, sal_Int32 nI
// buffer: abcXYZ123 in LTR paragraph
// view: abc123ZYX
// cursor is between c and X in the buffer and cursor level = 0
- nCrsrLevel++;
+ nCursorLevel++;
}
// 2. special case: at beginning of portion after bidi portion
@@ -933,7 +933,7 @@ static void lcl_VisualMoveRecursion( const SwLineLayout& rCurrLine, sal_Int32 nI
static_cast<const SwMultiPortion*>(pLast)->IsBidi() && nIdx == nPos )
{
// enter bidi portion
- if ( nCrsrLevel != nDefaultDir )
+ if ( nCursorLevel != nDefaultDir )
{
bRecurse = true;
nIdx = nIdx - pLast->GetLen();
@@ -947,20 +947,20 @@ static void lcl_VisualMoveRecursion( const SwLineLayout& rCurrLine, sal_Int32 nI
const SwLineLayout& rLine = static_cast<const SwMultiPortion*>(pPor)->GetRoot();
sal_Int32 nTmpPos = nPos - nIdx;
bool bTmpForward = ! bRight;
- sal_uInt8 nTmpCrsrLevel = nCrsrLevel;
+ sal_uInt8 nTmpCursorLevel = nCursorLevel;
lcl_VisualMoveRecursion( rLine, 0, nTmpPos, bTmpForward,
- nTmpCrsrLevel, nDefaultDir + 1 );
+ nTmpCursorLevel, nDefaultDir + 1 );
nPos = nTmpPos + nIdx;
bRight = bTmpForward;
- nCrsrLevel = nTmpCrsrLevel;
+ nCursorLevel = nTmpCursorLevel;
}
// go forward
else
{
bRight = true;
- nCrsrLevel = nDefaultDir;
+ nCursorLevel = nDefaultDir;
}
}
@@ -972,7 +972,7 @@ static void lcl_VisualMoveRecursion( const SwLineLayout& rCurrLine, sal_Int32 nI
if ( bRecurse && nIdx == nPos )
{
// leave bidi portion
- if ( nCrsrLevel == nDefaultDir )
+ if ( nCursorLevel == nDefaultDir )
{
bRecurse = false;
}
@@ -985,7 +985,7 @@ static void lcl_VisualMoveRecursion( const SwLineLayout& rCurrLine, sal_Int32 nI
nPos = nPos - pLast->GetLen();
// enter bidi portion
- if ( nCrsrLevel % 2 == nDefaultDir % 2 )
+ if ( nCursorLevel % 2 == nDefaultDir % 2 )
{
bRecurse = true;
nIdx = nIdx - pLast->GetLen();
@@ -995,7 +995,7 @@ static void lcl_VisualMoveRecursion( const SwLineLayout& rCurrLine, sal_Int32 nI
// buffer: abcXYZ123 in LTR paragraph
// view: abc123ZYX
// cursor is behind 3 in the buffer and cursor level = 2
- if ( nDefaultDir + 2 == nCrsrLevel )
+ if ( nDefaultDir + 2 == nCursorLevel )
nPos = nPos + pLast->GetLen();
}
}
@@ -1006,37 +1006,37 @@ static void lcl_VisualMoveRecursion( const SwLineLayout& rCurrLine, sal_Int32 nI
const SwLineLayout& rLine = static_cast<const SwMultiPortion*>(pPor)->GetRoot();
sal_Int32 nTmpPos = nPos - nIdx;
bool bTmpForward = ! bRight;
- sal_uInt8 nTmpCrsrLevel = nCrsrLevel;
+ sal_uInt8 nTmpCursorLevel = nCursorLevel;
lcl_VisualMoveRecursion( rLine, 0, nTmpPos, bTmpForward,
- nTmpCrsrLevel, nDefaultDir + 1 );
+ nTmpCursorLevel, nDefaultDir + 1 );
// special case:
// buffer: abcXYZ123 in LTR paragraph
// view: abc123ZYX
// cursor is between Z and 1 in the buffer and cursor level = 2
- if ( nTmpPos == pPor->GetLen() && nTmpCrsrLevel == nDefaultDir + 1 )
+ if ( nTmpPos == pPor->GetLen() && nTmpCursorLevel == nDefaultDir + 1 )
{
nTmpPos = nTmpPos - pPor->GetLen();
- nTmpCrsrLevel = nDefaultDir;
+ nTmpCursorLevel = nDefaultDir;
bTmpForward = ! bTmpForward;
}
nPos = nTmpPos + nIdx;
bRight = bTmpForward;
- nCrsrLevel = nTmpCrsrLevel;
+ nCursorLevel = nTmpCursorLevel;
}
// go backward
else
{
bRight = false;
- nCrsrLevel = nDefaultDir;
+ nCursorLevel = nDefaultDir;
}
}
}
-void SwTextFrm::PrepareVisualMove( sal_Int32& nPos, sal_uInt8& nCrsrLevel,
- bool& bForward, bool bInsertCrsr )
+void SwTextFrame::PrepareVisualMove( sal_Int32& nPos, sal_uInt8& nCursorLevel,
+ bool& bForward, bool bInsertCursor )
{
if( IsEmpty() || IsHiddenNow() )
return;
@@ -1047,7 +1047,7 @@ void SwTextFrm::PrepareVisualMove( sal_Int32& nPos, sal_uInt8& nCrsrLevel,
SwTextCursor aLine(this, &aInf);
if( nPos )
- aLine.CharCrsrToLine( nPos );
+ aLine.CharCursorToLine( nPos );
else
aLine.Top();
@@ -1064,10 +1064,10 @@ void SwTextFrm::PrepareVisualMove( sal_Int32& nPos, sal_uInt8& nCrsrLevel,
// If the cursor level is 1, the cursor blinks between X and d and
// -> sets the cursor between d and e.
// The overwrite cursor simply travels to the next visual character.
- if ( bInsertCrsr )
+ if ( bInsertCursor )
{
lcl_VisualMoveRecursion( *pLine, nStt, nPos, bForward,
- nCrsrLevel, IsRightToLeft() ? 1 : 0 );
+ nCursorLevel, IsRightToLeft() ? 1 : 0 );
return;
}
@@ -1138,7 +1138,7 @@ void SwTextFrm::PrepareVisualMove( sal_Int32& nPos, sal_uInt8& nCrsrLevel,
ubidi_close( pBidi );
}
-bool SwTextFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset,
+bool SwTextFrame::_UnitDown(SwPaM *pPam, const SwTwips nOffset,
bool bSetInReadOnly ) const
{
@@ -1148,15 +1148,15 @@ bool SwTextFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset,
{
// If the PaM is located within different boxes, we have a table selection,
// which is handled by the base class.
- return SwContentFrm::UnitDown( pPam, nOffset, bSetInReadOnly );
+ return SwContentFrame::UnitDown( pPam, nOffset, bSetInReadOnly );
}
- const_cast<SwTextFrm*>(this)->GetFormatted();
+ const_cast<SwTextFrame*>(this)->GetFormatted();
const sal_Int32 nPos = pPam->GetPoint()->nContent.GetIndex();
SwRect aCharBox;
- const SwContentFrm *pTmpFollow = nullptr;
+ const SwContentFrame *pTmpFollow = nullptr;
if ( IsVertical() )
- const_cast<SwTextFrm*>(this)->SwapWidthAndHeight();
+ const_cast<SwTextFrame*>(this)->SwapWidthAndHeight();
if ( !IsEmpty() && !IsHiddenNow() )
{
@@ -1164,14 +1164,14 @@ bool SwTextFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset,
do
{
if( nFormat != COMPLETE_STRING && !IsFollow() &&
- !sw_ChangeOffset( const_cast<SwTextFrm*>(this), nFormat ) )
+ !sw_ChangeOffset( const_cast<SwTextFrame*>(this), nFormat ) )
break;
- SwTextSizeInfo aInf( const_cast<SwTextFrm*>(this) );
- SwTextCursor aLine( const_cast<SwTextFrm*>(this), &aInf );
+ SwTextSizeInfo aInf( const_cast<SwTextFrame*>(this) );
+ SwTextCursor aLine( const_cast<SwTextFrame*>(this), &aInf );
nFormat = aLine.GetEnd();
- aLine.CharCrsrToLine( nPos );
+ aLine.CharCursorToLine( nPos );
const SwLineLayout* pNextLine = aLine.GetNextLine();
const sal_Int32 nStart = aLine.GetStart();
@@ -1183,34 +1183,34 @@ bool SwTextFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset,
{
aCharBox.SSize().Width() /= 2;
#if OSL_DEBUG_LEVEL > 0
- // See comment in SwTextFrm::GetCrsrOfst()
+ // See comment in SwTextFrame::GetCursorOfst()
const sal_uLong nOldNode = pPam->GetPoint()->nNode.GetIndex();
#endif
if ( pNextLine && ! bFirstOfDouble )
aLine.NextLine();
- sal_Int32 nTmpOfst = aLine.GetCrsrOfst( pPam->GetPoint(),
+ sal_Int32 nTmpOfst = aLine.GetCursorOfst( pPam->GetPoint(),
aCharBox.Pos(), false );
#if OSL_DEBUG_LEVEL > 0
OSL_ENSURE( nOldNode == pPam->GetPoint()->nNode.GetIndex(),
- "SwTextFrm::UnitDown: illegal node change" );
+ "SwTextFrame::UnitDown: illegal node change" );
#endif
// We make sure that we move down.
if( nTmpOfst <= nStart && ! bFirstOfDouble )
nTmpOfst = nStart + 1;
pPam->GetPoint()->nContent =
- SwIndex( const_cast<SwTextFrm*>(this)->GetTextNode(), nTmpOfst );
+ SwIndex( const_cast<SwTextFrame*>(this)->GetTextNode(), nTmpOfst );
if ( IsVertical() )
- const_cast<SwTextFrm*>(this)->SwapWidthAndHeight();
+ const_cast<SwTextFrame*>(this)->SwapWidthAndHeight();
return true;
}
if( nullptr != ( pTmpFollow = GetFollow() ) )
{ // Skip protected follows
- const SwContentFrm* pTmp = pTmpFollow;
- SwViewShell *pSh = getRootFrm()->GetCurrShell();
+ const SwContentFrame* pTmp = pTmpFollow;
+ SwViewShell *pSh = getRootFrame()->GetCurrShell();
if( !pSh || !pSh->GetViewOptions()->IsCursorInProtectedArea() )
{
while( pTmpFollow && pTmpFollow->IsProtected() )
@@ -1222,8 +1222,8 @@ bool SwTextFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset,
if( !pTmpFollow ) // Only protected ones left
{
if ( IsVertical() )
- const_cast<SwTextFrm*>(this)->SwapWidthAndHeight();
- return pTmp->SwContentFrm::UnitDown( pPam, nOffset, bSetInReadOnly );
+ const_cast<SwTextFrame*>(this)->SwapWidthAndHeight();
+ return pTmp->SwContentFrame::UnitDown( pPam, nOffset, bSetInReadOnly );
}
aLine.GetCharRect( &aCharBox, nPos );
@@ -1251,63 +1251,63 @@ bool SwTextFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset,
pTmpFollow = GetFollow();
if ( IsVertical() )
- const_cast<SwTextFrm*>(this)->SwapWidthAndHeight();
+ const_cast<SwTextFrame*>(this)->SwapWidthAndHeight();
// We take a shortcut for follows
if( pTmpFollow )
{
- aCharBox.Pos().Y() = pTmpFollow->Frm().Top() + 1;
- return static_cast<const SwTextFrm*>(pTmpFollow)->GetKeyCrsrOfst( pPam->GetPoint(),
+ aCharBox.Pos().Y() = pTmpFollow->Frame().Top() + 1;
+ return static_cast<const SwTextFrame*>(pTmpFollow)->GetKeyCursorOfst( pPam->GetPoint(),
aCharBox.Pos() );
}
- return SwContentFrm::UnitDown( pPam, nOffset, bSetInReadOnly );
+ return SwContentFrame::UnitDown( pPam, nOffset, bSetInReadOnly );
}
-bool SwTextFrm::UnitUp(SwPaM *pPam, const SwTwips nOffset,
+bool SwTextFrame::UnitUp(SwPaM *pPam, const SwTwips nOffset,
bool bSetInReadOnly ) const
{
- /* We call ContentNode::GertFrm() in CrsrSh::Up().
+ /* We call ContentNode::GertFrame() in CursorSh::Up().
* This _always returns the master.
* In order to not mess with cursor travelling, we correct here
- * in SwTextFrm.
- * We calculate UnitUp for pFrm. pFrm is either a master (= this) or a
+ * in SwTextFrame.
+ * We calculate UnitUp for pFrame. pFrame is either a master (= this) or a
* follow (!= this).
*/
- const SwTextFrm *pFrm = GetAdjFrmAtPos( const_cast<SwTextFrm*>(this), *(pPam->GetPoint()),
+ const SwTextFrame *pFrame = GetAdjFrameAtPos( const_cast<SwTextFrame*>(this), *(pPam->GetPoint()),
SwTextCursor::IsRightMargin() );
- const bool bRet = pFrm->_UnitUp( pPam, nOffset, bSetInReadOnly );
+ const bool bRet = pFrame->_UnitUp( pPam, nOffset, bSetInReadOnly );
// No SwTextCursor::SetRightMargin( false );
// Instead we have a SwSetToRightMargin in _UnitUp
return bRet;
}
-bool SwTextFrm::UnitDown(SwPaM *pPam, const SwTwips nOffset,
+bool SwTextFrame::UnitDown(SwPaM *pPam, const SwTwips nOffset,
bool bSetInReadOnly ) const
{
- const SwTextFrm *pFrm = GetAdjFrmAtPos(const_cast<SwTextFrm*>(this), *(pPam->GetPoint()),
+ const SwTextFrame *pFrame = GetAdjFrameAtPos(const_cast<SwTextFrame*>(this), *(pPam->GetPoint()),
SwTextCursor::IsRightMargin() );
- const bool bRet = pFrm->_UnitDown( pPam, nOffset, bSetInReadOnly );
+ const bool bRet = pFrame->_UnitDown( pPam, nOffset, bSetInReadOnly );
SwTextCursor::SetRightMargin( false );
return bRet;
}
-void SwTextFrm::FillCrsrPos( SwFillData& rFill ) const
+void SwTextFrame::FillCursorPos( SwFillData& rFill ) const
{
- if( !rFill.bColumn && GetUpper()->IsColBodyFrm() ) // ColumnFrms now with BodyFrm
+ if( !rFill.bColumn && GetUpper()->IsColBodyFrame() ) // ColumnFrames now with BodyFrame
{
- const SwColumnFrm* pTmp =
- static_cast<const SwColumnFrm*>(GetUpper()->GetUpper()->GetUpper()->Lower()); // The 1st column
- // The first SwFrm in BodyFrm of the first column
- const SwFrm* pFrm = static_cast<const SwLayoutFrm*>(pTmp->Lower())->Lower();
+ const SwColumnFrame* pTmp =
+ static_cast<const SwColumnFrame*>(GetUpper()->GetUpper()->GetUpper()->Lower()); // The 1st column
+ // The first SwFrame in BodyFrame of the first column
+ const SwFrame* pFrame = static_cast<const SwLayoutFrame*>(pTmp->Lower())->Lower();
sal_uInt16 nNextCol = 0;
// In which column do we end up in?
- while( rFill.X() > pTmp->Frm().Right() && pTmp->GetNext() )
+ while( rFill.X() > pTmp->Frame().Right() && pTmp->GetNext() )
{
- pTmp = static_cast<const SwColumnFrm*>(pTmp->GetNext());
- if( static_cast<const SwLayoutFrm*>(pTmp->Lower())->Lower() ) // ColumnFrms now with BodyFrm
+ pTmp = static_cast<const SwColumnFrame*>(pTmp->GetNext());
+ if( static_cast<const SwLayoutFrame*>(pTmp->Lower())->Lower() ) // ColumnFrames now with BodyFrame
{
- pFrm = static_cast<const SwLayoutFrm*>(pTmp->Lower())->Lower();
+ pFrame = static_cast<const SwLayoutFrame*>(pTmp->Lower())->Lower();
nNextCol = 0;
}
else
@@ -1315,39 +1315,39 @@ void SwTextFrm::FillCrsrPos( SwFillData& rFill ) const
}
if( pTmp != GetUpper()->GetUpper() ) // Did we end up in another column?
{
- if( !pFrm )
+ if( !pFrame )
return;
if( nNextCol )
{
- while( pFrm->GetNext() )
- pFrm = pFrm->GetNext();
+ while( pFrame->GetNext() )
+ pFrame = pFrame->GetNext();
}
else
{
- while( pFrm->GetNext() && pFrm->Frm().Bottom() < rFill.Y() )
- pFrm = pFrm->GetNext();
+ while( pFrame->GetNext() && pFrame->Frame().Bottom() < rFill.Y() )
+ pFrame = pFrame->GetNext();
}
// No filling, if the last frame in the targeted column does
// not contain a paragraph, but e.g. a table
- if( pFrm->IsTextFrm() )
+ if( pFrame->IsTextFrame() )
{
rFill.Fill().nColumnCnt = nNextCol;
rFill.bColumn = true;
if( rFill.pPos )
{
- SwTextNode* pTextNd = const_cast<SwTextFrm*>(static_cast<const SwTextFrm*>(pFrm))->GetTextNode();
+ SwTextNode* pTextNd = const_cast<SwTextFrame*>(static_cast<const SwTextFrame*>(pFrame))->GetTextNode();
rFill.pPos->nNode = *pTextNd;
rFill.pPos->nContent.Assign(
pTextNd, pTextNd->GetText().getLength());
}
if( nNextCol )
{
- rFill.aFrm = pTmp->Prt();
- rFill.aFrm += pTmp->Frm().Pos();
+ rFill.aFrame = pTmp->Prt();
+ rFill.aFrame += pTmp->Frame().Pos();
}
else
- rFill.aFrm = pFrm->Frm();
- static_cast<const SwTextFrm*>(pFrm)->FillCrsrPos( rFill );
+ rFill.aFrame = pFrame->Frame();
+ static_cast<const SwTextFrame*>(pFrame)->FillCursorPos( rFill );
}
return;
}
@@ -1355,14 +1355,14 @@ void SwTextFrm::FillCrsrPos( SwFillData& rFill ) const
SwFont *pFnt;
SwTextFormatColl* pColl = GetTextNode()->GetTextColl();
SwTwips nFirst = GetTextNode()->GetSwAttrSet().GetULSpace().GetLower();
- SwTwips nDiff = rFill.Y() - Frm().Bottom();
+ SwTwips nDiff = rFill.Y() - Frame().Bottom();
if( nDiff < nFirst )
nDiff = -1;
else
pColl = &pColl->GetNextTextFormatColl();
SwAttrSet aSet( const_cast<SwDoc*>(GetTextNode()->GetDoc())->GetAttrPool(), aTextFormatCollSetRange );
const SwAttrSet* pSet = &pColl->GetAttrSet();
- SwViewShell *pSh = getRootFrm()->GetCurrShell();
+ SwViewShell *pSh = getRootFrame()->GetCurrShell();
if( GetTextNode()->HasSwAttrSet() )
{
aSet.Put( *GetTextNode()->GetpSwAttrSet() );
@@ -1393,7 +1393,7 @@ void SwTextFrm::FillCrsrPos( SwFillData& rFill ) const
SwTwips nDist = std::max( rUL.GetLower(), rUL.GetUpper() );
if( rFill.Fill().nColumnCnt )
{
- rFill.aFrm.Height( nLineHeight );
+ rFill.aFrame.Height( nLineHeight );
nDiff = rFill.Y() - rFill.Bottom();
nFirst = 0;
}
@@ -1423,7 +1423,7 @@ void SwTextFrm::FillCrsrPos( SwFillData& rFill ) const
const SvxTabStopItem &rRuler = pSet->GetTabStops();
const SvxLRSpaceItem &rLRSpace = pSet->GetLRSpace();
- SwRect &rRect = rFill.Fill().aCrsr;
+ SwRect &rRect = rFill.Fill().aCursor;
rRect.Top( rFill.Bottom() + (nDiff+1) * nDist - nLineHeight );
if( nFirst && nDiff > -1 )
rRect.Top( rRect.Top() + nFirst );
@@ -1641,13 +1641,13 @@ void SwTextFrm::FillCrsrPos( SwFillData& rFill ) const
}
}
// Do we extend over the page's/column's/etc. lower edge?
- const SwFrm* pUp = GetUpper();
+ const SwFrame* pUp = GetUpper();
if( pUp->IsInSct() )
{
- if( pUp->IsSctFrm() )
+ if( pUp->IsSctFrame() )
pUp = pUp->GetUpper();
- else if( pUp->IsColBodyFrm() &&
- pUp->GetUpper()->GetUpper()->IsSctFrm() )
+ else if( pUp->IsColBodyFrame() &&
+ pUp->GetUpper()->GetUpper()->IsSctFrame() )
pUp = pUp->GetUpper()->GetUpper()->GetUpper();
}
SWRECTFN( this )
@@ -1662,7 +1662,7 @@ void SwTextFrm::FillCrsrPos( SwFillData& rFill ) const
rRect.Width( 1 );
}
}
- const_cast<SwCrsrMoveState*>(rFill.pCMS)->m_bFillRet = bFill;
+ const_cast<SwCursorMoveState*>(rFill.pCMS)->m_bFillRet = bFill;
delete pFnt;
}