Kaydet (Commit) 2772d52e authored tarafından Philipp Riemer's avatar Philipp Riemer

Cleanup sw/source/core/layout/trvlfrm.cxx

Change-Id: I979269121cda8e2b70a410ce622e78efe472c82c
üst bc599dca
...@@ -149,14 +149,7 @@ public: ...@@ -149,14 +149,7 @@ public:
static SwCrsrOszControl aOszCtrl = { 0, 0, 0 }; static SwCrsrOszControl aOszCtrl = { 0, 0, 0 };
/************************************************************************* /** Searches the CntntFrm owning the PrtArea containing the point. */
|*
|* SwLayoutFrm::GetCrsrOfst()
|*
|* Description: Searches the CntntFrm owning the PrtArea
|* containing the point.
|*
|*************************************************************************/
sal_Bool SwLayoutFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint, sal_Bool SwLayoutFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
SwCrsrMoveState* pCMS, bool ) const SwCrsrMoveState* pCMS, bool ) const
{ {
...@@ -183,13 +176,7 @@ sal_Bool SwLayoutFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint, ...@@ -183,13 +176,7 @@ sal_Bool SwLayoutFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
return bRet; return bRet;
} }
/************************************************************************* /** Searches the page containing the searched point. */
|*
|* SwPageFrm::GetCrsrOfst()
|*
|* Description: Searches the page containing the searched point.
|*
|*************************************************************************/
sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint, sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
SwCrsrMoveState* pCMS, bool bTestBackground ) const SwCrsrMoveState* pCMS, bool bTestBackground ) const
...@@ -395,14 +382,10 @@ bool SwRootFrm::FillSelection( SwSelectionList& aSelList, const SwRect& rRect) c ...@@ -395,14 +382,10 @@ bool SwRootFrm::FillSelection( SwSelectionList& aSelList, const SwRect& rRect) c
return !aSelList.isEmpty(); return !aSelList.isEmpty();
} }
/************************************************************************* /** Primary passes the call to the first page.
|* *
|* SwRootFrm::GetCrsrOfst() * @return sal_False, if the passed Point gets changed
|* */
|* Description: Primary passes the call to the first page.
|* If the passed Point gets changed we return sal_False.
|*
|*************************************************************************/
sal_Bool SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint, sal_Bool SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
SwCrsrMoveState* pCMS, bool bTestBackground ) const SwCrsrMoveState* pCMS, bool bTestBackground ) const
{ {
...@@ -444,16 +427,12 @@ sal_Bool SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint, ...@@ -444,16 +427,12 @@ sal_Bool SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
return aOldPoint == rPoint; return aOldPoint == rPoint;
} }
/************************************************************************* /**
|* * If this is about a Cntnt-carrying cell the Crsr will be force inserted into one of the CntntFrms
|* SwCellFrm::GetCrsrOfst() * if there are no other options.
|* *
|* Description: If this is about a Cntnt-carrying cell the Crsr will * There is no entry for protected cells.
|* be force inserted into one of the CntntFrms if there are */
|* no other options.
|* There is no entry for protected cells.
|*
|*************************************************************************/
sal_Bool SwCellFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint, sal_Bool SwCellFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
SwCrsrMoveState* pCMS, bool ) const SwCrsrMoveState* pCMS, bool ) const
{ {
...@@ -516,19 +495,13 @@ sal_Bool SwCellFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint, ...@@ -516,19 +495,13 @@ sal_Bool SwCellFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
return sal_False; return sal_False;
} }
/*************************************************************************
|*
|* SwFlyFrm::GetCrsrOfst()
|*
|*************************************************************************/
//Problem: If two Flys have the same size and share the same position then //Problem: If two Flys have the same size and share the same position then
//they end inside each other. //they end inside each other.
//Because we recursively check if a Point doesn't randomly lie inside an other //Because we recursively check if a Point doesn't randomly lie inside an other
//fly which lies completely inside the current Fly we could trigger an endless //fly which lies completely inside the current Fly we could trigger an endless
//loop with the mentioned situation above. //loop with the mentioned situation above.
//Using the helper class SwCrsrOszControl we prevent the recursion. During //Using the helper class SwCrsrOszControl we prevent the recursion. During
// a recursion GetCrsrOfst picks the one which lies on top. //a recursion GetCrsrOfst picks the one which lies on top.
sal_Bool SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint, sal_Bool SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
SwCrsrMoveState* pCMS, bool ) const SwCrsrMoveState* pCMS, bool ) const
{ {
...@@ -605,11 +578,7 @@ sal_Bool SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint, ...@@ -605,11 +578,7 @@ sal_Bool SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
return bRet; return bRet;
} }
/************************************************************************* /** Layout dependent cursor travelling */
|*
|* Description: Layout dependent cursor travelling
|*
|*************************************************************************/
sal_Bool SwCntntFrm::LeftMargin(SwPaM *pPam) const sal_Bool SwCntntFrm::LeftMargin(SwPaM *pPam) const
{ {
if( pPam->GetNode() != (SwCntntNode*)GetNode() ) if( pPam->GetNode() != (SwCntntNode*)GetNode() )
...@@ -640,7 +609,7 @@ static const SwCntntFrm *lcl_GetPrvCnt( const SwCntntFrm* pCnt ) ...@@ -640,7 +609,7 @@ static const SwCntntFrm *lcl_GetPrvCnt( const SwCntntFrm* pCnt )
typedef const SwCntntFrm *(*GetNxtPrvCnt)( const SwCntntFrm* ); typedef const SwCntntFrm *(*GetNxtPrvCnt)( const SwCntntFrm* );
//Frame in repeated headline? /// Frame in repeated headline?
static bool lcl_IsInRepeatedHeadline( const SwFrm *pFrm, static bool lcl_IsInRepeatedHeadline( const SwFrm *pFrm,
const SwTabFrm** ppTFrm = 0 ) const SwTabFrm** ppTFrm = 0 )
{ {
...@@ -651,7 +620,7 @@ static bool lcl_IsInRepeatedHeadline( const SwFrm *pFrm, ...@@ -651,7 +620,7 @@ static bool lcl_IsInRepeatedHeadline( const SwFrm *pFrm,
} }
//Skip protected table cells. Optionally also skip repeated headlines. /// Skip protected table cells. Optionally also skip repeated headlines.
//MA 1998-01-26: Chg also skip other protected areas //MA 1998-01-26: Chg also skip other protected areas
//FME: Skip follow flow cells //FME: Skip follow flow cells
static const SwCntntFrm * lcl_MissProtectedFrames( const SwCntntFrm *pCnt, static const SwCntntFrm * lcl_MissProtectedFrames( const SwCntntFrm *pCnt,
...@@ -958,15 +927,11 @@ sal_Bool SwCntntFrm::UnitDown( SwPaM* pPam, const SwTwips, sal_Bool bInReadOnly ...@@ -958,15 +927,11 @@ sal_Bool SwCntntFrm::UnitDown( SwPaM* pPam, const SwTwips, sal_Bool bInReadOnly
return ::lcl_UpDown( pPam, this, lcl_GetNxtCnt, bInReadOnly ); return ::lcl_UpDown( pPam, this, lcl_GetNxtCnt, bInReadOnly );
} }
/************************************************************************* /** Returns the number of the current page.
|* *
|* SwRootFrm::GetCurrPage() * If the method gets a PaM then the current page is the one in which the PaM sits. Otherwise the
|* * current page is the first one inside the VisibleArea. We only work on available pages!
|* Description: Returns the number of the current page. */
|* If the method gets a PaM then the current page is the one in which
|* the PaM sits. Otherwise the current page is the first one inside the
|* VisibleArea. We only work on available pages!
|*************************************************************************/
sal_uInt16 SwRootFrm::GetCurrPage( const SwPaM *pActualCrsr ) const sal_uInt16 SwRootFrm::GetCurrPage( const SwPaM *pActualCrsr ) const
{ {
OSL_ENSURE( pActualCrsr, "Welche Seite soll's denn sein?" ); OSL_ENSURE( pActualCrsr, "Welche Seite soll's denn sein?" );
...@@ -977,16 +942,13 @@ sal_uInt16 SwRootFrm::GetCurrPage( const SwPaM *pActualCrsr ) const ...@@ -977,16 +942,13 @@ sal_uInt16 SwRootFrm::GetCurrPage( const SwPaM *pActualCrsr ) const
return pActFrm->FindPageFrm()->GetPhyPageNum(); return pActFrm->FindPageFrm()->GetPhyPageNum();
} }
/************************************************************************* /** Returns a PaM which sits at the beginning of the requested page.
|* *
|* SwRootFrm::SetCurrPage() * Formatting is done as far as necessary.
|* * The PaM sits on the last page, if the page number was chosen to big.
|* Description: Returns a PaM which sits at the beginning of the *
|* requested page. * @return Null, if the operation was not possible.
|* Formatting is done as far as necessary. */
|* Returns Null if the operation was not possible.
|* The PaM sits on the last page, if the page number was chosen to big.
|*************************************************************************/
sal_uInt16 SwRootFrm::SetCurrPage( SwCursor* pToSet, sal_uInt16 nPageNum ) sal_uInt16 SwRootFrm::SetCurrPage( SwCursor* pToSet, sal_uInt16 nPageNum )
{ {
OSL_ENSURE( Lower() && Lower()->IsPageFrm(), "No page available." ); OSL_ENSURE( Lower() && Lower()->IsPageFrm(), "No page available." );
...@@ -1099,8 +1061,10 @@ SwWhichPage fnPagePrev = GetPrevFrm; ...@@ -1099,8 +1061,10 @@ SwWhichPage fnPagePrev = GetPrevFrm;
SwWhichPage fnPageCurr = GetThisFrm; SwWhichPage fnPageCurr = GetThisFrm;
SwWhichPage fnPageNext = GetNextFrm; SwWhichPage fnPageNext = GetNextFrm;
//Returns the first/last Contentframe (controlled using the parameter fnPosPage) /**
//of the current/previous/next page (controlled using the parameter fnWhichPage). * Returns the first/last Contentframe (controlled using the parameter fnPosPage)
* of the current/previous/next page (controlled using the parameter fnWhichPage).
*/
sal_Bool GetFrmInPage( const SwCntntFrm *pCnt, SwWhichPage fnWhichPage, sal_Bool GetFrmInPage( const SwCntntFrm *pCnt, SwWhichPage fnWhichPage,
SwPosPage fnPosPage, SwPaM *pPam ) SwPosPage fnPosPage, SwPaM *pPam )
{ {
...@@ -1151,16 +1115,6 @@ sal_Bool GetFrmInPage( const SwCntntFrm *pCnt, SwWhichPage fnWhichPage, ...@@ -1151,16 +1115,6 @@ sal_Bool GetFrmInPage( const SwCntntFrm *pCnt, SwWhichPage fnWhichPage,
} }
} }
/*************************************************************************
|*
|* SwLayoutFrm::GetCntntPos()
|*
|* Description The nearest Cntnt to pass will be searched. Considered
|* are the previous, the current and the next page.
|* If no content is found, the area gets expanded until one
|* is found. The 'semantically correct' position inside
|* the PrtArea of the found CntntFrm will be returned.
|*************************************************************************/
sal_uLong CalcDiff( const Point &rPt1, const Point &rPt2 ) sal_uLong CalcDiff( const Point &rPt1, const Point &rPt2 )
{ {
//Calculate the distance between the two points. //Calculate the distance between the two points.
...@@ -1174,13 +1128,12 @@ sal_uLong CalcDiff( const Point &rPt1, const Point &rPt2 ) ...@@ -1174,13 +1128,12 @@ sal_uLong CalcDiff( const Point &rPt1, const Point &rPt2 )
return ::SqRt( dX1 + dY1 ); return ::SqRt( dX1 + dY1 );
} }
// lcl_Inside checks if the point lies inside the page part in wich also the /** Check if the point lies inside the page part in wich also the CntntFrame lies.
// CntntFrame lies. In this context header, page body, footer and footnote- *
// container count as page part. * In this context header, page body, footer and footnote-container count as page part.
// This will suit the purpose that the CntntFrm which lies in the "right" page * This will suit the purpose that the CntntFrm which lies in the "right" page part will be
// part will be accepted instead of one which doesn't lie there although his * accepted instead of one which doesn't lie there although his distance to the point is shorter.
// distance to the point is shorter. */
static const SwLayoutFrm* lcl_Inside( const SwCntntFrm *pCnt, Point& rPt ) static const SwLayoutFrm* lcl_Inside( const SwCntntFrm *pCnt, Point& rPt )
{ {
const SwLayoutFrm* pUp = pCnt->GetUpper(); const SwLayoutFrm* pUp = pCnt->GetUpper();
...@@ -1199,6 +1152,13 @@ static const SwLayoutFrm* lcl_Inside( const SwCntntFrm *pCnt, Point& rPt ) ...@@ -1199,6 +1152,13 @@ static const SwLayoutFrm* lcl_Inside( const SwCntntFrm *pCnt, Point& rPt )
return NULL; return NULL;
} }
/** Search for the nearest Cntnt to pass.
*
* Considers the previous, the current and the next page.
* If no content is found, the area gets expanded until one is found.
*
* @return The 'semantically correct' position inside the PrtArea of the found CntntFrm.
*/
const SwCntntFrm *SwLayoutFrm::GetCntntPos( Point& rPoint, const SwCntntFrm *SwLayoutFrm::GetCntntPos( Point& rPoint,
const sal_Bool bDontLeave, const sal_Bool bDontLeave,
const sal_Bool bBodyOnly, const sal_Bool bBodyOnly,
...@@ -1400,14 +1360,7 @@ const SwCntntFrm *SwLayoutFrm::GetCntntPos( Point& rPoint, ...@@ -1400,14 +1360,7 @@ const SwCntntFrm *SwLayoutFrm::GetCntntPos( Point& rPoint,
return pActual; return pActual;
} }
/************************************************************************* /** Same as SwLayoutFrm::GetCntntPos(). Specialized for fields and border. */
|*
|* SwPageFrm::GetCntntPosition()
|*
|* Description: Same as SwLayoutFrm::GetCntntPos().
|* Specialized for fields and border.
|*
|*************************************************************************/
void SwPageFrm::GetCntntPosition( const Point &rPt, SwPosition &rPos ) const void SwPageFrm::GetCntntPosition( const Point &rPt, SwPosition &rPos ) const
{ {
//Determine the first CntntFrm. //Determine the first CntntFrm.
...@@ -1495,15 +1448,6 @@ void SwPageFrm::GetCntntPosition( const Point &rPt, SwPosition &rPos ) const ...@@ -1495,15 +1448,6 @@ void SwPageFrm::GetCntntPosition( const Point &rPt, SwPosition &rPos ) const
} }
} }
/*************************************************************************
|*
|* SwRootFrm::GetNextPrevCntntPos()
|*
|* Description: Search the nearest Cntnt to the passed point. Only
|* search inside the BodyText.
|*
|*************************************************************************/
// #123110# - helper class to disable creation of an action // #123110# - helper class to disable creation of an action
// by a callback event - e.g., change event from a drawing object // by a callback event - e.g., change event from a drawing object
class DisableCallbackAction class DisableCallbackAction
...@@ -1526,8 +1470,12 @@ class DisableCallbackAction ...@@ -1526,8 +1470,12 @@ class DisableCallbackAction
} }
}; };
//!!!!! Only the nearest vertically one will be searched. /** Search the nearest Cntnt to the passed point.
//JP 11.10.2001: only in tables we try to find the right column - Bug 72294 *
* Only search inside the BodyText.
* @note Only the nearest vertically one will be searched.
* @note JP 11.10.2001: only in tables we try to find the right column - Bug 72294
*/
Point SwRootFrm::GetNextPrevCntntPos( const Point& rPoint, sal_Bool bNext ) const Point SwRootFrm::GetNextPrevCntntPos( const Point& rPoint, sal_Bool bNext ) const
{ {
// #123110# - disable creation of an action by a callback // #123110# - disable creation of an action by a callback
...@@ -1609,16 +1557,13 @@ Point SwRootFrm::GetNextPrevCntntPos( const Point& rPoint, sal_Bool bNext ) cons ...@@ -1609,16 +1557,13 @@ Point SwRootFrm::GetNextPrevCntntPos( const Point& rPoint, sal_Bool bNext ) cons
return Point( 0, 0 ); return Point( 0, 0 );
} }
/************************************************************************* /** Returns the absolute document position of the desired page.
|* *
|* SwRootFrm::GetPagePos() * Formatting is done only as far as needed and only if bFormat=sal_True.
|* * Pos is set to the one of the last page, if the page number was chosen to big.
|* Description: Returns the absolute document position of the desired page. *
|* Formatting is done only as far as needed and only if bFormat=sal_True. * @return Null, if the operation failed.
|* Returns Null if the operation failed. */
|* Pos is set to the one of the last page, if the page number was
|* chosen to big.
|*************************************************************************/
Point SwRootFrm::GetPagePos( sal_uInt16 nPageNum ) const Point SwRootFrm::GetPagePos( sal_uInt16 nPageNum ) const
{ {
OSL_ENSURE( Lower() && Lower()->IsPageFrm(), "No page available." ); OSL_ENSURE( Lower() && Lower()->IsPageFrm(), "No page available." );
...@@ -1634,11 +1579,11 @@ Point SwRootFrm::GetPagePos( sal_uInt16 nPageNum ) const ...@@ -1634,11 +1579,11 @@ Point SwRootFrm::GetPagePos( sal_uInt16 nPageNum ) const
} }
/** get page frame by phyiscal page number /** get page frame by phyiscal page number
*
OD 14.01.2003 #103492# * OD 14.01.2003 #103492#
*
@return pointer to the page frame with the given physical page number * @return pointer to the page frame with the given physical page number
*/ */
SwPageFrm* SwRootFrm::GetPageByPageNum( sal_uInt16 _nPageNum ) const SwPageFrm* SwRootFrm::GetPageByPageNum( sal_uInt16 _nPageNum ) const
{ {
const SwPageFrm* pPageFrm = static_cast<const SwPageFrm*>( Lower() ); const SwPageFrm* pPageFrm = static_cast<const SwPageFrm*>( Lower() );
...@@ -1657,13 +1602,9 @@ SwPageFrm* SwRootFrm::GetPageByPageNum( sal_uInt16 _nPageNum ) const ...@@ -1657,13 +1602,9 @@ SwPageFrm* SwRootFrm::GetPageByPageNum( sal_uInt16 _nPageNum ) const
} }
} }
/************************************************************************* /**
|* * @return sal_True, when the given physical pagenumber does't exist or this page is an empty page.
|* SwRootFrm::IsDummyPage(sal_uInt16) */
|*
|* Description: Returns sal_True, when the given physical pagenumber does't exist
|* or this page is an empty page.
|*************************************************************************/
sal_Bool SwRootFrm::IsDummyPage( sal_uInt16 nPageNum ) const sal_Bool SwRootFrm::IsDummyPage( sal_uInt16 nPageNum ) const
{ {
if( !Lower() || !nPageNum || nPageNum > GetPageNum() ) if( !Lower() || !nPageNum || nPageNum > GetPageNum() )
...@@ -1676,13 +1617,10 @@ sal_Bool SwRootFrm::IsDummyPage( sal_uInt16 nPageNum ) const ...@@ -1676,13 +1617,10 @@ sal_Bool SwRootFrm::IsDummyPage( sal_uInt16 nPageNum ) const
} }
/************************************************************************* /** Is the Frm or rather the Section in which it lies protected?
|* *
|* SwFrm::IsProtected() * Also Fly in Fly in ... and Footnotes
|* */
|* Description: Is the Frm or rather the Section in which it lies
|* protected? Also Fly in Fly in .... and Footnotes
|*************************************************************************/
sal_Bool SwFrm::IsProtected() const sal_Bool SwFrm::IsProtected() const
{ {
if (this->IsCntntFrm() && ((SwCntntFrm*)this)->GetNode()) if (this->IsCntntFrm() && ((SwCntntFrm*)this)->GetNode())
...@@ -1739,33 +1677,24 @@ sal_Bool SwFrm::IsProtected() const ...@@ -1739,33 +1677,24 @@ sal_Bool SwFrm::IsProtected() const
return sal_False; return sal_False;
} }
/************************************************************************* /** @return the physical page number */
|*
|* SwFrm::GetPhyPageNum()
|* Description: Returns the physical page number
|*
|*
|*************************************************************************/
sal_uInt16 SwFrm::GetPhyPageNum() const sal_uInt16 SwFrm::GetPhyPageNum() const
{ {
const SwPageFrm *pPage = FindPageFrm(); const SwPageFrm *pPage = FindPageFrm();
return pPage ? pPage->GetPhyPageNum() : 0; return pPage ? pPage->GetPhyPageNum() : 0;
} }
/*-------------------------------------------------- /** Decides if the page want to be a rightpage or not.
* SwFrm::WannaRightPage() *
* decides if the page want to be a rightpage or not. * If the first content of the page has a page descriptor, we take the follow
* If the first content of the page has a page descriptor, * of the page descriptor of the last not empty page. If this descriptor allows
* we take the follow of the page descriptor of the last not empty page. * only right(left) pages and the page isn't an empty page then it wanna be
* If this descriptor allows only right(left) pages and the page * such right(left) page. If the descriptor allows right and left pages, we
* isn't an empty page then it wanna be such right(left) page. * look for a number offset in the first content. If there is one, odd number
* If the descriptor allows right and left pages, we look for a number offset * results right pages, even number results left pages.
* in the first content. If there is one, odd number results right pages,
* even number results left pages.
* If there is no number offset, we take the physical page number instead, * If there is no number offset, we take the physical page number instead,
* but a previous empty page don't count. * but a previous empty page don't count.
* --------------------------------------------------*/ */
sal_Bool SwFrm::WannaRightPage() const sal_Bool SwFrm::WannaRightPage() const
{ {
const SwPageFrm *pPage = FindPageFrm(); const SwPageFrm *pPage = FindPageFrm();
...@@ -1839,12 +1768,7 @@ bool SwFrm::OnFirstPage() const ...@@ -1839,12 +1768,7 @@ bool SwFrm::OnFirstPage() const
return bRet; return bRet;
} }
/************************************************************************* /** @return the virtual page number with the offset. */
|*
|* SwFrm::GetVirtPageNum()
|* Description: Returns the virtual page number with the offset.
|*
|*************************************************************************/
sal_uInt16 SwFrm::GetVirtPageNum() const sal_uInt16 SwFrm::GetVirtPageNum() const
{ {
const SwPageFrm *pPage = FindPageFrm(); const SwPageFrm *pPage = FindPageFrm();
...@@ -1892,13 +1816,7 @@ sal_uInt16 SwFrm::GetVirtPageNum() const ...@@ -1892,13 +1816,7 @@ sal_uInt16 SwFrm::GetVirtPageNum() const
return nPhyPage; return nPhyPage;
} }
/************************************************************************* /** Determines and sets those cells which are enclosed by the selection. */
|*
|* SwRootFrm::MakeTblCrsrs()
|*
|* Description: Determines and sets those cells which are enclosed
|* by the selection.
|*************************************************************************/
bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr ) bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr )
{ {
//Find Union-Rects and tables (Follows) of the selection. //Find Union-Rects and tables (Follows) of the selection.
...@@ -2009,12 +1927,12 @@ bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr ) ...@@ -2009,12 +1927,12 @@ bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr )
return bRet; return bRet;
} }
inline void Sub( SwRegionRects& rRegion, const SwRect& rRect )
/************************************************************************* {
|* if( rRect.Width() > 1 && rRect.Height() > 1 &&
|* SwRootFrm::CalcFrmRects rRect.IsOver( rRegion.GetOrigin() ))
|* rRegion -= rRect;
|*************************************************************************/ }
/* /*
* The following situations can happen: * The following situations can happen:
...@@ -2041,14 +1959,6 @@ bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr ) ...@@ -2041,14 +1959,6 @@ bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr )
* inverted rectangles are available. * inverted rectangles are available.
* In the end the Flys are cut out of the section. * In the end the Flys are cut out of the section.
*/ */
inline void Sub( SwRegionRects& rRegion, const SwRect& rRect )
{
if( rRect.Width() > 1 && rRect.Height() > 1 &&
rRect.IsOver( rRegion.GetOrigin() ))
rRegion -= rRect;
}
void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode ) void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
{ {
SwPosition *pStartPos = rCrsr.Start(), SwPosition *pStartPos = rCrsr.Start(),
...@@ -2577,7 +2487,7 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode ) ...@@ -2577,7 +2487,7 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
} }
pCntnt = pCntnt->GetNextCntntFrm(); pCntnt = pCntnt->GetNextCntntFrm();
OSL_ENSURE( pCntnt, OSL_ENSURE( pCntnt,
"<SwRootFrm::CalcFrmRects(..)> - no content frame. This is a serious defect -> please inform OD" ); "<SwRootFrm::CalcFrmRects(..)> - no content frame. This is a serious defect!" );
} }
if ( aPrvRect.HasArea() ) if ( aPrvRect.HasArea() )
Sub( aRegion, aPrvRect ); Sub( aRegion, aPrvRect );
...@@ -2682,5 +2592,4 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode ) ...@@ -2682,5 +2592,4 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
rCrsr.assign( aRegion.begin(), aRegion.end() ); rCrsr.assign( aRegion.begin(), aRegion.end() );
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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