diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2016-12-06 22:46:31 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-12-08 09:39:51 +0000 |
commit | 34132442982c6c936dc1fa3f23bc68b22b4e2eae (patch) | |
tree | aa873fd7db3e510f5c9f289e3817d2495e08ef9d /sw | |
parent | 9bd471cb76e47c8db2e885232bbe9732ac2d7e2b (diff) |
SwRectFnSet: hide pointer-to-(member)function syntax
Change-Id: I700e51dbfe0768642d482556299407f8f198e998
Reviewed-on: https://gerrit.libreoffice.org/31709
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
42 files changed, 1341 insertions, 1319 deletions
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index 0e4a3ebd763d..46f29d3a0f88 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -1070,7 +1070,7 @@ bool SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCn const SwRowFrame* pRow = GetRowFrame( *pSelBox->GetUpper() ); OSL_ENSURE( pRow, "Where is the SwTableLine's Frame?" ); SwRectFnSet aRectFnSet(pRow); - pRowHeights[ n ] = (pRow->Frame().*aRectFnSet->fnGetHeight)(); + pRowHeights[ n ] = aRectFnSet.GetHeight(pRow->Frame()); } } diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index f3604c12db16..633f3a860d82 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -2535,14 +2535,14 @@ void SwDoc::GetTabCols( SwTabCols &rFill, const SwCursor* pCursor, // Set fixed points, LeftMin in Document coordinates, all others relative SwRectFnSet aRectFnSet(pTab); const SwPageFrame* pPage = pTab->FindPageFrame(); - const sal_uLong nLeftMin = (pTab->Frame().*aRectFnSet->fnGetLeft)() - - (pPage->Frame().*aRectFnSet->fnGetLeft)(); - const sal_uLong nRightMax = (pTab->Frame().*aRectFnSet->fnGetRight)() - - (pPage->Frame().*aRectFnSet->fnGetLeft)(); + const sal_uLong nLeftMin = aRectFnSet.GetLeft(pTab->Frame()) - + aRectFnSet.GetLeft(pPage->Frame()); + const sal_uLong nRightMax = aRectFnSet.GetRight(pTab->Frame()) - + aRectFnSet.GetLeft(pPage->Frame()); rFill.SetLeftMin ( nLeftMin ); - rFill.SetLeft ( (pTab->Prt().*aRectFnSet->fnGetLeft)() ); - rFill.SetRight ( (pTab->Prt().*aRectFnSet->fnGetRight)()); + rFill.SetLeft ( aRectFnSet.GetLeft(pTab->Prt()) ); + rFill.SetRight ( aRectFnSet.GetRight(pTab->Prt())); rFill.SetRightMax( nRightMax - nLeftMin ); pTab->GetTable()->GetTabCols( rFill, pBox ); @@ -2614,12 +2614,12 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCursor* , // Set fixed points, LeftMin in Document coordinates, all others relative SwRectFnSet aRectFnSet(pTab); const SwPageFrame* pPage = pTab->FindPageFrame(); - const long nLeftMin = ( aRectFnSet.bVert ? + const long nLeftMin = ( aRectFnSet.IsVert() ? pTab->GetPrtLeft() - pPage->Frame().Left() : pTab->GetPrtTop() - pPage->Frame().Top() ); - const long nLeft = aRectFnSet.bVert ? LONG_MAX : 0; - const long nRight = (pTab->Prt().*aRectFnSet->fnGetHeight)(); - const long nRightMax = aRectFnSet.bVert ? nRight : LONG_MAX; + const long nLeft = aRectFnSet.IsVert() ? LONG_MAX : 0; + const long nRight = aRectFnSet.GetHeight(pTab->Prt()); + const long nRightMax = aRectFnSet.IsVert() ? nRight : LONG_MAX; rFill.SetLeftMin( nLeftMin ); rFill.SetLeft( nLeft ); @@ -2640,8 +2640,8 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCursor* , if ( pFrame->IsCellFrame() && pFrame->FindTabFrame() == pTab ) { // upper and lower borders of current cell frame: - long nUpperBorder = (pFrame->Frame().*aRectFnSet->fnGetTop)(); - long nLowerBorder = (pFrame->Frame().*aRectFnSet->fnGetBottom)(); + long nUpperBorder = aRectFnSet.GetTop(pFrame->Frame()); + long nLowerBorder = aRectFnSet.GetBottom(pFrame->Frame()); // get boundaries for nUpperBorder: aIter = aBoundaries.find( nUpperBorder ); @@ -2689,10 +2689,10 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCursor* , size_t nIdx = 0; for ( aIter = aBoundaries.begin(); aIter != aBoundaries.end(); ++aIter ) { - const long nTabTop = (pTab->*aRectFnSet->fnGetPrtTop)(); - const long nKey = (*aRectFnSet->fnYDiff)( (*aIter).first, nTabTop ); + const long nTabTop = aRectFnSet.GetPrtTop(*pTab); + const long nKey = aRectFnSet.YDiff( (*aIter).first, nTabTop ); const std::pair< long, long > aTmpPair = (*aIter).second; - const long nFirst = (*aRectFnSet->fnYDiff)( aTmpPair.first, nTabTop ); + const long nFirst = aRectFnSet.YDiff( aTmpPair.first, nTabTop ); const long nSecond = aTmpPair.second; aHiddenIter = aHidden.find( (*aIter).first ); @@ -2734,7 +2734,7 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, bool bCurRowOnly, // #i17174# - With fix for #i9040# the shadow size is taken // from the table width. Thus, add its left and right size to current table // printing area width in order to get the correct table size attribute. - SwTwips nPrtWidth = (pTab->Prt().*aRectFnSet->fnGetWidth)(); + SwTwips nPrtWidth = aRectFnSet.GetWidth(pTab->Prt()); { SvxShadowItem aShadow( rTab.GetFrameFormat()->GetShadow() ); nPrtWidth += aShadow.CalcShadowSpace( SvxShadowItemSide::LEFT ) + @@ -2750,15 +2750,15 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, bool bCurRowOnly, SwTabCols aOld( rNew.Count() ); const SwPageFrame* pPage = pTab->FindPageFrame(); - const sal_uLong nLeftMin = (pTab->Frame().*aRectFnSet->fnGetLeft)() - - (pPage->Frame().*aRectFnSet->fnGetLeft)(); - const sal_uLong nRightMax = (pTab->Frame().*aRectFnSet->fnGetRight)() - - (pPage->Frame().*aRectFnSet->fnGetLeft)(); + const sal_uLong nLeftMin = aRectFnSet.GetLeft(pTab->Frame()) - + aRectFnSet.GetLeft(pPage->Frame()); + const sal_uLong nRightMax = aRectFnSet.GetRight(pTab->Frame()) - + aRectFnSet.GetLeft(pPage->Frame()); // Set fixed points, LeftMin in Document coordinates, all others relative aOld.SetLeftMin ( nLeftMin ); - aOld.SetLeft ( (pTab->Prt().*aRectFnSet->fnGetLeft)() ); - aOld.SetRight ( (pTab->Prt().*aRectFnSet->fnGetRight)()); + aOld.SetLeft ( aRectFnSet.GetLeft(pTab->Prt()) ); + aOld.SetRight ( aRectFnSet.GetRight(pTab->Prt())); aOld.SetRightMax( nRightMax - nLeftMin ); rTab.GetTabCols( aOld, pBox ); @@ -2788,9 +2788,9 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, bool bCurColOnly, // Set fixed points, LeftMin in Document coordinates, all others relative const SwPageFrame* pPage = pTab->FindPageFrame(); - aOld.SetRight( (pTab->Prt().*aRectFnSet->fnGetHeight)() ); + aOld.SetRight( aRectFnSet.GetHeight(pTab->Prt()) ); long nLeftMin; - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) { nLeftMin = pTab->GetPrtLeft() - pPage->Frame().Left(); aOld.SetLeft ( LONG_MAX ); @@ -2816,8 +2816,8 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, bool bCurColOnly, for ( size_t i = 0; i <= nCount; ++i ) { - const size_t nIdxStt = aRectFnSet.bVert ? nCount - i : i - 1; - const size_t nIdxEnd = aRectFnSet.bVert ? nCount - i - 1 : i; + const size_t nIdxStt = aRectFnSet.IsVert() ? nCount - i : i - 1; + const size_t nIdxEnd = aRectFnSet.IsVert() ? nCount - i - 1 : i; const long nOldRowStart = i == 0 ? 0 : aOld[ nIdxStt ]; const long nOldRowEnd = i == nCount ? aOld.GetRight() : aOld[ nIdxEnd ]; @@ -2844,9 +2844,9 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, bool bCurColOnly, { if ( pFrame->IsCellFrame() && pFrame->FindTabFrame() == pTab ) { - const long nLowerBorder = (pFrame->Frame().*aRectFnSet->fnGetBottom)(); - const sal_uLong nTabTop = (pTab->*aRectFnSet->fnGetPrtTop)(); - if ( std::abs( (*aRectFnSet->fnYInc)( nTabTop, nOldRowEnd ) - nLowerBorder ) <= ROWFUZZY ) + const long nLowerBorder = aRectFnSet.GetBottom(pFrame->Frame()); + const sal_uLong nTabTop = aRectFnSet.GetPrtTop(*pTab); + if ( std::abs( aRectFnSet.YInc( nTabTop, nOldRowEnd ) - nLowerBorder ) <= ROWFUZZY ) { if ( !bCurColOnly || pFrame == pBoxFrame ) { @@ -2864,7 +2864,7 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, bool bCurColOnly, { // The new row height must not to be calculated from a overlapping box SwFormatFrameSize aNew( pLine->GetFrameFormat()->GetFrameSize() ); - const long nNewSize = (pFrame->Frame().*aRectFnSet->fnGetHeight)() + nDiff; + const long nNewSize = aRectFnSet.GetHeight(pFrame->Frame()) + nDiff; if( nNewSize != aNew.GetHeight() ) { aNew.SetHeight( nNewSize ); diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index 15f146c52a31..9224bbbbc42c 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -1275,20 +1275,20 @@ static sal_uInt16 lcl_CalcCellFit( const SwLayoutFrame *pCell ) SwRectFnSet aRectFnSet(pCell); while ( pFrame ) { - const SwTwips nAdd = (pFrame->Frame().*aRectFnSet->fnGetWidth)() - - (pFrame->Prt().*aRectFnSet->fnGetWidth)(); + const SwTwips nAdd = aRectFnSet.GetWidth(pFrame->Frame()) - + aRectFnSet.GetWidth(pFrame->Prt()); // pFrame does not necessarily have to be a SwTextFrame! const SwTwips nCalcFitToContent = pFrame->IsTextFrame() ? const_cast<SwTextFrame*>(static_cast<const SwTextFrame*>(pFrame))->CalcFitToContent() : - (pFrame->Prt().*aRectFnSet->fnGetWidth)(); + aRectFnSet.GetWidth(pFrame->Prt()); nRet = std::max( nRet, nCalcFitToContent + nAdd ); pFrame = pFrame->GetNext(); } // Surrounding border as well as left and Right Border also need to be respected - nRet += (pCell->Frame().*aRectFnSet->fnGetWidth)() - - (pCell->Prt().*aRectFnSet->fnGetWidth)(); + nRet += aRectFnSet.GetWidth(pCell->Frame()) - + aRectFnSet.GetWidth(pCell->Prt()); // To compensate for the accuracy of calculation later on in SwTable::SetTabCols // we keep adding up a little. @@ -1327,14 +1327,14 @@ static void lcl_CalcSubColValues( std::vector<sal_uInt16> &rToFill, const SwTabC nColRight += rCols.GetLeftMin(); // Adapt values to the proportions of the Table (Follows) - if ( rCols.GetLeftMin() != (pTab->Frame().*aRectFnSet->fnGetLeft)() ) + if ( rCols.GetLeftMin() != aRectFnSet.GetLeft(pTab->Frame()) ) { - const long nDiff = (pTab->Frame().*aRectFnSet->fnGetLeft)() - rCols.GetLeftMin(); + const long nDiff = aRectFnSet.GetLeft(pTab->Frame()) - rCols.GetLeftMin(); nColLeft += nDiff; nColRight += nDiff; } - const long nCellLeft = (pCell->Frame().*aRectFnSet->fnGetLeft)(); - const long nCellRight = (pCell->Frame().*aRectFnSet->fnGetRight)(); + const long nCellLeft = aRectFnSet.GetLeft(pCell->Frame()); + const long nCellRight = aRectFnSet.GetRight(pCell->Frame()); // Calculate overlapping value long nWidth = 0; @@ -1394,8 +1394,8 @@ static void lcl_CalcColValues( std::vector<sal_uInt16> &rToFill, const SwTabCols { if ( pCell->IsCellFrame() && pCell->FindTabFrame() == pTab && ::IsFrameInTableSel( rUnion, pCell ) ) { - const long nCLeft = (pCell->Frame().*aRectFnSet->fnGetLeft)(); - const long nCRight = (pCell->Frame().*aRectFnSet->fnGetRight)(); + const long nCLeft = aRectFnSet.GetLeft(pCell->Frame()); + const long nCRight = aRectFnSet.GetRight(pCell->Frame()); bool bNotInCols = true; @@ -1418,9 +1418,9 @@ static void lcl_CalcColValues( std::vector<sal_uInt16> &rToFill, const SwTabCols // Adapt values to the proportions of the Table (Follows) long nLeftA = nColLeft; long nRightA = nColRight; - if ( rCols.GetLeftMin() != sal_uInt16((pTab->Frame().*aRectFnSet->fnGetLeft)()) ) + if ( rCols.GetLeftMin() != sal_uInt16(aRectFnSet.GetLeft(pTab->Frame())) ) { - const long nDiff = (pTab->Frame().*aRectFnSet->fnGetLeft)() - rCols.GetLeftMin(); + const long nDiff = aRectFnSet.GetLeft(pTab->Frame()) - rCols.GetLeftMin(); nLeftA += nDiff; nRightA += nDiff; } diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index ae4192199377..417ec4ac8f24 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -530,18 +530,18 @@ void SwFEShell::GetTabCols_( SwTabCols &rToFill, const SwFrame *pBox ) SwRectFnSet aRectFnSet(pTab); const SwPageFrame* pPage = pTab->FindPageFrame(); - const sal_uLong nLeftMin = (pTab->Frame().*aRectFnSet->fnGetLeft)() - - (pPage->Frame().*aRectFnSet->fnGetLeft)(); - const sal_uLong nRightMax = (pTab->Frame().*aRectFnSet->fnGetRight)() - - (pPage->Frame().*aRectFnSet->fnGetLeft)(); + const sal_uLong nLeftMin = aRectFnSet.GetLeft(pTab->Frame()) - + aRectFnSet.GetLeft(pPage->Frame()); + const sal_uLong nRightMax = aRectFnSet.GetRight(pTab->Frame()) - + aRectFnSet.GetLeft(pPage->Frame()); if (g_pColumnCacheLastTabFrame != pTab) { // if TabFrame was changed, we only shift a little bit // as the width is the same SwRectFnSet fnRectX(g_pColumnCacheLastTabFrame); - if ((g_pColumnCacheLastTabFrame->Frame().*fnRectX->fnGetWidth)() == - (pTab->Frame().*aRectFnSet->fnGetWidth)() ) + if (fnRectX.GetWidth(g_pColumnCacheLastTabFrame->Frame()) == + aRectFnSet.GetWidth(pTab->Frame()) ) { pLastCols->SetLeftMin( nLeftMin ); @@ -553,8 +553,8 @@ void SwFEShell::GetTabCols_( SwTabCols &rToFill, const SwFrame *pBox ) if ( !bDel && pLastCols->GetLeftMin () == (sal_uInt16)nLeftMin && - pLastCols->GetLeft () == (sal_uInt16)(pTab->Prt().*aRectFnSet->fnGetLeft)() && - pLastCols->GetRight () == (sal_uInt16)(pTab->Prt().*aRectFnSet->fnGetRight)()&& + pLastCols->GetLeft () == (sal_uInt16)aRectFnSet.GetLeft(pTab->Prt()) && + pLastCols->GetRight () == (sal_uInt16)aRectFnSet.GetRight(pTab->Prt())&& pLastCols->GetRightMax() == (sal_uInt16)nRightMax - pLastCols->GetLeftMin() ) { if (g_pColumnCacheLastCellFrame != pBox) @@ -593,12 +593,12 @@ void SwFEShell::GetTabRows_( SwTabCols &rToFill, const SwFrame *pBox ) bDel = false; SwRectFnSet aRectFnSet(pTab); const SwPageFrame* pPage = pTab->FindPageFrame(); - const long nLeftMin = ( aRectFnSet.bVert ? + const long nLeftMin = ( aRectFnSet.IsVert() ? pTab->GetPrtLeft() - pPage->Frame().Left() : pTab->GetPrtTop() - pPage->Frame().Top() ); - const long nLeft = aRectFnSet.bVert ? LONG_MAX : 0; - const long nRight = (pTab->Prt().*aRectFnSet->fnGetHeight)(); - const long nRightMax = aRectFnSet.bVert ? nRight : LONG_MAX; + const long nLeft = aRectFnSet.IsVert() ? LONG_MAX : 0; + const long nRight = aRectFnSet.GetHeight(pTab->Prt()); + const long nRightMax = aRectFnSet.IsVert() ? nRight : LONG_MAX; if (g_pRowCacheLastTabFrame != pTab || g_pRowCacheLastCellFrame != pBox) bDel = true; @@ -1359,7 +1359,7 @@ size_t SwFEShell::GetCurTabColNum() const if( pFrame->FindTabFrame()->IsRightToLeft() ) { - long nX = (pFrame->Frame().*aRectFnSet->fnGetRight)() - (pPage->Frame().*aRectFnSet->fnGetLeft)(); + long nX = aRectFnSet.GetRight(pFrame->Frame()) - aRectFnSet.GetLeft(pPage->Frame()); const long nRight = aTabCols.GetLeftMin() + aTabCols.GetRight(); @@ -1376,8 +1376,8 @@ size_t SwFEShell::GetCurTabColNum() const } else { - const long nX = (pFrame->Frame().*aRectFnSet->fnGetLeft)() - - (pPage->Frame().*aRectFnSet->fnGetLeft)(); + const long nX = aRectFnSet.GetLeft(pFrame->Frame()) - + aRectFnSet.GetLeft(pPage->Frame()); const long nLeft = aTabCols.GetLeftMin(); @@ -1465,15 +1465,15 @@ static const SwCellFrame *lcl_FindFrame( const SwLayoutFrame *pLay, const Point aTabRect.Pos() += pFrame->Frame().Pos(); const SwTwips nLeft = bRTL ? - (aTabRect.*aRectFnSet->fnGetRight)() : - (aTabRect.*aRectFnSet->fnGetLeft)(); - const SwTwips nTop = (aTabRect.*aRectFnSet->fnGetTop)(); + aRectFnSet.GetRight(aTabRect) : + aRectFnSet.GetLeft(aTabRect); + const SwTwips nTop = aRectFnSet.GetTop(aTabRect); - SwTwips& rPointX = aRectFnSet.bVert ? aPt.Y() : aPt.X(); - SwTwips& rPointY = aRectFnSet.bVert ? aPt.X() : aPt.Y(); + SwTwips& rPointX = aRectFnSet.IsVert() ? aPt.Y() : aPt.X(); + SwTwips& rPointY = aRectFnSet.IsVert() ? aPt.X() : aPt.Y(); - const SwTwips nXDiff = (*aRectFnSet->fnXDiff)( nLeft, rPointX ) * ( bRTL ? (-1) : 1 ); - const SwTwips nYDiff = (*aRectFnSet->fnYDiff)( nTop, rPointY ); + const SwTwips nXDiff = aRectFnSet.XDiff( nLeft, rPointX ) * ( bRTL ? (-1) : 1 ); + const SwTwips nYDiff = aRectFnSet.YDiff( nTop, rPointY ); bCloseToRow = nXDiff >= 0 && nXDiff < nFuzzy; bCloseToCol = nYDiff >= 0 && nYDiff < nFuzzy; @@ -1497,7 +1497,7 @@ static const SwCellFrame *lcl_FindFrame( const SwLayoutFrame *pLay, const Point // If we found the point to be 'close' to the left or top border // of the table frame, we adjust the point to be on that border: if ( bCloseToRow && bCloseToCol ) - aPt = bRTL ? aTabRect.TopRight() : (aTabRect.*aRectFnSet->fnGetPos)(); + aPt = bRTL ? aTabRect.TopRight() : aRectFnSet.GetPos(aTabRect); else if ( bCloseToRow ) rPointX = nLeft; else if ( bCloseToCol ) @@ -1574,8 +1574,8 @@ static const SwCellFrame *lcl_FindFrame( const SwLayoutFrame *pLay, const Point SwRectFnSet aRectFnSet(pTabFrame); - const SwTwips nTabTop = (aTabRect.*aRectFnSet->fnGetTop)(); - const SwTwips nMouseTop = aRectFnSet.bVert ? rPt.X() : rPt.Y(); + const SwTwips nTabTop = aRectFnSet.GetTop(aTabRect); + const SwTwips nMouseTop = aRectFnSet.IsVert() ? rPt.X() : rPt.Y(); // Do not allow to drag upper table border: if ( !::IsSame( nTabTop, nMouseTop ) ) @@ -2178,7 +2178,7 @@ bool SwFEShell::SetColRowWidthHeight( sal_uInt16 eType, sal_uInt16 nDiff ) // then it should be recalculated to absolute values now const SwFormatFrameSize& rTableFrameSz = pTab->GetFormat()->GetFrameSize(); SwRectFnSet aRectFnSet(pTab); - long nPrtWidth = (pTab->Prt().*aRectFnSet->fnGetWidth)(); + long nPrtWidth = aRectFnSet.GetWidth(pTab->Prt()); if( TBLVAR_CHGABS == pTab->GetTable()->GetTableChgMode() && ( eType & nsTableChgWidthHeightType::WH_COL_LEFT || eType & nsTableChgWidthHeightType::WH_COL_RIGHT ) && text::HoriOrientation::NONE == pTab->GetFormat()->GetHoriOrient().GetHoriOrient() && @@ -2192,7 +2192,7 @@ bool SwFEShell::SetColRowWidthHeight( sal_uInt16 eType, sal_uInt16 nDiff ) if( (eType & (nsTableChgWidthHeightType::WH_FLAG_BIGGER | nsTableChgWidthHeightType::WH_FLAG_INSDEL)) == (nsTableChgWidthHeightType::WH_FLAG_BIGGER | nsTableChgWidthHeightType::WH_FLAG_INSDEL) ) { - nDiff = sal_uInt16((pFrame->Frame().*aRectFnSet->fnGetWidth)()); + nDiff = sal_uInt16(aRectFnSet.GetWidth(pFrame->Frame())); // we must move the cursor outside the current cell before // deleting the cells. diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index 58d0c904f837..3f596e2d370d 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -758,12 +758,12 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, if ( bRTL ) aPos = pFrame->Frame().TopRight(); else - aPos = (pFrame->Frame().*aRectFnSet->fnGetPos)(); + aPos = aRectFnSet.GetPos(pFrame->Frame()); - if( aRectFnSet.bVert || aRectFnSet.bVertL2R ) + if( aRectFnSet.IsVert() || aRectFnSet.IsVertL2R() ) { - bVertic = aRectFnSet.bVert; - bVerticalL2R = aRectFnSet.bVertL2R; + bVertic = aRectFnSet.IsVert(); + bVerticalL2R = aRectFnSet.IsVertL2R(); _bMirror = false; // no mirroring in vertical environment switch ( _eHoriRelOrient ) { @@ -813,7 +813,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, } } - if ( aRectFnSet.bVert && !aRectFnSet.bVertL2R ) + if ( aRectFnSet.IsVert() && !aRectFnSet.IsVertL2R() ) { switch ( _eVertRelOrient ) { @@ -825,7 +825,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, break; } } - else if ( aRectFnSet.bVertL2R ) + else if ( aRectFnSet.IsVertL2R() ) { switch ( _eVertRelOrient ) { @@ -884,7 +884,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, if ( bRTL ) aPos = pFrame->Frame().TopRight(); else - aPos = (pFrame->Frame().*aRectFnSet->fnGetPos)(); + aPos = aRectFnSet.GetPos(pFrame->Frame()); // #i17567# - allow negative positions // for fly frames anchor to paragraph/to character. if ((_nAnchorId == FLY_AT_PARA) || (_nAnchorId == FLY_AT_CHAR)) @@ -912,11 +912,11 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, // to page areas. if ( _eVertRelOrient == text::RelOrientation::PAGE_FRAME || _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA ) { - if ( aRectFnSet.bVert && !aRectFnSet.bVertL2R ) + if ( aRectFnSet.IsVert() && !aRectFnSet.IsVertL2R() ) { aPos.X() = aVertEnvironRect.Right(); } - else if ( aRectFnSet.bVertL2R ) + else if ( aRectFnSet.IsVertL2R() ) { aPos.X() = aVertEnvironRect.Left(); } @@ -936,7 +936,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, // to page areas. if ( _eVertRelOrient == text::RelOrientation::PAGE_FRAME || _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA ) { - if ( aRectFnSet.bVert && !aRectFnSet.bVertL2R ) + if ( aRectFnSet.IsVert() && !aRectFnSet.IsVertL2R() ) { aPos.X() = aVertEnvironRect.Right(); if ( _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA ) @@ -944,7 +944,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, aPos.setX(aPos.getX() - rVertEnvironLayFrame.GetRightMargin()); } } - else if ( aRectFnSet.bVertL2R ) + else if ( aRectFnSet.IsVertL2R() ) { aPos.X() = aVertEnvironRect.Left(); if ( _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA ) @@ -995,7 +995,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, SwPosition aDefaultContentPos( *(pTextFrame->GetTextNode()) ); pTextFrame->GetAutoPos( aChRect, aDefaultContentPos ); } - nTop = (aChRect.*aRectFnSet->fnGetBottom)(); + nTop = aRectFnSet.GetBottom(aChRect); } else { @@ -1010,7 +1010,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, pTextFrame->GetTopOfLine( nTop, aDefaultContentPos ); } } - if ( aRectFnSet.bVert || aRectFnSet.bVertL2R ) + if ( aRectFnSet.IsVert() || aRectFnSet.IsVertL2R() ) { aPos.setX(nTop); } @@ -1039,8 +1039,8 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, SwPosition aDefaultContentPos( *(pTextFrame->GetTextNode()) ); pTextFrame->GetAutoPos( aChRect, aDefaultContentPos ); } - nLeft = (aChRect.*aRectFnSet->fnGetLeft)(); - if ( aRectFnSet.bVert || aRectFnSet.bVertL2R ) + nLeft = aRectFnSet.GetLeft(aChRect); + if ( aRectFnSet.IsVert() || aRectFnSet.IsVertL2R() ) { aPos.setY(nLeft); } @@ -1049,7 +1049,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, aPos.setX(nLeft); } } - if ( aRectFnSet.bVert || aRectFnSet.bVertL2R ) + if ( aRectFnSet.IsVert() || aRectFnSet.IsVertL2R() ) { _orRect = SwRect( aVertEnvironRect.Left(), aHoriEnvironRect.Top(), @@ -1077,13 +1077,13 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, if ( pUpper->IsCellFrame() )//MA_FLY_HEIGHT { const SwFrame* pTab = pUpper->FindTabFrame(); - long nBottom = (pTab->GetUpper()->*aRectFnSet->fnGetPrtBottom)(); - (_orRect.*aRectFnSet->fnSetBottom)( nBottom ); + long nBottom = aRectFnSet.GetPrtBottom(*pTab->GetUpper()); + aRectFnSet.SetBottom( _orRect, nBottom ); } } // only use 90% of height for character bound { - if( aRectFnSet.bVert || aRectFnSet.bVertL2R ) + if( aRectFnSet.IsVert() || aRectFnSet.IsVertL2R() ) _orRect.Width( (_orRect.Width()*9)/10 ); else _orRect.Height( (_orRect.Height()*9)/10 ); @@ -1093,10 +1093,10 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, const SwTwips nBaseOfstForFly = ( pFrame->IsTextFrame() && pFly ) ? static_cast<const SwTextFrame*>(pFrame)->GetBaseOfstForFly( !bWrapThrough ) : 0; - if( aRectFnSet.bVert || aRectFnSet.bVertL2R ) + if( aRectFnSet.IsVert() || aRectFnSet.IsVertL2R() ) { - bVertic = aRectFnSet.bVert; - bVerticalL2R = aRectFnSet.bVertL2R; + bVertic = aRectFnSet.IsVert(); + bVerticalL2R = aRectFnSet.IsVertL2R(); _bMirror = false; switch ( _eHoriRelOrient ) @@ -1104,12 +1104,12 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, case text::RelOrientation::FRAME_RIGHT: { aPos.setY(aPos.getY() + pFrame->Prt().Height()); - aPos += (pFrame->Prt().*aRectFnSet->fnGetPos)(); + aPos += aRectFnSet.GetPos(pFrame->Prt()); break; } case text::RelOrientation::PRINT_AREA: { - aPos += (pFrame->Prt().*aRectFnSet->fnGetPos)(); + aPos += aRectFnSet.GetPos(pFrame->Prt()); aPos.setY(aPos.getY() + nBaseOfstForFly); break; } diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index 610b83edd713..d7ae1b44c7fc 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -522,8 +522,8 @@ bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd ) // ignore if FrameRect is outside the union - const long nXFuzzy = aRectFnSet.bVert ? 0 : 20; - const long nYFuzzy = aRectFnSet.bVert ? 20 : 0; + const long nXFuzzy = aRectFnSet.IsVert() ? 0 : 20; + const long nYFuzzy = aRectFnSet.IsVert() ? 20 : 0; if( !( rUnion.Top() + nYFuzzy > nFrameBottom || nUnionBottom < rFrameRect.Top() + nYFuzzy || @@ -578,7 +578,7 @@ bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd ) for( n = 0 ; n < aCellFrames.size(); ++n ) { const Sort_CellFrame& rCF = aCellFrames[ n ]; - if( (rCF.pFrame->Frame().*aRectFnSet->fnGetTop)() != nYPos ) + if( aRectFnSet.GetTop(rCF.pFrame->Frame()) != nYPos ) { // new row if( n ) @@ -592,20 +592,20 @@ bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd ) } } nCellCnt = 1; - nYPos = (rCF.pFrame->Frame().*aRectFnSet->fnGetTop)(); - nHeight = (rCF.pFrame->Frame().*aRectFnSet->fnGetHeight)(); + nYPos = aRectFnSet.GetTop(rCF.pFrame->Frame()); + nHeight = aRectFnSet.GetHeight(rCF.pFrame->Frame()); nXPos = bRTL ? - (rCF.pFrame->Frame().*aRectFnSet->fnGetLeft)() : - (rCF.pFrame->Frame().*aRectFnSet->fnGetRight)(); + aRectFnSet.GetLeft(rCF.pFrame->Frame()) : + aRectFnSet.GetRight(rCF.pFrame->Frame()); } else if( nXPos == ( bRTL ? - (rCF.pFrame->Frame().*aRectFnSet->fnGetRight)() : - (rCF.pFrame->Frame().*aRectFnSet->fnGetLeft)() ) && - nHeight == (rCF.pFrame->Frame().*aRectFnSet->fnGetHeight)() ) + aRectFnSet.GetRight(rCF.pFrame->Frame()) : + aRectFnSet.GetLeft(rCF.pFrame->Frame()) ) && + nHeight == aRectFnSet.GetHeight(rCF.pFrame->Frame()) ) { nXPos += ( bRTL ? (-1) : 1 ) * - (rCF.pFrame->Frame().*aRectFnSet->fnGetWidth)(); + aRectFnSet.GetWidth(rCF.pFrame->Frame()); ++nCellCnt; } else @@ -983,8 +983,8 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes, pLastBox = pBox; rBoxes.insert( pBox ); aPosArr.insert( - CmpLPt( (pCell->Frame().*aRectFnSet->fnGetPos)(), - pBox, aRectFnSet.bVert ) ); + CmpLPt( aRectFnSet.GetPos(pCell->Frame()), + pBox, aRectFnSet.IsVert() ) ); pBox = pBox->GetUpper()->GetTabBoxes()[ nInsPos ]; aNew.SetWidth( nTmpWidth ); @@ -1000,8 +1000,8 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes, pLastBox = pBox; rBoxes.insert( pBox ); aPosArr.insert( - CmpLPt( (pCell->Frame().*aRectFnSet->fnGetPos)(), - pBox, aRectFnSet.bVert ) ); + CmpLPt( aRectFnSet.GetPos(pCell->Frame()), + pBox, aRectFnSet.IsVert() ) ); } } // overlapping on left- or right-side @@ -1047,8 +1047,8 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes, pLastBox = pBox; rBoxes.insert( pBox ); aPosArr.insert( - CmpLPt( (pCell->Frame().*aRectFnSet->fnGetPos)(), - pBox, aRectFnSet.bVert ) ); + CmpLPt( aRectFnSet.GetPos(pCell->Frame()), + pBox, aRectFnSet.IsVert() ) ); pBox = pBox->GetUpper()->GetTabBoxes()[ nInsPos+1 ]; aNew.SetWidth( nRight ); @@ -1088,7 +1088,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes, pLastBox = pBox; rBoxes.insert( pBox ); aPosArr.insert( CmpLPt( Point( rUnion.Left(), - pCell->Frame().Top()), pBox, aRectFnSet.bVert )); + pCell->Frame().Top()), pBox, aRectFnSet.IsVert() )); if( pUndo ) pUndo->AddNewBox( pBox->GetSttIdx() ); @@ -1266,7 +1266,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes, nWidth = 0; long nY = !aPosArr.empty() ? - ( aRectFnSet.bVert ? + ( aRectFnSet.IsVert() ? aPosArr[ 0 ].X() : aPosArr[ 0 ].Y() ) : 0; @@ -1276,7 +1276,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes, const CmpLPt& rPt = aPosArr[ n ]; if( bCalcWidth ) { - if( nY == ( aRectFnSet.bVert ? rPt.X() : rPt.Y() ) ) // same Y level? + if( nY == ( aRectFnSet.IsVert() ? rPt.X() : rPt.Y() ) ) // same Y level? nWidth += rPt.pSelBox->GetFrameFormat()->GetFrameSize().GetWidth(); else bCalcWidth = false; // one line ready @@ -1611,13 +1611,13 @@ static void lcl_FindStartEndCol( const SwLayoutFrame *&rpStart, if ( pTab->GetTable()->IsNewModel() ) { - nSX = (rpStart->Frame().*aRectFnSet->fnGetLeft )(); - nSX2 = (rpStart->Frame().*aRectFnSet->fnGetRight)(); + nSX = aRectFnSet.GetLeft(rpStart->Frame()); + nSX2 = aRectFnSet.GetRight(rpStart->Frame()); } else { - const SwTwips nPrtWidth = (pTab->Prt().*aRectFnSet->fnGetWidth)(); - nSX = ::lcl_CalcWish( rpStart, nWish, nPrtWidth ) + (pTab->*aRectFnSet->fnGetPrtLeft)(); + const SwTwips nPrtWidth = aRectFnSet.GetWidth(pTab->Prt()); + nSX = ::lcl_CalcWish( rpStart, nWish, nPrtWidth ) + aRectFnSet.GetPrtLeft(*pTab); nSX2 = nSX + (rpStart->GetFormat()->GetFrameSize().GetWidth() * nPrtWidth / nWish); } @@ -1625,10 +1625,10 @@ static void lcl_FindStartEndCol( const SwLayoutFrame *&rpStart, while ( pTmp && (!pTmp->IsCellFrame() || - ( ( ! bRTL && (pTmp->Frame().*aRectFnSet->fnGetLeft)() < nSX && - (pTmp->Frame().*aRectFnSet->fnGetRight)()< nSX2 ) || - ( bRTL && (pTmp->Frame().*aRectFnSet->fnGetLeft)() > nSX && - (pTmp->Frame().*aRectFnSet->fnGetRight)()> nSX2 ) ) ) ) + ( ( ! bRTL && aRectFnSet.GetLeft(pTmp->Frame()) < nSX && + aRectFnSet.GetRight(pTmp->Frame())< nSX2 ) || + ( bRTL && aRectFnSet.GetLeft(pTmp->Frame()) > nSX && + aRectFnSet.GetRight(pTmp->Frame())> nSX2 ) ) ) ) pTmp = pTmp->GetNextLayoutLeaf(); if ( pTmp ) @@ -1660,12 +1660,12 @@ static void lcl_FindStartEndCol( const SwLayoutFrame *&rpStart, if ( pTab->GetTable()->IsNewModel() ) { - nEX = (rpEnd->Frame().*aRectFnSet->fnGetLeft )(); + nEX = aRectFnSet.GetLeft(rpEnd->Frame()); } else { - const SwTwips nPrtWidth = (pTab->Prt().*aRectFnSet->fnGetWidth)(); - nEX = ::lcl_CalcWish( rpEnd, nWish, nPrtWidth ) + (pTab->*aRectFnSet->fnGetPrtLeft)(); + const SwTwips nPrtWidth = aRectFnSet.GetWidth(pTab->Prt()); + nEX = ::lcl_CalcWish( rpEnd, nWish, nPrtWidth ) + aRectFnSet.GetPrtLeft(*pTab); } const SwContentFrame* pLastContent = pTab->FindLastContent(); @@ -1677,8 +1677,8 @@ static void lcl_FindStartEndCol( const SwLayoutFrame *&rpStart, while( !rpEnd->IsCellFrame() ) rpEnd = rpEnd->GetUpper(); - while ( ( bRTL && (rpEnd->Frame().*aRectFnSet->fnGetLeft)() < nEX ) || - ( ! bRTL && (rpEnd->Frame().*aRectFnSet->fnGetLeft)() > nEX ) ) + while ( ( bRTL && aRectFnSet.GetLeft(rpEnd->Frame()) < nEX ) || + ( ! bRTL && aRectFnSet.GetLeft(rpEnd->Frame()) > nEX ) ) { const SwLayoutFrame* pTmpLeaf = rpEnd->GetPrevLayoutLeaf(); if( !pTmpLeaf || !pTab->IsAnLower( pTmpLeaf ) ) @@ -1695,10 +1695,10 @@ static void lcl_FindStartEndCol( const SwLayoutFrame *&rpStart, { const SwLayoutFrame *pTmpLeaf = rpStart; pTmpLeaf = pTmpLeaf->GetNextLayoutLeaf(); - while ( pTmpLeaf && (pTmpLeaf->Frame().*aRectFnSet->fnGetLeft)() > nEX ) // first skip line + while ( pTmpLeaf && aRectFnSet.GetLeft(pTmpLeaf->Frame()) > nEX ) // first skip line pTmpLeaf = pTmpLeaf->GetNextLayoutLeaf(); - while ( pTmpLeaf && (pTmpLeaf->Frame().*aRectFnSet->fnGetLeft)() < nSX && - (pTmpLeaf->Frame().*aRectFnSet->fnGetRight)()< nSX2 ) + while ( pTmpLeaf && aRectFnSet.GetLeft(pTmpLeaf->Frame()) < nSX && + aRectFnSet.GetRight(pTmpLeaf->Frame())< nSX2 ) pTmpLeaf = pTmpLeaf->GetNextLayoutLeaf(); const SwTabFrame *pTmpTab = rpStart->FindTabFrame(); if ( !pTmpTab->IsAnLower( pTmpLeaf ) ) @@ -1706,8 +1706,8 @@ static void lcl_FindStartEndCol( const SwLayoutFrame *&rpStart, pTmpTab = pTmpTab->GetFollow(); rpStart = pTmpTab->FirstCell(); while ( rpStart && - (rpStart->Frame().*aRectFnSet->fnGetLeft)() < nSX && - (rpStart->Frame().*aRectFnSet->fnGetRight)()< nSX2 ) + aRectFnSet.GetLeft(rpStart->Frame()) < nSX && + aRectFnSet.GetRight(rpStart->Frame())< nSX2 ) rpStart = rpStart->GetNextLayoutLeaf(); } else @@ -1717,9 +1717,9 @@ static void lcl_FindStartEndCol( const SwLayoutFrame *&rpStart, { const SwLayoutFrame *pTmpLeaf = rpEnd; pTmpLeaf = pTmpLeaf->GetPrevLayoutLeaf(); - while ( pTmpLeaf && (pTmpLeaf->Frame().*aRectFnSet->fnGetLeft)() < nEX )//erstmal die Zeile ueberspr. + while ( pTmpLeaf && aRectFnSet.GetLeft(pTmpLeaf->Frame()) < nEX )//erstmal die Zeile ueberspr. pTmpLeaf = pTmpLeaf->GetPrevLayoutLeaf(); - while ( pTmpLeaf && (pTmpLeaf->Frame().*aRectFnSet->fnGetLeft)() > nEX ) + while ( pTmpLeaf && aRectFnSet.GetLeft(pTmpLeaf->Frame()) > nEX ) pTmpLeaf = pTmpLeaf->GetPrevLayoutLeaf(); const SwTabFrame *pTmpTab = rpEnd->FindTabFrame(); if ( !pTmpLeaf || !pTmpTab->IsAnLower( pTmpLeaf ) ) @@ -1729,7 +1729,7 @@ static void lcl_FindStartEndCol( const SwLayoutFrame *&rpStart, rpEnd = pTmpTab->FindLastContent()->GetUpper(); while( !rpEnd->IsCellFrame() ) rpEnd = rpEnd->GetUpper(); - while ( (rpEnd->Frame().*aRectFnSet->fnGetLeft)() > nEX ) + while ( aRectFnSet.GetLeft(rpEnd->Frame()) > nEX ) rpEnd = rpEnd->GetPrevLayoutLeaf(); } else @@ -1768,15 +1768,15 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrame *pStart, else { SwRectFnSet aRectFnSet(pTable); - long nSttTop = (pStart->Frame().*aRectFnSet->fnGetTop)(); - long nEndTop = (pEnd->Frame().*aRectFnSet->fnGetTop)(); + long nSttTop = aRectFnSet.GetTop(pStart->Frame()); + long nEndTop = aRectFnSet.GetTop(pEnd->Frame()); if( nSttTop == nEndTop ) { - if( (pStart->Frame().*aRectFnSet->fnGetLeft)() > - (pEnd->Frame().*aRectFnSet->fnGetLeft)() ) + if( aRectFnSet.GetLeft(pStart->Frame()) > + aRectFnSet.GetLeft(pEnd->Frame()) ) bExchange = true; } - else if( aRectFnSet.bVert == ( nSttTop < nEndTop ) ) + else if( aRectFnSet.IsVert() == ( nSttTop < nEndTop ) ) bExchange = true; } if ( bExchange ) @@ -1807,8 +1807,8 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrame *pStart, while ( pTable ) { SwRectFnSet aRectFnSet(pTable); - const long nOfst = (pTable->*aRectFnSet->fnGetPrtLeft)(); - const long nPrtWidth = (pTable->Prt().*aRectFnSet->fnGetWidth)(); + const long nOfst = aRectFnSet.GetPrtLeft(*pTable); + const long nPrtWidth = aRectFnSet.GetWidth(pTable->Prt()); long nSt1 = ::lcl_CalcWish( pStart, nWish, nPrtWidth ) + nOfst; long nEd1 = ::lcl_CalcWish( pEnd, nWish, nPrtWidth ) + nOfst; @@ -1820,13 +1820,13 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrame *pStart, long nSt2; long nEd2; if( pTable->IsAnLower( pStart ) ) - nSt2 = (pStart->Frame().*aRectFnSet->fnGetTop)(); + nSt2 = aRectFnSet.GetTop(pStart->Frame()); else - nSt2 = (pTable->Frame().*aRectFnSet->fnGetTop)(); + nSt2 = aRectFnSet.GetTop(pTable->Frame()); if( pTable->IsAnLower( pEnd ) ) - nEd2 = (pEnd->Frame().*aRectFnSet->fnGetBottom)(); + nEd2 = aRectFnSet.GetBottom(pEnd->Frame()); else - nEd2 = (pTable->Frame().*aRectFnSet->fnGetBottom)(); + nEd2 = aRectFnSet.GetBottom(pTable->Frame()); Point aSt, aEd; if( nSt1 > nEd1 ) { @@ -1840,7 +1840,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrame *pStart, nSt2 = nEd2; nEd2 = nTmp; } - if( aRectFnSet.bVert ) + if( aRectFnSet.IsVert() ) { aSt = Point( nSt2, nSt1 ); aEd = Point( nEd2, nEd1 ); @@ -1918,7 +1918,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrame *pStart, aUnion.Width( 0 ); } - if( (aUnion.*aRectFnSet->fnGetWidth)() ) + if( aRectFnSet.GetWidth(aUnion) ) { rUnions.push_back(SwSelUnion(aUnion, const_cast<SwTabFrame*>(pTable))); } @@ -1990,7 +1990,7 @@ bool CheckSplitCells( const SwCursor& rCursor, sal_uInt16 nDiv, OSL_ENSURE( pCell->IsCellFrame(), "Frame without cell" ); if( ::IsFrameInTableSel( rSelUnion.GetUnion(), pCell ) ) { - if( (pCell->Frame().*aRectFnSet->fnGetWidth)() < nMinValue ) + if( aRectFnSet.GetWidth(pCell->Frame()) < nMinValue ) return false; } diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index e8f56ce064e6..4ba2cf4c2442 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -1140,13 +1140,10 @@ struct SwRectFnCollection typedef SwRectFnCollection* SwRectFn; +// This class allows to use proper methods regardless of orientation (LTR/RTL, horizontal or vertical) extern SwRectFn fnRectHori, fnRectVert, fnRectB2T, fnRectVL2R, fnRectVertL2R; -struct SwRectFnSet { - bool bVert; - bool bRev; - bool bVertL2R; - SwRectFn fnRect; - +class SwRectFnSet { +public: explicit SwRectFnSet(const SwFrame *pFrame) : bVert(pFrame->IsVertical()) , bRev(pFrame->IsReverse()) @@ -1157,9 +1154,6 @@ struct SwRectFnSet { (bRev ? fnRectB2T : fnRectHori); } - // Convenience operator to simplify pointer-to-member syntax - SwRectFn operator ->() const { return fnRect; } - void Refresh(const SwFrame *pFrame) { bVert = pFrame->IsVertical(); @@ -1170,11 +1164,71 @@ struct SwRectFnSet { (bRev ? fnRectB2T : fnRectHori); } - bool PosDiff(const SwRect &rRect1, const SwRect &rRect2) + bool IsVert() const { return bVert; } + bool IsRev() const { return bRev; } + bool IsVertL2R() const { return bVertL2R; } + SwRectFn FnRect() const { return fnRect; } + + bool PosDiff(const SwRect &rRect1, const SwRect &rRect2) const { return ((rRect1.*fnRect->fnGetTop)() != (rRect2.*fnRect->fnGetTop)() || (rRect1.*fnRect->fnGetLeft)() != (rRect2.*fnRect->fnGetLeft)()); } + + long GetTop (const SwRect& rRect) const { return (rRect.*fnRect->fnGetTop) (); } + long GetBottom(const SwRect& rRect) const { return (rRect.*fnRect->fnGetBottom)(); } + long GetLeft (const SwRect& rRect) const { return (rRect.*fnRect->fnGetLeft) (); } + long GetRight (const SwRect& rRect) const { return (rRect.*fnRect->fnGetRight) (); } + long GetWidth (const SwRect& rRect) const { return (rRect.*fnRect->fnGetWidth) (); } + long GetHeight(const SwRect& rRect) const { return (rRect.*fnRect->fnGetHeight)(); } + Point GetPos (const SwRect& rRect) const { return (rRect.*fnRect->fnGetPos) (); } + + void SetTop (SwRect& rRect, long nNew) const { (rRect.*fnRect->fnSetTop) (nNew); } + void SetBottom(SwRect& rRect, long nNew) const { (rRect.*fnRect->fnSetBottom)(nNew); } + void SetLeft (SwRect& rRect, long nNew) const { (rRect.*fnRect->fnSetLeft) (nNew); } + void SetRight (SwRect& rRect, long nNew) const { (rRect.*fnRect->fnSetRight) (nNew); } + void SetWidth (SwRect& rRect, long nNew) const { (rRect.*fnRect->fnSetWidth) (nNew); } + void SetHeight(SwRect& rRect, long nNew) const { (rRect.*fnRect->fnSetHeight)(nNew); } + + void SubTop (SwRect& rRect, long nNew) const { (rRect.*fnRect->fnSubTop) (nNew); } + void AddBottom(SwRect& rRect, long nNew) const { (rRect.*fnRect->fnAddBottom)(nNew); } + void SubLeft (SwRect& rRect, long nNew) const { (rRect.*fnRect->fnSubLeft) (nNew); } + void AddRight (SwRect& rRect, long nNew) const { (rRect.*fnRect->fnAddRight) (nNew); } + void AddWidth (SwRect& rRect, long nNew) const { (rRect.*fnRect->fnAddWidth) (nNew); } + void AddHeight(SwRect& rRect, long nNew) const { (rRect.*fnRect->fnAddHeight)(nNew); } + + void SetPosX(SwRect& rRect, long nNew) const { (rRect.*fnRect->fnSetPosX)(nNew); } + void SetPosY(SwRect& rRect, long nNew) const { (rRect.*fnRect->fnSetPosY)(nNew); } + + long GetTopMargin (const SwFrame& rFrame) const { return (rFrame.*fnRect->fnGetTopMargin) (); } + long GetBottomMargin(const SwFrame& rFrame) const { return (rFrame.*fnRect->fnGetBottomMargin)(); } + long GetLeftMargin (const SwFrame& rFrame) const { return (rFrame.*fnRect->fnGetLeftMargin) (); } + long GetRightMargin (const SwFrame& rFrame) const { return (rFrame.*fnRect->fnGetRightMargin) (); } + void SetXMargins(SwFrame& rFrame, long nLeft, long nRight) const { (rFrame.*fnRect->fnSetXMargins)(nLeft, nRight); } + void SetYMargins(SwFrame& rFrame, long nTop, long nBottom) const { (rFrame.*fnRect->fnSetYMargins)(nTop, nBottom); } + long GetPrtTop (const SwFrame& rFrame) const { return (rFrame.*fnRect->fnGetPrtTop) (); } + long GetPrtBottom (const SwFrame& rFrame) const { return (rFrame.*fnRect->fnGetPrtBottom) (); } + long GetPrtLeft (const SwFrame& rFrame) const { return (rFrame.*fnRect->fnGetPrtLeft) (); } + long GetPrtRight (const SwFrame& rFrame) const { return (rFrame.*fnRect->fnGetPrtRight) (); } + long TopDist (const SwRect& rRect, long nPos) const { return (rRect.*fnRect->fnTopDist) (nPos); } + long BottomDist(const SwRect& rRect, long nPos) const { return (rRect.*fnRect->fnBottomDist) (nPos); } + bool SetLimit (SwFrame& rFrame, long nNew) const { return (rFrame.*fnRect->fnSetLimit) (nNew); } + bool OverStep (const SwRect& rRect, long nPos) const { return (rRect.*fnRect->fnOverStep) (nPos); } + + void SetPos(SwRect& rRect, const Point& rNew) const { (rRect.*fnRect->fnSetPos)(rNew); } + void MakePos(SwFrame& rFrame, const SwFrame* pUp, const SwFrame* pPrv, bool bNotify) const { (rFrame.*fnRect->fnMakePos)(pUp, pPrv, bNotify); } + long XDiff(long n1, long n2) const { return (fnRect->fnXDiff) (n1, n2); } + long YDiff(long n1, long n2) const { return (fnRect->fnYDiff) (n1, n2); } + long YInc (long n1, long n2) const { return (fnRect->fnYInc) (n1, n2); } + + void SetLeftAndWidth(SwRect& rRect, long nLeft, long nWidth) const { (rRect.*fnRect->fnSetLeftAndWidth)(nLeft, nWidth); } + void SetTopAndHeight(SwRect& rRect, long nTop, long nHeight) const { (rRect.*fnRect->fnSetTopAndHeight)(nTop, nHeight); } + +private: + bool bVert; + bool bRev; + bool bVertL2R; + SwRectFn fnRect; }; #endif diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx index 9fe438db4ec3..c4f7d9973666 100644 --- a/sw/source/core/layout/anchoreddrawobject.cxx +++ b/sw/source/core/layout/anchoreddrawobject.cxx @@ -493,7 +493,7 @@ void SwAnchoredDrawObject::MakeObjPosAnchoredAtLayout() SetCurrRelPos( aObjPositioning.GetRelPos() ); const SwFrame* pAnchorFrame = GetAnchorFrame(); SwRectFnSet aRectFnSet(pAnchorFrame); - const Point aAnchPos( (pAnchorFrame->Frame().*aRectFnSet->fnGetPos)() ); + const Point aAnchPos( aRectFnSet.GetPos(pAnchorFrame->Frame()) ); SetObjLeft( aAnchPos.X() + GetCurrRelPos().X() ); SetObjTop( aAnchPos.Y() + GetCurrRelPos().Y() ); } diff --git a/sw/source/core/layout/anchoredobject.cxx b/sw/source/core/layout/anchoredobject.cxx index 120666ea5f6c..98a9a16ab6b8 100644 --- a/sw/source/core/layout/anchoredobject.cxx +++ b/sw/source/core/layout/anchoredobject.cxx @@ -273,19 +273,15 @@ void SwAnchoredObject::CheckCharRect( const SwFormatAnchor& _rAnch, // of anchor character has changed. const sal_Int16 eVertRelOrient = aVert.GetRelationOrient(); if ( ( aHori.GetRelationOrient() == text::RelOrientation::CHAR && - (aCharRect.*aRectFnSet->fnGetLeft)() != - (maLastCharRect.*aRectFnSet->fnGetLeft)() ) || + aRectFnSet.GetLeft(aCharRect) != aRectFnSet.GetLeft(maLastCharRect) ) || ( eVertRelOrient == text::RelOrientation::CHAR && - ( (aCharRect.*aRectFnSet->fnGetTop)() != - (maLastCharRect.*aRectFnSet->fnGetTop)() || - (aCharRect.*aRectFnSet->fnGetHeight)() != - (maLastCharRect.*aRectFnSet->fnGetHeight)() ) ) || + ( aRectFnSet.GetTop(aCharRect) != aRectFnSet.GetTop(maLastCharRect) || + aRectFnSet.GetHeight(aCharRect) != aRectFnSet.GetHeight(maLastCharRect) ) ) || ( ( ( eVertRelOrient == text::RelOrientation::FRAME ) || ( eVertRelOrient == text::RelOrientation::PRINT_AREA ) || ( eVertRelOrient == text::RelOrientation::PAGE_FRAME ) || ( eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA ) ) && - ( (aCharRect.*aRectFnSet->fnGetTop)() != - (maLastCharRect.*aRectFnSet->fnGetTop)() ) ) ) + ( aRectFnSet.GetTop(aCharRect) != aRectFnSet.GetTop(maLastCharRect) ) ) ) { // #i26945#, #i35911# - unlock position of // anchored object, if it isn't registered at the page, diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 8f65b8ed8da9..7f2a9f06b79a 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -93,8 +93,8 @@ bool SwContentFrame::ShouldBwdMoved( SwLayoutFrame *pNewUpper, bool, bool & ) } SwRectFnSet aRectFnSet(this); SwRectFnSet fnRectX(pNewUpper); - if( std::abs( (pNewUpper->Prt().*fnRectX->fnGetWidth)() - - (GetUpper()->Prt().*aRectFnSet->fnGetWidth)() ) > 1 ) { + if( std::abs( fnRectX.GetWidth(pNewUpper->Prt()) - + aRectFnSet.GetWidth(GetUpper()->Prt()) ) > 1 ) { // In this case, only a WouldFit_ with test move is possible nMoveAnyway = 2; } @@ -110,7 +110,7 @@ bool SwContentFrame::ShouldBwdMoved( SwLayoutFrame *pNewUpper, bool, bool & ) const SwFrame *pPrevFrame = pNewUpper->Lower(); while ( pPrevFrame ) { - SwTwips nNewTop = (pPrevFrame->Frame().*fnRectX->fnGetBottom)(); + SwTwips nNewTop = fnRectX.GetBottom(pPrevFrame->Frame()); // OD 2004-03-01 #106629#: // consider lower spacing of last frame in a table cell { @@ -139,7 +139,7 @@ bool SwContentFrame::ShouldBwdMoved( SwLayoutFrame *pNewUpper, bool, bool & ) } } } - (aRect.*fnRectX->fnSetTop)( nNewTop ); + fnRectX.SetTop( aRect, nNewTop ); pPrevFrame = pPrevFrame->GetNext(); } @@ -147,7 +147,7 @@ bool SwContentFrame::ShouldBwdMoved( SwLayoutFrame *pNewUpper, bool, bool & ) nMoveAnyway |= BwdMoveNecessary( pNewPage, aRect); //determine space left in new upper frame - nSpace = (aRect.*fnRectX->fnGetHeight)(); + nSpace = fnRectX.GetHeight(aRect); const SwViewShell *pSh = pNewUpper->getRootFrame()->GetCurrShell(); if ( IsInFootnote() || (pSh && pSh->GetViewOptions()->getBrowseMode()) || @@ -186,7 +186,7 @@ bool SwContentFrame::ShouldBwdMoved( SwLayoutFrame *pNewUpper, bool, bool & ) // we have a fresh multi-column section - so we really have to // float back unless there is no space. return pNewUpper->IsInSct() && pNewUpper->IsColBodyFrame() && - !(pNewUpper->Prt().*fnRectX->fnGetWidth)() && + !fnRectX.GetWidth(pNewUpper->Prt()) && ( pNewUpper->GetUpper()->GetPrev() || pNewUpper->GetUpper()->GetNext() ); } @@ -504,23 +504,23 @@ void SwFrame::MakePos() { bool bR2L = IsRightToLeft(); if( bR2L ) - (maFrame.*aRectFnSet->fnSetPosX)( (maFrame.*aRectFnSet->fnGetLeft)() - - (maFrame.*aRectFnSet->fnGetWidth)() ); + aRectFnSet.SetPosX( maFrame, aRectFnSet.GetLeft(maFrame) - + aRectFnSet.GetWidth(maFrame) ); else - (maFrame.*aRectFnSet->fnSetPosX)( (maFrame.*aRectFnSet->fnGetLeft)() + - (pPrv->Frame().*aRectFnSet->fnGetWidth)() ); + aRectFnSet.SetPosX( maFrame, aRectFnSet.GetLeft(maFrame) + + aRectFnSet.GetWidth(pPrv->Frame()) ); // cells may now leave their uppers - if( aRectFnSet.bVert && SwFrameType::Cell & nMyType && !mbReverse ) + if( aRectFnSet.IsVert() && SwFrameType::Cell & nMyType && !mbReverse ) maFrame.Pos().setX(maFrame.Pos().getX() - maFrame.Width() + pPrv->Frame().Width()); } - else if( aRectFnSet.bVert && FRM_NOTE_VERT & nMyType ) + else if( aRectFnSet.IsVert() && FRM_NOTE_VERT & nMyType ) { if( mbReverse ) maFrame.Pos().setX(maFrame.Pos().getX() + pPrv->Frame().Width()); else { - if ( aRectFnSet.bVertL2R ) + if ( aRectFnSet.IsVertL2R() ) maFrame.Pos().setX(maFrame.Pos().getX() + pPrv->Frame().Width()); else maFrame.Pos().setX(maFrame.Pos().getX() - maFrame.Width()); @@ -558,17 +558,17 @@ void SwFrame::MakePos() { bool bR2L = IsRightToLeft(); if( bR2L ) - (maFrame.*aRectFnSet->fnSetPosX)( (maFrame.*aRectFnSet->fnGetLeft)() - - (maFrame.*aRectFnSet->fnGetWidth)() ); + aRectFnSet.SetPosX( maFrame, aRectFnSet.GetLeft(maFrame) - + aRectFnSet.GetWidth(maFrame) ); else - (maFrame.*aRectFnSet->fnSetPosX)( (maFrame.*aRectFnSet->fnGetLeft)() + - (pPrv->Frame().*aRectFnSet->fnGetWidth)() ); + aRectFnSet.SetPosX( maFrame, aRectFnSet.GetLeft(maFrame) + + aRectFnSet.GetWidth(pPrv->Frame()) ); // cells may now leave their uppers - if( aRectFnSet.bVert && SwFrameType::Cell & nMyType && !mbReverse ) + if( aRectFnSet.IsVert() && SwFrameType::Cell & nMyType && !mbReverse ) maFrame.Pos().setX(maFrame.Pos().getX() - maFrame.Width() + pPrv->Frame().Width()); } - else if( aRectFnSet.bVert && FRM_NOTE_VERT & nMyType ) + else if( aRectFnSet.IsVert() && FRM_NOTE_VERT & nMyType ) { if( mbReverse ) maFrame.Pos().setX(maFrame.Pos().getX() + pPrv->Frame().Width()); @@ -588,14 +588,14 @@ void SwFrame::MakePos() if( FRM_NEIGHBOUR & nMyType && IsRightToLeft() ) { - if( aRectFnSet.bVert ) + if( aRectFnSet.IsVert() ) maFrame.Pos().setY(maFrame.Pos().getY() + GetUpper()->Prt().Height() - maFrame.Height()); else maFrame.Pos().setX(maFrame.Pos().getX() + GetUpper()->Prt().Width() - maFrame.Width()); } - else if( aRectFnSet.bVert && !aRectFnSet.bVertL2R && FRM_NOTE_VERT & nMyType && !mbReverse ) + else if( aRectFnSet.IsVert() && !aRectFnSet.IsVertL2R() && FRM_NOTE_VERT & nMyType && !mbReverse ) maFrame.Pos().setX(maFrame.Pos().getX() - maFrame.Width() + GetUpper()->Prt().Width()); } } @@ -605,7 +605,7 @@ void SwFrame::MakePos() maFrame.Pos().setY(0); } - if( IsBodyFrame() && aRectFnSet.bVert && !aRectFnSet.bVertL2R && !mbReverse && GetUpper() ) + if( IsBodyFrame() && aRectFnSet.IsVert() && !aRectFnSet.IsVertL2R() && !mbReverse && GetUpper() ) maFrame.Pos().setX(maFrame.Pos().getX() + GetUpper()->Prt().Width() - maFrame.Width()); mbValidPos = true; } @@ -961,13 +961,13 @@ bool SwContentFrame::MakePrtArea( const SwBorderAttrs &rAttrs ) if ( static_cast<SwTextFrame*>(this)->HasFollow() ) static_cast<SwTextFrame*>(this)->JoinFrame(); - if( (Prt().*aRectFnSet->fnGetHeight)() ) + if( aRectFnSet.GetHeight(Prt()) ) static_cast<SwTextFrame*>(this)->HideHidden(); Prt().Pos().setX(0); Prt().Pos().setY(0); - (Prt().*aRectFnSet->fnSetWidth)( (Frame().*aRectFnSet->fnGetWidth)() ); - (Prt().*aRectFnSet->fnSetHeight)( 0 ); - nUpper = -( (Frame().*aRectFnSet->fnGetHeight)() ); + aRectFnSet.SetWidth( Prt(), aRectFnSet.GetWidth(Frame()) ); + aRectFnSet.SetHeight( Prt(), 0 ); + nUpper = -( aRectFnSet.GetHeight(Frame()) ); } else { @@ -977,11 +977,11 @@ bool SwContentFrame::MakePrtArea( const SwBorderAttrs &rAttrs ) // the borders are simply subtracted. const long nLeft = rAttrs.CalcLeft( this ); const long nRight = rAttrs.CalcRight( this ); - (this->*aRectFnSet->fnSetXMargins)( nLeft, nRight ); + aRectFnSet.SetXMargins( *this, nLeft, nRight ); SwViewShell *pSh = getRootFrame()->GetCurrShell(); SwTwips nWidthArea; - if( pSh && 0!=(nWidthArea=(pSh->VisArea().*aRectFnSet->fnGetWidth)()) && + if( pSh && 0!=(nWidthArea=aRectFnSet.GetWidth(pSh->VisArea())) && GetUpper()->IsPageBodyFrame() && // but not for BodyFrames in Columns pSh->GetViewOptions()->getBrowseMode() ) { @@ -1013,23 +1013,21 @@ bool SwContentFrame::MakePrtArea( const SwBorderAttrs &rAttrs ) const Size aBorder = pSh->GetOut()->PixelToLogic( pSh->GetBrowseBorder() ); long nWidth = nWidthArea - 2 * ( IsVertical() ? aBorder.Height() : aBorder.Width() ); - nWidth -= (Prt().*aRectFnSet->fnGetLeft)(); + nWidth -= aRectFnSet.GetLeft(Prt()); nWidth -= rAttrs.CalcRightLine(); nWidth = std::max( nMinWidth, nWidth ); - (Prt().*aRectFnSet->fnSetWidth)( std::min( nWidth, - (Prt().*aRectFnSet->fnGetWidth)() ) ); + aRectFnSet.SetWidth( Prt(), std::min( nWidth, aRectFnSet.GetWidth(Prt()) ) ); } - if ( (Prt().*aRectFnSet->fnGetWidth)() <= MINLAY ) + if ( aRectFnSet.GetWidth(Prt()) <= MINLAY ) { // The PrtArea should already be at least MINLAY wide, matching the // minimal values of the UI - (Prt().*aRectFnSet->fnSetWidth)( std::min( long(MINLAY), - (Frame().*aRectFnSet->fnGetWidth)() ) ); - SwTwips nTmp = (Frame().*aRectFnSet->fnGetWidth)() - - (Prt().*aRectFnSet->fnGetWidth)(); - if( (Prt().*aRectFnSet->fnGetLeft)() > nTmp ) - (Prt().*aRectFnSet->fnSetLeft)( nTmp ); + aRectFnSet.SetWidth( Prt(), std::min( long(MINLAY), aRectFnSet.GetWidth(Frame()) ) ); + SwTwips nTmp = aRectFnSet.GetWidth(Frame()) - + aRectFnSet.GetWidth(Prt()); + if( aRectFnSet.GetLeft(Prt()) > nTmp ) + aRectFnSet.SetLeft( Prt(), nTmp ); } // The following rules apply for VarSize: @@ -1052,10 +1050,10 @@ bool SwContentFrame::MakePrtArea( const SwBorderAttrs &rAttrs ) nLower=0; } - (Prt().*aRectFnSet->fnSetPosY)( (!aRectFnSet.bVert || mbReverse) ? nUpper : nLower); + aRectFnSet.SetPosY( Prt(), (!aRectFnSet.IsVert() || mbReverse) ? nUpper : nLower); nUpper += nLower; - nUpper -= (Frame().*aRectFnSet->fnGetHeight)() - - (Prt().*aRectFnSet->fnGetHeight)(); + nUpper -= aRectFnSet.GetHeight(Frame()) - + aRectFnSet.GetHeight(Prt()); } // If there's a difference between old and new size, call Grow() or // Shrink() respectively. @@ -1280,8 +1278,8 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) } } - aOldFramePos = (Frame().*aRectFnSet->fnGetPos)(); - aOldPrtPos = (Prt().*aRectFnSet->fnGetPos)(); + aOldFramePos = aRectFnSet.GetPos(Frame()); + aOldPrtPos = aRectFnSet.GetPos(Prt()); if ( !mbValidPos ) MakePos(); @@ -1300,15 +1298,15 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) // Note: A text frame can be in such a situation, if the format is // triggered by method call <SwCursorShell::SetCursor()> after // loading the document. - const SwTwips nNewFrameWidth = (GetUpper()->Prt().*aRectFnSet->fnGetWidth)(); + const SwTwips nNewFrameWidth = aRectFnSet.GetWidth(GetUpper()->Prt()); if ( mbValidPrtArea && nNewFrameWidth > 0 && - (Frame().*aRectFnSet->fnGetWidth)() == 0 && - (Prt().*aRectFnSet->fnGetWidth)() == 0 ) + aRectFnSet.GetWidth(Frame()) == 0 && + aRectFnSet.GetWidth(Prt()) == 0 ) { mbValidPrtArea = false; } - (Frame().*aRectFnSet->fnSetWidth)( nNewFrameWidth ); + aRectFnSet.SetWidth( Frame(), nNewFrameWidth ); // When a lower of a vertically aligned fly frame changes its size we need to recalculate content pos. if( GetUpper() && GetUpper()->IsFlyFrame() && @@ -1320,11 +1318,11 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) } if ( !mbValidPrtArea ) { - const long nOldW = (Prt().*aRectFnSet->fnGetWidth)(); + const long nOldW = aRectFnSet.GetWidth(Prt()); // #i34730# - keep current frame height - const SwTwips nOldH = (Frame().*aRectFnSet->fnGetHeight)(); + const SwTwips nOldH = aRectFnSet.GetHeight(Frame()); MakePrtArea( rAttrs ); - if ( nOldW != (Prt().*aRectFnSet->fnGetWidth)() ) + if ( nOldW != aRectFnSet.GetWidth(Prt()) ) Prepare( PREP_FIXSIZE_CHG ); // #i34730# - check, if frame height has changed. // If yes, send a PREP_ADJUST_FRM and invalidate the size flag to @@ -1333,16 +1331,16 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) // fit and if not, performs necessary actions. // #i40150# - no check, if frame is undersized. if ( mbValidSize && !IsUndersized() && - nOldH != (Frame().*aRectFnSet->fnGetHeight)() ) + nOldH != aRectFnSet.GetHeight(Frame()) ) { // #115759# - no PREP_ADJUST_FRM and size // invalidation, if height decreases only by the additional // lower space as last content of a table cell and an existing // follow containing one line exists. - const SwTwips nHDiff = nOldH - (Frame().*aRectFnSet->fnGetHeight)(); + const SwTwips nHDiff = nOldH - aRectFnSet.GetHeight(Frame()); const bool bNoPrepAdjustFrame = nHDiff > 0 && IsInTab() && GetFollow() && - ( 1 == static_cast<SwTextFrame*>(GetFollow())->GetLineCount( COMPLETE_STRING ) || (static_cast<SwTextFrame*>(GetFollow())->Frame().*aRectFnSet->fnGetWidth)() < 0 ) && + ( 1 == static_cast<SwTextFrame*>(GetFollow())->GetLineCount( COMPLETE_STRING ) || aRectFnSet.GetWidth(static_cast<SwTextFrame*>(GetFollow())->Frame()) < 0 ) && GetFollow()->CalcAddLowerSpaceAsLastInTableCell() == nHDiff; if ( !bNoPrepAdjustFrame ) { @@ -1359,15 +1357,15 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) if ( !bMustFit ) { bool bWidow = true; - const SwTwips nDeadLine = (GetUpper()->*aRectFnSet->fnGetPrtBottom)(); - if ( bMoveable && !bFormatted && ( GetFollow() || - ( (Frame().*aRectFnSet->fnOverStep)( nDeadLine ) ) ) ) + const SwTwips nDeadLine = aRectFnSet.GetPrtBottom(*GetUpper()); + if( bMoveable && !bFormatted && + ( GetFollow() || aRectFnSet.OverStep( Frame(), nDeadLine ) ) ) { Prepare( PREP_WIDOWS_ORPHANS, nullptr, false ); mbValidSize = bWidow = false; } - if( (Frame().*aRectFnSet->fnGetPos)() != aOldFramePos || - (Prt().*aRectFnSet->fnGetPos)() != aOldPrtPos ) + if( aRectFnSet.GetPos(Frame()) != aOldFramePos || + aRectFnSet.GetPos(Prt()) != aOldPrtPos ) { // In this Prepare, an InvalidateSize_() might happen. // mbValidSize becomes false and Format() gets called. @@ -1423,20 +1421,19 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) bMoveable = IsMoveable(); aRectFnSet.Refresh(this); } - Point aOldPos = (Frame().*aRectFnSet->fnGetPos)(); + Point aOldPos = aRectFnSet.GetPos(Frame()); MakePos(); - if( aOldPos != (Frame().*aRectFnSet->fnGetPos)() ) + if( aOldPos != aRectFnSet.GetPos(Frame()) ) { Prepare( PREP_POS_CHGD, static_cast<const void*>(&bFormatted), false ); if ( !mbValidSize ) { - (Frame().*aRectFnSet->fnSetWidth)( (GetUpper()-> - Prt().*aRectFnSet->fnGetWidth)() ); + aRectFnSet.SetWidth( Frame(), aRectFnSet.GetWidth(GetUpper()->Prt()) ); if ( !mbValidPrtArea ) { - const long nOldW = (Prt().*aRectFnSet->fnGetWidth)(); + const long nOldW = aRectFnSet.GetWidth(Prt()); MakePrtArea( rAttrs ); - if( nOldW != (Prt().*aRectFnSet->fnGetWidth)() ) + if( nOldW != aRectFnSet.GetWidth(Prt()) ) Prepare( PREP_FIXSIZE_CHG, nullptr, false ); } if( GetFollow() ) @@ -1496,8 +1493,8 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) { mbValidPos = false; MakePos(); - aOldFramePos = (Frame().*aRectFnSet->fnGetPos)(); - aOldPrtPos = (Prt().*aRectFnSet->fnGetPos)(); + aOldFramePos = aRectFnSet.GetPos(Frame()); + aOldPrtPos = aRectFnSet.GetPos(Prt()); } } @@ -1522,8 +1519,8 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) // Attention: because height == 0, it's better to use Top()+Height() instead of // Bottom(). This might happen with undersized TextFrames on the lower edge of a // multi-column section - const long nPrtBottom = (GetUpper()->*aRectFnSet->fnGetPrtBottom)(); - long nBottomDist = (Frame().*aRectFnSet->fnBottomDist)(nPrtBottom); + const long nPrtBottom = aRectFnSet.GetPrtBottom(*GetUpper()); + long nBottomDist = aRectFnSet.BottomDist(Frame(), nPrtBottom); // Hide whitespace may require not to insert a new page. SwPageFrame* pPageFrame = FindPageFrame(); @@ -1562,7 +1559,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) { const bool bMoveFwdInvalid = nullptr != GetIndNext(); const bool bNxtNew = - ( 0 == (pNxt->Prt().*aRectFnSet->fnGetHeight)() ) && + ( 0 == aRectFnSet.GetHeight(pNxt->Prt()) ) && (!pNxt->IsTextFrame() ||!static_cast<SwTextFrame*>(pNxt)->IsHiddenNow()); pNxt->Calc(getRootFrame()->GetCurrShell()->GetOut()); @@ -1590,8 +1587,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) { if( !bMoveable && IsInTab() ) { - long nDiff = -(Frame().*aRectFnSet->fnBottomDist)( - (GetUpper()->*aRectFnSet->fnGetPrtBottom)() ); + long nDiff = -aRectFnSet.BottomDist( Frame(), aRectFnSet.GetPrtBottom(*GetUpper()) ); long nReal = GetUpper()->Grow( nDiff ); if( nReal ) continue; @@ -1623,13 +1619,13 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) nullptr != GetNextCellLeaf( MAKEPAGE_NONE ) ) bDontMoveMe = false; - if ( bDontMoveMe && (Frame().*aRectFnSet->fnGetHeight)() > - (GetUpper()->Prt().*aRectFnSet->fnGetHeight)() ) + if ( bDontMoveMe && aRectFnSet.GetHeight(Frame()) > + aRectFnSet.GetHeight(GetUpper()->Prt()) ) { if ( !bFitPromise ) { - SwTwips nTmp = (GetUpper()->Prt().*aRectFnSet->fnGetHeight)() - - (Prt().*aRectFnSet->fnGetTop)(); + SwTwips nTmp = aRectFnSet.GetHeight(GetUpper()->Prt()) - + aRectFnSet.GetTop(Prt()); bool bSplit = !IsFwdMoveAllowed(); if ( nTmp > 0 && WouldFit( nTmp, bSplit, false ) ) { @@ -1679,7 +1675,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) } const bool bCheckForGrownBody = pOldUp->IsBodyFrame(); - const long nOldBodyHeight = (pOldUp->Frame().*aRectFnSet->fnGetHeight)(); + const long nOldBodyHeight = aRectFnSet.GetHeight(pOldUp->Frame()); if ( !bMovedFwd && !MoveFwd( bMakePage, false ) ) bMakePage = false; @@ -1692,7 +1688,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) // If pOldUp was a footnote frame, it has been deleted inside MoveFwd. // Therefore we only check for growing body frames. if ( bCheckForGrownBody && ! bMovedBwd && pOldUp != GetUpper() && - (pOldUp->Frame().*aRectFnSet->fnGetHeight)() > nOldBodyHeight ) + aRectFnSet.GetHeight(pOldUp->Frame()) > nOldBodyHeight ) { bMovedFwd = false; } diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index d517103922d6..ffa8168f1c9a 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -512,7 +512,7 @@ bool SwFlowFrame::PasteTree( SwFrame *pStart, SwLayoutFrame *pParent, SwFrame *p else bRet = true; - nGrowVal += (pFloat->Frame().*aRectFnSet->fnGetHeight)(); + nGrowVal += aRectFnSet.GetHeight(pFloat->Frame()); if ( pFloat->GetNext() ) pFloat = pFloat->GetNext(); else @@ -1542,25 +1542,25 @@ SwTwips SwFlowFrame::GetUpperSpaceAmountConsideredForPageGrid_( pGrid->GetBaseHeight() + pGrid->GetRubyHeight(); SwRectFnSet aRectFnSet(&m_rThis); - const SwTwips nBodyPrtTop = (pBodyFrame->*aRectFnSet->fnGetPrtTop)(); + const SwTwips nBodyPrtTop = aRectFnSet.GetPrtTop(*pBodyFrame); const SwTwips nProposedPrtTop = - (*aRectFnSet->fnYInc)( (m_rThis.Frame().*aRectFnSet->fnGetTop)(), + aRectFnSet.YInc( aRectFnSet.GetTop(m_rThis.Frame()), _nUpperSpaceWithoutGrid ); const SwTwips nSpaceAbovePrtTop = - (*aRectFnSet->fnYDiff)( nProposedPrtTop, nBodyPrtTop ); + aRectFnSet.YDiff( nProposedPrtTop, nBodyPrtTop ); const SwTwips nSpaceOfCompleteLinesAbove = nGridLineHeight * ( nSpaceAbovePrtTop / nGridLineHeight ); SwTwips nNewPrtTop = - (*aRectFnSet->fnYInc)( nBodyPrtTop, nSpaceOfCompleteLinesAbove ); - if ( (*aRectFnSet->fnYDiff)( nProposedPrtTop, nNewPrtTop ) > 0 ) + aRectFnSet.YInc( nBodyPrtTop, nSpaceOfCompleteLinesAbove ); + if ( aRectFnSet.YDiff( nProposedPrtTop, nNewPrtTop ) > 0 ) { - nNewPrtTop = (*aRectFnSet->fnYInc)( nNewPrtTop, nGridLineHeight ); + nNewPrtTop = aRectFnSet.YInc( nNewPrtTop, nGridLineHeight ); } const SwTwips nNewUpperSpace = - (*aRectFnSet->fnYDiff)( nNewPrtTop, - (m_rThis.Frame().*aRectFnSet->fnGetTop)() ); + aRectFnSet.YDiff( nNewPrtTop, + aRectFnSet.GetTop(m_rThis.Frame()) ); nUpperSpaceAmountConsideredForPageGrid = nNewUpperSpace - _nUpperSpaceWithoutGrid; @@ -1902,7 +1902,7 @@ bool SwFlowFrame::MoveFwd( bool bMakePage, bool bPageBreak, bool bMoveAlways ) // silly things... SwRectFnSet aRectFnSet(pOldBoss); SwSaveFootnoteHeight aHeight( pOldBoss, - (pOldBoss->Frame().*aRectFnSet->fnGetBottom)() ); + aRectFnSet.GetBottom(pOldBoss->Frame()) ); SwContentFrame* pStart = m_rThis.IsContentFrame() ? static_cast<SwContentFrame*>(&m_rThis) : static_cast<SwLayoutFrame&>(m_rThis).ContainsContent(); OSL_ENSURE( pStart || ( m_rThis.IsTabFrame() && !static_cast<SwTabFrame&>(m_rThis).Lower() ), diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 1ab6bd16d1a8..30d693044c78 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -32,7 +32,6 @@ #include <fmtsrnd.hxx> #include <fmtornt.hxx> #include <fmtcnct.hxx> -#include <layhelp.hxx> #include <ndgrf.hxx> #include <tolayoutanchoredobjectposition.hxx> #include <fmtfollowtextflow.hxx> @@ -486,10 +485,10 @@ void SwFlyFrame::ChainFrames( SwFlyFrame *pMaster, SwFlyFrame *pFollow ) // To get a text flow we need to invalidate SwFrame *pInva = pMaster->FindLastLower(); SwRectFnSet aRectFnSet(pMaster); - const long nBottom = (pMaster->*aRectFnSet->fnGetPrtBottom)(); + const long nBottom = aRectFnSet.GetPrtBottom(*pMaster); while ( pInva ) { - if( (pInva->Frame().*aRectFnSet->fnBottomDist)( nBottom ) <= 0 ) + if( aRectFnSet.BottomDist( pInva->Frame(), nBottom ) <= 0 ) { pInva->InvalidateSize(); pInva->Prepare(); @@ -1264,7 +1263,7 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA { long nMinHeight = 0; if( IsMinHeight() ) - nMinHeight = aRectFnSet.bVert ? aRelSize.Width() : aRelSize.Height(); + nMinHeight = aRectFnSet.IsVert() ? aRelSize.Width() : aRelSize.Height(); SwTwips nRemaining = CalcContentHeight(pAttrs, nMinHeight, nUL); if( IsMinHeight() && (nRemaining + nUL) < nMinHeight ) @@ -1279,9 +1278,9 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA if ( nRemaining < MINFLY ) nRemaining = MINFLY; - (Prt().*aRectFnSet->fnSetHeight)( nRemaining ); - nRemaining -= (Frame().*aRectFnSet->fnGetHeight)(); - (Frame().*aRectFnSet->fnAddBottom)( nRemaining + nUL ); + aRectFnSet.SetHeight( Prt(), nRemaining ); + nRemaining -= aRectFnSet.GetHeight(Frame()); + aRectFnSet.AddBottom( Frame(), nRemaining + nUL ); // #i68520# if ( nRemaining + nUL != 0 ) { @@ -1296,7 +1295,7 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA if (SdrObjCustomShape* pCustomShape = dynamic_cast<SdrObjCustomShape*>( pShape) ) { // The shape is a customshape: then inform it about the calculated fly size. - Size aSize((Frame().*aRectFnSet->fnGetWidth)(), (Frame().*aRectFnSet->fnGetHeight)()); + Size aSize(aRectFnSet.GetWidth(Frame()), aRectFnSet.GetHeight(Frame())); pCustomShape->SuggestTextFrameSize(aSize); // Do the calculations normally done after touching editeng text of the shape. pCustomShape->NbcSetOutlinerParaObjectForText(nullptr, nullptr); @@ -1307,13 +1306,13 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA { mbValidSize = true; // Fixed Frames do not Format itself // Flys set their size using the attr - SwTwips nNewSize = aRectFnSet.bVert ? aRelSize.Width() : aRelSize.Height(); + SwTwips nNewSize = aRectFnSet.IsVert() ? aRelSize.Width() : aRelSize.Height(); nNewSize -= nUL; if( nNewSize < MINFLY ) nNewSize = MINFLY; - (Prt().*aRectFnSet->fnSetHeight)( nNewSize ); - nNewSize += nUL - (Frame().*aRectFnSet->fnGetHeight)(); - (Frame().*aRectFnSet->fnAddBottom)( nNewSize ); + aRectFnSet.SetHeight( Prt(), nNewSize ); + nNewSize += nUL - aRectFnSet.GetHeight(Frame()); + aRectFnSet.AddBottom( Frame(), nNewSize ); // #i68520# if ( nNewSize != 0 ) { @@ -1324,7 +1323,7 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA if ( !m_bFormatHeightOnly ) { OSL_ENSURE( aRelSize == CalcRel( rFrameSz ), "SwFlyFrame::Format CalcRel problem" ); - SwTwips nNewSize = aRectFnSet.bVert ? aRelSize.Height() : aRelSize.Width(); + SwTwips nNewSize = aRectFnSet.IsVert() ? aRelSize.Height() : aRelSize.Width(); if ( rFrameSz.GetWidthSizeType() != ATT_FIX_SIZE ) { @@ -1343,9 +1342,9 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA if( nNewSize < MINFLY ) nNewSize = MINFLY; - (Prt().*aRectFnSet->fnSetWidth)( nNewSize ); - nNewSize += nLR - (Frame().*aRectFnSet->fnGetWidth)(); - (Frame().*aRectFnSet->fnAddRight)( nNewSize ); + aRectFnSet.SetWidth( Prt(), nNewSize ); + nNewSize += nLR - aRectFnSet.GetWidth(Frame()); + aRectFnSet.AddRight( Frame(), nNewSize ); // #i68520# if ( nNewSize != 0 ) { @@ -1692,7 +1691,7 @@ void SwFlyFrame::MakeObjPos() SwRectFnSet aRectFnSet(GetAnchorFrame()); maFrame.Pos( aObjPositioning.GetRelPos() ); - maFrame.Pos() += (GetAnchorFrame()->Frame().*aRectFnSet->fnGetPos)(); + maFrame.Pos() += aRectFnSet.GetPos(GetAnchorFrame()->Frame()); // #i69335# InvalidateObjRectWithSpaces(); } @@ -1706,9 +1705,9 @@ void SwFlyFrame::MakePrtArea( const SwBorderAttrs &rAttrs ) // OD 31.07.2003 #110978# - consider vertical layout SwRectFnSet aRectFnSet(this); - (this->*aRectFnSet->fnSetXMargins)( rAttrs.CalcLeftLine(), + aRectFnSet.SetXMargins( *this, rAttrs.CalcLeftLine(), rAttrs.CalcRightLine() ); - (this->*aRectFnSet->fnSetYMargins)( rAttrs.CalcTopLine(), + aRectFnSet.SetYMargins( *this, rAttrs.CalcTopLine(), rAttrs.CalcBottomLine() ); } } @@ -1725,7 +1724,7 @@ void SwFlyFrame::MakeContentPos( const SwBorderAttrs &rAttrs ) SwRectFnSet aRectFnSet(this); long nMinHeight = 0; if( IsMinHeight() ) - nMinHeight = aRectFnSet.bVert ? aRelSize.Width() : aRelSize.Height(); + nMinHeight = aRectFnSet.IsVert() ? aRelSize.Width() : aRelSize.Height(); Point aNewContentPos; aNewContentPos = Prt().Pos(); @@ -1737,24 +1736,24 @@ void SwFlyFrame::MakeContentPos( const SwBorderAttrs &rAttrs ) SwTwips nDiff = 0; if( nContentHeight != 0) - nDiff = (Prt().*aRectFnSet->fnGetHeight)() - nContentHeight; + nDiff = aRectFnSet.GetHeight(Prt()) - nContentHeight; if( nDiff > 0 ) { if( nAdjust == SDRTEXTVERTADJUST_CENTER ) { - if( aRectFnSet.bVertL2R ) + if( aRectFnSet.IsVertL2R() ) aNewContentPos.setX(aNewContentPos.getX() + nDiff/2); - else if( aRectFnSet.bVert ) + else if( aRectFnSet.IsVert() ) aNewContentPos.setX(aNewContentPos.getX() - nDiff/2); else aNewContentPos.setY(aNewContentPos.getY() + nDiff/2); } else if( nAdjust == SDRTEXTVERTADJUST_BOTTOM ) { - if( aRectFnSet.bVertL2R ) + if( aRectFnSet.IsVertL2R() ) aNewContentPos.setX(aNewContentPos.getX() + nDiff); - else if( aRectFnSet.bVert ) + else if( aRectFnSet.IsVert() ) aNewContentPos.setX(aNewContentPos.getX() - nDiff); else aNewContentPos.setY(aNewContentPos.getY() + nDiff); @@ -1783,7 +1782,7 @@ SwTwips SwFlyFrame::Grow_( SwTwips nDist, bool bTst ) SwRectFnSet aRectFnSet(this); if ( Lower() && !IsColLocked() && !HasFixSize() ) { - SwTwips nSize = (Frame().*aRectFnSet->fnGetHeight)(); + SwTwips nSize = aRectFnSet.GetHeight(Frame()); if( nSize > 0 && nDist > ( LONG_MAX - nSize ) ) nDist = LONG_MAX - nSize; @@ -1846,7 +1845,7 @@ SwTwips SwFlyFrame::Grow_( SwTwips nDist, bool bTst ) const SwRect aNew( GetObjRectWithSpaces() ); if ( aOld != aNew ) ::Notify( this, FindPageFrame(), aOld ); - return (aNew.*aRectFnSet->fnGetHeight)()-(aOld.*aRectFnSet->fnGetHeight)(); + return aRectFnSet.GetHeight(aNew)-aRectFnSet.GetHeight(aOld); } return nDist; } @@ -1858,7 +1857,7 @@ SwTwips SwFlyFrame::Shrink_( SwTwips nDist, bool bTst ) if( Lower() && !IsColLocked() && !HasFixSize() ) { SwRectFnSet aRectFnSet(this); - SwTwips nHeight = (Frame().*aRectFnSet->fnGetHeight)(); + SwTwips nHeight = aRectFnSet.GetHeight(Frame()); if ( nDist > nHeight ) nDist = nHeight; @@ -1866,7 +1865,7 @@ SwTwips SwFlyFrame::Shrink_( SwTwips nDist, bool bTst ) if ( IsMinHeight() ) { const SwFormatFrameSize& rFormatSize = GetFormat()->GetFrameSize(); - SwTwips nFormatHeight = aRectFnSet.bVert ? rFormatSize.GetWidth() : rFormatSize.GetHeight(); + SwTwips nFormatHeight = aRectFnSet.IsVert() ? rFormatSize.GetWidth() : rFormatSize.GetHeight(); nVal = std::min( nDist, nHeight - nFormatHeight ); } @@ -1880,14 +1879,14 @@ SwTwips SwFlyFrame::Shrink_( SwTwips nDist, bool bTst ) if ( !bTst ) { SwRect aOld( GetObjRectWithSpaces() ); - (Frame().*aRectFnSet->fnSetHeight)( nHeight - nVal ); + aRectFnSet.SetHeight( Frame(), nHeight - nVal ); // #i68520# if ( nHeight - nVal != 0 ) { InvalidateObjRectWithSpaces(); } - nHeight = (Prt().*aRectFnSet->fnGetHeight)(); - (Prt().*aRectFnSet->fnSetHeight)( nHeight - nVal ); + nHeight = aRectFnSet.GetHeight(Prt()); + aRectFnSet.SetHeight( Prt(), nHeight - nVal ); InvalidatePos_(); InvalidateSize(); ::Notify( this, FindPageFrame(), aOld ); @@ -1945,8 +1944,8 @@ SwTwips SwFlyFrame::Shrink_( SwTwips nDist, bool bTst ) if ( GetAnchorFrame()->IsInFly() ) AnchorFrame()->FindFlyFrame()->Shrink( nDist, bTst ); } - return (aOld.*aRectFnSet->fnGetHeight)() - - (aNew.*aRectFnSet->fnGetHeight)(); + return aRectFnSet.GetHeight(aOld) - + aRectFnSet.GetHeight(aNew); } return nVal; } @@ -2654,18 +2653,18 @@ SwTwips SwFlyFrame::CalcContentHeight(const SwBorderAttrs *pAttrs, const SwTwips if ( Lower()->IsColumnFrame() ) { FormatWidthCols( *pAttrs, nUL, nMinHeight ); - nHeight = (Lower()->Frame().*aRectFnSet->fnGetHeight)(); + nHeight = aRectFnSet.GetHeight(Lower()->Frame()); } else { SwFrame *pFrame = Lower(); while ( pFrame ) { - nHeight += (pFrame->Frame().*aRectFnSet->fnGetHeight)(); + nHeight += aRectFnSet.GetHeight(pFrame->Frame()); if( pFrame->IsTextFrame() && static_cast<SwTextFrame*>(pFrame)->IsUndersized() ) // This TextFrame would like to be a bit larger nHeight += static_cast<SwTextFrame*>(pFrame)->GetParHeight() - - (pFrame->Prt().*aRectFnSet->fnGetHeight)(); + - aRectFnSet.GetHeight(pFrame->Prt()); else if( pFrame->IsSctFrame() && static_cast<SwSectionFrame*>(pFrame)->IsUndersized() ) nHeight += static_cast<SwSectionFrame*>(pFrame)->Undersize(); pFrame = pFrame->GetNext(); @@ -2674,9 +2673,9 @@ SwTwips SwFlyFrame::CalcContentHeight(const SwBorderAttrs *pAttrs, const SwTwips if ( GetDrawObjs() ) { const size_t nCnt = GetDrawObjs()->size(); - SwTwips nTop = (Frame().*aRectFnSet->fnGetTop)(); - SwTwips nBorder = (Frame().*aRectFnSet->fnGetHeight)() - - (Prt().*aRectFnSet->fnGetHeight)(); + SwTwips nTop = aRectFnSet.GetTop(Frame()); + SwTwips nBorder = aRectFnSet.GetHeight(Frame()) - + aRectFnSet.GetHeight(Prt()); for ( size_t i = 0; i < nCnt; ++i ) { SwAnchoredObject* pAnchoredObj = (*GetDrawObjs())[i]; @@ -2689,8 +2688,7 @@ SwTwips SwFlyFrame::CalcContentHeight(const SwBorderAttrs *pAttrs, const SwTwips pFly->Frame().Top() != FAR_AWAY && pFly->GetFormat()->GetFollowTextFlow().GetValue() ) { - SwTwips nDist = -(pFly->Frame().*aRectFnSet-> - fnBottomDist)( nTop ); + SwTwips nDist = -aRectFnSet.BottomDist( pFly->Frame(), nTop ); if( nDist > nBorder + nHeight ) nHeight = nDist - nBorder; } diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx index 9e70c763f455..98c553facf31 100644 --- a/sw/source/core/layout/flycnt.cxx +++ b/sw/source/core/layout/flycnt.cxx @@ -385,10 +385,10 @@ void SwFlyAtContentFrame::MakeAll(vcl::RenderContext* pRenderContext) bool bConsiderWrapInfluenceDueToMovedFwdAnchor( false ); do { SwRectFnSet aRectFnSet(this); - Point aOldPos( (Frame().*aRectFnSet->fnGetPos)() ); + Point aOldPos( aRectFnSet.GetPos(Frame()) ); SwFlyFreeFrame::MakeAll(pRenderContext); const bool bPosChgDueToOwnFormat = - aOldPos != (Frame().*aRectFnSet->fnGetPos)(); + aOldPos != aRectFnSet.GetPos(Frame()); // #i3317# if ( !ConsiderObjWrapInfluenceOnObjPos() && OverlapsPrevColumn() ) @@ -446,7 +446,7 @@ void SwFlyAtContentFrame::MakeAll(vcl::RenderContext* pRenderContext) } } - if ( aOldPos != (Frame().*aRectFnSet->fnGetPos)() || + if ( aOldPos != aRectFnSet.GetPos(Frame()) || ( !GetValidPosFlag() && ( pFooter || bPosChgDueToOwnFormat ) ) ) { @@ -507,8 +507,8 @@ void SwFlyAtContentFrame::MakeAll(vcl::RenderContext* pRenderContext) if ( pCellFrame ) { SwRectFnSet aRectFnSet(pCellFrame); - if ( (pCellFrame->Frame().*aRectFnSet->fnGetTop)() == 0 && - (pCellFrame->Frame().*aRectFnSet->fnGetHeight)() == 0 ) + if ( aRectFnSet.GetTop(pCellFrame->Frame()) == 0 && + aRectFnSet.GetHeight(pCellFrame->Frame()) == 0 ) { bConsiderWrapInfluenceDueToMovedFwdAnchor = false; } diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx index 44dfb9b69763..a18562d2c28c 100644 --- a/sw/source/core/layout/flyincnt.cxx +++ b/sw/source/core/layout/flyincnt.cxx @@ -73,7 +73,7 @@ void SwFlyInContentFrame::SetRefPoint( const Point& rPoint, aRef = rPoint; SetCurrRelPos( rRelAttr ); SwRectFnSet aRectFnSet(GetAnchorFrame()); - (Frame().*aRectFnSet->fnSetPos)( rPoint + rRelPos ); + aRectFnSet.SetPos( Frame(), rPoint + rRelPos ); // #i68520# InvalidateObjRectWithSpaces(); if( pNotify ) diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx index 85fc5b92e92c..4a462ada6a14 100644 --- a/sw/source/core/layout/flylay.cxx +++ b/sw/source/core/layout/flylay.cxx @@ -176,7 +176,7 @@ void SwFlyFreeFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) if ( !mbValidPos ) { - const Point aOldPos( (Frame().*aRectFnSet->fnGetPos)() ); + const Point aOldPos( aRectFnSet.GetPos(Frame()) ); // #i26791# - use new method <MakeObjPos()> // #i34753# - no positioning, if requested. if ( IsNoMakePos() ) @@ -184,7 +184,7 @@ void SwFlyFreeFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) else // #i26791# - use new method <MakeObjPos()> MakeObjPos(); - if( aOldPos == (Frame().*aRectFnSet->fnGetPos)() ) + if( aOldPos == aRectFnSet.GetPos(Frame()) ) { if( !mbValidPos && GetAnchorFrame()->IsInSct() && !GetAnchorFrame()->FindSctFrame()->IsValid() ) @@ -217,8 +217,8 @@ void SwFlyFreeFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) #if OSL_DEBUG_LEVEL > 0 SwRectFnSet aRectFnSet(this); - OSL_ENSURE( m_bHeightClipped || ( (Frame().*aRectFnSet->fnGetHeight)() > 0 && - (Prt().*aRectFnSet->fnGetHeight)() > 0), + OSL_ENSURE( m_bHeightClipped || ( aRectFnSet.GetHeight(Frame()) > 0 && + aRectFnSet.GetHeight(Prt()) > 0), "SwFlyFreeFrame::Format(), flipping Fly." ); #endif @@ -934,16 +934,16 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) if( rV.GetVertOrient() != text::VertOrientation::NONE && rV.GetRelationOrient() == text::RelOrientation::PRINT_AREA ) { - (rRect.*aRectFnSet->fnSetTop)( (pClip->*aRectFnSet->fnGetPrtTop)() ); - (rRect.*aRectFnSet->fnSetBottom)( (pClip->*aRectFnSet->fnGetPrtBottom)() ); + aRectFnSet.SetTop( rRect, aRectFnSet.GetPrtTop(*pClip) ); + aRectFnSet.SetBottom( rRect, aRectFnSet.GetPrtBottom(*pClip) ); } // horizontal clipping: Top and Bottom, also to PrtArea if necessary const SwFormatHoriOrient &rH = pFly->GetFormat()->GetHoriOrient(); if( rH.GetHoriOrient() != text::HoriOrientation::NONE && rH.GetRelationOrient() == text::RelOrientation::PRINT_AREA ) { - (rRect.*aRectFnSet->fnSetLeft)( (pClip->*aRectFnSet->fnGetPrtLeft)() ); - (rRect.*aRectFnSet->fnSetRight)((pClip->*aRectFnSet->fnGetPrtRight)()); + aRectFnSet.SetLeft( rRect, aRectFnSet.GetPrtLeft(*pClip) ); + aRectFnSet.SetRight(rRect, aRectFnSet.GetPrtRight(*pClip)); } } else if( pFly->IsFlyAtContentFrame() ) @@ -1019,8 +1019,8 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) const SwLayoutFrame* pHoriClipFrame = pFly->GetAnchorFrame()->FindPageFrame()->GetUpper(); SwRectFnSet aRectFnSet(pFly->GetAnchorFrame()); - (rRect.*aRectFnSet->fnSetLeft)( (pHoriClipFrame->Frame().*aRectFnSet->fnGetLeft)() ); - (rRect.*aRectFnSet->fnSetRight)((pHoriClipFrame->Frame().*aRectFnSet->fnGetRight)()); + aRectFnSet.SetLeft( rRect, aRectFnSet.GetLeft(pHoriClipFrame->Frame()) ); + aRectFnSet.SetRight(rRect, aRectFnSet.GetRight(pHoriClipFrame->Frame())); } else { @@ -1061,8 +1061,8 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) if (pUp) { rRect = pUp->GetUpper()->Frame(); - (rRect.*aRectFnSet->fnSetTop)( (pUp->*aRectFnSet->fnGetPrtTop)() ); - (rRect.*aRectFnSet->fnSetBottom)((pUp->*aRectFnSet->fnGetPrtBottom)()); + aRectFnSet.SetTop( rRect, aRectFnSet.GetPrtTop(*pUp) ); + aRectFnSet.SetBottom(rRect, aRectFnSet.GetPrtBottom(*pUp)); } } else @@ -1103,8 +1103,7 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) else if ( pUp->IsCellFrame() ) //MA_FLY_HEIGHT { const SwFrame *pTab = pUp->FindTabFrame(); - (rRect.*aRectFnSet->fnSetBottom)( - (pTab->GetUpper()->*aRectFnSet->fnGetPrtBottom)() ); + aRectFnSet.SetBottom( rRect, aRectFnSet.GetPrtBottom(*pTab->GetUpper()) ); // expand to left and right cell border rRect.Left ( pUp->Frame().Left() ); rRect.Width( pUp->Frame().Width() ); @@ -1135,39 +1134,38 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) if ( pUp->IsCellFrame() ) { const SwFrame *pTab = pUp->FindTabFrame(); - (rRect.*aRectFnSet->fnSetBottom)( - (pTab->GetUpper()->*aRectFnSet->fnGetPrtBottom)() ); + aRectFnSet.SetBottom( rRect, aRectFnSet.GetPrtBottom(*pTab->GetUpper()) ); } } else if ( pUp->GetUpper()->IsPageFrame() ) { // Objects anchored as character may exceed right margin // of body frame: - (rRect.*aRectFnSet->fnSetRight)( (pUp->GetUpper()->Frame().*aRectFnSet->fnGetRight)() ); + aRectFnSet.SetRight( rRect, aRectFnSet.GetRight(pUp->GetUpper()->Frame()) ); } - long nHeight = (9*(rRect.*aRectFnSet->fnGetHeight)())/10; + long nHeight = (9*aRectFnSet.GetHeight(rRect))/10; long nTop; const SwFormat *pFormat = GetUserCall(pSdrObj)->GetFormat(); const SvxULSpaceItem &rUL = pFormat->GetULSpace(); if( bMove ) { - nTop = aRectFnSet.bVert ? static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().X() : + nTop = aRectFnSet.IsVert() ? static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().X() : static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().Y(); - nTop = (*aRectFnSet->fnYInc)( nTop, -nHeight ); - long nWidth = (pFly->Frame().*aRectFnSet->fnGetWidth)(); - (rRect.*aRectFnSet->fnSetLeftAndWidth)( aRectFnSet.bVert ? + nTop = aRectFnSet.YInc( nTop, -nHeight ); + long nWidth = aRectFnSet.GetWidth(pFly->Frame()); + aRectFnSet.SetLeftAndWidth( rRect, aRectFnSet.IsVert() ? static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().Y() : static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().X(), nWidth ); nHeight = 2*nHeight - rUL.GetLower() - rUL.GetUpper(); } else { - nTop = (*aRectFnSet->fnYInc)( (pFly->Frame().*aRectFnSet->fnGetBottom)(), + nTop = aRectFnSet.YInc( aRectFnSet.GetBottom(pFly->Frame()), rUL.GetLower() - nHeight ); - nHeight = 2*nHeight - (pFly->Frame().*aRectFnSet->fnGetHeight)() + nHeight = 2*nHeight - aRectFnSet.GetHeight(pFly->Frame()) - rUL.GetLower() - rUL.GetUpper(); } - (rRect.*aRectFnSet->fnSetTopAndHeight)( nTop, nHeight ); + aRectFnSet.SetTopAndHeight( rRect, nTop, nHeight ); } } else @@ -1188,17 +1186,17 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) rRect = pUp->Prt(); rRect += pUp->Frame().Pos(); SwRectFnSet aRectFnSet(pAnchorFrame); - long nHeight = (9*(rRect.*aRectFnSet->fnGetHeight)())/10; + long nHeight = (9*aRectFnSet.GetHeight(rRect))/10; long nTop; const SvxULSpaceItem &rUL = pFormat->GetULSpace(); SwRect aSnapRect( pSdrObj->GetSnapRect() ); long nTmpH = 0; if( bMove ) { - nTop = (*aRectFnSet->fnYInc)( aRectFnSet.bVert ? pSdrObj->GetAnchorPos().X() : + nTop = aRectFnSet.YInc( aRectFnSet.IsVert() ? pSdrObj->GetAnchorPos().X() : pSdrObj->GetAnchorPos().Y(), -nHeight ); - long nWidth = (aSnapRect.*aRectFnSet->fnGetWidth)(); - (rRect.*aRectFnSet->fnSetLeftAndWidth)( aRectFnSet.bVert ? + long nWidth = aRectFnSet.GetWidth(aSnapRect); + aRectFnSet.SetLeftAndWidth( rRect, aRectFnSet.IsVert() ? pSdrObj->GetAnchorPos().Y() : pSdrObj->GetAnchorPos().X(), nWidth ); } @@ -1206,13 +1204,13 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) { // #i26791# - value of <nTmpH> is needed to // calculate value of <nTop>. - nTmpH = aRectFnSet.bVert ? pSdrObj->GetCurrentBoundRect().GetWidth() : + nTmpH = aRectFnSet.IsVert() ? pSdrObj->GetCurrentBoundRect().GetWidth() : pSdrObj->GetCurrentBoundRect().GetHeight(); - nTop = (*aRectFnSet->fnYInc)( (aSnapRect.*aRectFnSet->fnGetTop)(), + nTop = aRectFnSet.YInc( aRectFnSet.GetTop(aSnapRect), rUL.GetLower() + nTmpH - nHeight ); } nHeight = 2*nHeight - nTmpH - rUL.GetLower() - rUL.GetUpper(); - (rRect.*aRectFnSet->fnSetTopAndHeight)( nTop, nHeight ); + aRectFnSet.SetTopAndHeight( rRect, nTop, nHeight ); } else { diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index ae891013136b..1cf252f3fffc 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -105,9 +105,9 @@ SwFrameNotify::~SwFrameNotify() SwRectFnSet aRectFnSet(mpFrame); const bool bAbsP = aRectFnSet.PosDiff(maFrame, mpFrame->Frame()); const bool bChgWidth = - (maFrame.*aRectFnSet->fnGetWidth)() != (mpFrame->Frame().*aRectFnSet->fnGetWidth)(); + aRectFnSet.GetWidth(maFrame) != aRectFnSet.GetWidth(mpFrame->Frame()); const bool bChgHeight = - (maFrame.*aRectFnSet->fnGetHeight)()!=(mpFrame->Frame().*aRectFnSet->fnGetHeight)(); + aRectFnSet.GetHeight(maFrame)!=aRectFnSet.GetHeight(mpFrame->Frame()); const bool bChgFlyBasePos = mpFrame->IsTextFrame() && ( ( mnFlyAnchorOfst != static_cast<SwTextFrame*>(mpFrame)->GetBaseOfstForFly( true ) ) || ( mnFlyAnchorOfstNoWrap != static_cast<SwTextFrame*>(mpFrame)->GetBaseOfstForFly( false ) ) ); @@ -147,8 +147,8 @@ SwFrameNotify::~SwFrameNotify() } else if ( !pFlow->HasFollow() ) { - long nOldHeight = (maFrame.*aRectFnSet->fnGetHeight)(); - long nNewHeight = (mpFrame->Frame().*aRectFnSet->fnGetHeight)(); + long nOldHeight = aRectFnSet.GetHeight(maFrame); + long nNewHeight = aRectFnSet.GetHeight(mpFrame->Frame()); if( (nOldHeight > nNewHeight) || (!nOldHeight && nNewHeight) ) pFlow->CheckKeep(); } @@ -174,7 +174,7 @@ SwFrameNotify::~SwFrameNotify() // #104100# - correct condition for setting retouche // flag for vertical layout. if( mpFrame->IsRetoucheFrame() && - (maFrame.*aRectFnSet->fnTopDist)( (mpFrame->Frame().*aRectFnSet->fnGetTop)() ) > 0 ) + aRectFnSet.TopDist( maFrame, aRectFnSet.GetTop(mpFrame->Frame()) ) > 0 ) { mpFrame->SetRetouche(); } @@ -191,9 +191,9 @@ SwFrameNotify::~SwFrameNotify() //For each resize of the background graphics is a repaint necessary. const bool bPrtWidth = - (maPrt.*aRectFnSet->fnGetWidth)() != (mpFrame->Prt().*aRectFnSet->fnGetWidth)(); + aRectFnSet.GetWidth(maPrt) != aRectFnSet.GetWidth(mpFrame->Prt()); const bool bPrtHeight = - (maPrt.*aRectFnSet->fnGetHeight)()!=(mpFrame->Prt().*aRectFnSet->fnGetHeight)(); + aRectFnSet.GetHeight(maPrt)!=aRectFnSet.GetHeight(mpFrame->Prt()); if ( bPrtWidth || bPrtHeight ) { //UUUU @@ -456,11 +456,11 @@ SwLayNotify::~SwLayNotify() if ( pLay->IsRowFrame() ) { bInvaPercent = true; - long nNew = (pLay->Prt().*aRectFnSet->fnGetHeight)(); - if( nNew != (maPrt.*aRectFnSet->fnGetHeight)() ) + long nNew = aRectFnSet.GetHeight(pLay->Prt()); + if( nNew != aRectFnSet.GetHeight(maPrt) ) static_cast<SwRowFrame*>(pLay)->AdjustCells( nNew, true); - if( (pLay->Prt().*aRectFnSet->fnGetWidth)() - != (maPrt.*aRectFnSet->fnGetWidth)() ) + if( aRectFnSet.GetWidth(pLay->Prt()) + != aRectFnSet.GetWidth(maPrt) ) static_cast<SwRowFrame*>(pLay)->AdjustCells( 0, false ); } else @@ -478,8 +478,8 @@ SwLayNotify::~SwLayNotify() if ( pLay->Lower() ) { bLow = !pLay->Lower()->IsColumnFrame() || - (pLay->Lower()->Frame().*aRectFnSet->fnGetHeight)() - != (pLay->Prt().*aRectFnSet->fnGetHeight)(); + aRectFnSet.GetHeight(pLay->Lower()->Frame()) + != aRectFnSet.GetHeight(pLay->Prt()); } else bLow = false; @@ -808,7 +808,7 @@ SwContentNotify::~SwContentNotify() } } - const bool bFirst = (maFrame.*aRectFnSet->fnGetWidth)() == 0; + const bool bFirst = aRectFnSet.GetWidth(maFrame) == 0; if ( pCnt->IsNoTextFrame() ) { @@ -1178,10 +1178,10 @@ static void lcl_SetPos( SwFrame& _rNewFrame, const SwLayoutFrame& _rLayFrame ) { SwRectFnSet aRectFnSet(&_rLayFrame); - (_rNewFrame.Frame().*aRectFnSet->fnSetPos)( (_rLayFrame.Frame().*aRectFnSet->fnGetPos)() ); + aRectFnSet.SetPos( _rNewFrame.Frame(), aRectFnSet.GetPos(_rLayFrame.Frame()) ); // move position by one SwTwip in text flow direction in order to get // notifications for a new calculated position after its formatting. - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) _rNewFrame.Frame().Pos().X() -= 1; else _rNewFrame.Frame().Pos().Y() += 1; @@ -2568,7 +2568,7 @@ void RestoreContent( SwFrame *pSav, SwLayoutFrame *pParent, SwFrame *pSibling ) SwFrame* pLast; do { pSav->mpUpper = pParent; - nGrowVal += (pSav->Frame().*aRectFnSet->fnGetHeight)(); + nGrowVal += aRectFnSet.GetHeight(pSav->Frame()); pSav->InvalidateAll_(); // register Flys, if TextFrames than also invalidate appropriately diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 44eab116b817..bd5fef550b30 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -162,7 +162,7 @@ static long lcl_Undersize( const SwFrame* pFrame ) { // Does this TextFrame would like to be a little bit bigger? nRet = static_cast<const SwTextFrame*>(pFrame)->GetParHeight() - - (pFrame->Prt().*aRectFnSet->fnGetHeight)(); + aRectFnSet.GetHeight(pFrame->Prt()); if( nRet < 0 ) nRet = 0; } @@ -191,10 +191,10 @@ void SwFootnoteContFrame::Format( vcl::RenderContext* /*pRenderContext*/, const if ( !mbValidPrtArea ) { mbValidPrtArea = true; - (Prt().*aRectFnSet->fnSetTop)( nBorder ); - (Prt().*aRectFnSet->fnSetWidth)( (Frame().*aRectFnSet->fnGetWidth)() ); - (Prt().*aRectFnSet->fnSetHeight)((Frame().*aRectFnSet->fnGetHeight)() - nBorder ); - if( (Prt().*aRectFnSet->fnGetHeight)() < 0 && !pPage->IsFootnotePage() ) + aRectFnSet.SetTop( Prt(), nBorder ); + aRectFnSet.SetWidth( Prt(), aRectFnSet.GetWidth(Frame()) ); + aRectFnSet.SetHeight(Prt(), aRectFnSet.GetHeight(Frame()) - nBorder ); + if( aRectFnSet.GetHeight(Prt()) < 0 && !pPage->IsFootnotePage() ) mbValidSize = false; } @@ -219,7 +219,7 @@ void SwFootnoteContFrame::Format( vcl::RenderContext* /*pRenderContext*/, const // would like to be bigger. They are created especially in // columnized borders, if these do not have their maximum // size yet. - nRemaining += (pFrame->Frame().*aRectFnSet->fnGetHeight)() + lcl_Undersize( pFrame ); + nRemaining += aRectFnSet.GetHeight(pFrame->Frame()) + lcl_Undersize( pFrame ); pFrame = pFrame->GetNext(); } // add the own border @@ -228,17 +228,16 @@ void SwFootnoteContFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwTwips nDiff; if( IsInSct() ) { - nDiff = -(Frame().*aRectFnSet->fnBottomDist)( - (GetUpper()->*aRectFnSet->fnGetPrtBottom)() ); + nDiff = -aRectFnSet.BottomDist( Frame(), aRectFnSet.GetPrtBottom(*GetUpper()) ); if( nDiff > 0 ) { - if( nDiff > (Frame().*aRectFnSet->fnGetHeight)() ) - nDiff = (Frame().*aRectFnSet->fnGetHeight)(); - (Frame().*aRectFnSet->fnAddBottom)( -nDiff ); - (Prt().*aRectFnSet->fnAddHeight)( -nDiff ); + if( nDiff > aRectFnSet.GetHeight(Frame()) ) + nDiff = aRectFnSet.GetHeight(Frame()); + aRectFnSet.AddBottom( Frame(), -nDiff ); + aRectFnSet.AddHeight( Prt(), -nDiff ); } } - nDiff = (Frame().*aRectFnSet->fnGetHeight)() - nRemaining; + nDiff = aRectFnSet.GetHeight(Frame()) - nRemaining; if ( nDiff > 0 ) Shrink( nDiff ); else if ( nDiff < 0 ) @@ -247,12 +246,12 @@ void SwFootnoteContFrame::Format( vcl::RenderContext* /*pRenderContext*/, const // It may happen that there is less space available, // than what the border needs - the size of the PrtArea // will then be negative. - SwTwips nPrtHeight = (Prt().*aRectFnSet->fnGetHeight)(); + SwTwips nPrtHeight = aRectFnSet.GetHeight(Prt()); if( nPrtHeight < 0 ) { - const SwTwips nTmpDiff = std::max( (Prt().*aRectFnSet->fnGetTop)(), + const SwTwips nTmpDiff = std::max( aRectFnSet.GetTop(Prt()), -nPrtHeight ); - (Prt().*aRectFnSet->fnSubTop)( nTmpDiff ); + aRectFnSet.SubTop( Prt(), nTmpDiff ); } } } @@ -268,9 +267,9 @@ SwTwips SwFootnoteContFrame::GrowFrame( SwTwips nDist, bool bTst, bool ) assert(GetUpper() && GetUpper()->IsFootnoteBossFrame()); SwRectFnSet aRectFnSet(this); - if( (Frame().*aRectFnSet->fnGetHeight)() > 0 && - nDist > ( LONG_MAX - (Frame().*aRectFnSet->fnGetHeight)() ) ) - nDist = LONG_MAX - (Frame().*aRectFnSet->fnGetHeight)(); + if( aRectFnSet.GetHeight(Frame()) > 0 && + nDist > ( LONG_MAX - aRectFnSet.GetHeight(Frame()) ) ) + nDist = LONG_MAX - aRectFnSet.GetHeight(Frame()); SwFootnoteBossFrame *pBoss = static_cast<SwFootnoteBossFrame*>(GetUpper()); if( IsInSct() ) @@ -294,7 +293,7 @@ SwTwips SwFootnoteContFrame::GrowFrame( SwTwips nDist, bool bTst, bool ) if ( pBoss->GetMaxFootnoteHeight() != LONG_MAX ) { nDist = std::min( nDist, pBoss->GetMaxFootnoteHeight() - - (Frame().*aRectFnSet->fnGetHeight)() ); + - aRectFnSet.GetHeight(Frame()) ); if ( nDist <= 0 ) return 0L; } @@ -308,9 +307,9 @@ SwTwips SwFootnoteContFrame::GrowFrame( SwTwips nDist, bool bTst, bool ) return 0L; } } - else if( nDist > (GetPrev()->Frame().*aRectFnSet->fnGetHeight)() ) + else if( nDist > aRectFnSet.GetHeight(GetPrev()->Frame()) ) // do not use more space than the body has - nDist = (GetPrev()->Frame().*aRectFnSet->fnGetHeight)(); + nDist = aRectFnSet.GetHeight(GetPrev()->Frame()); long nAvail = 0; if ( bBrowseMode ) @@ -327,7 +326,7 @@ SwTwips SwFootnoteContFrame::GrowFrame( SwTwips nDist, bool bTst, bool ) if ( !bTst ) { - (Frame().*aRectFnSet->fnSetHeight)( (Frame().*aRectFnSet->fnGetHeight)() + nDist ); + aRectFnSet.SetHeight( Frame(), aRectFnSet.GetHeight(Frame()) + nDist ); if( IsVertical() && !IsVertLR() && !IsReverse() ) Frame().Pos().X() -= nDist; @@ -548,15 +547,15 @@ void SwFootnoteFrame::Paste( SwFrame* pParent, SwFrame* pSibling ) InsertBefore( static_cast<SwLayoutFrame*>(pParent), pSibling ); SwRectFnSet aRectFnSet(this); - if( (Frame().*aRectFnSet->fnGetWidth)()!=(pParent->Prt().*aRectFnSet->fnGetWidth)() ) + if( aRectFnSet.GetWidth(Frame())!=aRectFnSet.GetWidth(pParent->Prt()) ) InvalidateSize_(); InvalidatePos_(); SwPageFrame *pPage = FindPageFrame(); InvalidatePage( pPage ); if ( GetNext() ) GetNext()->InvalidatePos_(); - if( (Frame().*aRectFnSet->fnGetHeight)() ) - pParent->Grow( (Frame().*aRectFnSet->fnGetHeight)() ); + if( aRectFnSet.GetHeight(Frame()) ) + pParent->Grow( aRectFnSet.GetHeight(Frame()) ); // If the predecessor is the master and/or the successor is the Follow, // then take their content and destroy them. @@ -1929,19 +1928,19 @@ void SwFootnoteBossFrame::MoveFootnotes_( SwFootnoteFrames &rFootnoteArr, bool b while( pTmp && static_cast<SwLayoutFrame*>(pCnt)->IsAnLower( pTmp ) ) { pTmp->Prepare( PREP_MOVEFTN ); - (pTmp->Frame().*aRectFnSet->fnSetHeight)(0); - (pTmp->Prt().*aRectFnSet->fnSetHeight)(0); + aRectFnSet.SetHeight(pTmp->Frame(), 0); + aRectFnSet.SetHeight(pTmp->Prt(), 0); pTmp = pTmp->FindNext(); } } else pCnt->Prepare( PREP_MOVEFTN ); - (pCnt->Frame().*aRectFnSet->fnSetHeight)(0); - (pCnt->Prt().*aRectFnSet->fnSetHeight)(0); + aRectFnSet.SetHeight(pCnt->Frame(), 0); + aRectFnSet.SetHeight(pCnt->Prt(), 0); pCnt = pCnt->GetNext(); } - (pFootnote->Frame().*aRectFnSet->fnSetHeight)(0); - (pFootnote->Prt().*aRectFnSet->fnSetHeight)(0); + aRectFnSet.SetHeight(pFootnote->Frame(), 0); + aRectFnSet.SetHeight(pFootnote->Prt(), 0); pFootnote->Calc(getRootFrame()->GetCurrShell()->GetOut()); pFootnote->GetUpper()->Calc(getRootFrame()->GetCurrShell()->GetOut()); @@ -2203,8 +2202,8 @@ void SwFootnoteBossFrame::RearrangeFootnotes( const SwTwips nDeadLine, const boo // footnote frames. { SwRectFnSet aRectFnSet(this); - SwFrame* aFootnoteContFrame = pFootnoteFrame->GetUpper(); - if ( (pFootnoteFrame->Frame().*aRectFnSet->fnTopDist)((aFootnoteContFrame->*aRectFnSet->fnGetPrtBottom)()) > 0 ) + SwFrame* pFootnoteContFrame = pFootnoteFrame->GetUpper(); + if ( aRectFnSet.TopDist(pFootnoteFrame->Frame(), aRectFnSet.GetPrtBottom(*pFootnoteContFrame)) > 0 ) { pFootnoteFrame->InvalidatePos_(); } @@ -2395,10 +2394,10 @@ void SwFootnoteBossFrame::SetFootnoteDeadLine( const SwTwips nDeadLine ) if ( pCont ) { pCont->Calc(getRootFrame()->GetCurrShell()->GetOut()); - nMaxFootnoteHeight = -(pCont->Frame().*aRectFnSet->fnBottomDist)( nDeadLine ); + nMaxFootnoteHeight = -aRectFnSet.BottomDist( pCont->Frame(), nDeadLine ); } else - nMaxFootnoteHeight = -(pBody->Frame().*aRectFnSet->fnBottomDist)( nDeadLine ); + nMaxFootnoteHeight = -aRectFnSet.BottomDist( pBody->Frame(), nDeadLine ); const SwViewShell *pSh = getRootFrame() ? getRootFrame()->GetCurrShell() : nullptr; if( pSh && pSh->GetViewOptions()->getBrowseMode() ) @@ -2428,8 +2427,8 @@ SwTwips SwFootnoteBossFrame::GetVarSpace() const if( IsInSct() ) { nRet = 0; - SwTwips nTmp = (*aRectFnSet->fnYDiff)( (pBody->*aRectFnSet->fnGetPrtTop)(), - (Frame().*aRectFnSet->fnGetTop)() ); + SwTwips nTmp = aRectFnSet.YDiff( aRectFnSet.GetPrtTop(*pBody), + aRectFnSet.GetTop(Frame()) ); const SwSectionFrame* pSect = FindSctFrame(); // Endnotes in a ftncontainer causes a deadline: // the bottom of the last contentfrm @@ -2451,9 +2450,9 @@ SwTwips SwFootnoteBossFrame::GetVarSpace() const { while( pFrame->GetNext() ) pFrame = pFrame->GetNext(); // last cntntfrm - nTmp += (*aRectFnSet->fnYDiff)( - (Frame().*aRectFnSet->fnGetTop)(), - (pFrame->Frame().*aRectFnSet->fnGetBottom)() ); + nTmp += aRectFnSet.YDiff( + aRectFnSet.GetTop(Frame()), + aRectFnSet.GetBottom(pFrame->Frame()) ); } break; } @@ -2465,8 +2464,8 @@ SwTwips SwFootnoteBossFrame::GetVarSpace() const nRet = nTmp; } else - nRet = - (pPg->Prt().*aRectFnSet->fnGetHeight)()/5; - nRet += (pBody->Frame().*aRectFnSet->fnGetHeight)(); + nRet = - aRectFnSet.GetHeight(pPg->Prt())/5; + nRet += aRectFnSet.GetHeight(pBody->Frame()); if( nRet < 0 ) nRet = 0; } diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 152410bed34f..a4ef2ab39904 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -223,16 +223,16 @@ void SwLayAction::PaintContent( const SwContentFrame *pCnt, { // paint the area between printing bottom and frame bottom and // the area left and right beside the frame, if its height changed. - long nOldHeight = (rOldRect.*aRectFnSet->fnGetHeight)(); - long nNewHeight = (pCnt->Frame().*aRectFnSet->fnGetHeight)(); + long nOldHeight = aRectFnSet.GetHeight(rOldRect); + long nNewHeight = aRectFnSet.GetHeight(pCnt->Frame()); const bool bHeightDiff = nOldHeight != nNewHeight; if( bHeightDiff ) { // consider whole potential paint area. SwRect aDrawRect( pCnt->PaintArea() ); if( nOldHeight > nNewHeight ) - nOldBottom = (pCnt->*aRectFnSet->fnGetPrtBottom)(); - (aDrawRect.*aRectFnSet->fnSetTop)( nOldBottom ); + nOldBottom = aRectFnSet.GetPrtBottom(*pCnt); + aRectFnSet.SetTop( aDrawRect, nOldBottom ); PaintContent_( pCnt, pPage, aDrawRect ); } // paint content area @@ -250,7 +250,7 @@ void SwLayAction::PaintContent( const SwContentFrame *pCnt, pTmp = pSct; } SwRect aRect( pTmp->GetUpper()->PaintArea() ); - (aRect.*aRectFnSet->fnSetTop)( (pTmp->*aRectFnSet->fnGetPrtBottom)() ); + aRectFnSet.SetTop( aRect, aRectFnSet.GetPrtBottom(*pTmp) ); if ( !PaintContent_( pCnt, pPage, aRect ) ) pCnt->ResetRetouche(); } @@ -1349,7 +1349,7 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame *pLa // vertical layout support SwRectFnSet aRectFnSet(pLay); SwRect aRect( pLay->GetUpper()->PaintArea() ); - (aRect.*aRectFnSet->fnSetTop)( (pLay->*aRectFnSet->fnGetPrtBottom)() ); + aRectFnSet.SetTop( aRect, aRectFnSet.GetPrtBottom(*pLay) ); if ( !m_pImp->GetShell()->AddPaintRect( aRect ) ) pLay->ResetRetouche(); } @@ -1495,40 +1495,40 @@ bool SwLayAction::FormatLayoutTab( SwTabFrame *pTab, bool bAddRect ) pTab->IsComplete() && ( pTab->Frame().SSize() != pTab->Prt().SSize() || // vertical layout support - (pTab->*aRectFnSet->fnGetLeftMargin)() ) && + aRectFnSet.GetLeftMargin(*pTab) ) && pTab->Frame().HasArea() ) { // re-implement calculation of margin rectangles. SwRect aMarginRect; - SwTwips nLeftMargin = (pTab->*aRectFnSet->fnGetLeftMargin)(); + SwTwips nLeftMargin = aRectFnSet.GetLeftMargin(*pTab); if ( nLeftMargin > 0) { aMarginRect = pTab->Frame(); - (aMarginRect.*aRectFnSet->fnSetWidth)( nLeftMargin ); + aRectFnSet.SetWidth( aMarginRect, nLeftMargin ); m_pImp->GetShell()->AddPaintRect( aMarginRect ); } - if ( (pTab->*aRectFnSet->fnGetRightMargin)() > 0) + if ( aRectFnSet.GetRightMargin(*pTab) > 0) { aMarginRect = pTab->Frame(); - (aMarginRect.*aRectFnSet->fnSetLeft)( (pTab->*aRectFnSet->fnGetPrtRight)() ); + aRectFnSet.SetLeft( aMarginRect, aRectFnSet.GetPrtRight(*pTab) ); m_pImp->GetShell()->AddPaintRect( aMarginRect ); } - SwTwips nTopMargin = (pTab->*aRectFnSet->fnGetTopMargin)(); + SwTwips nTopMargin = aRectFnSet.GetTopMargin(*pTab); if ( nTopMargin > 0) { aMarginRect = pTab->Frame(); - (aMarginRect.*aRectFnSet->fnSetHeight)( nTopMargin ); + aRectFnSet.SetHeight( aMarginRect, nTopMargin ); m_pImp->GetShell()->AddPaintRect( aMarginRect ); } - if ( (pTab->*aRectFnSet->fnGetBottomMargin)() > 0) + if ( aRectFnSet.GetBottomMargin(*pTab) > 0) { aMarginRect = pTab->Frame(); - (aMarginRect.*aRectFnSet->fnSetTop)( (pTab->*aRectFnSet->fnGetPrtBottom)() ); + aRectFnSet.SetTop( aMarginRect, aRectFnSet.GetPrtBottom(*pTab) ); m_pImp->GetShell()->AddPaintRect( aMarginRect ); } } @@ -1543,7 +1543,7 @@ bool SwLayAction::FormatLayoutTab( SwTabFrame *pTab, bool bAddRect ) { SwRect aRect( pTab->GetUpper()->PaintArea() ); // vertical layout support - (aRect.*aRectFnSet->fnSetTop)( (pTab->*aRectFnSet->fnGetPrtBottom)() ); + aRectFnSet.SetTop( aRect, aRectFnSet.GetPrtBottom(*pTab) ); if ( !m_pImp->GetShell()->AddPaintRect( aRect ) ) pTab->ResetRetouche(); } @@ -1561,7 +1561,7 @@ bool SwLayAction::FormatLayoutTab( SwTabFrame *pTab, bool bAddRect ) // and bottom of paint area of the upper frame. SwRect aRect( pTab->GetUpper()->PaintArea() ); // vertical layout support - (aRect.*aRectFnSet->fnSetTop)( (pTab->*aRectFnSet->fnGetPrtBottom)() ); + aRectFnSet.SetTop( aRect, aRectFnSet.GetPrtBottom(*pTab) ); if ( !m_pImp->GetShell()->AddPaintRect( aRect ) ) pTab->ResetRetouche(); } @@ -1791,12 +1791,12 @@ void SwLayAction::FormatContent_( const SwContentFrame *pContent, if ( !bDrawObjsOnly && IsPaint() ) { const SwRect aOldRect( pContent->UnionFrame() ); - const long nOldBottom = (pContent->*aRectFnSet->fnGetPrtBottom)(); + const long nOldBottom = aRectFnSet.GetPrtBottom(*pContent); pContent->OptCalc(); if( IsAgain() ) return; - if( (*aRectFnSet->fnYDiff)( (pContent->Frame().*aRectFnSet->fnGetBottom)(), - (aOldRect.*aRectFnSet->fnGetBottom)() ) < 0 ) + if( aRectFnSet.YDiff( aRectFnSet.GetBottom(pContent->Frame()), + aRectFnSet.GetBottom(aOldRect) ) < 0 ) { pContent->SetRetouche(); } @@ -1806,7 +1806,7 @@ void SwLayAction::FormatContent_( const SwContentFrame *pContent, { if ( IsPaint() && pContent->IsTextFrame() && static_cast<const SwTextFrame*>(pContent)->HasRepaint() ) PaintContent( pContent, pPage, pContent->Frame(), - (pContent->Frame().*aRectFnSet->fnGetBottom)() ); + aRectFnSet.GetBottom(pContent->Frame()) ); pContent->OptCalc(); } } diff --git a/sw/source/core/layout/layouter.cxx b/sw/source/core/layout/layouter.cxx index 2b27fe267f87..638d0e76056c 100644 --- a/sw/source/core/layout/layouter.cxx +++ b/sw/source/core/layout/layouter.cxx @@ -459,8 +459,8 @@ bool SwLayouter::MoveBwdSuppressed( const SwDoc& p_rDoc, } aMoveBwdLayoutInfo.mnFreeSpaceInNewUpper = pLastLower - ? (pLastLower->Frame().*aRectFnSet->fnBottomDist)( (p_rNewUpperFrame.*aRectFnSet->fnGetPrtBottom)() ) - : (p_rNewUpperFrame.Frame().*aRectFnSet->fnGetHeight)(); + ? aRectFnSet.BottomDist( pLastLower->Frame(), aRectFnSet.GetPrtBottom(p_rNewUpperFrame) ) + : aRectFnSet.GetHeight(p_rNewUpperFrame.Frame()); // check for moving backward suppress threshold const sal_uInt16 cMoveBwdCountSuppressThreshold = 20; diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 735af25573ea..8f828e91eb37 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -109,7 +109,7 @@ void SwBodyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder bNoGrid = false; long nSum = pGrid->GetBaseHeight() + pGrid->GetRubyHeight(); SwRectFnSet aRectFnSet(this); - long nSize = (Frame().*aRectFnSet->fnGetWidth)(); + long nSize = aRectFnSet.GetWidth(Frame()); long nBorder = 0; if( GRID_LINES_CHARS == pGrid->GetGridType() ) { @@ -119,11 +119,11 @@ void SwBodyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder nSize -= nBorder; nBorder /= 2; } - (Prt().*aRectFnSet->fnSetPosX)( nBorder ); - (Prt().*aRectFnSet->fnSetWidth)( nSize ); + aRectFnSet.SetPosX( Prt(), nBorder ); + aRectFnSet.SetWidth( Prt(), nSize ); // Height of body frame: - nBorder = (Frame().*aRectFnSet->fnGetHeight)(); + nBorder = aRectFnSet.GetHeight(Frame()); // Number of possible lines in area of body frame: long nNumberOfLines = nBorder / nSum; @@ -139,8 +139,8 @@ void SwBodyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder const bool bAdjust = static_cast<SwPageFrame*>(GetUpper())->GetFormat()->GetDoc()-> GetFootnoteIdxs().empty(); - (Prt().*aRectFnSet->fnSetPosY)( bAdjust ? nBorder : 0 ); - (Prt().*aRectFnSet->fnSetHeight)( nSize ); + aRectFnSet.SetPosY( Prt(), bAdjust ? nBorder : 0 ); + aRectFnSet.SetHeight( Prt(), nSize ); } } if( bNoGrid ) diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 90cfe6975309..90c1f3ba6c35 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -3303,9 +3303,9 @@ void SwRootFrame::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, // current paint area and invalidate the resulting region. SwRectFnSet aRectFnSet(pPage); SwRect aPageRectTemp( aPaintRect ); - (aPageRectTemp.*aRectFnSet->fnSetLeftAndWidth)( - (pPage->Frame().*aRectFnSet->fnGetLeft)(), - (pPage->Frame().*aRectFnSet->fnGetWidth)() ); + aRectFnSet.SetLeftAndWidth( aPageRectTemp, + aRectFnSet.GetLeft(pPage->Frame()), + aRectFnSet.GetWidth(pPage->Frame()) ); aPageRectTemp.Intersection_( pSh->VisArea() ); vcl::Region aPageRectRegion( aPageRectTemp.SVRect() ); aPageRectRegion.Exclude( aPaintRect.SVRect() ); @@ -4654,7 +4654,7 @@ void SwFrame::PaintShadow( const SwRect& rRect, SwRect& rOutRect, ); SwRectFnSet aRectFnSet(this); - ::lcl_ExtendLeftAndRight( rOutRect, *(this), rAttrs, aRectFnSet.fnRect ); + ::lcl_ExtendLeftAndRight( rOutRect, *(this), rAttrs, aRectFnSet.FnRect() ); lcl_PaintShadow(rRect, rOutRect, rShadow, bDrawFullShadowRectangle, bTop, bBottom, true, true, gProp); } @@ -5507,8 +5507,8 @@ void SwFrame::PaintBorder( const SwRect& rRect, const SwPageFrame *pPage, { const SwFrame* pDirRefFrame = IsCellFrame() ? FindTabFrame() : this; SwRectFnSet aRectFnSet(pDirRefFrame); - ::lcl_PaintLeftRightLine ( true, *(this), *(pPage), aRect, rRect, rAttrs, aRectFnSet.fnRect, gProp); - ::lcl_PaintLeftRightLine ( false, *(this), *(pPage), aRect, rRect, rAttrs, aRectFnSet.fnRect, gProp); + ::lcl_PaintLeftRightLine ( true, *(this), *(pPage), aRect, rRect, rAttrs, aRectFnSet.FnRect(), gProp); + ::lcl_PaintLeftRightLine ( false, *(this), *(pPage), aRect, rRect, rAttrs, aRectFnSet.FnRect(), gProp); if ( !IsContentFrame() || rAttrs.GetTopLine( *(this) ) ) { // - @@ -5519,11 +5519,11 @@ void SwFrame::PaintBorder( const SwRect& rRect, const SwPageFrame *pPage, SwBorderAttrAccess aAccess( SwFrame::GetCache(), pCellFrameForTopBorderAttrs ); const SwBorderAttrs &rTopAttrs = *aAccess.Get(); - ::lcl_PaintTopBottomLine( true, *(this), *(pPage), aRect, rRect, rTopAttrs, aRectFnSet.fnRect, gProp); + ::lcl_PaintTopBottomLine( true, *(this), *(pPage), aRect, rRect, rTopAttrs, aRectFnSet.FnRect(), gProp); } else { - ::lcl_PaintTopBottomLine( true, *(this), *(pPage), aRect, rRect, rAttrs, aRectFnSet.fnRect, gProp ); + ::lcl_PaintTopBottomLine( true, *(this), *(pPage), aRect, rRect, rAttrs, aRectFnSet.FnRect(), gProp ); } } if ( !IsContentFrame() || rAttrs.GetBottomLine( *(this) ) ) @@ -5536,11 +5536,11 @@ void SwFrame::PaintBorder( const SwRect& rRect, const SwPageFrame *pPage, SwBorderAttrAccess aAccess( SwFrame::GetCache(), pCellFrameForBottomBorderAttrs ); const SwBorderAttrs &rBottomAttrs = *aAccess.Get(); - ::lcl_PaintTopBottomLine(false, *(this), *(pPage), aRect, rRect, rBottomAttrs, aRectFnSet.fnRect, gProp); + ::lcl_PaintTopBottomLine(false, *(this), *(pPage), aRect, rRect, rBottomAttrs, aRectFnSet.FnRect(), gProp); } else { - ::lcl_PaintTopBottomLine(false, *(this), *(pPage), aRect, rRect, rAttrs, aRectFnSet.fnRect, gProp); + ::lcl_PaintTopBottomLine(false, *(this), *(pPage), aRect, rRect, rAttrs, aRectFnSet.FnRect(), gProp); } } } @@ -5578,11 +5578,11 @@ void SwFootnoteContFrame::PaintLine( const SwRect& rRect, const SwPageFootnoteInfo &rInf = pPage->GetPageDesc()->GetFootnoteInfo(); SwRectFnSet aRectFnSet(this); - SwTwips nPrtWidth = (Prt().*aRectFnSet->fnGetWidth)(); + SwTwips nPrtWidth = aRectFnSet.GetWidth(Prt()); Fraction aFract( nPrtWidth, 1 ); const SwTwips nWidth = (long)(aFract *= rInf.GetWidth()); - SwTwips nX = (this->*aRectFnSet->fnGetPrtLeft)(); + SwTwips nX = aRectFnSet.GetPrtLeft(*this); switch ( rInf.GetAdj() ) { case FTNADJ_CENTER: @@ -5595,7 +5595,7 @@ void SwFootnoteContFrame::PaintLine( const SwRect& rRect, OSL_ENSURE( false, "New adjustment for footnote lines?" ); } SwTwips nLineWidth = rInf.GetLineWidth(); - const SwRect aLineRect = aRectFnSet.bVert ? + const SwRect aLineRect = aRectFnSet.IsVert() ? SwRect( Point(Frame().Left()+Frame().Width()-rInf.GetTopDist()-nLineWidth, nX), Size( nLineWidth, nWidth ) ) : SwRect( Point( nX, Frame().Pos().Y() + rInf.GetTopDist() ), diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index 7fbb23ff8e77..08230e6a3329 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -96,16 +96,16 @@ void SwSectionFrame::Init() { assert(GetUpper() && "SwSectionFrame::Init before insertion?!"); SwRectFnSet aRectFnSet(this); - long nWidth = (GetUpper()->Prt().*aRectFnSet->fnGetWidth)(); - (Frame().*aRectFnSet->fnSetWidth)( nWidth ); - (Frame().*aRectFnSet->fnSetHeight)( 0 ); + long nWidth = aRectFnSet.GetWidth(GetUpper()->Prt()); + aRectFnSet.SetWidth( Frame(), nWidth ); + aRectFnSet.SetHeight( Frame(), 0 ); // #109700# LRSpace for sections const SvxLRSpaceItem& rLRSpace = GetFormat()->GetLRSpace(); - (Prt().*aRectFnSet->fnSetLeft)( rLRSpace.GetLeft() ); - (Prt().*aRectFnSet->fnSetWidth)( nWidth - rLRSpace.GetLeft() - + aRectFnSet.SetLeft( Prt(), rLRSpace.GetLeft() ); + aRectFnSet.SetWidth( Prt(), nWidth - rLRSpace.GetLeft() - rLRSpace.GetRight() ); - (Prt().*aRectFnSet->fnSetHeight)( 0 ); + aRectFnSet.SetHeight( Prt(), 0 ); const SwFormatCol &rCol = GetFormat()->GetCol(); if( ( rCol.GetNumCols() > 1 || IsAnyNoteAtEnd() ) && !IsInFootnote() ) @@ -277,13 +277,13 @@ void SwSectionFrame::Cut_( bool bRemove ) if ( pUp ) { SwRectFnSet aRectFnSet(this); - SwTwips nFrameHeight = (Frame().*aRectFnSet->fnGetHeight)(); + SwTwips nFrameHeight = aRectFnSet.GetHeight(Frame()); if( nFrameHeight > 0 ) { if( !bRemove ) { - (Frame().*aRectFnSet->fnSetHeight)( 0 ); - (Prt().*aRectFnSet->fnSetHeight)( 0 ); + aRectFnSet.SetHeight( Frame(), 0 ); + aRectFnSet.SetHeight( Prt(), 0 ); } pUp->Shrink( nFrameHeight ); } @@ -355,7 +355,7 @@ void SwSectionFrame::Paste( SwFrame* pParent, SwFrame* pSibling ) if (bInserted) { pSect->Init(); - (pSect->*aRectFnSet->fnMakePos)( pSect->GetUpper(), pSect->GetPrev(), true); + aRectFnSet.MakePos( *pSect, pSect->GetUpper(), pSect->GetPrev(), true); } if( !static_cast<SwLayoutFrame*>(pParent)->Lower() ) { @@ -378,7 +378,7 @@ void SwSectionFrame::Paste( SwFrame* pParent, SwFrame* pSibling ) pSibling->InvalidatePage( pPage ); } - SwTwips nFrameHeight = (Frame().*aRectFnSet->fnGetHeight)(); + SwTwips nFrameHeight = aRectFnSet.GetHeight(Frame()); if( nFrameHeight ) pParent->Grow( nFrameHeight ); @@ -483,7 +483,7 @@ bool SwSectionFrame::SplitSect( SwFrame* pFrame, bool bApres ) pNew->InsertBehind( pSect->GetUpper(), pSect ); pNew->Init(); SwRectFnSet aRectFnSet(this); - (pNew->*aRectFnSet->fnMakePos)( nullptr, pSect, true ); + aRectFnSet.MakePos( *pNew, nullptr, pSect, true ); // OD 25.03.2003 #108339# - restore content: // determine layout frame for restoring content after the initialization // of the section frame. In the section initialization the columns are @@ -670,7 +670,7 @@ void SwSectionFrame::MoveContentAndDelete( SwSectionFrame* pDel, bool bSave ) pPrvSct->InsertBehind( pUp, pPrv ); pPrvSct->Init(); SwRectFnSet aRectFnSet(pUp); - (pPrvSct->*aRectFnSet->fnMakePos)( pUp, pPrv, true ); + aRectFnSet.MakePos( *pPrvSct, pUp, pPrv, true ); pUp = FirstLeaf( pPrvSct ); pPrv = nullptr; } @@ -708,7 +708,7 @@ void SwSectionFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) if( GetUpper() ) { SwRectFnSet aRectFnSet(GetUpper()); - (this->*aRectFnSet->fnMakePos)( GetUpper(), GetPrev(), false ); + aRectFnSet.MakePos( *this, GetUpper(), GetPrev(), false ); } } mbValidSize = mbValidPos = mbValidPrtArea = true; @@ -845,8 +845,8 @@ bool SwSectionFrame::CalcMinDiff( SwTwips& rMinDiff ) const if( ToMaximize( true ) ) { SwRectFnSet aRectFnSet(this); - rMinDiff = (GetUpper()->*aRectFnSet->fnGetPrtBottom)(); - rMinDiff = (Frame().*aRectFnSet->fnBottomDist)( rMinDiff ); + rMinDiff = aRectFnSet.GetPrtBottom(*GetUpper()); + rMinDiff = aRectFnSet.BottomDist( Frame(), rMinDiff ); return true; } return false; @@ -969,27 +969,27 @@ void SwSectionFrame::CheckClipping( bool bGrow, bool bMaximize ) { SwRectFnSet aRectFnSet(this); long nDiff; - SwTwips nDeadLine = (GetUpper()->*aRectFnSet->fnGetPrtBottom)(); + SwTwips nDeadLine = aRectFnSet.GetPrtBottom(*GetUpper()); if( bGrow && ( !IsInFly() || !GetUpper()->IsColBodyFrame() || !FindFlyFrame()->IsLocked() ) ) { - nDiff = -(Frame().*aRectFnSet->fnBottomDist)( nDeadLine ); + nDiff = -aRectFnSet.BottomDist( Frame(), nDeadLine ); if( !bMaximize ) nDiff += Undersize(); if( nDiff > 0 ) { long nAdd = GetUpper()->Grow( nDiff ); - if( aRectFnSet.bVert && !aRectFnSet.bRev ) + if( aRectFnSet.IsVert() && !aRectFnSet.IsRev() ) nDeadLine -= nAdd; else nDeadLine += nAdd; } } - nDiff = -(Frame().*aRectFnSet->fnBottomDist)( nDeadLine ); + nDiff = -aRectFnSet.BottomDist( Frame(), nDeadLine ); SetUndersized( !bMaximize && nDiff >= 0 ); const bool bCalc = ( IsUndersized() || bMaximize ) && ( nDiff || - (Prt().*aRectFnSet->fnGetTop)() > (Frame().*aRectFnSet->fnGetHeight)() ); + aRectFnSet.GetTop(Prt()) > aRectFnSet.GetHeight(Frame()) ); // OD 03.11.2003 #i19737# - introduce local variable <bExtraCalc> to indicate // that a calculation has to be done beside the value of <bCalc>. bool bExtraCalc = false; @@ -1012,21 +1012,21 @@ void SwSectionFrame::CheckClipping( bool bGrow, bool bMaximize ) } if ( bCalc || bExtraCalc ) { - nDiff = (*aRectFnSet->fnYDiff)( nDeadLine, (Frame().*aRectFnSet->fnGetTop)() ); + nDiff = aRectFnSet.YDiff( nDeadLine, aRectFnSet.GetTop(Frame()) ); if( nDiff < 0 ) - nDeadLine = (Frame().*aRectFnSet->fnGetTop)(); + nDeadLine = aRectFnSet.GetTop(Frame()); const Size aOldSz( Prt().SSize() ); - long nTop = (this->*aRectFnSet->fnGetTopMargin)(); - (Frame().*aRectFnSet->fnSetBottom)( nDeadLine ); - nDiff = (Frame().*aRectFnSet->fnGetHeight)(); + long nTop = aRectFnSet.GetTopMargin(*this); + aRectFnSet.SetBottom( Frame(), nDeadLine ); + nDiff = aRectFnSet.GetHeight(Frame()); if( nTop > nDiff ) nTop = nDiff; - (this->*aRectFnSet->fnSetYMargins)( nTop, 0 ); + aRectFnSet.SetYMargins( *this, nTop, 0 ); // OD 18.09.2002 #100522# // Determine, if height has changed. // Note: In vertical layout the height equals the width value. - bool bHeightChanged = aRectFnSet.bVert ? + bool bHeightChanged = aRectFnSet.IsVert() ? (aOldSz.Width() != Prt().Width()) : (aOldSz.Height() != Prt().Height()); // Last but not least we have changed the height again, thus the inner @@ -1063,20 +1063,20 @@ void SwSectionFrame::SimpleFormat() { // assure notifications on position changes. const SwLayNotify aNotify( this ); - (this->*aRectFnSet->fnMakePos)( GetUpper(), GetPrev(), false ); + aRectFnSet.MakePos( *this, GetUpper(), GetPrev(), false ); mbValidPos = true; } - SwTwips nDeadLine = (GetUpper()->*aRectFnSet->fnGetPrtBottom)(); + SwTwips nDeadLine = aRectFnSet.GetPrtBottom(*GetUpper()); // OD 22.10.2002 #97265# - call always method <lcl_ColumnRefresh(..)>, in // order to get calculated lowers, not only if there space left in its upper. - if( (Frame().*aRectFnSet->fnBottomDist)( nDeadLine ) >= 0 ) + if( aRectFnSet.BottomDist( Frame(), nDeadLine ) >= 0 ) { - (Frame().*aRectFnSet->fnSetBottom)( nDeadLine ); - long nHeight = (Frame().*aRectFnSet->fnGetHeight)(); + aRectFnSet.SetBottom( Frame(), nDeadLine ); + long nHeight = aRectFnSet.GetHeight(Frame()); long nTop = CalcUpperSpace(); if( nTop > nHeight ) nTop = nHeight; - (this->*aRectFnSet->fnSetYMargins)( nTop, 0 ); + aRectFnSet.SetYMargins( *this, nTop, 0 ); } lcl_ColumnRefresh( this, false ); UnlockJoin(); @@ -1150,15 +1150,15 @@ class ExtraFormatToPositionObjs { // grow section till bottom of printing area of upper frame SwRectFnSet aRectFnSet(mpSectFrame); - SwTwips nTopMargin = (mpSectFrame->*aRectFnSet->fnGetTopMargin)(); + SwTwips nTopMargin = aRectFnSet.GetTopMargin(*mpSectFrame); Size aOldSectPrtSize( mpSectFrame->Prt().SSize() ); - SwTwips nDiff = (mpSectFrame->Frame().*aRectFnSet->fnBottomDist)( - (mpSectFrame->GetUpper()->*aRectFnSet->fnGetPrtBottom)() ); - (mpSectFrame->Frame().*aRectFnSet->fnAddBottom)( nDiff ); - (mpSectFrame->*aRectFnSet->fnSetYMargins)( nTopMargin, 0 ); + SwTwips nDiff = aRectFnSet.BottomDist( mpSectFrame->Frame(), + aRectFnSet.GetPrtBottom(*mpSectFrame->GetUpper()) ); + aRectFnSet.AddBottom( mpSectFrame->Frame(), nDiff ); + aRectFnSet.SetYMargins( *mpSectFrame, nTopMargin, 0 ); // #i59789# // suppress formatting, if printing area of section is too narrow - if ( (mpSectFrame->Prt().*aRectFnSet->fnGetHeight)() <= 0 ) + if ( aRectFnSet.GetHeight(mpSectFrame->Prt()) <= 0 ) { return; } @@ -1229,22 +1229,22 @@ void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderA // #109700# LRSpace for sections const SvxLRSpaceItem& rLRSpace = GetFormat()->GetLRSpace(); - (this->*aRectFnSet->fnSetXMargins)( rLRSpace.GetLeft(), rLRSpace.GetRight() ); + aRectFnSet.SetXMargins( *this, rLRSpace.GetLeft(), rLRSpace.GetRight() ); - if( nUpper != (this->*aRectFnSet->fnGetTopMargin)() ) + if( nUpper != aRectFnSet.GetTopMargin(*this) ) { mbValidSize = false; SwFrame* pOwn = ContainsAny(); if( pOwn ) pOwn->InvalidatePos_(); } - (this->*aRectFnSet->fnSetYMargins)( nUpper, 0 ); + aRectFnSet.SetYMargins( *this, nUpper, 0 ); } if ( !mbValidSize ) { PROTOCOL_ENTER( this, PROT::Size, DbgAction::NONE, nullptr ) - const long nOldHeight = (Frame().*aRectFnSet->fnGetHeight)(); + const long nOldHeight = aRectFnSet.GetHeight(Frame()); bool bOldLock = IsColLocked(); ColLock(); @@ -1279,12 +1279,12 @@ void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderA if( GetUpper() ) { - long nWidth = (GetUpper()->Prt().*aRectFnSet->fnGetWidth)(); - (maFrame.*aRectFnSet->fnSetWidth)( nWidth ); + long nWidth = aRectFnSet.GetWidth(GetUpper()->Prt()); + aRectFnSet.SetWidth( maFrame, nWidth ); // #109700# LRSpace for sections const SvxLRSpaceItem& rLRSpace = GetFormat()->GetLRSpace(); - (maPrt.*aRectFnSet->fnSetWidth)( nWidth - rLRSpace.GetLeft() - + aRectFnSet.SetWidth( maPrt, nWidth - rLRSpace.GetLeft() - rLRSpace.GetRight() ); // OD 15.10.2002 #103517# - allow grow in online layout @@ -1302,7 +1302,7 @@ void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderA if ( !bMaximize ) { - SwTwips nRemaining = (this->*aRectFnSet->fnGetTopMargin)(); + SwTwips nRemaining = aRectFnSet.GetTopMargin(*this); SwFrame *pFrame = m_pLower; if( pFrame ) { @@ -1310,7 +1310,7 @@ void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderA { // #i61435# // suppress formatting, if upper frame has height <= 0 - if ( (GetUpper()->Frame().*aRectFnSet->fnGetHeight)() > 0 ) + if ( aRectFnSet.GetHeight(GetUpper()->Frame()) > 0 ) { FormatWidthCols( *pAttr, nRemaining, MINLAY ); } @@ -1325,7 +1325,7 @@ void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderA break; } bMaximize = ToMaximize( false ); - nRemaining += (pFrame->Frame().*aRectFnSet->fnGetHeight)(); + nRemaining += aRectFnSet.GetHeight(pFrame->Frame()); } else { @@ -1347,19 +1347,19 @@ void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderA } } - SwTwips nDiff = (Frame().*aRectFnSet->fnGetHeight)() - nRemaining; + SwTwips nDiff = aRectFnSet.GetHeight(Frame()) - nRemaining; if( nDiff < 0) { - SwTwips nDeadLine = (GetUpper()->*aRectFnSet->fnGetPrtBottom)(); + SwTwips nDeadLine = aRectFnSet.GetPrtBottom(*GetUpper()); { - long nBottom = (Frame().*aRectFnSet->fnGetBottom)(); - nBottom = (*aRectFnSet->fnYInc)( nBottom, -nDiff ); - long nTmpDiff = (*aRectFnSet->fnYDiff)( nBottom, nDeadLine ); + long nBottom = aRectFnSet.GetBottom(Frame()); + nBottom = aRectFnSet.YInc( nBottom, -nDiff ); + long nTmpDiff = aRectFnSet.YDiff( nBottom, nDeadLine ); if( nTmpDiff > 0 ) { nTmpDiff = GetUpper()->Grow( nTmpDiff, true ); - nDeadLine = (*aRectFnSet->fnYInc)( nDeadLine, nTmpDiff ); - nTmpDiff = (*aRectFnSet->fnYDiff)( nBottom, nDeadLine ); + nDeadLine = aRectFnSet.YInc( nDeadLine, nTmpDiff ); + nTmpDiff = aRectFnSet.YDiff( nBottom, nDeadLine ); if( nTmpDiff > 0 ) nDiff += nTmpDiff; if( nDiff > 0 ) @@ -1369,10 +1369,10 @@ void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderA } if( nDiff ) { - long nTmp = nRemaining - (Frame().*aRectFnSet->fnGetHeight)(); - long nTop = (this->*aRectFnSet->fnGetTopMargin)(); - (Frame().*aRectFnSet->fnAddBottom)( nTmp ); - (this->*aRectFnSet->fnSetYMargins)( nTop, 0 ); + long nTmp = nRemaining - aRectFnSet.GetHeight(Frame()); + long nTop = aRectFnSet.GetTopMargin(*this); + aRectFnSet.AddBottom( Frame(), nTmp ); + aRectFnSet.SetYMargins( *this, nTop, 0 ); InvalidateNextPos(); if (m_pLower && (!m_pLower->IsColumnFrame() || !m_pLower->GetNext())) { @@ -1412,7 +1412,7 @@ void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderA CheckClipping( true, bMaximize ); if( !bOldLock ) ColUnlock(); - long nDiff = nOldHeight - (Frame().*aRectFnSet->fnGetHeight)(); + long nDiff = nOldHeight - aRectFnSet.GetHeight(Frame()); if( nDiff > 0 ) { if( !GetNext() ) @@ -1592,7 +1592,7 @@ SwLayoutFrame *SwFrame::GetNextSctLeaf( MakePageType eMakePage ) pNew->InsertBefore( pLayLeaf, pLayLeaf->Lower() ); pNew->Init(); SwRectFnSet aRectFnSet(pNew); - (pNew->*aRectFnSet->fnMakePos)( pLayLeaf, nullptr, true ); + aRectFnSet.MakePos( *pNew, pLayLeaf, nullptr, true ); // If our section frame has a successor then that has to be // moved behind the new Follow of the section frames @@ -1800,7 +1800,7 @@ SwLayoutFrame *SwFrame::GetPrevSctLeaf( MakePageType ) pNew->InsertBefore( pLayLeaf, nullptr ); pNew->Init(); SwRectFnSet aRectFnSet(pNew); - (pNew->*aRectFnSet->fnMakePos)( pLayLeaf, pNew->GetPrev(), true ); + aRectFnSet.MakePos( *pNew, pLayLeaf, pNew->GetPrev(), true ); pLayLeaf = FirstLeaf( pNew ); if( !pNew->Lower() ) // Format single column sections @@ -1850,16 +1850,16 @@ static SwTwips lcl_DeadLine( const SwFrame* pFrame ) break; } SwRectFnSet aRectFnSet(pFrame); - return pUp ? (pUp->*aRectFnSet->fnGetPrtBottom)() : - (pFrame->Frame().*aRectFnSet->fnGetBottom)(); + return pUp ? aRectFnSet.GetPrtBottom(*pUp) : + aRectFnSet.GetBottom(pFrame->Frame()); } /// checks whether the SectionFrame is still able to grow, as case may be the environment has to be asked bool SwSectionFrame::Growable() const { SwRectFnSet aRectFnSet(this); - if( (*aRectFnSet->fnYDiff)( lcl_DeadLine( this ), - (Frame().*aRectFnSet->fnGetBottom)() ) > 0 ) + if( aRectFnSet.YDiff( lcl_DeadLine( this ), + aRectFnSet.GetBottom(Frame()) ) > 0 ) return true; return ( GetUpper() && const_cast<SwFrame*>(static_cast<SwFrame const *>(GetUpper()))->Grow( LONG_MAX, true ) ); @@ -1870,7 +1870,7 @@ SwTwips SwSectionFrame::Grow_( SwTwips nDist, bool bTst ) if ( !IsColLocked() && !HasFixSize() ) { SwRectFnSet aRectFnSet(this); - long nFrameHeight = (Frame().*aRectFnSet->fnGetHeight)(); + long nFrameHeight = aRectFnSet.GetHeight(Frame()); if( nFrameHeight > 0 && nDist > (LONG_MAX - nFrameHeight) ) nDist = LONG_MAX - nFrameHeight; @@ -1894,8 +1894,7 @@ SwTwips SwSectionFrame::Grow_( SwTwips nDist, bool bTst ) else { nGrow = lcl_DeadLine( this ); - nGrow = (*aRectFnSet->fnYDiff)( nGrow, - (Frame().*aRectFnSet->fnGetBottom)() ); + nGrow = aRectFnSet.YDiff( nGrow, aRectFnSet.GetBottom(Frame()) ); } SwTwips nSpace = nGrow; if( !bInCalcContent && nGrow < nDist && GetUpper() ) @@ -1933,9 +1932,9 @@ SwTwips SwSectionFrame::Grow_( SwTwips nDist, bool bTst ) if( GetUpper() && GetUpper()->IsHeaderFrame() ) GetUpper()->InvalidateSize(); } - (Frame().*aRectFnSet->fnAddBottom)( nGrow ); - long nPrtHeight = (Prt().*aRectFnSet->fnGetHeight)() + nGrow; - (Prt().*aRectFnSet->fnSetHeight)( nPrtHeight ); + aRectFnSet.AddBottom( Frame(), nGrow ); + long nPrtHeight = aRectFnSet.GetHeight(Prt()) + nGrow; + aRectFnSet.SetHeight( Prt(), nPrtHeight ); if( Lower() && Lower()->IsColumnFrame() && Lower()->GetNext() ) { @@ -1995,7 +1994,7 @@ SwTwips SwSectionFrame::Shrink_( SwTwips nDist, bool bTst ) else { SwRectFnSet aRectFnSet(this); - long nFrameHeight = (Frame().*aRectFnSet->fnGetHeight)(); + long nFrameHeight = aRectFnSet.GetHeight(Frame()); if ( nDist > nFrameHeight ) nDist = nFrameHeight; @@ -2016,9 +2015,9 @@ SwTwips SwSectionFrame::Shrink_( SwTwips nDist, bool bTst ) SetCompletePaint(); InvalidatePage(); } - (Frame().*aRectFnSet->fnAddBottom)( -nDist ); - long nPrtHeight = (Prt().*aRectFnSet->fnGetHeight)() - nDist; - (Prt().*aRectFnSet->fnSetHeight)( nPrtHeight ); + aRectFnSet.AddBottom( Frame(), -nDist ); + long nPrtHeight = aRectFnSet.GetHeight(Prt()) - nDist; + aRectFnSet.SetHeight( Prt(), nPrtHeight ); // We do not allow a section frame to shrink the its upper // footer frame. This is because in the calculation of a @@ -2495,7 +2494,7 @@ void SwSectionFrame::InvalidateFootnotePos() SwTwips SwSectionFrame::CalcUndersize() const { SwRectFnSet aRectFnSet(this); - return InnerHeight() - (Prt().*aRectFnSet->fnGetHeight)(); + return InnerHeight() - aRectFnSet.GetHeight(Prt()); } SwTwips SwSectionFrame::Undersize() diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index af5cf4a459fc..f382e20157f6 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -203,7 +203,7 @@ static SwTwips lcl_GetHeightOfRows( const SwFrame* pStart, long nCount ) SwRectFnSet aRectFnSet(pStart); while ( pStart && nCount > 0 ) { - nRet += (pStart->Frame().*aRectFnSet->fnGetHeight)(); + nRet += aRectFnSet.GetHeight(pStart->Frame()); pStart = pStart->GetNext(); --nCount; } @@ -320,7 +320,7 @@ static void lcl_ShrinkCellsAndAllContent( SwRowFrame& rRow ) // #i26945# // all lowers should have the correct position lcl_ArrangeLowers( &rToAdjust, - (rToAdjust.*aRectFnSet->fnGetPrtTop)(), + aRectFnSet.GetPrtTop(rToAdjust), false ); // TODO: Optimize number of frames which are set to 0 height // we have to start with the last lower frame, otherwise @@ -348,7 +348,7 @@ static void lcl_ShrinkCellsAndAllContent( SwRowFrame& rRow ) { lcl_ShrinkCellsAndAllContent( *pTmpRow ); - if ((pTmpRow->Frame().*aRectFnSet->fnGetHeight)() > 0) + if (aRectFnSet.GetHeight(pTmpRow->Frame()) > 0) bAllRowsCollapsed = false; pTmpRow = static_cast<SwRowFrame*>(pTmpRow->GetNext()); @@ -357,20 +357,20 @@ static void lcl_ShrinkCellsAndAllContent( SwRowFrame& rRow ) if (bAllRowsCollapsed) { // All rows of this table have 0 height -> set height of the table itself as well. - (pTmp->Frame().*aRectFnSet->fnSetHeight)(0); - (pTmp->Prt().*aRectFnSet->fnSetTop)(0); - (pTmp->Prt().*aRectFnSet->fnSetHeight)(0); + aRectFnSet.SetHeight(pTmp->Frame(), 0); + aRectFnSet.SetTop(pTmp->Prt(), 0); + aRectFnSet.SetHeight(pTmp->Prt(), 0); } else bAllLowersCollapsed = false; } else { - pTmp->Shrink( (pTmp->Frame().*aRectFnSet->fnGetHeight)() ); - (pTmp->Prt().*aRectFnSet->fnSetTop)( 0 ); - (pTmp->Prt().*aRectFnSet->fnSetHeight)( 0 ); + pTmp->Shrink(aRectFnSet.GetHeight(pTmp->Frame())); + aRectFnSet.SetTop(pTmp->Prt(), 0); + aRectFnSet.SetHeight(pTmp->Prt(), 0); - if ((pTmp->Frame().*aRectFnSet->fnGetHeight)() > 0) + if (aRectFnSet.GetHeight(pTmp->Frame()) > 0) bAllLowersCollapsed = false; } @@ -379,16 +379,16 @@ static void lcl_ShrinkCellsAndAllContent( SwRowFrame& rRow ) // all lowers should have the correct position lcl_ArrangeLowers( &rToAdjust, - (rToAdjust.*aRectFnSet->fnGetPrtTop)(), + aRectFnSet.GetPrtTop(rToAdjust), false ); } if (bAllLowersCollapsed) { // All lower frame of this cell have 0 height -> set height of the cell itself as well. - (pCurrMasterCell->Frame().*aRectFnSet->fnSetHeight)(0); - (pCurrMasterCell->Prt().*aRectFnSet->fnSetTop)(0); - (pCurrMasterCell->Prt().*aRectFnSet->fnSetHeight)(0); + aRectFnSet.SetHeight(pCurrMasterCell->Frame(), 0); + aRectFnSet.SetTop(pCurrMasterCell->Prt(), 0); + aRectFnSet.SetHeight(pCurrMasterCell->Prt(), 0); } else bAllCellsCollapsed = false; @@ -399,9 +399,9 @@ static void lcl_ShrinkCellsAndAllContent( SwRowFrame& rRow ) if (bAllCellsCollapsed) { // All cells have 0 height -> set height of row as well. - (rRow.Frame().*aRectFnSet->fnSetHeight)(0); - (rRow.Prt().*aRectFnSet->fnSetTop)(0); - (rRow.Prt().*aRectFnSet->fnSetHeight)(0); + aRectFnSet.SetHeight(rRow.Frame(), 0); + aRectFnSet.SetTop(rRow.Prt(), 0); + aRectFnSet.SetHeight(rRow.Prt(), 0); } } @@ -525,7 +525,7 @@ static void lcl_PreprocessRowsInCells( SwTabFrame& rTab, SwRowFrame& rLastLine, // 2. The borders of the cells inside the row // 3. The minimum height of the row if ( pTmpLastLineRow->HasFixSize() ) - nMinHeight = (pTmpLastLineRow->Frame().*aRectFnSet->fnGetHeight)(); + nMinHeight = aRectFnSet.GetHeight(pTmpLastLineRow->Frame()); else { while ( pCell ) @@ -576,8 +576,8 @@ static void lcl_PreprocessRowsInCells( SwTabFrame& rTab, SwRowFrame& rLastLine, lcl_MoveFootnotes( rTab, *rTab.GetFollow(), *pTmpLastLineRow ); pTmpLastLineRow->RemoveFromLayout(); pTmpLastLineRow->InsertBefore( pCurrFollowFlowLineCell, nullptr ); - pTmpLastLineRow->Shrink( ( pTmpLastLineRow->Frame().*aRectFnSet->fnGetHeight)() ); - pCurrFollowFlowLineCell->Grow( ( pTmpLastLineRow->Frame().*aRectFnSet->fnGetHeight)() ); + pTmpLastLineRow->Shrink( aRectFnSet.GetHeight(pTmpLastLineRow->Frame()) ); + pCurrFollowFlowLineCell->Grow( aRectFnSet.GetHeight(pTmpLastLineRow->Frame()) ); pTmpLastLineRow = pTmp; } } @@ -697,7 +697,7 @@ static bool lcl_RecalcSplitLine( SwRowFrame& rLastLine, SwRowFrame& rFollowLine, // 1. Check if table fits to its upper. // #i26945# - include check, if objects fit const SwTwips nDistanceToUpperPrtBottom = - (rTab.Frame().*aRectFnSet->fnBottomDist)( (rTab.GetUpper()->*aRectFnSet->fnGetPrtBottom)()); + aRectFnSet.BottomDist(rTab.Frame(), aRectFnSet.GetPrtBottom(*rTab.GetUpper())); if ( nDistanceToUpperPrtBottom < 0 || !rTab.DoesObjsFit() ) bRet = false; @@ -772,9 +772,9 @@ static void lcl_AdjustRowSpanCells( SwRowFrame* pRow ) { // calculate height of cell: const long nNewCellHeight = lcl_GetHeightOfRows( pRow, nLayoutRowSpan ); - const long nDiff = nNewCellHeight - (pCellFrame->Frame().*aRectFnSet->fnGetHeight)(); + const long nDiff = nNewCellHeight - aRectFnSet.GetHeight(pCellFrame->Frame()); if ( nDiff ) - (pCellFrame->Frame().*aRectFnSet->fnAddBottom)( nDiff ); + aRectFnSet.AddBottom(pCellFrame->Frame(), nDiff); } pCellFrame = static_cast<SwCellFrame*>(pCellFrame->GetNext()); @@ -855,7 +855,7 @@ bool SwTabFrame::RemoveFollowFlowLine() while ( pRow && nRowsToMove-- > 1 ) { SwFrame* pNxt = pRow->GetNext(); - nGrow += (pRow->Frame().*aRectFnSet->fnGetHeight)(); + nGrow += aRectFnSet.GetHeight(pRow->Frame()); // The footnotes have to be moved: lcl_MoveFootnotes( *GetFollow(), *this, static_cast<SwRowFrame&>(*pRow) ); @@ -944,20 +944,20 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK sal_uInt16 nRowCount = 0; // pRow currently points to the first row SwTwips nRemainingSpaceForLastRow = - (*aRectFnSet->fnYDiff)( nCutPos, (Frame().*aRectFnSet->fnGetTop)() ); - nRemainingSpaceForLastRow -= (this->*aRectFnSet->fnGetTopMargin)(); + aRectFnSet.YDiff(nCutPos, aRectFnSet.GetTop(Frame())); + nRemainingSpaceForLastRow -= aRectFnSet.GetTopMargin(*this); // Make pRow point to the line that does not fit anymore: while( pRow->GetNext() && - nRemainingSpaceForLastRow >= ( (pRow->Frame().*aRectFnSet->fnGetHeight)() + + nRemainingSpaceForLastRow >= ( aRectFnSet.GetHeight(pRow->Frame()) + (IsCollapsingBorders() ? pRow->GetBottomLineSize() : 0 ) ) ) { if( bTryToSplit || !pRow->IsRowSpanLine() || - 0 != (pRow->Frame().*aRectFnSet->fnGetHeight)() ) + 0 != aRectFnSet.GetHeight(pRow->Frame()) ) ++nRowCount; - nRemainingSpaceForLastRow -= (pRow->Frame().*aRectFnSet->fnGetHeight)(); + nRemainingSpaceForLastRow -= aRectFnSet.GetHeight(pRow->Frame()); pRow = static_cast<SwRowFrame*>(pRow->GetNext()); } @@ -1009,8 +1009,7 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK { const SwRowFrame* pLowerRow = static_cast<SwRowFrame*>(pLowerCell->Lower()); if ( !pLowerRow->IsRowSplitAllowed() && - (pLowerRow->Frame().*aRectFnSet->fnGetHeight)() > - nRemainingSpaceForLastRow ) + aRectFnSet.GetHeight(pLowerRow->Frame()) > nRemainingSpaceForLastRow ) { bKeepNextRow = true; break; @@ -1027,7 +1026,7 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK if ( bKeepNextRow ) { pRow = GetFirstNonHeadlineRow(); - if( pRow && pRow->IsRowSpanLine() && 0 == (pRow->Frame().*aRectFnSet->fnGetHeight)() ) + if ( pRow && pRow->IsRowSpanLine() && 0 == aRectFnSet.GetHeight(pRow->Frame()) ) pRow = static_cast<SwRowFrame*>(pRow->GetNext()); if ( pRow ) { @@ -1043,7 +1042,7 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK // We try to split the row if // - the attributes of the row are set accordingly and // - we are allowed to do so - // - the it should not keep with the next row + // - it should not be kept with the next row bSplitRowAllowed = bSplitRowAllowed && bTryToSplit && ( !bTableRowKeep || !pRow->ShouldRowKeepWithNext() ); @@ -1068,7 +1067,7 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK } } - // If we do not indent to split pRow, we check if we are + // If we do not intend to split pRow, we check if we are // allowed to move pRow to a follow. Otherwise we return // false, indicating an error if ( !bSplitRowAllowed ) @@ -1104,9 +1103,9 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK pFoll = new SwTabFrame( *this ); // We give the follow table an initial width. - (pFoll->Frame().*aRectFnSet->fnAddWidth)( (Frame().*aRectFnSet->fnGetWidth)() ); - (pFoll->Prt().*aRectFnSet->fnAddWidth)( (Prt().*aRectFnSet->fnGetWidth)() ); - (pFoll->Frame().*aRectFnSet->fnSetLeft)( (Frame().*aRectFnSet->fnGetLeft)() ); + aRectFnSet.AddWidth(pFoll->Frame(), aRectFnSet.GetWidth(Frame())); + aRectFnSet.AddWidth(pFoll->Prt(), aRectFnSet.GetWidth(Prt())); + aRectFnSet.SetLeft(pFoll->Frame(), aRectFnSet.GetLeft(Frame())); // Insert the new follow table pFoll->InsertBehind( GetUpper(), this ); @@ -1190,7 +1189,7 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK while ( pRow ) { SwFrame* pNxt = pRow->GetNext(); - nRet += (pRow->Frame().*aRectFnSet->fnGetHeight)(); + nRet += aRectFnSet.GetHeight(pRow->Frame()); // The footnotes do not have to be moved, this is done in the // MoveFwd of the follow table!!! pRow->RemoveFromLayout(); @@ -1209,7 +1208,7 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK while ( pRow ) { SwFrame* pNxt = pRow->GetNext(); - nRet += (pRow->Frame().*aRectFnSet->fnGetHeight)(); + nRet += aRectFnSet.GetHeight(pRow->Frame()); // The footnotes have to be moved: lcl_MoveFootnotes( *this, *GetFollow(), *pRow ); @@ -1266,7 +1265,7 @@ bool SwTabFrame::Join() while ( pRow ) { pNxt = pRow->GetNext(); - nHeight += (pRow->Frame().*aRectFnSet->fnGetHeight)(); + nHeight += aRectFnSet.GetHeight(pRow->Frame()); pRow->RemoveFromLayout(); pRow->InvalidateAll_(); pRow->InsertBehind( this, pPrv ); @@ -1307,7 +1306,7 @@ void SwInvalidatePositions( SwFrame *pFrame, long nBottom ) pFrame = pFrame->GetNext(); } while ( pFrame && ( bAll || - (*aRectFnSet->fnYDiff)( (pFrame->Frame().*aRectFnSet->fnGetTop)(), nBottom ) < 0 ) ); + aRectFnSet.YDiff( aRectFnSet.GetTop(pFrame->Frame()), nBottom ) < 0 ) ); } void SwInvalidateAll( SwFrame *pFrame, long nBottom ) @@ -1342,7 +1341,7 @@ void SwInvalidateAll( SwFrame *pFrame, long nBottom ) pFrame = pFrame->GetNext(); } while ( pFrame && ( bAll || - (*aRectFnSet->fnYDiff)( (pFrame->Frame().*aRectFnSet->fnGetTop)(), nBottom ) < 0 ) ); + aRectFnSet.YDiff( aRectFnSet.GetTop(pFrame->Frame()), nBottom ) < 0 ) ); } // #i29550# @@ -1452,7 +1451,7 @@ bool SwContentFrame::CalcLowers( SwLayoutFrame* pLay, const SwLayoutFrame* pDont } pCnt->GetUpper()->Calc(pRenderContext); } - if( ! bAll && (*aRectFnSet->fnYDiff)((pCnt->Frame().*aRectFnSet->fnGetTop)(), nBottom) > 0 ) + if( ! bAll && aRectFnSet.YDiff(aRectFnSet.GetTop(pCnt->Frame()), nBottom) > 0 ) break; pCnt = pCnt->GetNextContentFrame(); } @@ -1500,7 +1499,7 @@ static bool lcl_InnerCalcLayout( SwFrame *pFrame, pFrame = pFrame->GetNext(); } while( pFrame && ( bAll || - (*aRectFnSet->fnYDiff)((pFrame->Frame().*aRectFnSet->fnGetTop)(), nBottom) < 0 ) + aRectFnSet.YDiff(aRectFnSet.GetTop(pFrame->Frame()), nBottom) < 0 ) && pFrame->GetUpper() == pOldUp ); return bRet; } @@ -1876,12 +1875,12 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) bSplit = false; } - Point aOldPos( (Frame().*aRectFnSet->fnGetPos)() ); + Point aOldPos( aRectFnSet.GetPos(Frame()) ); MakePos(); - if ( aOldPos != (Frame().*aRectFnSet->fnGetPos)() ) + if ( aOldPos != aRectFnSet.GetPos(Frame()) ) { - if ( aOldPos.Y() != (Frame().*aRectFnSet->fnGetTop)() ) + if ( aOldPos.Y() != aRectFnSet.GetTop(Frame()) ) { SwHTMLTableLayout *pLayout = GetTable()->GetHTMLTableLayout(); if( pLayout ) @@ -1915,20 +1914,20 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) { SwFrame* pFrame = GetFirstNonHeadlineRow(); if ( pFrame ) - n1StLineHeight = (pFrame->Frame().*aRectFnSet->fnGetHeight)(); + n1StLineHeight = aRectFnSet.GetHeight(pFrame->Frame()); } if ( !mbValidSize || !mbValidPrtArea ) { - const long nOldPrtWidth = (Prt().*aRectFnSet->fnGetWidth)(); - const long nOldFrameWidth = (Frame().*aRectFnSet->fnGetWidth)(); - const Point aOldPrtPos = (Prt().*aRectFnSet->fnGetPos)(); + const long nOldPrtWidth = aRectFnSet.GetWidth(Prt()); + const long nOldFrameWidth = aRectFnSet.GetWidth(Frame()); + const Point aOldPrtPos = aRectFnSet.GetPos(Prt()); Format( getRootFrame()->GetCurrShell()->GetOut(), pAttrs ); SwHTMLTableLayout *pLayout = GetTable()->GetHTMLTableLayout(); if ( pLayout && - ((Prt().*aRectFnSet->fnGetWidth)() != nOldPrtWidth || - (Frame().*aRectFnSet->fnGetWidth)() != nOldFrameWidth) ) + (aRectFnSet.GetWidth(Prt()) != nOldPrtWidth || + aRectFnSet.GetWidth(Frame()) != nOldFrameWidth) ) { pAccess.reset(); m_bCalcLowers |= pLayout->Resize( @@ -1936,7 +1935,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) pAccess = o3tl::make_unique<SwBorderAttrAccess>(SwFrame::GetCache(), this); pAttrs = pAccess->Get(); } - if ( aOldPrtPos != (Prt().*aRectFnSet->fnGetPos)() ) + if ( aOldPrtPos != aRectFnSet.GetPos(Prt()) ) aNotify.SetLowersComplete( false ); } @@ -1952,7 +1951,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) { // Only if the height of the first line got smaller. SwFrame *pFrame = GetFirstNonHeadlineRow(); - if( pFrame && n1StLineHeight >(pFrame->Frame().*aRectFnSet->fnGetHeight )() ) + if( pFrame && n1StLineHeight >aRectFnSet.GetHeight(pFrame->Frame()) ) { SwTabFrame *pMaster = FindMaster(); bool bDummy; @@ -1971,9 +1970,9 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) MoveLowerFootnotes( nullptr, pOldBoss, nullptr, true ); if ( bReformat || bKeep ) { - long nOldTop = (Frame().*aRectFnSet->fnGetTop)(); + long nOldTop = aRectFnSet.GetTop(Frame()); MakePos(); - if( nOldTop != (Frame().*aRectFnSet->fnGetTop)() ) + if( nOldTop != aRectFnSet.GetTop(Frame()) ) { SwHTMLTableLayout *pHTMLLayout = GetTable()->GetHTMLTableLayout(); @@ -2021,7 +2020,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) // table frame bottom to the bottom of the upper printing area. // Note: negative values denotes the situation that table frame doesn't fit in its upper. SwTwips nDistanceToUpperPrtBottom = - (Frame().*aRectFnSet->fnBottomDist)( (GetUpper()->*aRectFnSet->fnGetPrtBottom)()); + aRectFnSet.BottomDist(Frame(), aRectFnSet.GetPrtBottom(*GetUpper())); /// In online layout try to grow upper of table frame, if table frame doesn't fit in its upper. const SwViewShell *pSh = getRootFrame()->GetCurrShell(); @@ -2031,7 +2030,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) if ( GetUpper()->Grow( -nDistanceToUpperPrtBottom ) ) { // upper is grown --> recalculate <nDistanceToUpperPrtBottom> - nDistanceToUpperPrtBottom = (Frame().*aRectFnSet->fnBottomDist)( (GetUpper()->*aRectFnSet->fnGetPrtBottom)()); + nDistanceToUpperPrtBottom = aRectFnSet.BottomDist(Frame(), aRectFnSet.GetPrtBottom(*GetUpper())); } } @@ -2049,10 +2048,10 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) if ( GetFollow()->ShouldBwdMoved( GetUpper(), false, bDummy ) ) { SwFrame *pTmp = GetUpper(); - SwTwips nDeadLine = (pTmp->*aRectFnSet->fnGetPrtBottom)(); + SwTwips nDeadLine = aRectFnSet.GetPrtBottom(*pTmp); if ( bBrowseMode ) nDeadLine += pTmp->Grow( LONG_MAX, true ); - if( (Frame().*aRectFnSet->fnBottomDist)( nDeadLine ) > 0 ) + if( aRectFnSet.BottomDist( Frame(), nDeadLine ) > 0 ) { // First, we remove an existing follow flow line. if ( HasFollowFlowLine() ) @@ -2088,7 +2087,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) continue; } - const SwTwips nOld = (Frame().*aRectFnSet->fnGetHeight)(); + const SwTwips nOld = aRectFnSet.GetHeight(Frame()); long nRowsToMove = lcl_GetMaximumLayoutRowSpan( *pRow ); SwFrame* pRowToMove = pRow; @@ -2121,7 +2120,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) pRowToMove = pNextRow; } - if ( nOld != (Frame().*aRectFnSet->fnGetHeight)() ) + if ( nOld != aRectFnSet.GetHeight(Frame()) ) lcl_RecalcTable( *this, static_cast<SwLayoutFrame*>(pRow), aNotify ); continue; @@ -2259,7 +2258,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) // all kinds of unexpected things could happen. if ( !bEmulateTableKeepFwdMoveAllowed || ( IsInSct() && (FindSctFrame())->Lower()->IsColumnFrame() && - 0 == (GetUpper()->Frame().*aRectFnSet->fnGetHeight)() + 0 == aRectFnSet.GetHeight(GetUpper()->Frame()) ) ) { bTryToSplit = false; @@ -2269,9 +2268,9 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) // 2. Try: bTryToSplit = false => Split the table between the rows. if ( pFirstNonHeadlineRow->GetNext() || bTryToSplit ) { - SwTwips nDeadLine = (GetUpper()->*aRectFnSet->fnGetPrtBottom)(); + SwTwips nDeadLine = aRectFnSet.GetPrtBottom(*GetUpper()); if( IsInSct() || GetUpper()->IsInTab() ) // TABLE IN TABLE) - nDeadLine = (*aRectFnSet->fnYInc)( nDeadLine, + nDeadLine = aRectFnSet.YInc( nDeadLine, GetUpper()->Grow( LONG_MAX, true ) ); { @@ -2285,7 +2284,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) // One more check if its really necessary to split the table. // 1. The table either has to exceed the deadline or // 2. We explicitly want to cut off the last row. - if( (Frame().*aRectFnSet->fnBottomDist)( nDeadLine ) > 0 && !bLastRowHasToMoveToFollow ) + if( aRectFnSet.BottomDist( Frame(), nDeadLine ) > 0 && !bLastRowHasToMoveToFollow ) { continue; } @@ -2321,15 +2320,15 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) if ( !bTryToSplit ) ++nMinNumOfLines; - const SwTwips nBreakLine = (*aRectFnSet->fnYInc)( - (Frame().*aRectFnSet->fnGetTop)(), - (this->*aRectFnSet->fnGetTopMargin)() + + const SwTwips nBreakLine = aRectFnSet.YInc( + aRectFnSet.GetTop(Frame()), + aRectFnSet.GetTopMargin(*this) + lcl_GetHeightOfRows( GetLower(), nMinNumOfLines ) ); // Some more checks if we want to call the split algorithm or not: // The repeating lines / keeping lines still fit into the upper or // if we do not have an (in)direct Prev, we split anyway. - if( (*aRectFnSet->fnYDiff)(nDeadLine, nBreakLine) >=0 + if( aRectFnSet.YDiff(nDeadLine, nBreakLine) >=0 || !pIndPrev || !bEmulateTableKeepFwdMoveAllowed ) { aNotify.SetLowersComplete( false ); @@ -2415,7 +2414,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) const bool bOldJoinLock = GetFollow()->IsJoinLocked(); GetFollow()->LockJoin(); ::lcl_RecalcRow( static_cast<SwRowFrame&>(*GetFollow()->Lower()), - (GetFollow()->GetUpper()->Frame().*fnRectX->fnGetBottom)() ); + fnRectX.GetBottom(GetFollow()->GetUpper()->Frame()) ); // #i43913# // #i63632# Do not unlock the // follow if it wasn't locked before. @@ -2518,7 +2517,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) // and can cause layout loops, if table doesn't fit and isn't // allowed to split. SwTwips nDistToUpperPrtBottom = - (Frame().*aRectFnSet->fnBottomDist)( (GetUpper()->*aRectFnSet->fnGetPrtBottom)()); + aRectFnSet.BottomDist( Frame(), aRectFnSet.GetPrtBottom(*GetUpper())); if ( nDistToUpperPrtBottom >= 0 || bTryToSplit ) { lcl_RecalcTable( *this, nullptr, aNotify ); @@ -2571,12 +2570,12 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper, { SwRectFnSet aRectFnSet(this); const bool bConsiderWrapOnObjPos = rIDSA.get(DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION); - long nPrtPos = (Frame().*aRectFnSet->fnGetTop)(); - nPrtPos = (*aRectFnSet->fnYInc)( nPrtPos, rUpper ); + long nPrtPos = aRectFnSet.GetTop(Frame()); + nPrtPos = aRectFnSet.YInc( nPrtPos, rUpper ); SwRect aRect( Frame() ); - long nYDiff = (*aRectFnSet->fnYDiff)( (Prt().*aRectFnSet->fnGetTop)(), rUpper ); + long nYDiff = aRectFnSet.YDiff( aRectFnSet.GetTop(Prt()), rUpper ); if( nYDiff > 0 ) - (aRect.*aRectFnSet->fnAddBottom)( -nYDiff ); + aRectFnSet.AddBottom( aRect, -nYDiff ); for ( size_t i = 0; i < pPage->GetSortedObjs()->size(); ++i ) { SwAnchoredObject* pAnchoredObj = (*pPage->GetSortedObjs())[i]; @@ -2650,8 +2649,8 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper, const SwFormatHoriOrient &rHori= pFly->GetFormat()->GetHoriOrient(); if ( SURROUND_NONE == rSur.GetSurround() ) { - long nBottom = (aFlyRect.*aRectFnSet->fnGetBottom)(); - if( (*aRectFnSet->fnYDiff)( nPrtPos, nBottom ) < 0 ) + long nBottom = aRectFnSet.GetBottom(aFlyRect); + if( aRectFnSet.YDiff( nPrtPos, nBottom ) < 0 ) nPrtPos = nBottom; bInvalidatePrtArea = true; } @@ -2659,9 +2658,9 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper, SURROUND_PARALLEL == rSur.GetSurround())&& text::HoriOrientation::LEFT == rHori.GetHoriOrient() ) { - const long nWidth = (*aRectFnSet->fnXDiff)( - (aFlyRect.*aRectFnSet->fnGetRight)(), - (pFly->GetAnchorFrame()->Frame().*aRectFnSet->fnGetLeft)() ); + const long nWidth = aRectFnSet.XDiff( + aRectFnSet.GetRight(aFlyRect), + aRectFnSet.GetLeft(pFly->GetAnchorFrame()->Frame()) ); rLeftOffset = std::max( rLeftOffset, nWidth ); bInvalidatePrtArea = true; } @@ -2669,16 +2668,16 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper, SURROUND_PARALLEL == rSur.GetSurround())&& text::HoriOrientation::RIGHT == rHori.GetHoriOrient() ) { - const long nWidth = (*aRectFnSet->fnXDiff)( - (pFly->GetAnchorFrame()->Frame().*aRectFnSet->fnGetRight)(), - (aFlyRect.*aRectFnSet->fnGetLeft)() ); + const long nWidth = aRectFnSet.XDiff( + aRectFnSet.GetRight(pFly->GetAnchorFrame()->Frame()), + aRectFnSet.GetLeft(aFlyRect) ); rRightOffset = std::max( rRightOffset, nWidth ); bInvalidatePrtArea = true; } } } } - rUpper = (*aRectFnSet->fnYDiff)( nPrtPos, (Frame().*aRectFnSet->fnGetTop)() ); + rUpper = aRectFnSet.YDiff( nPrtPos, aRectFnSet.GetTop(Frame()) ); } return bInvalidatePrtArea; @@ -2693,10 +2692,10 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA SwRectFnSet aRectFnSet(this); if ( !mbValidSize ) { - long nDiff = (GetUpper()->Prt().*aRectFnSet->fnGetWidth)() - - (Frame().*aRectFnSet->fnGetWidth)(); + long nDiff = aRectFnSet.GetWidth(GetUpper()->Prt()) - + aRectFnSet.GetWidth(Frame()); if( nDiff ) - (maFrame.*aRectFnSet->fnAddRight)( nDiff ); + aRectFnSet.AddRight( maFrame, nDiff ); } //VarSize is always the height. @@ -2731,8 +2730,8 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA //If the adjustment is 0, the borders are set according to the border //attributes. - const SwTwips nOldHeight = (Prt().*aRectFnSet->fnGetHeight)(); - const SwTwips nMax = (maFrame.*aRectFnSet->fnGetWidth)(); + const SwTwips nOldHeight = aRectFnSet.GetHeight(Prt()); + const SwTwips nMax = aRectFnSet.GetWidth(maFrame); // OD 14.03.2003 #i9040# - adjust variable names. const SwTwips nLeftLine = pAttrs->CalcLeftLine(); @@ -2896,11 +2895,11 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA { nLower += pAttrs->GetULSpace().GetLower(); } - (this->*aRectFnSet->fnSetYMargins)( nUpper, nLower ); + aRectFnSet.SetYMargins( *this, nUpper, nLower ); if( (nMax - MINLAY) < (nLeftSpacing + nRightSpacing) ) - (this->*aRectFnSet->fnSetXMargins)( 0, 0 ); + aRectFnSet.SetXMargins( *this, 0, 0 ); else - (this->*aRectFnSet->fnSetXMargins)( nLeftSpacing, nRightSpacing ); + aRectFnSet.SetXMargins( *this, nLeftSpacing, nRightSpacing ); SwViewShell *pSh = getRootFrame()->GetCurrShell(); if ( bCheckBrowseWidth && @@ -2917,7 +2916,7 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA Prt().Width( std::min( nWidth, Prt().Width() ) ); } - if ( nOldHeight != (Prt().*aRectFnSet->fnGetHeight)() ) + if ( nOldHeight != aRectFnSet.GetHeight(Prt()) ) mbValidSize = false; } @@ -2930,13 +2929,13 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA SwFrame *pFrame = m_pLower; while ( pFrame ) { - nRemaining += (pFrame->Frame().*aRectFnSet->fnGetHeight)(); + nRemaining += aRectFnSet.GetHeight(pFrame->Frame()); pFrame = pFrame->GetNext(); } //And now add the borders nRemaining += nUpper + nLower; - nDiff = (Frame().*aRectFnSet->fnGetHeight)() - nRemaining; + nDiff = aRectFnSet.GetHeight(Frame()) - nRemaining; if ( nDiff > 0 ) Shrink( nDiff ); else if ( nDiff < 0 ) @@ -2947,7 +2946,7 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA SwTwips SwTabFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) { SwRectFnSet aRectFnSet(this); - SwTwips nHeight =(Frame().*aRectFnSet->fnGetHeight)(); + SwTwips nHeight = aRectFnSet.GetHeight(Frame()); if( nHeight > 0 && nDist > ( LONG_MAX - nHeight ) ) nDist = LONG_MAX - nHeight; @@ -2960,11 +2959,11 @@ SwTwips SwTabFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) //The upper only grows as far as needed. nReal provides the distance //which is already available. - SwTwips nReal = (GetUpper()->Prt().*aRectFnSet->fnGetHeight)(); + SwTwips nReal = aRectFnSet.GetHeight(GetUpper()->Prt()); SwFrame *pFrame = GetUpper()->Lower(); while ( pFrame && GetFollow() != pFrame ) { - nReal -= (pFrame->Frame().*aRectFnSet->fnGetHeight)(); + nReal -= aRectFnSet.GetHeight(pFrame->Frame()); pFrame = pFrame->GetNext(); } @@ -2981,7 +2980,7 @@ SwTwips SwTabFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) if ( !bTst ) { - (Frame().*aRectFnSet->fnAddBottom)( nDist ); + aRectFnSet.AddBottom( Frame(), nDist ); SwRootFrame *pRootFrame = getRootFrame(); if( pRootFrame && pRootFrame->IsAnyShellAccessible() && @@ -3302,9 +3301,9 @@ bool SwTabFrame::ShouldBwdMoved( SwLayoutFrame *pNewUpper, bool, bool &rReformat if ( !SwFlowFrame::IsMoveBwdJump() ) { - long nOldWidth = (GetUpper()->Prt().*aRectFnSet->fnGetWidth)(); + long nOldWidth = aRectFnSet.GetWidth(GetUpper()->Prt()); SwRectFnSet fnRectX(pNewUpper); - long nNewWidth = (pNewUpper->Prt().*fnRectX->fnGetWidth)(); + long nNewWidth = fnRectX.GetWidth(pNewUpper->Prt()); if( std::abs( nNewWidth - nOldWidth ) < 2 ) { bMoveAnyway = BwdMoveNecessary( pOldPage, Frame() ) > 1; @@ -3315,8 +3314,7 @@ bool SwTabFrame::ShouldBwdMoved( SwLayoutFrame *pNewUpper, bool, bool &rReformat const SwFrame *pPrevFrame = pNewUpper->Lower(); while ( pPrevFrame && pPrevFrame != this ) { - (aRect.*fnRectX->fnSetTop)( (pPrevFrame->Frame().*fnRectX-> - fnGetBottom)() ); + fnRectX.SetTop( aRect, fnRectX.GetBottom(pPrevFrame->Frame()) ); pPrevFrame = pPrevFrame->GetNext(); } bMoveAnyway = BwdMoveNecessary( pNewPage, aRect) > 1; @@ -3328,8 +3326,8 @@ bool SwTabFrame::ShouldBwdMoved( SwLayoutFrame *pNewUpper, bool, bool &rReformat // results and we really do not want to MoveBackward into a // 0 height frame. If nTmpSpace is already <= 0, we take this // value: - const SwTwips nTmpSpace = (aRect.*fnRectX->fnGetHeight)(); - if ( (pNewUpper->Prt().*fnRectX->fnGetHeight)() > 0 || nTmpSpace <= 0 ) + const SwTwips nTmpSpace = fnRectX.GetHeight(aRect); + if ( fnRectX.GetHeight(pNewUpper->Prt()) > 0 || nTmpSpace <= 0 ) nSpace = nTmpSpace; const SwViewShell *pSh = getRootFrame()->GetCurrShell(); @@ -3447,7 +3445,7 @@ void SwTabFrame::Cut() pSct->InvalidateSize_(); } } - else if( (Frame().*aRectFnSet->fnGetHeight)() ) + else if( aRectFnSet.GetHeight(Frame()) ) { // OD 26.08.2003 #i18103# - *no* 'ColUnlock' of section - // undo changes of fix for #104992# @@ -3484,10 +3482,10 @@ void SwTabFrame::Paste( SwFrame* pParent, SwFrame* pSibling ) } SwRectFnSet aRectFnSet(this); - if( (Frame().*aRectFnSet->fnGetHeight)() ) - pParent->Grow( (Frame().*aRectFnSet->fnGetHeight)() ); + if( aRectFnSet.GetHeight(Frame()) ) + pParent->Grow( aRectFnSet.GetHeight(Frame()) ); - if( (Frame().*aRectFnSet->fnGetWidth)() != (pParent->Prt().*aRectFnSet->fnGetWidth)() ) + if( aRectFnSet.GetWidth(Frame()) != aRectFnSet.GetWidth(pParent->Prt()) ) Prepare( PREP_FIXSIZE_CHG ); if ( GetPrev() ) { @@ -3681,18 +3679,18 @@ long CalcHeightWithFlys( const SwFrame *pFrame ) if( !rSz.GetHeightPercent() ) { const SwTwips nDistOfFlyBottomToAnchorTop = - (pAnchoredObj->GetObjRect().*aRectFnSet->fnGetHeight)() + - ( aRectFnSet.bVert ? + aRectFnSet.GetHeight(pAnchoredObj->GetObjRect()) + + ( aRectFnSet.IsVert() ? pAnchoredObj->GetCurrRelPos().X() : pAnchoredObj->GetCurrRelPos().Y() ); const SwTwips nFrameDiff = - (*aRectFnSet->fnYDiff)( - (pTmp->Frame().*aRectFnSet->fnGetTop)(), - (pFrame->Frame().*aRectFnSet->fnGetTop)() ); + aRectFnSet.YDiff( + aRectFnSet.GetTop(pTmp->Frame()), + aRectFnSet.GetTop(pFrame->Frame()) ); nHeight = std::max( nHeight, nDistOfFlyBottomToAnchorTop + nFrameDiff - - (pFrame->Frame().*aRectFnSet->fnGetHeight)() ); + aRectFnSet.GetHeight(pFrame->Frame()) ); // #i56115# The first height calculation // gives wrong results if pFrame->Prt().Y() > 0. We do @@ -3701,9 +3699,9 @@ long CalcHeightWithFlys( const SwFrame *pFrame ) // I do not want to remove the first calculation because // if clipping has been applied, using the GetCurrRelPos // might be the better option to calculate nHeight. - const SwTwips nDistOfFlyBottomToAnchorTop2 = (*aRectFnSet->fnYDiff)( - (pAnchoredObj->GetObjRect().*aRectFnSet->fnGetBottom)(), - (pFrame->Frame().*aRectFnSet->fnGetBottom)() ); + const SwTwips nDistOfFlyBottomToAnchorTop2 = aRectFnSet.YDiff( + aRectFnSet.GetBottom(pAnchoredObj->GetObjRect()), + aRectFnSet.GetBottom(pFrame->Frame()) ); nHeight = std::max( nHeight, nDistOfFlyBottomToAnchorTop2 ); } @@ -3774,7 +3772,7 @@ static SwTwips lcl_CalcMinCellHeight( const SwLayoutFrame *_pCell, } else { - long nLowHeight = (pLow->Frame().*aRectFnSet->fnGetHeight)(); + long nLowHeight = aRectFnSet.GetHeight(pLow->Frame()); nHeight += nLowHeight; // #i26945# if ( _bConsiderObjs ) @@ -3847,14 +3845,14 @@ static SwTwips lcl_CalcMinRowHeight( const SwRowFrame* _pRow, const SwFrame* pMasterRow = rMaster.GetUpper(); while ( pMasterRow && pMasterRow != _pRow ) { - nTmp -= (pMasterRow->Frame().*aRectFnSet->fnGetHeight)(); + nTmp -= aRectFnSet.GetHeight(pMasterRow->Frame()); pMasterRow = pMasterRow->GetNext(); } } // <-- NEW TABLES // Do not consider rotated cells: - if ( pLow->IsVertical() == aRectFnSet.bVert && nTmp > nHeight ) + if ( pLow->IsVertical() == aRectFnSet.IsVert() && nTmp > nHeight ) nHeight = nTmp; pLow = static_cast<const SwCellFrame*>(pLow->GetNext()); @@ -4085,7 +4083,7 @@ void SwRowFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA OSL_ENSURE( rFrameSize.GetSize().Height() > 0, "Hat ihn" ); } #endif - const SwTwips nDiff = (Frame().*aRectFnSet->fnGetHeight)() - + const SwTwips nDiff = aRectFnSet.GetHeight(Frame()) - ( HasFixSize() && !IsRowSpanLine() ? pAttrs->GetSize().Height() // #i26945# @@ -4106,10 +4104,10 @@ void SwRowFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA if ( !GetNext() ) { //The last fills the remaining space in the upper. - SwTwips nDiff = (GetUpper()->Prt().*aRectFnSet->fnGetHeight)(); + SwTwips nDiff = aRectFnSet.GetHeight(GetUpper()->Prt()); SwFrame *pSibling = GetUpper()->Lower(); do - { nDiff -= (pSibling->Frame().*aRectFnSet->fnGetHeight)(); + { nDiff -= aRectFnSet.GetHeight(pSibling->Frame()); pSibling = pSibling->GetNext(); } while ( pSibling ); if ( nDiff > 0 ) @@ -4146,10 +4144,10 @@ void SwRowFrame::AdjustCells( const SwTwips nHeight, const bool bHeight ) if ( pCellFrame->GetTabBox()->getRowSpan() < 1 ) { // Set height of current (covered) cell to new line height. - const long nDiff = nHeight - (pCellFrame->Frame().*aRectFnSet->fnGetHeight)(); + const long nDiff = nHeight - aRectFnSet.GetHeight(pCellFrame->Frame()); if ( nDiff ) { - (pCellFrame->Frame().*aRectFnSet->fnAddBottom)( nDiff ); + aRectFnSet.AddBottom( pCellFrame->Frame(), nDiff ); pCellFrame->InvalidatePrt_(); } } @@ -4178,7 +4176,7 @@ void SwRowFrame::AdjustCells( const SwTwips nHeight, const bool bHeight ) // Use new height for the current row: nSumRowHeight += pToAdjustRow == this ? nHeight : - (pToAdjustRow->Frame().*aRectFnSet->fnGetHeight)(); + aRectFnSet.GetHeight(pToAdjustRow->Frame()); if ( nRowSpan-- == 1 ) break; @@ -4189,11 +4187,11 @@ void SwRowFrame::AdjustCells( const SwTwips nHeight, const bool bHeight ) if ( pToAdjustRow && pToAdjustRow != this ) pToAdjustRow->InvalidateSize_(); - const long nDiff = nSumRowHeight - (pToAdjust->Frame().*aRectFnSet->fnGetHeight)(); + const long nDiff = nSumRowHeight - aRectFnSet.GetHeight(pToAdjust->Frame()); if ( nDiff ) { aOldFrame = pToAdjust->Frame(); - (pToAdjust->Frame().*aRectFnSet->fnAddBottom)( nDiff ); + aRectFnSet.AddBottom( pToAdjust->Frame(), nDiff ); pNotify = pToAdjust; } @@ -4253,13 +4251,13 @@ SwTwips SwRowFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) // There may still be some space left in my direct upper: const SwTwips nAdditionalSpace = - (Frame().*aRectFnSet->fnBottomDist)( (GetUpper()->GetUpper()->*aRectFnSet->fnGetPrtBottom)() ); + aRectFnSet.BottomDist( Frame(), aRectFnSet.GetPrtBottom(*GetUpper()->GetUpper()) ); if ( bRestrictTableGrowth && nAdditionalSpace > 0 ) { nReal = std::min( nAdditionalSpace, nDist ); nDist -= nReal; if ( !bTst ) - (Frame().*aRectFnSet->fnAddBottom)( nReal ); + aRectFnSet.AddBottom( Frame(), nReal ); } } @@ -4285,7 +4283,7 @@ SwTwips SwRowFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) if ( !bTst ) { SwRectFnSet fnRectX(this); - AdjustCells( (Prt().*fnRectX->fnGetHeight)() + nReal, true ); + AdjustCells( fnRectX.GetHeight(Prt()) + nReal, true ); if ( nReal ) SetCompletePaint(); } @@ -4298,7 +4296,7 @@ SwTwips SwRowFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) SwRectFnSet aRectFnSet(this); if( HasFixSize() ) { - AdjustCells( (Prt().*aRectFnSet->fnGetHeight)(), true ); + AdjustCells( aRectFnSet.GetHeight(Prt()), true ); return 0L; } @@ -4319,7 +4317,7 @@ SwTwips SwRowFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) // Only necessary to calculate minimal row height if height // of pRow is at least nMinHeight. Otherwise nMinHeight is the // minimum height. - if( nMinHeight < (Frame().*aRectFnSet->fnGetHeight)() ) + if( nMinHeight < aRectFnSet.GetHeight(Frame()) ) { // #i26945# OSL_ENSURE( FindTabFrame(), "<SwRowFrame::ShrinkFrame(..)> - no table frame -> crash." ); @@ -4327,8 +4325,8 @@ SwTwips SwRowFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) nMinHeight = lcl_CalcMinRowHeight( this, bConsiderObjs ); } - if ( ((Frame().*aRectFnSet->fnGetHeight)() - nRealDist) < nMinHeight ) - nRealDist = (Frame().*aRectFnSet->fnGetHeight)() - nMinHeight; + if ( (aRectFnSet.GetHeight(Frame()) - nRealDist) < nMinHeight ) + nRealDist = aRectFnSet.GetHeight(Frame()) - nMinHeight; } if ( nRealDist < 0 ) nRealDist = 0; @@ -4338,10 +4336,10 @@ SwTwips SwRowFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) { if ( !bTst ) { - SwTwips nHeight = (Frame().*aRectFnSet->fnGetHeight)(); - (Frame().*aRectFnSet->fnSetHeight)( nHeight - nReal ); + SwTwips nHeight = aRectFnSet.GetHeight(Frame()); + aRectFnSet.SetHeight( Frame(), nHeight - nReal ); - if( IsVertical() && !IsVertLR() && !aRectFnSet.bRev ) + if( IsVertical() && !IsVertLR() && !aRectFnSet.IsRev() ) Frame().Pos().X() += nReal; } @@ -4354,10 +4352,10 @@ SwTwips SwRowFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) if ( !bTst ) { nReal -= nTmp; - SwTwips nHeight = (Frame().*aRectFnSet->fnGetHeight)(); - (Frame().*aRectFnSet->fnSetHeight)( nHeight + nReal ); + SwTwips nHeight = aRectFnSet.GetHeight(Frame()); + aRectFnSet.SetHeight( Frame(), nHeight + nReal ); - if( IsVertical() && !IsVertLR() && !aRectFnSet.bRev ) + if( IsVertical() && !IsVertLR() && !aRectFnSet.IsRev() ) Frame().Pos().X() -= nReal; } nReal = nTmp; @@ -4384,7 +4382,7 @@ SwTwips SwRowFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) pMasterTab->InvalidatePos(); } } - AdjustCells( (Prt().*aRectFnSet->fnGetHeight)() - nReal, true ); + AdjustCells( aRectFnSet.GetHeight(Prt()) - nReal, true ); } return nReal; } @@ -4484,14 +4482,14 @@ static bool lcl_ArrangeLowers( SwLayoutFrame *pLay, long lYStart, bool bInva ) SwRectFnSet aRectFnSet(pLay); while ( pFrame ) { - long nFrameTop = (pFrame->Frame().*aRectFnSet->fnGetTop)(); + long nFrameTop = aRectFnSet.GetTop(pFrame->Frame()); if( nFrameTop != lYStart ) { bRet = true; - const long lDiff = (*aRectFnSet->fnYDiff)( lYStart, nFrameTop ); + const long lDiff = aRectFnSet.YDiff( lYStart, nFrameTop ); const long lDiffX = lYStart - nFrameTop; - (pFrame->Frame().*aRectFnSet->fnSubTop)( -lDiff ); - (pFrame->Frame().*aRectFnSet->fnAddBottom)( lDiff ); + aRectFnSet.SubTop( pFrame->Frame(), -lDiff ); + aRectFnSet.AddBottom( pFrame->Frame(), lDiff ); pFrame->SetCompletePaint(); if ( !pFrame->GetNext() ) pFrame->SetRetouche(); @@ -4499,7 +4497,7 @@ static bool lcl_ArrangeLowers( SwLayoutFrame *pLay, long lYStart, bool bInva ) pFrame->Prepare( PREP_POS_CHGD ); if ( pFrame->IsLayoutFrame() && static_cast<SwLayoutFrame*>(pFrame)->Lower() ) lcl_ArrangeLowers( static_cast<SwLayoutFrame*>(pFrame), - (static_cast<SwLayoutFrame*>(pFrame)->Lower()->Frame().*aRectFnSet->fnGetTop)() + aRectFnSet.GetTop(static_cast<SwLayoutFrame*>(pFrame)->Lower()->Frame()) + lDiffX, bInva ); if ( pFrame->GetDrawObjs() ) { @@ -4546,8 +4544,8 @@ static bool lcl_ArrangeLowers( SwLayoutFrame *pLay, long lYStart, bool bInva ) !pFly->ConsiderObjWrapInfluenceOnObjPos(); if ( bDirectMove ) { - (pFly->Frame().*aRectFnSet->fnSubTop)( -lDiff ); - (pFly->Frame().*aRectFnSet->fnAddBottom)( lDiff ); + aRectFnSet.SubTop( pFly->Frame(), -lDiff ); + aRectFnSet.AddBottom( pFly->Frame(), lDiff ); pFly->GetVirtDrawObj()->SetRectsDirty(); // --> OD 2004-08-17 - also notify view of <SdrObject> // instance, which represents the Writer fly frame in @@ -4607,7 +4605,7 @@ static bool lcl_ArrangeLowers( SwLayoutFrame *pLay, long lYStart, bool bInva ) // moved if ( bDirectMove && ::lcl_ArrangeLowers( pFly, - (pFly->*aRectFnSet->fnGetPrtTop)(), + aRectFnSet.GetPrtTop(*pFly), bInva ) ) { pFly->SetCompletePaint(); @@ -4648,7 +4646,7 @@ static bool lcl_ArrangeLowers( SwLayoutFrame *pLay, long lYStart, bool bInva ) if ( bDirectMove ) { SwObjPositioningInProgress aObjPosInProgress( *pAnchoredObj ); - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) { pAnchoredObj->DrawObj()->Move( Size( lDiff, 0 ) ); } @@ -4670,8 +4668,8 @@ static bool lcl_ArrangeLowers( SwLayoutFrame *pLay, long lYStart, bool bInva ) } // Columns and cells are ordered horizontal, not vertical if( !pFrame->IsColumnFrame() && !pFrame->IsCellFrame() ) - lYStart = (*aRectFnSet->fnYInc)( lYStart, - (pFrame->Frame().*aRectFnSet->fnGetHeight)() ); + lYStart = aRectFnSet.YInc( lYStart, + aRectFnSet.GetHeight(pFrame->Frame()) ); // Nowadays, the content inside a cell can flow into the follow table. // Thus, the cell may only grow up to the end of the environment. @@ -4679,7 +4677,7 @@ static bool lcl_ArrangeLowers( SwLayoutFrame *pLay, long lYStart, bool bInva ) // Therefore we have to trigger a formatting for the frames, which do // not fit into the cell anymore: SwTwips nDistanceToUpperPrtBottom = - (pFrame->Frame().*aRectFnSet->fnBottomDist)( (pLay->*aRectFnSet->fnGetPrtBottom)()); + aRectFnSet.BottomDist( pFrame->Frame(), aRectFnSet.GetPrtBottom(*pLay) ); // #i56146# - Revise fix of issue #i26945# // do *not* consider content inside fly frames, if it's an undersized paragraph. // #i26945# - consider content inside fly frames @@ -4728,8 +4726,8 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder nTopSpace = pAttrs->CalcTop(); nBottomSpace = pAttrs->CalcBottom(); } - (this->*aRectFnSet->fnSetXMargins)( nLeftSpace, nRightSpace ); - (this->*aRectFnSet->fnSetYMargins)( nTopSpace, nBottomSpace ); + aRectFnSet.SetXMargins( *this, nLeftSpace, nRightSpace ); + aRectFnSet.SetYMargins( *this, nTopSpace, nBottomSpace ); } } // #i26945# @@ -4758,7 +4756,7 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder OSL_ENSURE( nWidth <= nWish, "Width of cell larger than table." ); OSL_ENSURE( nWidth > 0, "Box without width" ); - const long nPrtWidth = (pTab->Prt().*aRectFnSet->fnGetWidth)(); + const long nPrtWidth = aRectFnSet.GetWidth(pTab->Prt()); if ( nWish != nPrtWidth ) { // Avoid rounding problems, at least for the new table model @@ -4789,7 +4787,7 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder SwTwips nSumFrameWidths = 0; while ( pTmpCell != this ) { - nSumFrameWidths += (pTmpCell->Frame().*aRectFnSet->fnGetWidth)(); + nSumFrameWidths += aRectFnSet.GetWidth(pTmpCell->Frame()); pTmpCell = pTmpCell->GetNext(); } @@ -4809,23 +4807,23 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder else { OSL_ENSURE( pAttrs->GetSize().Width() > 0, "Box without width" ); - nWidth = (GetUpper()->Prt().*aRectFnSet->fnGetWidth)(); + nWidth = aRectFnSet.GetWidth(GetUpper()->Prt()); SwFrame *pPre = GetUpper()->Lower(); while ( pPre != this ) { - nWidth -= (pPre->Frame().*aRectFnSet->fnGetWidth)(); + nWidth -= aRectFnSet.GetWidth(pPre->Frame()); pPre = pPre->GetNext(); } } - const long nDiff = nWidth - (Frame().*aRectFnSet->fnGetWidth)(); + const long nDiff = nWidth - aRectFnSet.GetWidth(Frame()); if( IsNeighbourFrame() && IsRightToLeft() ) - (Frame().*aRectFnSet->fnSubLeft)( nDiff ); + aRectFnSet.SubLeft( Frame(), nDiff ); else - (Frame().*aRectFnSet->fnAddRight)( nDiff ); - (Prt().*aRectFnSet->fnAddRight)( nDiff ); + aRectFnSet.AddRight( Frame(), nDiff ); + aRectFnSet.AddRight( Prt(), nDiff ); //Adjust the height, it's defined through the content and the border. - const long nDiffHeight = nRemaining - (Frame().*aRectFnSet->fnGetHeight)(); + const long nDiffHeight = nRemaining - aRectFnSet.GetHeight(Frame()); if ( nDiffHeight ) { if ( nDiffHeight > 0 ) @@ -4912,11 +4910,11 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder } } - long nPrtHeight = (Prt().*aRectFnSet->fnGetHeight)(); + long nPrtHeight = aRectFnSet.GetHeight(Prt()); if( ( bVertDir && ( nRemaining -= lcl_CalcTopAndBottomMargin( *this, *pAttrs ) ) < nPrtHeight ) || - (Lower()->Frame().*aRectFnSet->fnGetTop)() != (this->*aRectFnSet->fnGetPrtTop)() ) + aRectFnSet.GetTop(Lower()->Frame()) != aRectFnSet.GetPrtTop(*this) ) { - long nDiff = (Prt().*aRectFnSet->fnGetHeight)() - nRemaining; + long nDiff = aRectFnSet.GetHeight(Prt()) - nRemaining; if ( nDiff >= 0 ) { long lTopOfst = 0; @@ -4929,8 +4927,8 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder default: break; }; } - long nTmp = (*aRectFnSet->fnYInc)( - (this->*aRectFnSet->fnGetPrtTop)(), lTopOfst ); + long nTmp = aRectFnSet.YInc( + aRectFnSet.GetPrtTop(*this), lTopOfst ); if ( lcl_ArrangeLowers( this, nTmp, !bVertDir ) ) SetCompletePaint(); } @@ -4941,7 +4939,7 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder //Was an old alignment taken into account? if ( Lower()->IsContentFrame() ) { - const long lYStart = (this->*aRectFnSet->fnGetPrtTop)(); + const long lYStart = aRectFnSet.GetPrtTop(*this); lcl_ArrangeLowers( this, lYStart, true ); } } @@ -4965,7 +4963,7 @@ void SwCellFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) Lower() && Lower()->IsContentFrame() ) { SwRectFnSet aRectFnSet(this); - const long lYStart = (this->*aRectFnSet->fnGetPrtTop)(); + const long lYStart = aRectFnSet.GetPrtTop(*this); bInva = lcl_ArrangeLowers( this, lYStart, false ); } if ( bInva ) @@ -5187,12 +5185,12 @@ static SwTwips lcl_CalcHeightOfFirstContentLine( const SwRowFrame& rSourceLine ) // If we are in a split row, there may be some space // left in the cell frame of the master row. // We look for the minimum of all first line heights; - SwTwips nReal = (pPrevCell->Prt().*aRectFnSet->fnGetHeight)(); + SwTwips nReal = aRectFnSet.GetHeight(pPrevCell->Prt()); const SwFrame* pFrame = pPrevCell->Lower(); const SwFrame* pLast = pFrame; while ( pFrame ) { - nReal -= (pFrame->Frame().*aRectFnSet->fnGetHeight)(); + nReal -= aRectFnSet.GetHeight(pFrame->Frame()); pLast = pFrame; pFrame = pFrame->GetNext(); } @@ -5278,7 +5276,7 @@ SwTwips SwTabFrame::CalcHeightOfFirstContentLine() const if ( bDontSplit ) { // Table is not allowed to split: Take the whole height, that's all - return (Frame().*aRectFnSet->fnGetHeight)(); + return aRectFnSet.GetHeight(Frame()); } SwTwips nTmpHeight = 0; @@ -5329,7 +5327,7 @@ SwTwips SwTabFrame::CalcHeightOfFirstContentLine() const if ( pFirstRow ) { const bool bSplittable = pFirstRow->IsRowSplitAllowed(); - const SwTwips nFirstLineHeight = (pFirstRow->Frame().*aRectFnSet->fnGetHeight)(); + const SwTwips nFirstLineHeight = aRectFnSet.GetHeight(pFirstRow->Frame()); if ( !bSplittable ) { diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 7cc66a0d5bca..48241a98c41b 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -298,20 +298,20 @@ bool SwPageFrame::GetCursorOfst( SwPosition *pPos, Point &rPoint, SwRect nextTextRect; pTextFrame->GetCharRect(nextTextRect, nextTextPos); SwRectFnSet aRectFnSet(pTextFrame); - if ((aTextRect.*aRectFnSet->fnGetTop)() == - (nextTextRect.*aRectFnSet->fnGetTop)()) // same line? + if (aRectFnSet.GetTop(aTextRect) == + aRectFnSet.GetTop(nextTextRect)) // same line? { // need to handle mixed RTL/LTR portions somehow - if ((aTextRect.*aRectFnSet->fnGetLeft)() < - (nextTextRect.*aRectFnSet->fnGetLeft)()) + if (aRectFnSet.GetLeft(aTextRect) < + aRectFnSet.GetLeft(nextTextRect)) { - (aTextRect.*aRectFnSet->fnSetRight)( - (nextTextRect.*aRectFnSet->fnGetLeft)()); + aRectFnSet.SetRight( aTextRect, + aRectFnSet.GetLeft(nextTextRect)); } else // RTL { - (aTextRect.*aRectFnSet->fnSetLeft)( - (nextTextRect.*aRectFnSet->fnGetLeft)()); + aRectFnSet.SetLeft( aTextRect, + aRectFnSet.GetLeft(nextTextRect)); } } } @@ -745,7 +745,7 @@ static bool lcl_UpDown( SwPaM *pPam, const SwContentFrame *pStart, SwRect aRect( pStart->Frame() ); pStart->GetCharRect( aRect, *pPam->GetPoint() ); Point aCenter = aRect.Center(); - nX = aRectFnSet.bVert ? aCenter.Y() : aCenter.X(); + nX = aRectFnSet.IsVert() ? aCenter.Y() : aCenter.X(); pTable = pCnt ? pCnt->FindTabFrame() : nullptr; if ( !pTable ) @@ -759,16 +759,16 @@ static bool lcl_UpDown( SwPaM *pPam, const SwContentFrame *pStart, while ( pCell && !pCell->IsCellFrame() ) pCell = pCell->GetUpper(); OSL_ENSURE( pCell, "could not find the cell" ); - nX = (pCell->Frame().*aRectFnSet->fnGetLeft)() + - (pCell->Frame().*aRectFnSet->fnGetWidth)() / 2; + nX = aRectFnSet.GetLeft(pCell->Frame()) + + aRectFnSet.GetWidth(pCell->Frame()) / 2; //The flow leads from one table to the next. The X-value needs to be //corrected based on the middle of the starting cell by the amount //of the offset of the tables. if ( pStTab != pTable ) { - nX += (pTable->Frame().*aRectFnSet->fnGetLeft)() - - (pStTab->Frame().*aRectFnSet->fnGetLeft)(); + nX += aRectFnSet.GetLeft(pTable->Frame()) - + aRectFnSet.GetLeft(pStTab->Frame()); } } @@ -778,15 +778,15 @@ static bool lcl_UpDown( SwPaM *pPam, const SwContentFrame *pStart, { const bool bRTL = pTable->IsRightToLeft(); const long nPrtLeft = bRTL ? - (pTable->*aRectFnSet->fnGetPrtRight)() : - (pTable->*aRectFnSet->fnGetPrtLeft)(); + aRectFnSet.GetPrtRight(*pTable) : + aRectFnSet.GetPrtLeft(*pTable); if ( bRTL != (nX < nPrtLeft) ) nX = nPrtLeft; else { const long nPrtRight = bRTL ? - (pTable->*aRectFnSet->fnGetPrtLeft)() : - (pTable->*aRectFnSet->fnGetPrtRight)(); + aRectFnSet.GetPrtLeft(*pTable) : + aRectFnSet.GetPrtRight(*pTable); if ( bRTL != (nX > nPrtRight) ) nX = nPrtRight; } @@ -882,8 +882,8 @@ static bool lcl_UpDown( SwPaM *pPam, const SwContentFrame *pStart, Point aInsideCnt; if ( pCell ) { - long nTmpTop = (pCell->Frame().*aRectFnSet->fnGetTop)(); - if ( aRectFnSet.bVert ) + long nTmpTop = aRectFnSet.GetTop(pCell->Frame()); + if ( aRectFnSet.IsVert() ) { if ( nTmpTop ) --nTmpTop; @@ -894,8 +894,8 @@ static bool lcl_UpDown( SwPaM *pPam, const SwContentFrame *pStart, aInsideCell = Point( nX, nTmpTop ); } - long nTmpTop = (pCnt->Frame().*aRectFnSet->fnGetTop)(); - if ( aRectFnSet.bVert ) + long nTmpTop = aRectFnSet.GetTop(pCnt->Frame()); + if ( aRectFnSet.IsVert() ) { if ( nTmpTop ) --nTmpTop; @@ -1326,22 +1326,22 @@ const SwContentFrame *SwLayoutFrame::GetContentPos( Point& rPoint, SwRectFnSet aRectFnSet(pActual); if ( !pActual->GetPrev() && - (*aRectFnSet->fnYDiff)( (pActual->*aRectFnSet->fnGetPrtTop)(), - aRectFnSet.bVert ? rPoint.X() : rPoint.Y() ) > 0 ) + aRectFnSet.YDiff( aRectFnSet.GetPrtTop(*pActual), + aRectFnSet.IsVert() ? rPoint.X() : rPoint.Y() ) > 0 ) { aPoint.Y() = pActual->Frame().Top() + pActual->Prt().Top(); aPoint.X() = pActual->Frame().Left() + - ( pActual->IsRightToLeft() || aRectFnSet.bVert ? + ( pActual->IsRightToLeft() || aRectFnSet.IsVert() ? pActual->Prt().Right() : pActual->Prt().Left() ); } else if ( !pActual->GetNext() && - (*aRectFnSet->fnYDiff)( (pActual->*aRectFnSet->fnGetPrtBottom)(), - aRectFnSet.bVert ? rPoint.X() : rPoint.Y() ) < 0 ) + aRectFnSet.YDiff( aRectFnSet.GetPrtBottom(*pActual), + aRectFnSet.IsVert() ? rPoint.X() : rPoint.Y() ) < 0 ) { aPoint.Y() = pActual->Frame().Top() + pActual->Prt().Bottom(); aPoint.X() = pActual->Frame().Left() + - ( pActual->IsRightToLeft() || aRectFnSet.bVert ? + ( pActual->IsRightToLeft() || aRectFnSet.IsVert() ? pActual->Prt().Left() : pActual->Prt().Right() ); } @@ -2146,19 +2146,19 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor) bR2L; if( MultiPortionType::BIDI == pSt2Pos->nMultiType && - (pSt2Pos->aPortion2.*aRectFnSet->fnGetWidth)() ) + aRectFnSet.GetWidth(pSt2Pos->aPortion2) ) { // nested bidi portion - long nRightAbs = (pSt2Pos->aPortion.*aRectFnSet->fnGetRight)(); - nRightAbs -= (pSt2Pos->aPortion2.*aRectFnSet->fnGetLeft)(); - long nLeftAbs = nRightAbs - (pSt2Pos->aPortion2.*aRectFnSet->fnGetWidth)(); + long nRightAbs = aRectFnSet.GetRight(pSt2Pos->aPortion); + nRightAbs -= aRectFnSet.GetLeft(pSt2Pos->aPortion2); + long nLeftAbs = nRightAbs - aRectFnSet.GetWidth(pSt2Pos->aPortion2); - (aTmp.*aRectFnSet->fnSetRight)( nRightAbs ); + aRectFnSet.SetRight( aTmp, nRightAbs ); if ( ! pEnd2Pos || pEnd2Pos->aPortion != pSt2Pos->aPortion ) { SwRect aTmp2( pSt2Pos->aPortion ); - (aTmp2.*aRectFnSet->fnSetRight)( nLeftAbs ); + aRectFnSet.SetRight( aTmp2, nLeftAbs ); aTmp2.Intersection( aEndFrame ); Sub( aRegion, aTmp2 ); } @@ -2166,49 +2166,43 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor) else { if( bPorR2L ) - (aTmp.*aRectFnSet->fnSetLeft)( - (pSt2Pos->aPortion.*aRectFnSet->fnGetLeft)() ); + aRectFnSet.SetLeft( aTmp, aRectFnSet.GetLeft(pSt2Pos->aPortion) ); else - (aTmp.*aRectFnSet->fnSetRight)( - (pSt2Pos->aPortion.*aRectFnSet->fnGetRight)() ); + aRectFnSet.SetRight( aTmp, aRectFnSet.GetRight(pSt2Pos->aPortion) ); } if( MultiPortionType::ROT_90 == pSt2Pos->nMultiType || - (pSt2Pos->aPortion.*aRectFnSet->fnGetTop)() == - (aTmp.*aRectFnSet->fnGetTop)() ) + aRectFnSet.GetTop(pSt2Pos->aPortion) == + aRectFnSet.GetTop(aTmp) ) { - (aTmp.*aRectFnSet->fnSetTop)( - (pSt2Pos->aLine.*aRectFnSet->fnGetTop)() ); + aRectFnSet.SetTop( aTmp, aRectFnSet.GetTop(pSt2Pos->aLine) ); } aTmp.Intersection( aStFrame ); Sub( aRegion, aTmp ); - SwTwips nTmp = (pSt2Pos->aLine.*aRectFnSet->fnGetBottom)(); + SwTwips nTmp = aRectFnSet.GetBottom(pSt2Pos->aLine); if( MultiPortionType::ROT_90 != pSt2Pos->nMultiType && - (aStRect.*aRectFnSet->fnBottomDist)( nTmp ) > 0 ) + aRectFnSet.BottomDist( aStRect, nTmp ) > 0 ) { - (aTmp.*aRectFnSet->fnSetTop)( (aTmp.*aRectFnSet->fnGetBottom)() ); - (aTmp.*aRectFnSet->fnSetBottom)( nTmp ); - if( (aStRect.*aRectFnSet->fnBottomDist)( - (pSt2Pos->aPortion.*aRectFnSet->fnGetBottom)() ) > 0 ) + aRectFnSet.SetTop( aTmp, aRectFnSet.GetBottom(aTmp) ); + aRectFnSet.SetBottom( aTmp, nTmp ); + if( aRectFnSet.BottomDist( aStRect, aRectFnSet.GetBottom(pSt2Pos->aPortion) ) > 0 ) { if( bPorR2L ) - (aTmp.*aRectFnSet->fnSetRight)( - (pSt2Pos->aPortion.*aRectFnSet->fnGetRight)() ); + aRectFnSet.SetRight( aTmp, aRectFnSet.GetRight(pSt2Pos->aPortion) ); else - (aTmp.*aRectFnSet->fnSetLeft)( - (pSt2Pos->aPortion.*aRectFnSet->fnGetLeft)() ); + aRectFnSet.SetLeft( aTmp, aRectFnSet.GetLeft(pSt2Pos->aPortion) ); } aTmp.Intersection( aStFrame ); Sub( aRegion, aTmp ); } aStRect = pSt2Pos->aLine; - (aStRect.*aRectFnSet->fnSetLeft)( bR2L ? - (pSt2Pos->aPortion.*aRectFnSet->fnGetLeft)() : - (pSt2Pos->aPortion.*aRectFnSet->fnGetRight)() ); - (aStRect.*aRectFnSet->fnSetWidth)( 1 ); + aRectFnSet.SetLeft( aStRect, bR2L ? + aRectFnSet.GetLeft(pSt2Pos->aPortion) : + aRectFnSet.GetRight(pSt2Pos->aPortion) ); + aRectFnSet.SetWidth( aStRect, 1 ); } if( pEnd2Pos ) @@ -2222,19 +2216,19 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor) bEndR2L; if( MultiPortionType::BIDI == pEnd2Pos->nMultiType && - (pEnd2Pos->aPortion2.*fnRectX->fnGetWidth)() ) + fnRectX.GetWidth(pEnd2Pos->aPortion2) ) { // nested bidi portion - long nRightAbs = (pEnd2Pos->aPortion.*fnRectX->fnGetRight)(); - nRightAbs = nRightAbs - (pEnd2Pos->aPortion2.*fnRectX->fnGetLeft)(); - long nLeftAbs = nRightAbs - (pEnd2Pos->aPortion2.*fnRectX->fnGetWidth)(); + long nRightAbs = fnRectX.GetRight(pEnd2Pos->aPortion); + nRightAbs = nRightAbs - fnRectX.GetLeft(pEnd2Pos->aPortion2); + long nLeftAbs = nRightAbs - fnRectX.GetWidth(pEnd2Pos->aPortion2); - (aTmp.*fnRectX->fnSetLeft)( nLeftAbs ); + fnRectX.SetLeft( aTmp, nLeftAbs ); if ( ! pSt2Pos || pSt2Pos->aPortion != pEnd2Pos->aPortion ) { SwRect aTmp2( pEnd2Pos->aPortion ); - (aTmp2.*fnRectX->fnSetLeft)( nRightAbs ); + fnRectX.SetLeft( aTmp2, nRightAbs ); aTmp2.Intersection( aEndFrame ); Sub( aRegion, aTmp2 ); } @@ -2242,19 +2236,16 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor) else { if ( bPorR2L ) - (aTmp.*fnRectX->fnSetRight)( - (pEnd2Pos->aPortion.*fnRectX->fnGetRight)() ); + fnRectX.SetRight( aTmp, fnRectX.GetRight(pEnd2Pos->aPortion) ); else - (aTmp.*fnRectX->fnSetLeft)( - (pEnd2Pos->aPortion.*fnRectX->fnGetLeft)() ); + fnRectX.SetLeft( aTmp, fnRectX.GetLeft(pEnd2Pos->aPortion) ); } if( MultiPortionType::ROT_90 == pEnd2Pos->nMultiType || - (pEnd2Pos->aPortion.*fnRectX->fnGetBottom)() == - (aEndRect.*fnRectX->fnGetBottom)() ) + fnRectX.GetBottom(pEnd2Pos->aPortion) == + fnRectX.GetBottom(aEndRect) ) { - (aTmp.*fnRectX->fnSetBottom)( - (pEnd2Pos->aLine.*fnRectX->fnGetBottom)() ); + fnRectX.SetBottom( aTmp, fnRectX.GetBottom(pEnd2Pos->aLine) ); } aTmp.Intersection( aEndFrame ); @@ -2263,21 +2254,18 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor) // The next statement means neither ruby nor rotate(90): if( !( MultiPortionType::RUBY == pEnd2Pos->nMultiType ) ) { - SwTwips nTmp = (pEnd2Pos->aLine.*fnRectX->fnGetTop)(); - if( (aEndRect.*fnRectX->fnGetTop)() != nTmp ) + SwTwips nTmp = fnRectX.GetTop(pEnd2Pos->aLine); + if( fnRectX.GetTop(aEndRect) != nTmp ) { - (aTmp.*fnRectX->fnSetBottom)( - (aTmp.*fnRectX->fnGetTop)() ); - (aTmp.*fnRectX->fnSetTop)( nTmp ); - if( (aEndRect.*fnRectX->fnGetTop)() != - (pEnd2Pos->aPortion.*fnRectX->fnGetTop)() ) + fnRectX.SetBottom( aTmp, fnRectX.GetTop(aTmp) ); + fnRectX.SetTop( aTmp, nTmp ); + if( fnRectX.GetTop(aEndRect) != + fnRectX.GetTop(pEnd2Pos->aPortion) ) { if( bPorR2L ) - (aTmp.*fnRectX->fnSetLeft)( - (pEnd2Pos->aPortion.*fnRectX->fnGetLeft)() ); + fnRectX.SetLeft( aTmp, fnRectX.GetLeft(pEnd2Pos->aPortion) ); else - (aTmp.*fnRectX->fnSetRight)( - (pEnd2Pos->aPortion.*fnRectX->fnGetRight)() ); + fnRectX.SetRight( aTmp, fnRectX.GetRight(pEnd2Pos->aPortion) ); } aTmp.Intersection( aEndFrame ); Sub( aRegion, aTmp ); @@ -2285,10 +2273,10 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor) } aEndRect = pEnd2Pos->aLine; - (aEndRect.*fnRectX->fnSetLeft)( bEndR2L ? - (pEnd2Pos->aPortion.*fnRectX->fnGetRight)() : - (pEnd2Pos->aPortion.*fnRectX->fnGetLeft)() ); - (aEndRect.*fnRectX->fnSetWidth)( 1 ); + fnRectX.SetLeft( aEndRect, bEndR2L ? + fnRectX.GetRight(pEnd2Pos->aPortion) : + fnRectX.GetLeft(pEnd2Pos->aPortion) ); + fnRectX.SetWidth( aEndRect, 1 ); } } else if( pSt2Pos && pEnd2Pos && @@ -2301,37 +2289,37 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor) // ends in the same bidi portion but one start or end is inside a // nested bidi portion. - if ( (pSt2Pos->aPortion2.*aRectFnSet->fnGetWidth)() ) + if ( aRectFnSet.GetWidth(pSt2Pos->aPortion2) ) { SwRect aTmp( aStRect ); - long nRightAbs = (pSt2Pos->aPortion.*aRectFnSet->fnGetRight)(); - nRightAbs -= (pSt2Pos->aPortion2.*aRectFnSet->fnGetLeft)(); - long nLeftAbs = nRightAbs - (pSt2Pos->aPortion2.*aRectFnSet->fnGetWidth)(); + long nRightAbs = aRectFnSet.GetRight(pSt2Pos->aPortion); + nRightAbs -= aRectFnSet.GetLeft(pSt2Pos->aPortion2); + long nLeftAbs = nRightAbs - aRectFnSet.GetWidth(pSt2Pos->aPortion2); - (aTmp.*aRectFnSet->fnSetRight)( nRightAbs ); + aRectFnSet.SetRight( aTmp, nRightAbs ); aTmp.Intersection( aStFrame ); Sub( aRegion, aTmp ); aStRect = pSt2Pos->aLine; - (aStRect.*aRectFnSet->fnSetLeft)( bR2L ? nRightAbs : nLeftAbs ); - (aStRect.*aRectFnSet->fnSetWidth)( 1 ); + aRectFnSet.SetLeft( aStRect, bR2L ? nRightAbs : nLeftAbs ); + aRectFnSet.SetWidth( aStRect, 1 ); } SwRectFnSet fnRectX(pEndFrame); - if ( (pEnd2Pos->aPortion2.*fnRectX->fnGetWidth)() ) + if ( fnRectX.GetWidth(pEnd2Pos->aPortion2) ) { SwRect aTmp( aEndRect ); - long nRightAbs = (pEnd2Pos->aPortion.*fnRectX->fnGetRight)(); - nRightAbs -= (pEnd2Pos->aPortion2.*fnRectX->fnGetLeft)(); - long nLeftAbs = nRightAbs - (pEnd2Pos->aPortion2.*fnRectX->fnGetWidth)(); + long nRightAbs = fnRectX.GetRight(pEnd2Pos->aPortion); + nRightAbs -= fnRectX.GetLeft(pEnd2Pos->aPortion2); + long nLeftAbs = nRightAbs - fnRectX.GetWidth(pEnd2Pos->aPortion2); - (aTmp.*fnRectX->fnSetLeft)( nLeftAbs ); + fnRectX.SetLeft( aTmp, nLeftAbs ); aTmp.Intersection( aEndFrame ); Sub( aRegion, aTmp ); aEndRect = pEnd2Pos->aLine; - (aEndRect.*fnRectX->fnSetLeft)( bEndR2L ? nLeftAbs : nRightAbs ); - (aEndRect.*fnRectX->fnSetWidth)( 1 ); + fnRectX.SetLeft( aEndRect, bEndR2L ? nLeftAbs : nRightAbs ); + fnRectX.SetWidth( aEndRect, 1 ); } } @@ -2363,7 +2351,7 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor) pSt2Pos->aPortion == pEnd2Pos->aPortion; //case 1: (Same frame and same row) if( bSameRotatedOrBidi || - (aStRect.*aRectFnSet->fnGetTop)() == (aEndRect.*aRectFnSet->fnGetTop)() ) + aRectFnSet.GetTop(aStRect) == aRectFnSet.GetTop(aEndRect) ) { Point aTmpSt( aStRect.Pos() ); Point aTmpEnd( aEndRect.Right(), aEndRect.Bottom() ); @@ -2387,14 +2375,14 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor) // Bug 34888: If content is selected which doesn't take space // away (i.e. PostIts, RefMarks, TOXMarks), then at // least set the width of the Cursor. - if( 1 == (aTmp.*aRectFnSet->fnGetWidth)() && + if( 1 == aRectFnSet.GetWidth(aTmp) && pStartPos->nContent.GetIndex() != pEndPos->nContent.GetIndex() ) { OutputDevice* pOut = pSh->GetOut(); long nCursorWidth = pOut->GetSettings().GetStyleSettings(). GetCursorSize(); - (aTmp.*aRectFnSet->fnSetWidth)( pOut->PixelToLogic( + aRectFnSet.SetWidth( aTmp, pOut->PixelToLogic( Size( nCursorWidth, 0 ) ).Width() ); } aTmp.Intersection( aStFrame ); @@ -2406,45 +2394,45 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor) SwTwips lLeft, lRight; if( pSt2Pos && pEnd2Pos && pSt2Pos->aPortion == pEnd2Pos->aPortion ) { - lLeft = (pSt2Pos->aPortion.*aRectFnSet->fnGetLeft)(); - lRight = (pSt2Pos->aPortion.*aRectFnSet->fnGetRight)(); + lLeft = aRectFnSet.GetLeft(pSt2Pos->aPortion); + lRight = aRectFnSet.GetRight(pSt2Pos->aPortion); } else { - lLeft = (pStartFrame->Frame().*aRectFnSet->fnGetLeft)() + - (pStartFrame->Prt().*aRectFnSet->fnGetLeft)(); - lRight = (aEndFrame.*aRectFnSet->fnGetRight)(); + lLeft = aRectFnSet.GetLeft(pStartFrame->Frame()) + + aRectFnSet.GetLeft(pStartFrame->Prt()); + lRight = aRectFnSet.GetRight(aEndFrame); } - if( lLeft < (aStFrame.*aRectFnSet->fnGetLeft)() ) - lLeft = (aStFrame.*aRectFnSet->fnGetLeft)(); - if( lRight > (aStFrame.*aRectFnSet->fnGetRight)() ) - lRight = (aStFrame.*aRectFnSet->fnGetRight)(); + if( lLeft < aRectFnSet.GetLeft(aStFrame) ) + lLeft = aRectFnSet.GetLeft(aStFrame); + if( lRight > aRectFnSet.GetRight(aStFrame) ) + lRight = aRectFnSet.GetRight(aStFrame); SwRect aSubRect( aStRect ); //First line if( bR2L ) - (aSubRect.*aRectFnSet->fnSetLeft)( lLeft ); + aRectFnSet.SetLeft( aSubRect, lLeft ); else - (aSubRect.*aRectFnSet->fnSetRight)( lRight ); + aRectFnSet.SetRight( aSubRect, lRight ); Sub( aRegion, aSubRect ); //If there's at least a twips between start- and endline, //so the whole area between will be added. - SwTwips aTmpBottom = (aStRect.*aRectFnSet->fnGetBottom)(); - SwTwips aTmpTop = (aEndRect.*aRectFnSet->fnGetTop)(); + SwTwips aTmpBottom = aRectFnSet.GetBottom(aStRect); + SwTwips aTmpTop = aRectFnSet.GetTop(aEndRect); if( aTmpBottom != aTmpTop ) { - (aSubRect.*aRectFnSet->fnSetLeft)( lLeft ); - (aSubRect.*aRectFnSet->fnSetRight)( lRight ); - (aSubRect.*aRectFnSet->fnSetTop)( aTmpBottom ); - (aSubRect.*aRectFnSet->fnSetBottom)( aTmpTop ); + aRectFnSet.SetLeft( aSubRect, lLeft ); + aRectFnSet.SetRight( aSubRect, lRight ); + aRectFnSet.SetTop( aSubRect, aTmpBottom ); + aRectFnSet.SetBottom( aSubRect, aTmpTop ); Sub( aRegion, aSubRect ); } //and the last line aSubRect = aEndRect; if( bR2L ) - (aSubRect.*aRectFnSet->fnSetRight)( lRight ); + aRectFnSet.SetRight( aSubRect, lRight ); else - (aSubRect.*aRectFnSet->fnSetLeft)( lLeft ); + aRectFnSet.SetLeft( aSubRect, lLeft ); Sub( aRegion, aSubRect ); } } @@ -2454,15 +2442,15 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor) //The startframe first... SwRect aSubRect( aStRect ); if( bR2L ) - (aSubRect.*aRectFnSet->fnSetLeft)( (aStFrame.*aRectFnSet->fnGetLeft)()); + aRectFnSet.SetLeft( aSubRect, aRectFnSet.GetLeft(aStFrame)); else - (aSubRect.*aRectFnSet->fnSetRight)( (aStFrame.*aRectFnSet->fnGetRight)()); + aRectFnSet.SetRight( aSubRect, aRectFnSet.GetRight(aStFrame)); Sub( aRegion, aSubRect ); - SwTwips nTmpTwips = (aStRect.*aRectFnSet->fnGetBottom)(); - if( (aStFrame.*aRectFnSet->fnGetBottom)() != nTmpTwips ) + SwTwips nTmpTwips = aRectFnSet.GetBottom(aStRect); + if( aRectFnSet.GetBottom(aStFrame) != nTmpTwips ) { aSubRect = aStFrame; - (aSubRect.*aRectFnSet->fnSetTop)( nTmpTwips ); + aRectFnSet.SetTop( aSubRect, nTmpTwips ); Sub( aRegion, aSubRect ); } @@ -2525,18 +2513,18 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor) //At least the endframe... aRectFnSet.Refresh(pEndFrame); - nTmpTwips = (aEndRect.*aRectFnSet->fnGetTop)(); - if( (aEndFrame.*aRectFnSet->fnGetTop)() != nTmpTwips ) + nTmpTwips = aRectFnSet.GetTop(aEndRect); + if( aRectFnSet.GetTop(aEndFrame) != nTmpTwips ) { aSubRect = aEndFrame; - (aSubRect.*aRectFnSet->fnSetBottom)( nTmpTwips ); + aRectFnSet.SetBottom( aSubRect, nTmpTwips ); Sub( aRegion, aSubRect ); } aSubRect = aEndRect; if( bEndR2L ) - (aSubRect.*aRectFnSet->fnSetRight)((aEndFrame.*aRectFnSet->fnGetRight)()); + aRectFnSet.SetRight(aSubRect, aRectFnSet.GetRight(aEndFrame)); else - (aSubRect.*aRectFnSet->fnSetLeft)( (aEndFrame.*aRectFnSet->fnGetLeft)() ); + aRectFnSet.SetLeft( aSubRect, aRectFnSet.GetLeft(aEndFrame) ); Sub( aRegion, aSubRect ); } diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index ec8d94b1c56a..0ae2350a2028 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -992,7 +992,7 @@ void SwContentFrame::Cut() else { SwRectFnSet aRectFnSet(this); - long nFrameHeight = (Frame().*aRectFnSet->fnGetHeight)(); + long nFrameHeight = aRectFnSet.GetHeight(Frame()); if( nFrameHeight ) pUp->Shrink( nFrameHeight ); } @@ -1102,7 +1102,7 @@ void SwLayoutFrame::Cut() GetNext()->InvalidatePos_(); SwRectFnSet aRectFnSet(this); - SwTwips nShrink = (Frame().*aRectFnSet->fnGetHeight)(); + SwTwips nShrink = aRectFnSet.GetHeight(Frame()); // Remove first, then shrink upper. SwLayoutFrame *pUp = GetUpper(); @@ -1127,10 +1127,10 @@ void SwLayoutFrame::Cut() nReal = -AdjustNeighbourhood( -nShrink ); if( nReal < nShrink ) { - SwTwips nOldHeight = (Frame().*aRectFnSet->fnGetHeight)(); - (Frame().*aRectFnSet->fnSetHeight)( 0 ); + SwTwips nOldHeight = aRectFnSet.GetHeight(Frame()); + aRectFnSet.SetHeight( Frame(), 0 ); nReal += pUp->Shrink( nShrink - nReal ); - (Frame().*aRectFnSet->fnSetHeight)( nOldHeight ); + aRectFnSet.SetHeight( Frame(), nOldHeight ); } if( SwNeighbourAdjust::GrowAdjust == nAdjust && nReal < nShrink ) AdjustNeighbourhood( nReal - nShrink ); @@ -1163,7 +1163,7 @@ SwTwips SwFrame::Grow( SwTwips nDist, bool bTst, bool bInfo ) { SwRectFnSet aRectFnSet(this); - SwTwips nPrtHeight = (Prt().*aRectFnSet->fnGetHeight)(); + SwTwips nPrtHeight = aRectFnSet.GetHeight(Prt()); if( nPrtHeight > 0 && nDist > (LONG_MAX - nPrtHeight) ) nDist = LONG_MAX - nPrtHeight; @@ -1187,8 +1187,8 @@ SwTwips SwFrame::Grow( SwTwips nDist, bool bTst, bool bInfo ) const SwTwips nReal = GrowFrame( nDist, bTst, bInfo ); if( !bTst ) { - nPrtHeight = (Prt().*aRectFnSet->fnGetHeight)(); - (Prt().*aRectFnSet->fnSetHeight)( nPrtHeight + + nPrtHeight = aRectFnSet.GetHeight(Prt()); + aRectFnSet.SetHeight( Prt(), nPrtHeight + ( IsContentFrame() ? nDist : nReal ) ); } return nReal; @@ -1223,13 +1223,13 @@ SwTwips SwFrame::Shrink( SwTwips nDist, bool bTst, bool bInfo ) } SwRectFnSet aRectFnSet(this); - SwTwips nReal = (Frame().*aRectFnSet->fnGetHeight)(); + SwTwips nReal = aRectFnSet.GetHeight(Frame()); ShrinkFrame( nDist, bTst, bInfo ); - nReal -= (Frame().*aRectFnSet->fnGetHeight)(); + nReal -= aRectFnSet.GetHeight(Frame()); if( !bTst ) { - const SwTwips nPrtHeight = (Prt().*aRectFnSet->fnGetHeight)(); - (Prt().*aRectFnSet->fnSetHeight)( nPrtHeight - + const SwTwips nPrtHeight = aRectFnSet.GetHeight(Prt()); + aRectFnSet.SetHeight( Prt(), nPrtHeight - ( IsContentFrame() ? nDist : nReal ) ); } return nReal; @@ -1429,14 +1429,14 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst ) { if( !pFootnote->GetAttr()->GetFootnote().IsEndNote() ) { - nMinH += (pFootnote->Frame().*aRectFnSet->fnGetHeight)(); + nMinH += aRectFnSet.GetHeight(pFootnote->Frame()); bFootnote = true; } pFootnote = static_cast<SwFootnoteFrame*>(pFootnote->GetNext()); } if( bFootnote ) - nMinH += (pCont->Prt().*aRectFnSet->fnGetTop)(); - nReal = (pCont->Frame().*aRectFnSet->fnGetHeight)() - nMinH; + nMinH += aRectFnSet.GetTop(pCont->Prt()); + nReal = aRectFnSet.GetHeight(pCont->Frame()) - nMinH; if( nReal > nDiff ) nReal = nDiff; if( nReal > 0 ) @@ -1462,7 +1462,7 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst ) return 0; //If not one is found, everything else is solved. - nReal = (pFrame->Frame().*aRectFnSet->fnGetHeight)(); + nReal = aRectFnSet.GetHeight(pFrame->Frame()); if( nReal > nDiff ) nReal = nDiff; if( !bFootnotePage ) @@ -1481,15 +1481,14 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst ) { //If the Body doesn't return enough, we look for a footnote, if //there is one, we steal there accordingly. - const SwTwips nAddMax = (pFrame->GetNext()->Frame().*aRectFnSet-> - fnGetHeight)(); + const SwTwips nAddMax = aRectFnSet.GetHeight(pFrame->GetNext()->Frame()); nAdd = nDiff - nReal; if ( nAdd > nAddMax ) nAdd = nAddMax; if ( !bTst ) { - (pFrame->GetNext()->Frame().*aRectFnSet->fnSetHeight)(nAddMax-nAdd); - if( aRectFnSet.bVert && !aRectFnSet.bVertL2R && !aRectFnSet.bRev ) + aRectFnSet.SetHeight(pFrame->GetNext()->Frame(), nAddMax-nAdd); + if( aRectFnSet.IsVert() && !aRectFnSet.IsVertL2R() && !aRectFnSet.IsRev() ) pFrame->GetNext()->Frame().Pos().X() += nAdd; pFrame->GetNext()->InvalidatePrt(); if ( pFrame->GetNext()->GetNext() ) @@ -1501,9 +1500,9 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst ) if ( !bTst && nReal ) { - SwTwips nTmp = (pFrame->Frame().*aRectFnSet->fnGetHeight)(); - (pFrame->Frame().*aRectFnSet->fnSetHeight)( nTmp - nReal ); - if( aRectFnSet.bVert && !aRectFnSet.bVertL2R && !aRectFnSet.bRev ) + SwTwips nTmp = aRectFnSet.GetHeight(pFrame->Frame()); + aRectFnSet.SetHeight( pFrame->Frame(), nTmp - nReal ); + if( aRectFnSet.IsVert() && !aRectFnSet.IsVertL2R() && !aRectFnSet.IsRev() ) pFrame->Frame().Pos().X() += nReal; pFrame->InvalidatePrt(); if ( pFrame->GetNext() ) @@ -1711,7 +1710,7 @@ SwTwips SwContentFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) { SwRectFnSet aRectFnSet(this); - SwTwips nFrameHeight = (Frame().*aRectFnSet->fnGetHeight)(); + SwTwips nFrameHeight = aRectFnSet.GetHeight(Frame()); if( nFrameHeight > 0 && nDist > (LONG_MAX - nFrameHeight ) ) nDist = LONG_MAX - nFrameHeight; @@ -1725,7 +1724,7 @@ SwTwips SwContentFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) { if ( !bTst ) { - (Frame().*aRectFnSet->fnSetHeight)( nFrameHeight + nDist ); + aRectFnSet.SetHeight( Frame(), nFrameHeight + nDist ); if( IsVertical() && !IsVertLR() && !IsReverse() ) Frame().Pos().X() -= nDist; if ( GetNext() ) @@ -1745,18 +1744,18 @@ SwTwips SwContentFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) return 0; } - SwTwips nReal = (GetUpper()->Prt().*aRectFnSet->fnGetHeight)(); + SwTwips nReal = aRectFnSet.GetHeight(GetUpper()->Prt()); SwFrame *pFrame = GetUpper()->Lower(); while( pFrame && nReal > 0 ) - { nReal -= (pFrame->Frame().*aRectFnSet->fnGetHeight)(); + { nReal -= aRectFnSet.GetHeight(pFrame->Frame()); pFrame = pFrame->GetNext(); } if ( !bTst ) { //Contents are always resized to the wished value. - long nOld = (Frame().*aRectFnSet->fnGetHeight)(); - (Frame().*aRectFnSet->fnSetHeight)( nOld + nDist ); + long nOld = aRectFnSet.GetHeight(Frame()); + aRectFnSet.SetHeight( Frame(), nOld + nDist ); if( IsVertical()&& !IsVertLR() && !IsReverse() ) Frame().Pos().X() -= nDist; SwTabFrame *pTab = (nOld && IsInTab()) ? FindTabFrame() : nullptr; @@ -1816,15 +1815,14 @@ SwTwips SwContentFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) { SwRectFnSet aRectFnSet(this); OSL_ENSURE( nDist >= 0, "nDist < 0" ); - OSL_ENSURE( nDist <= (Frame().*aRectFnSet->fnGetHeight)(), + OSL_ENSURE( nDist <= aRectFnSet.GetHeight(Frame()), "nDist > than current size." ); if ( !bTst ) { SwTwips nRstHeight; if( GetUpper() ) - nRstHeight = (Frame().*aRectFnSet->fnBottomDist) - ( (GetUpper()->*aRectFnSet->fnGetPrtBottom)() ); + nRstHeight = aRectFnSet.BottomDist( Frame(), aRectFnSet.GetPrtBottom(*GetUpper()) ); else nRstHeight = 0; if( nRstHeight < 0 ) @@ -1835,7 +1833,7 @@ SwTwips SwContentFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) SwFrame *pNxt = GetNext(); while( pNxt ) { - nNextHeight += (pNxt->Frame().*aRectFnSet->fnGetHeight)(); + nNextHeight += aRectFnSet.GetHeight(pNxt->Frame()); pNxt = pNxt->GetNext(); } } @@ -1843,7 +1841,7 @@ SwTwips SwContentFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) } else nRstHeight = nDist; - (Frame().*aRectFnSet->fnSetHeight)( (Frame().*aRectFnSet->fnGetHeight)() - nDist ); + aRectFnSet.SetHeight( Frame(), aRectFnSet.GetHeight(Frame()) - nDist ); if( IsVertical() && !IsVertLR() ) Frame().Pos().X() += nDist; nDist = nRstHeight; @@ -2172,8 +2170,8 @@ SwTwips SwLayoutFrame::InnerHeight() const { SwTwips nTmp = static_cast<const SwLayoutFrame*>(pCnt)->InnerHeight(); if( pCnt->GetValidPrtAreaFlag() ) - nTmp += (pCnt->Frame().*aRectFnSet->fnGetHeight)() - - (pCnt->Prt().*aRectFnSet->fnGetHeight)(); + nTmp += aRectFnSet.GetHeight(pCnt->Frame()) - + aRectFnSet.GetHeight(pCnt->Prt()); if( nRet < nTmp ) nRet = nTmp; pCnt = pCnt->GetNext(); @@ -2183,13 +2181,13 @@ SwTwips SwLayoutFrame::InnerHeight() const { do { - nRet += (pCnt->Frame().*aRectFnSet->fnGetHeight)(); + nRet += aRectFnSet.GetHeight(pCnt->Frame()); if( pCnt->IsContentFrame() && static_cast<const SwTextFrame*>(pCnt)->IsUndersized() ) nRet += static_cast<const SwTextFrame*>(pCnt)->GetParHeight() - - (pCnt->Prt().*aRectFnSet->fnGetHeight)(); + aRectFnSet.GetHeight(pCnt->Prt()); if( pCnt->IsLayoutFrame() && !pCnt->IsTabFrame() ) nRet += static_cast<const SwLayoutFrame*>(pCnt)->InnerHeight() - - (pCnt->Prt().*aRectFnSet->fnGetHeight)(); + aRectFnSet.GetHeight(pCnt->Prt()); pCnt = pCnt->GetNext(); } while( pCnt ); @@ -2208,7 +2206,7 @@ SwTwips SwLayoutFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) return 0; SwRectFnSet aRectFnSet(this); - const SwTwips nFrameHeight = (Frame().*aRectFnSet->fnGetHeight)(); + const SwTwips nFrameHeight = aRectFnSet.GetHeight(Frame()); const SwTwips nFramePos = Frame().Pos().X(); if ( nFrameHeight > 0 && nDist > (LONG_MAX - nFrameHeight) ) @@ -2219,10 +2217,10 @@ SwTwips SwLayoutFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) { SwFrame *pFrame = GetUpper()->Lower(); while( pFrame ) - { nMin += (pFrame->Frame().*aRectFnSet->fnGetHeight)(); + { nMin += aRectFnSet.GetHeight(pFrame->Frame()); pFrame = pFrame->GetNext(); } - nMin = (GetUpper()->Prt().*aRectFnSet->fnGetHeight)() - nMin; + nMin = aRectFnSet.GetHeight(GetUpper()->Prt()) - nMin; if ( nMin < 0 ) nMin = 0; } @@ -2233,7 +2231,7 @@ SwTwips SwLayoutFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) bool bChgPos = IsVertical() && !IsReverse(); if ( !bTst ) { - (Frame().*aRectFnSet->fnSetHeight)( nFrameHeight + nDist ); + aRectFnSet.SetHeight( Frame(), nFrameHeight + nDist ); if( bChgPos && !IsVertLR() ) Frame().Pos().X() -= nDist; bMoveAccFrame = true; @@ -2284,10 +2282,10 @@ SwTwips SwLayoutFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) SwTwips nSpace = bTst ? 0 : -nDist; const SwFrame *pFrame = GetUpper()->Lower(); do - { nSpace += (pFrame->Frame().*aRectFnSet->fnGetHeight)(); + { nSpace += aRectFnSet.GetHeight(pFrame->Frame()); pFrame = pFrame->GetNext(); } while ( pFrame != GetNext() ); - nSpace = (GetUpper()->Prt().*aRectFnSet->fnGetHeight)() -nSpace; + nSpace = aRectFnSet.GetHeight(GetUpper()->Prt()) -nSpace; if ( nSpace < 0 ) nSpace = 0; nSpace += nGrow; @@ -2314,7 +2312,7 @@ SwTwips SwLayoutFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) // NEW TABLES ( !IsCellFrame() || static_cast<SwCellFrame*>(this)->GetLayoutRowSpan() > 1 ) ) { - (Frame().*aRectFnSet->fnSetHeight)( nFrameHeight + nReal ); + aRectFnSet.SetHeight( Frame(), nFrameHeight + nReal ); if( bChgPos && !IsVertLR() ) Frame().Pos().X() = nFramePos - nReal; bMoveAccFrame = true; @@ -2386,7 +2384,7 @@ SwTwips SwLayoutFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) OSL_ENSURE( nDist >= 0, "nDist < 0" ); SwRectFnSet aRectFnSet(this); - SwTwips nFrameHeight = (Frame().*aRectFnSet->fnGetHeight)(); + SwTwips nFrameHeight = aRectFnSet.GetHeight(Frame()); if ( nDist > nFrameHeight ) nDist = nFrameHeight; @@ -2396,15 +2394,15 @@ SwTwips SwLayoutFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) { if( !Lower()->IsNeighbourFrame() ) { const SwFrame *pFrame = Lower(); - const long nTmp = (Prt().*aRectFnSet->fnGetHeight)(); + const long nTmp = aRectFnSet.GetHeight(Prt()); while( pFrame && nMin < nTmp ) - { nMin += (pFrame->Frame().*aRectFnSet->fnGetHeight)(); + { nMin += aRectFnSet.GetHeight(pFrame->Frame()); pFrame = pFrame->GetNext(); } } } SwTwips nReal = nDist; - SwTwips nMinDiff = (Prt().*aRectFnSet->fnGetHeight)() - nMin; + SwTwips nMinDiff = aRectFnSet.GetHeight(Prt()) - nMin; if( nReal > nMinDiff ) nReal = nMinDiff; if( nReal <= 0 ) @@ -2416,7 +2414,7 @@ SwTwips SwLayoutFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) SwTwips nRealDist = nReal; if ( !bTst ) { - (Frame().*aRectFnSet->fnSetHeight)( nFrameHeight - nReal ); + aRectFnSet.SetHeight( Frame(), nFrameHeight - nReal ); if( bChgPos && !IsVertLR() ) Frame().Pos().X() += nReal; bMoveAccFrame = true; @@ -2436,7 +2434,7 @@ SwTwips SwLayoutFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) nReal *= -1; if ( !bTst && IsBodyFrame() && nReal < nRealDist ) { - (Frame().*aRectFnSet->fnSetHeight)( (Frame().*aRectFnSet->fnGetHeight)() + aRectFnSet.SetHeight( Frame(), aRectFnSet.GetHeight(Frame()) + nRealDist - nReal ); if( bChgPos && !IsVertLR() ) Frame().Pos().X() += nRealDist - nReal; @@ -2449,7 +2447,7 @@ SwTwips SwLayoutFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) SwTwips nTmp = GetUpper()->Shrink( nReal, bTst, bInfo ); if ( nTmp != nReal ) { - (Frame().*aRectFnSet->fnSetHeight)( (Frame().*aRectFnSet->fnGetHeight)() + aRectFnSet.SetHeight( Frame(), aRectFnSet.GetHeight(Frame()) + nReal - nTmp ); if( bChgPos && !IsVertLR() ) Frame().Pos().X() += nTmp - nReal; @@ -2574,7 +2572,7 @@ void SwLayoutFrame::ChgLowersProp( const Size& rOldSize ) // This shortcut basically tries to handle only lower frames that // are affected by the size change. Otherwise much more lower frames // are invalidated. - if ( !( aRectFnSet.bVert ? bHeightChgd : bWidthChgd ) && + if ( !( aRectFnSet.IsVert() ? bHeightChgd : bWidthChgd ) && ! Lower()->IsColumnFrame() && ( ( IsBodyFrame() && IsInDocBody() && ( !IsInSct() || !FindSctFrame()->IsColLocked() ) ) || // #i10826# Section frames without columns should not @@ -2633,8 +2631,8 @@ void SwLayoutFrame::ChgLowersProp( const Size& rOldSize ) } // Check, if variable size of body frame resp. section frame has grown // OD 28.10.2002 #97265# - correct check, if variable size has grown. - SwTwips nOldHeight = aRectFnSet.bVert ? rOldSize.Width() : rOldSize.Height(); - if( nOldHeight < (Prt().*aRectFnSet->fnGetHeight)() ) + SwTwips nOldHeight = aRectFnSet.IsVert() ? rOldSize.Width() : rOldSize.Height(); + if( nOldHeight < aRectFnSet.GetHeight(Prt()) ) { // If variable size of body|section frame has grown, only found // last lower and the position of the its next have to be invalidated. @@ -2651,7 +2649,7 @@ void SwLayoutFrame::ChgLowersProp( const Size& rOldSize ) // variable size of body|section frame has shrunk. Thus, // invalidate all lowers not matching the new body|section size // and the dedicated new last lower. - if( aRectFnSet.bVert ) + if( aRectFnSet.IsVert() ) { SwTwips nBot = Frame().Left() + Prt().Left(); while ( pLowerFrame && pLowerFrame->GetPrev() && pLowerFrame->Frame().Left() < nBot ) @@ -2704,7 +2702,7 @@ void SwLayoutFrame::ChgLowersProp( const Size& rOldSize ) // Declare booleans <bFixChgd> and <bVarChgd>, indicating for text frame // adjustment, if fixed/variable size has changed. bool bFixChgd, bVarChgd; - if( aRectFnSet.bVert == pLowerFrame->IsNeighbourFrame() ) + if( aRectFnSet.IsVert() == pLowerFrame->IsNeighbourFrame() ) { bFixChgd = bWidthChgd; bVarChgd = bHeightChgd; @@ -2720,7 +2718,7 @@ void SwLayoutFrame::ChgLowersProp( const Size& rOldSize ) // In vertical layout these are neighbour frames (cell and column frames), // header frames and footer frames. // In horizontal layout these are all frames, which aren't neighbour frames. - const SwFrameType nFixWidth = aRectFnSet.bVert ? (FRM_NEIGHBOUR | FRM_HEADFOOT) + const SwFrameType nFixWidth = aRectFnSet.IsVert() ? (FRM_NEIGHBOUR | FRM_HEADFOOT) : ~SwFrameType(FRM_NEIGHBOUR); // Declare const unsigned short <nFixHeight> and init it this frame types @@ -2728,7 +2726,7 @@ void SwLayoutFrame::ChgLowersProp( const Size& rOldSize ) // In vertical layout these are all frames, which aren't neighbour frames, // header frames, footer frames, body frames or foot note container frames. // In horizontal layout these are neighbour frames. - const SwFrameType nFixHeight = aRectFnSet.bVert ? ~SwFrameType(FRM_NEIGHBOUR | FRM_HEADFOOT | FRM_BODYFTNC) + const SwFrameType nFixHeight = aRectFnSet.IsVert() ? ~SwFrameType(FRM_NEIGHBOUR | FRM_HEADFOOT | FRM_BODYFTNC) : FRM_NEIGHBOUR; // Travel through all lowers using <GetNext()> @@ -2922,7 +2920,7 @@ void SwLayoutFrame::ChgLowersProp( const Size& rOldSize ) // Finally adjust the columns if width is set to auto // Possible optimization: execute this code earlier in this function and // return??? - if ( ( (aRectFnSet.bVert && bHeightChgd) || (! aRectFnSet.bVert && bWidthChgd) ) && + if ( ( (aRectFnSet.IsVert() && bHeightChgd) || (! aRectFnSet.IsVert() && bWidthChgd) ) && Lower()->IsColumnFrame() ) { // get column attribute @@ -3260,9 +3258,8 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs, SwRectFnSet aRectFnSet(this); if( IsSctFrame() ) { - nMaximum = (Frame().*aRectFnSet->fnGetHeight)() - nBorder + - (Frame().*aRectFnSet->fnBottomDist)( - (GetUpper()->*aRectFnSet->fnGetPrtBottom)() ); + nMaximum = aRectFnSet.GetHeight(Frame()) - nBorder + + aRectFnSet.BottomDist(Frame(), aRectFnSet.GetPrtBottom(*GetUpper())); nMaximum += GetUpper()->Grow( LONG_MAX, true ); if( nMaximum < nMinimum ) { @@ -3278,16 +3275,16 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs, GetBalancedColumns().GetValue(); SwFrame* pAny = ContainsAny(); if( bNoBalance || - ( !(Frame().*aRectFnSet->fnGetHeight)() && pAny ) ) + ( !aRectFnSet.GetHeight(Frame()) && pAny ) ) { - long nTop = (this->*aRectFnSet->fnGetTopMargin)(); + long nTop = aRectFnSet.GetTopMargin(*this); // #i23129# - correction // to the calculated maximum height. - (Frame().*aRectFnSet->fnAddBottom)( nMaximum - - (Frame().*aRectFnSet->fnGetHeight)() ); + aRectFnSet.AddBottom( Frame(), nMaximum - + aRectFnSet.GetHeight(Frame()) ); if( nTop > nMaximum ) nTop = nMaximum; - (this->*aRectFnSet->fnSetYMargins)( nTop, 0 ); + aRectFnSet.SetYMargins( *this, nTop, 0 ); } if( !pAny && !static_cast<SwSectionFrame*>(this)->IsFootnoteLock() ) { @@ -3369,8 +3366,8 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs, while( pCol ) { SwLayoutFrame* pLay = static_cast<SwLayoutFrame*>(pCol->Lower()); - SwTwips nInnerHeight = (pLay->Frame().*aRectFnSet->fnGetHeight)() - - (pLay->Prt().*aRectFnSet->fnGetHeight)(); + SwTwips nInnerHeight = aRectFnSet.GetHeight(pLay->Frame()) - + aRectFnSet.GetHeight(pLay->Prt()); if( pLay->Lower() ) { bFoundLower = true; @@ -3385,10 +3382,10 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs, pLay = static_cast<SwLayoutFrame*>(pLay->GetNext()); OSL_ENSURE( pLay->IsFootnoteContFrame(),"FootnoteContainer expected" ); nInnerHeight += pLay->InnerHeight(); - nInnerHeight += (pLay->Frame().*aRectFnSet->fnGetHeight)() - - (pLay->Prt().*aRectFnSet->fnGetHeight)(); + nInnerHeight += aRectFnSet.GetHeight(pLay->Frame()) - + aRectFnSet.GetHeight(pLay->Prt()); } - nInnerHeight -= (pCol->Prt().*aRectFnSet->fnGetHeight)(); + nInnerHeight -= aRectFnSet.GetHeight(pCol->Prt()); if( nInnerHeight > nDiff ) { nDiff = nInnerHeight; @@ -3414,7 +3411,7 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs, if ( nDiff || ::lcl_IsFlyHeightClipped( this ) || ( IsSctFrame() && static_cast<SwSectionFrame*>(this)->CalcMinDiff( nMinDiff ) ) ) { - long nPrtHeight = (Prt().*aRectFnSet->fnGetHeight)(); + long nPrtHeight = aRectFnSet.GetHeight(Prt()); // The minimum must not be smaller than our PrtHeight as // long as something juts over. if( nMinimum < nPrtHeight ) @@ -3436,7 +3433,7 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs, // minimal FrameHeight and PrtHeight is smaller than // nMindiff we grow in a way that PrtHeight is exactly // nMinDiff afterwards. - long nFrameHeight = (Frame().*aRectFnSet->fnGetHeight)(); + long nFrameHeight = aRectFnSet.GetHeight(Frame()); if ( nFrameHeight > nMinHeight || nPrtHeight >= nMinDiff ) nDiff = std::max( nDiff, nMinDiff ); else if( nDiff < nMinDiff ) @@ -3450,7 +3447,7 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs, } else if( nMaximum > nMinimum ) // We fit, do we still have some margin? { - long nPrtHeight = (Prt().*aRectFnSet->fnGetHeight)(); + long nPrtHeight = aRectFnSet.GetHeight(Prt()); if ( nMaximum < nPrtHeight ) nDiff = nMaximum - nPrtHeight; // We grew over a working // height and shrink back to it, but will this ever @@ -3486,17 +3483,17 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs, if( nDiff ) // now we shrink or grow... { Size aOldSz( Prt().SSize() ); - long nTop = (this->*aRectFnSet->fnGetTopMargin)(); - nDiff = (Prt().*aRectFnSet->fnGetHeight)() + nDiff + nBorder - - (Frame().*aRectFnSet->fnGetHeight)(); - (Frame().*aRectFnSet->fnAddBottom)( nDiff ); + long nTop = aRectFnSet.GetTopMargin(*this); + nDiff = aRectFnSet.GetHeight(Prt()) + nDiff + nBorder - + aRectFnSet.GetHeight(Frame()); + aRectFnSet.AddBottom( Frame(), nDiff ); // #i68520# SwFlyFrame *pFlyFrame = dynamic_cast<SwFlyFrame*>(this); if (pFlyFrame) { pFlyFrame->InvalidateObjRectWithSpaces(); } - (this->*aRectFnSet->fnSetYMargins)( nTop, nBorder - nTop ); + aRectFnSet.SetYMargins( *this, nTop, nBorder - nTop ); ChgLowersProp( aOldSz ); NotifyLowerObjs(); diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx index 4b300ce8bf3f..b281e52f84ae 100644 --- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx @@ -201,7 +201,7 @@ void SwAnchoredObjectPosition::GetVertAlignmentValues( SwTwips nOffset = 0; SwRectFnSet aRectFnSet(&_rVertOrientFrame); // #i11860# - top of <_rVertOrientFrame> for object positioning - const SwTwips nVertOrientTop = GetTopForObjPos( _rVertOrientFrame, aRectFnSet.fnRect, aRectFnSet.bVert ); + const SwTwips nVertOrientTop = GetTopForObjPos( _rVertOrientFrame, aRectFnSet.FnRect(), aRectFnSet.IsVert() ); // #i11860# - upper space amount of <_rVertOrientFrame> considered // for previous frame const SwTwips nVertOrientUpperSpaceForPrevFrameAndPageGrid = @@ -214,20 +214,20 @@ void SwAnchoredObjectPosition::GetVertAlignmentValues( case text::RelOrientation::FRAME: { // #i11860# - consider upper space of previous frame - nHeight = (_rVertOrientFrame.Frame().*aRectFnSet->fnGetHeight)() - + nHeight = aRectFnSet.GetHeight(_rVertOrientFrame.Frame()) - nVertOrientUpperSpaceForPrevFrameAndPageGrid; nOffset = 0; } break; case text::RelOrientation::PRINT_AREA: { - nHeight = (_rVertOrientFrame.Prt().*aRectFnSet->fnGetHeight)(); + nHeight = aRectFnSet.GetHeight(_rVertOrientFrame.Prt()); // #i11860# - consider upper space of previous frame - nOffset = (_rVertOrientFrame.*aRectFnSet->fnGetTopMargin)() - + nOffset = aRectFnSet.GetTopMargin(_rVertOrientFrame) - nVertOrientUpperSpaceForPrevFrameAndPageGrid; // if aligned to page in horizontal layout, consider header and // footer frame height appropriately. - if( _rVertOrientFrame.IsPageFrame() && !aRectFnSet.bVert ) + if( _rVertOrientFrame.IsPageFrame() && !aRectFnSet.IsVert() ) { const SwFrame* pPrtFrame = static_cast<const SwPageFrame&>(_rVertOrientFrame).Lower(); @@ -249,22 +249,22 @@ void SwAnchoredObjectPosition::GetVertAlignmentValues( break; case text::RelOrientation::PAGE_FRAME: { - nHeight = (_rPageAlignLayFrame.Frame().*aRectFnSet->fnGetHeight)(); - nOffset = (*aRectFnSet->fnYDiff)( - (_rPageAlignLayFrame.Frame().*aRectFnSet->fnGetTop)(), + nHeight = aRectFnSet.GetHeight(_rPageAlignLayFrame.Frame()); + nOffset = aRectFnSet.YDiff( + aRectFnSet.GetTop(_rPageAlignLayFrame.Frame()), nVertOrientTop ); } break; case text::RelOrientation::PAGE_PRINT_AREA: { - nHeight = (_rPageAlignLayFrame.Prt().*aRectFnSet->fnGetHeight)(); - nOffset = (_rPageAlignLayFrame.*aRectFnSet->fnGetTopMargin)() + - (*aRectFnSet->fnYDiff)( - (_rPageAlignLayFrame.Frame().*aRectFnSet->fnGetTop)(), + nHeight = aRectFnSet.GetHeight(_rPageAlignLayFrame.Prt()); + nOffset = aRectFnSet.GetTopMargin(_rPageAlignLayFrame) + + aRectFnSet.YDiff( + aRectFnSet.GetTop(_rPageAlignLayFrame.Frame()), nVertOrientTop ); // if aligned to page in horizontal layout, consider header and // footer frame height appropriately. - if( _rPageAlignLayFrame.IsPageFrame() && !aRectFnSet.bVert ) + if( _rPageAlignLayFrame.IsPageFrame() && !aRectFnSet.IsVert() ) { const SwFrame* pPrtFrame = static_cast<const SwPageFrame&>(_rPageAlignLayFrame).Lower(); @@ -290,7 +290,7 @@ void SwAnchoredObjectPosition::GetVertAlignmentValues( if ( IsAnchoredToChar() ) { nHeight = 0; - nOffset = (*aRectFnSet->fnYDiff)( ToCharTopOfLine(), nVertOrientTop ); + nOffset = aRectFnSet.YDiff( ToCharTopOfLine(), nVertOrientTop ); } else { @@ -302,8 +302,8 @@ void SwAnchoredObjectPosition::GetVertAlignmentValues( { if ( IsAnchoredToChar() ) { - nHeight = (ToCharRect()->*aRectFnSet->fnGetHeight)(); - nOffset = (*aRectFnSet->fnYDiff)( (ToCharRect()->*aRectFnSet->fnGetTop)(), + nHeight = aRectFnSet.GetHeight(*ToCharRect()); + nOffset = aRectFnSet.YDiff( aRectFnSet.GetTop(*ToCharRect()), nVertOrientTop ); } else @@ -344,7 +344,7 @@ SwTwips SwAnchoredObjectPosition::GetVertRelPos( nRelPosY = nAlignAreaOffset; const SwRect aObjBoundRect( GetAnchoredObj().GetObjRect() ); - const SwTwips nObjHeight = (aObjBoundRect.*aRectFnSet->fnGetHeight)(); + const SwTwips nObjHeight = aRectFnSet.GetHeight(aObjBoundRect); switch ( _eVertOrient ) { @@ -356,8 +356,8 @@ SwTwips SwAnchoredObjectPosition::GetVertRelPos( break; case text::VertOrientation::TOP: { - nRelPosY += aRectFnSet.bVert - ? ( aRectFnSet.bVertL2R + nRelPosY += aRectFnSet.IsVert() + ? ( aRectFnSet.IsVertL2R() ? _rLRSpacing.GetLeft() : _rLRSpacing.GetRight() ) : _rULSpacing.GetUpper(); @@ -371,8 +371,8 @@ SwTwips SwAnchoredObjectPosition::GetVertRelPos( case text::VertOrientation::BOTTOM: { nRelPosY += nAlignAreaHeight - - ( nObjHeight + ( aRectFnSet.bVert - ? ( aRectFnSet.bVertL2R + ( nObjHeight + ( aRectFnSet.IsVert() + ? ( aRectFnSet.IsVertL2R() ? _rLRSpacing.GetRight() : _rLRSpacing.GetLeft() ) : _rULSpacing.GetLower() ) ); @@ -577,14 +577,14 @@ void SwAnchoredObjectPosition::GetHoriAlignmentValues( const SwFrame& _rHoriOri { case text::RelOrientation::PRINT_AREA: { - nWidth = (_rHoriOrientFrame.Prt().*aRectFnSet->fnGetWidth)(); - nOffset = (_rHoriOrientFrame.*aRectFnSet->fnGetLeftMargin)(); + nWidth = aRectFnSet.GetWidth(_rHoriOrientFrame.Prt()); + nOffset = aRectFnSet.GetLeftMargin(_rHoriOrientFrame); if ( _rHoriOrientFrame.IsTextFrame() ) { // consider movement of text frame left nOffset += static_cast<const SwTextFrame&>(_rHoriOrientFrame).GetBaseOfstForFly( !_bObjWrapThrough ); } - else if ( _rHoriOrientFrame.IsPageFrame() && aRectFnSet.bVert ) + else if ( _rHoriOrientFrame.IsPageFrame() && aRectFnSet.IsVert() ) { // for to-page anchored objects, consider header/footer frame // in vertical layout @@ -609,27 +609,27 @@ void SwAnchoredObjectPosition::GetHoriAlignmentValues( const SwFrame& _rHoriOri case text::RelOrientation::PAGE_LEFT: { // align at left border of page frame/fly frame/cell frame - nWidth = (_rPageAlignLayFrame.*aRectFnSet->fnGetLeftMargin)(); - nOffset = (*aRectFnSet->fnXDiff)( - (_rPageAlignLayFrame.Frame().*aRectFnSet->fnGetLeft)(), - (_rHoriOrientFrame.Frame().*aRectFnSet->fnGetLeft)() ); + nWidth = aRectFnSet.GetLeftMargin(_rPageAlignLayFrame); + nOffset = aRectFnSet.XDiff( + aRectFnSet.GetLeft(_rPageAlignLayFrame.Frame()), + aRectFnSet.GetLeft(_rHoriOrientFrame.Frame()) ); _obAlignedRelToPage = true; } break; case text::RelOrientation::PAGE_RIGHT: { // align at right border of page frame/fly frame/cell frame - nWidth = (_rPageAlignLayFrame.*aRectFnSet->fnGetRightMargin)(); - nOffset = (*aRectFnSet->fnXDiff)( - (_rPageAlignLayFrame.*aRectFnSet->fnGetPrtRight)(), - (_rHoriOrientFrame.Frame().*aRectFnSet->fnGetLeft)() ); + nWidth = aRectFnSet.GetRightMargin(_rPageAlignLayFrame); + nOffset = aRectFnSet.XDiff( + aRectFnSet.GetPrtRight(_rPageAlignLayFrame), + aRectFnSet.GetLeft(_rHoriOrientFrame.Frame()) ); _obAlignedRelToPage = true; } break; case text::RelOrientation::FRAME_LEFT: { // align at left border of anchor frame - nWidth = (_rHoriOrientFrame.*aRectFnSet->fnGetLeftMargin)(); + nWidth = aRectFnSet.GetLeftMargin(_rHoriOrientFrame); nOffset = 0; } break; @@ -637,8 +637,8 @@ void SwAnchoredObjectPosition::GetHoriAlignmentValues( const SwFrame& _rHoriOri { // align at right border of anchor frame // Unify and simplify - nWidth = (_rHoriOrientFrame.*aRectFnSet->fnGetRightMargin)(); - nOffset = (_rHoriOrientFrame.Prt().*aRectFnSet->fnGetRight)(); + nWidth = aRectFnSet.GetRightMargin(_rHoriOrientFrame); + nOffset = aRectFnSet.GetRight(_rHoriOrientFrame.Prt()); } break; case text::RelOrientation::CHAR: @@ -648,20 +648,20 @@ void SwAnchoredObjectPosition::GetHoriAlignmentValues( const SwFrame& _rHoriOri if ( IsAnchoredToChar() ) { nWidth = 0; - nOffset = (*aRectFnSet->fnXDiff)( - (ToCharRect()->*aRectFnSet->fnGetLeft)(), - (ToCharOrientFrame()->Frame().*aRectFnSet->fnGetLeft)() ); + nOffset = aRectFnSet.XDiff( + aRectFnSet.GetLeft(*ToCharRect()), + aRectFnSet.GetLeft(ToCharOrientFrame()->Frame()) ); break; } SAL_FALLTHROUGH; } case text::RelOrientation::PAGE_PRINT_AREA: { - nWidth = (_rPageAlignLayFrame.Prt().*aRectFnSet->fnGetWidth)(); - nOffset = (*aRectFnSet->fnXDiff)( - (_rPageAlignLayFrame.*aRectFnSet->fnGetPrtLeft)(), - (_rHoriOrientFrame.Frame().*aRectFnSet->fnGetLeft)() ); - if ( _rHoriOrientFrame.IsPageFrame() && aRectFnSet.bVert ) + nWidth = aRectFnSet.GetWidth(_rPageAlignLayFrame.Prt()); + nOffset = aRectFnSet.XDiff( + aRectFnSet.GetPrtLeft(_rPageAlignLayFrame), + aRectFnSet.GetLeft(_rHoriOrientFrame.Frame()) ); + if ( _rHoriOrientFrame.IsPageFrame() && aRectFnSet.IsVert() ) { // for to-page anchored objects, consider header/footer frame // in vertical layout @@ -686,16 +686,16 @@ void SwAnchoredObjectPosition::GetHoriAlignmentValues( const SwFrame& _rHoriOri } case text::RelOrientation::PAGE_FRAME: { - nWidth = (_rPageAlignLayFrame.Frame().*aRectFnSet->fnGetWidth)(); - nOffset = (*aRectFnSet->fnXDiff)( - (_rPageAlignLayFrame.Frame().*aRectFnSet->fnGetLeft)(), - (_rHoriOrientFrame.Frame().*aRectFnSet->fnGetLeft)() ); + nWidth = aRectFnSet.GetWidth(_rPageAlignLayFrame.Frame()); + nOffset = aRectFnSet.XDiff( + aRectFnSet.GetLeft(_rPageAlignLayFrame.Frame()), + aRectFnSet.GetLeft(_rHoriOrientFrame.Frame()) ); _obAlignedRelToPage = true; break; } default: { - nWidth = (_rHoriOrientFrame.Frame().*aRectFnSet->fnGetWidth)(); + nWidth = aRectFnSet.GetWidth(_rHoriOrientFrame.Frame()); bool bWrapThrough = _bObjWrapThrough; // If the frame format is a TextBox of a draw shape, then use the @@ -806,7 +806,7 @@ SwTwips SwAnchoredObjectPosition::CalcRelPosX( const SwFrame& rAnchorFrame = GetAnchorFrame(); SwRectFnSet aRectFnSet(&_rHoriOrientFrame); - SwTwips nObjWidth = (GetAnchoredObj().GetObjRect().*aRectFnSet->fnGetWidth)(); + SwTwips nObjWidth = aRectFnSet.GetWidth(GetAnchoredObj().GetObjRect()); SwTwips nRelPosX = nOffset; if ( _rHoriOrient.GetHoriOrient() == text::HoriOrientation::NONE ) { @@ -835,17 +835,17 @@ SwTwips SwAnchoredObjectPosition::CalcRelPosX( else if ( text::HoriOrientation::RIGHT == eHoriOrient ) nRelPosX += nWidth - ( nObjWidth + - ( aRectFnSet.bVert ? _rULSpacing.GetLower() : _rLRSpacing.GetRight() ) ); + ( aRectFnSet.IsVert() ? _rULSpacing.GetLower() : _rLRSpacing.GetRight() ) ); else - nRelPosX += aRectFnSet.bVert ? _rULSpacing.GetUpper() : _rLRSpacing.GetLeft(); + nRelPosX += aRectFnSet.IsVert() ? _rULSpacing.GetUpper() : _rLRSpacing.GetLeft(); // adjust relative position by distance between anchor frame and // the frame, the object is oriented at. if ( &rAnchorFrame != &_rHoriOrientFrame ) { - SwTwips nLeftOrient = (_rHoriOrientFrame.Frame().*aRectFnSet->fnGetLeft)(); - SwTwips nLeftAnchor = (rAnchorFrame.Frame().*aRectFnSet->fnGetLeft)(); - nRelPosX += (*aRectFnSet->fnXDiff)( nLeftOrient, nLeftAnchor ); + SwTwips nLeftOrient = aRectFnSet.GetLeft(_rHoriOrientFrame.Frame()); + SwTwips nLeftAnchor = aRectFnSet.GetLeft(rAnchorFrame.Frame()); + nRelPosX += aRectFnSet.XDiff( nLeftOrient, nLeftAnchor ); } // adjust calculated relative horizontal position, in order to @@ -910,8 +910,8 @@ SwTwips SwAnchoredObjectPosition::AdjustHoriRelPosForDrawAside( SwTwips nAdjustedRelPosX = _nProposedRelPosX; // determine proposed object bound rectangle - Point aTmpPos = (rAnchorTextFrame.Frame().*aRectFnSet->fnGetPos)(); - if( aRectFnSet.bVert ) + Point aTmpPos = aRectFnSet.GetPos(rAnchorTextFrame.Frame()); + if( aRectFnSet.IsVert() ) { aTmpPos.X() -= _nRelPosY + aObjBoundRect.Width(); aTmpPos.Y() += nAdjustedRelPosX; @@ -934,7 +934,7 @@ SwTwips SwAnchoredObjectPosition::AdjustHoriRelPosForDrawAside( if ( DrawAsideFly( pFly, aTmpObjRect, pObjContext, nObjIndex, _bEvenPage, _eHoriOrient, _eRelOrient ) ) { - if( aRectFnSet.bVert ) + if( aRectFnSet.IsVert() ) { const SvxULSpaceItem& rOtherUL = pFly->GetFormat()->GetULSpace(); const SwTwips nOtherTop = pFly->Frame().Top() - rOtherUL.GetUpper(); @@ -1032,8 +1032,8 @@ bool SwAnchoredObjectPosition::DrawAsideFly( const SwFlyFrame* _pFly, SwRectFnSet aRectFnSet(&GetAnchorFrame()); if ( _pFly->IsFlyAtContentFrame() && - (_pFly->Frame().*aRectFnSet->fnBottomDist)( (_rObjRect.*aRectFnSet->fnGetTop)() ) < 0 && - (_rObjRect.*aRectFnSet->fnBottomDist)( (_pFly->Frame().*aRectFnSet->fnGetTop)() ) < 0 && + aRectFnSet.BottomDist( _pFly->Frame(), aRectFnSet.GetTop(_rObjRect) ) < 0 && + aRectFnSet.BottomDist( _rObjRect, aRectFnSet.GetTop(_pFly->Frame()) ) < 0 && ::FindKontext( _pFly->GetAnchorFrame(), SwFrameType::Column ) == _pObjContext ) { sal_uLong nOtherIndex = diff --git a/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx b/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx index 3cba3e08a774..6af121ee3fec 100644 --- a/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx @@ -88,7 +88,7 @@ void SwAsCharAnchoredObjectPosition::CalcPosition() const SwFrameFormat& rFrameFormat = GetFrameFormat(); SwRect aObjBoundRect( GetAnchoredObj().GetObjRect() ); - SwTwips nObjWidth = (aObjBoundRect.*aRectFnSet->fnGetWidth)(); + SwTwips nObjWidth = aRectFnSet.GetWidth(aObjBoundRect); // determine spacing values considering layout-/text-direction const SvxLRSpaceItem& rLRSpace = rFrameFormat.GetLRSpace(); @@ -303,7 +303,7 @@ void SwAsCharAnchoredObjectPosition::CalcPosition() // set new anchor position and relative position SwFlyInContentFrame* pFlyInContentFrame = &(const_cast<SwFlyInContentFrame&>(rFlyInContentFrame)); pFlyInContentFrame->SetRefPoint( aAnchorPos, aRelAttr, aRelPos ); - if( nObjWidth != (pFlyInContentFrame->Frame().*aRectFnSet->fnGetWidth)() ) + if( nObjWidth != aRectFnSet.GetWidth(pFlyInContentFrame->Frame()) ) { // recalculate object bound rectangle, if object width has changed. aObjBoundRect = GetAnchoredObj().GetObjRect(); @@ -313,7 +313,7 @@ void SwAsCharAnchoredObjectPosition::CalcPosition() aObjBoundRect.Height( aObjBoundRect.Height() + rULSpace.GetLower() ); } } - OSL_ENSURE( (rFlyInContentFrame.Frame().*aRectFnSet->fnGetHeight)(), + OSL_ENSURE( aRectFnSet.GetHeight(rFlyInContentFrame.Frame()), "SwAnchoredObjectPosition::CalcPosition(..) - fly frame has an invalid height" ); } diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx index f73145b1e324..55a9d842f33b 100644 --- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx @@ -252,15 +252,15 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // determine relative vertical position SwTwips nRelPosY = nAlignAreaOffset; - const SwTwips nObjHeight = (aObjBoundRect.*aRectFnSet->fnGetHeight)(); - const SwTwips nUpperSpace = aRectFnSet.bVert - ? ( aRectFnSet.bVertL2R + const SwTwips nObjHeight = aRectFnSet.GetHeight(aObjBoundRect); + const SwTwips nUpperSpace = aRectFnSet.IsVert() + ? ( aRectFnSet.IsVertL2R() ? rLR.GetLeft() : rLR.GetRight() ) : rUL.GetUpper(); // --> OD 2009-08-31 #monglianlayout# - const SwTwips nLowerSpace = aRectFnSet.bVert - ? ( aRectFnSet.bVertL2R + const SwTwips nLowerSpace = aRectFnSet.IsVert() + ? ( aRectFnSet.IsVertL2R() ? rLR.GetLeft() : rLR.GetRight() ) : rUL.GetLower(); @@ -272,7 +272,7 @@ void SwToContentAnchoredObjectPosition::CalcPosition() { // bottom (to character anchored) nRelPosY += nAlignAreaHeight + nUpperSpace; - if ( aRectFnSet.bVert && !aRectFnSet.bVertL2R ) + if ( aRectFnSet.IsVert() && !aRectFnSet.IsVertL2R() ) { nRelPosY += nObjHeight; } @@ -380,21 +380,21 @@ void SwToContentAnchoredObjectPosition::CalcPosition() { // #i11860# - use new method <GetTopForObjPos> // to get top of frame for object positioning. - const SwTwips nTopOfOrient = GetTopForObjPos( *pOrientFrame, aRectFnSet.fnRect, aRectFnSet.bVert ); - nRelPosY += (*aRectFnSet->fnYDiff)( nTopOfOrient, - GetTopForObjPos( rAnchorTextFrame, aRectFnSet.fnRect, aRectFnSet.bVert ) ); + const SwTwips nTopOfOrient = GetTopForObjPos( *pOrientFrame, aRectFnSet.FnRect(), aRectFnSet.IsVert() ); + nRelPosY += aRectFnSet.YDiff( nTopOfOrient, + GetTopForObjPos( rAnchorTextFrame, aRectFnSet.FnRect(), aRectFnSet.IsVert() ) ); } // #i42124# - capture object inside vertical // layout environment. { const SwTwips nTopOfAnch = - GetTopForObjPos( *pOrientFrame, aRectFnSet.fnRect, aRectFnSet.bVert ); + GetTopForObjPos( *pOrientFrame, aRectFnSet.FnRect(), aRectFnSet.IsVert() ); const SwLayoutFrame& rVertEnvironLayFrame = aEnvOfObj.GetVertEnvironmentLayoutFrame( *(pOrientFrame->GetUpper()) ); const bool bCheckBottom = !DoesObjFollowsTextFlow(); - nRelPosY = AdjustVertRelPos( nTopOfAnch, aRectFnSet.bVert, aRectFnSet.bVertL2R, + nRelPosY = AdjustVertRelPos( nTopOfAnch, aRectFnSet.IsVert(), aRectFnSet.IsVertL2R(), rVertEnvironLayFrame, nRelPosY, DoesObjFollowsTextFlow(), bCheckBottom ); @@ -418,7 +418,7 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // determine absolute 'vertical' position, depending on layout-direction // #i26791# - determine offset to 'vertical' frame // anchor position, depending on layout-direction - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) { aRelPos.X() = nRelPosY; maOffsetToFrameAnchorPos.X() = nAlignAreaOffset; @@ -486,16 +486,16 @@ void SwToContentAnchoredObjectPosition::CalcPosition() { // #i11860# - use new method <GetTopForObjPos> // to get top of frame for object positioning. - SwTwips nTopOfOrient = GetTopForObjPos( *pOrientFrame, aRectFnSet.fnRect, aRectFnSet.bVert ); + SwTwips nTopOfOrient = GetTopForObjPos( *pOrientFrame, aRectFnSet.FnRect(), aRectFnSet.IsVert() ); if ( aVert.GetRelationOrient() == text::RelOrientation::CHAR ) { - nVertOffsetToFrameAnchorPos = (*aRectFnSet->fnYDiff)( - (ToCharRect()->*aRectFnSet->fnGetBottom)(), + nVertOffsetToFrameAnchorPos = aRectFnSet.YDiff( + aRectFnSet.GetBottom(*ToCharRect()), nTopOfOrient ); } else { - nVertOffsetToFrameAnchorPos = (*aRectFnSet->fnYDiff)( ToCharTopOfLine(), + nVertOffsetToFrameAnchorPos = aRectFnSet.YDiff( ToCharTopOfLine(), nTopOfOrient ); } nRelPosY = nVertOffsetToFrameAnchorPos - aVert.GetPos(); @@ -509,13 +509,13 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // #i11860# - use new method <GetTopForObjPos> // to get top of frame for object positioning. const SwTwips nTopOfOrient = - GetTopForObjPos( *pAnchorFrameForVertPos, aRectFnSet.fnRect, aRectFnSet.bVert ); + GetTopForObjPos( *pAnchorFrameForVertPos, aRectFnSet.FnRect(), aRectFnSet.IsVert() ); // Increase <nRelPosY> by margin height, // if position is vertical aligned to "paragraph text area" if ( aVert.GetRelationOrient() == text::RelOrientation::PRINT_AREA ) { // #i11860# - consider upper space amount of previous frame - SwTwips nTopMargin = (pAnchorFrameForVertPos->*aRectFnSet->fnGetTopMargin)(); + SwTwips nTopMargin = aRectFnSet.GetTopMargin(*pAnchorFrameForVertPos); if ( pAnchorFrameForVertPos->IsTextFrame() ) { nTopMargin -= pAnchorFrameForVertPos-> @@ -528,8 +528,8 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // vertical aligned to 'page areas' else if ( aVert.GetRelationOrient() == text::RelOrientation::PAGE_FRAME ) { - nVertOffsetToFrameAnchorPos += (*aRectFnSet->fnYDiff)( - (rPageAlignLayFrame.Frame().*aRectFnSet->fnGetTop)(), + nVertOffsetToFrameAnchorPos += aRectFnSet.YDiff( + aRectFnSet.GetTop(rPageAlignLayFrame.Frame()), nTopOfOrient ); } else if ( aVert.GetRelationOrient() == text::RelOrientation::PAGE_PRINT_AREA ) @@ -540,8 +540,8 @@ void SwToContentAnchoredObjectPosition::CalcPosition() aPgPrtRect = static_cast<const SwPageFrame&>(rPageAlignLayFrame).PrtWithoutHeaderAndFooter(); } - nVertOffsetToFrameAnchorPos += (*aRectFnSet->fnYDiff)( - (aPgPrtRect.*aRectFnSet->fnGetTop)(), + nVertOffsetToFrameAnchorPos += aRectFnSet.YDiff( + aRectFnSet.GetTop(aPgPrtRect), nTopOfOrient ); } nRelPosY = nVertOffsetToFrameAnchorPos + aVert.GetPos(); @@ -556,13 +556,13 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // #i26791# - determine offset to 'vertical' // frame anchor position, depending on layout-direction - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) maOffsetToFrameAnchorPos.X() = nVertOffsetToFrameAnchorPos; else maOffsetToFrameAnchorPos.Y() = nVertOffsetToFrameAnchorPos; // #i11860# - use new method <GetTopForObjPos> // to get top of frame for object positioning. - const SwTwips nTopOfAnch = GetTopForObjPos( *pAnchorFrameForVertPos, aRectFnSet.fnRect, aRectFnSet.bVert ); + const SwTwips nTopOfAnch = GetTopForObjPos( *pAnchorFrameForVertPos, aRectFnSet.FnRect(), aRectFnSet.IsVert() ); if( nRelPosY <= 0 ) { // Allow negative position, but keep it @@ -573,11 +573,11 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // anchored object would fit into environment layout frame, if // anchored object has to follow the text flow. const bool bCheckBottom = !DoesObjFollowsTextFlow(); - nRelPosY = AdjustVertRelPos( nTopOfAnch, aRectFnSet.bVert, aRectFnSet.bVertL2R, + nRelPosY = AdjustVertRelPos( nTopOfAnch, aRectFnSet.IsVert(), aRectFnSet.IsVertL2R(), rVertEnvironLayFrame, nRelPosY, DoesObjFollowsTextFlow(), bCheckBottom ); - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) aRelPos.X() = nRelPosY; else aRelPos.Y() = nRelPosY; @@ -586,7 +586,7 @@ void SwToContentAnchoredObjectPosition::CalcPosition() { aRectFnSet.Refresh(pAnchorFrameForVertPos); SwTwips nAvail = - (*aRectFnSet->fnYDiff)( (pUpperOfOrientFrame->*aRectFnSet->fnGetPrtBottom)(), + aRectFnSet.YDiff( aRectFnSet.GetPrtBottom(*pUpperOfOrientFrame), nTopOfAnch ); const bool bInFootnote = pAnchorFrameForVertPos->IsInFootnote(); while ( nRelPosY ) @@ -602,7 +602,7 @@ void SwToContentAnchoredObjectPosition::CalcPosition() if ( bDoesVertPosFits ) { SwTwips nTmpRelPosY = - (*aRectFnSet->fnYDiff)( (pUpperOfOrientFrame->*aRectFnSet->fnGetPrtBottom)(), + aRectFnSet.YDiff( aRectFnSet.GetPrtBottom(*pUpperOfOrientFrame), nTopOfAnch ) - nAvail + nRelPosY; // #i28701# - adjust calculated @@ -613,12 +613,12 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // anchored object would fit into environment layout // frame, if anchored object has to follow the text flow. const bool bCheckBottom = !DoesObjFollowsTextFlow(); - nTmpRelPosY = AdjustVertRelPos( nTopOfAnch, aRectFnSet.bVert, aRectFnSet.bVertL2R, + nTmpRelPosY = AdjustVertRelPos( nTopOfAnch, aRectFnSet.IsVert(), aRectFnSet.IsVertL2R(), rVertEnvironLayFrame, nTmpRelPosY, DoesObjFollowsTextFlow(), bCheckBottom ); - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) aRelPos.X() = nTmpRelPosY; else aRelPos.Y() = nTmpRelPosY; @@ -661,7 +661,7 @@ void SwToContentAnchoredObjectPosition::CalcPosition() pUpperOfOrientFrame = pTmp; bMoveable = rAnchorTextFrame.IsMoveable( pUpperOfOrientFrame ); aRectFnSet.Refresh(pUpperOfOrientFrame); - nAvail = (pUpperOfOrientFrame->Prt().*aRectFnSet->fnGetHeight)(); + nAvail = aRectFnSet.GetHeight(pUpperOfOrientFrame->Prt()); } else { @@ -674,9 +674,9 @@ void SwToContentAnchoredObjectPosition::CalcPosition() { const SwFrame* pSct = pUpperOfOrientFrame->FindSctFrame(); pUpperOfOrientFrame = pSct->GetUpper(); - nAvail = (*aRectFnSet->fnYDiff)( - (pUpperOfOrientFrame->*aRectFnSet->fnGetPrtBottom)(), - (pSct->*aRectFnSet->fnGetPrtBottom)() ); + nAvail = aRectFnSet.YDiff( + aRectFnSet.GetPrtBottom(*pUpperOfOrientFrame), + aRectFnSet.GetPrtBottom(*pSct) ); } else { @@ -699,11 +699,11 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // align at 'page areas', but stay inside given environment const SwFrame& rVertEnvironLayFrame = aEnvOfObj.GetVertEnvironmentLayoutFrame( *pUpperOfOrientFrame ); - nRelPosY = AdjustVertRelPos( nTopOfAnch, aRectFnSet.bVert, aRectFnSet.bVertL2R, + nRelPosY = AdjustVertRelPos( nTopOfAnch, aRectFnSet.IsVert(), aRectFnSet.IsVertL2R(), rVertEnvironLayFrame, nRelPosY, DoesObjFollowsTextFlow() ); - if( aRectFnSet.bVert ) + if( aRectFnSet.IsVert() ) aRelPos.X() = nRelPosY; else aRelPos.Y() = nRelPosY; @@ -717,11 +717,11 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // We need to calculate the part's absolute position, in order for // it to be put onto the right page and to be pulled into the // LayLeaf's PrtArea - const SwTwips nTopOfAnch = GetTopForObjPos( *pAnchorFrameForVertPos, aRectFnSet.fnRect, aRectFnSet.bVert ); - if( aRectFnSet.bVert ) + const SwTwips nTopOfAnch = GetTopForObjPos( *pAnchorFrameForVertPos, aRectFnSet.FnRect(), aRectFnSet.IsVert() ); + if( aRectFnSet.IsVert() ) { // --> OD 2009-08-31 #monglianlayout# - if ( !aRectFnSet.bVertL2R ) + if ( !aRectFnSet.IsVertL2R() ) { GetAnchoredObj().SetObjLeft( nTopOfAnch - ( aRelPos.X() - nRelDiff ) - @@ -752,8 +752,8 @@ void SwToContentAnchoredObjectPosition::CalcPosition() if ( bIgnoreSection ) pUpperOfOrientFrame = pSctFrame->GetUpper(); } - SwTwips nDist = (GetAnchoredObj().GetObjRect().*aRectFnSet->fnBottomDist)( - (pUpperOfOrientFrame->*aRectFnSet->fnGetPrtBottom)() ); + SwTwips nDist = aRectFnSet.BottomDist( GetAnchoredObj().GetObjRect(), + aRectFnSet.GetPrtBottom(*pUpperOfOrientFrame) ); if( nDist < 0 ) { // #i23512# - correction: @@ -766,8 +766,8 @@ void SwToContentAnchoredObjectPosition::CalcPosition() { pLayoutFrameToGrow = const_cast<SwLayoutFrame*>( pUpperOfOrientFrame->FindSctFrame()->GetUpper()); - nDist = (GetAnchoredObj().GetObjRect().*aRectFnSet->fnBottomDist)( - (pLayoutFrameToGrow->*aRectFnSet->fnGetPrtBottom)() ); + nDist = aRectFnSet.BottomDist( GetAnchoredObj().GetObjRect(), + aRectFnSet.GetPrtBottom(*pLayoutFrameToGrow) ); if ( nDist >= 0 ) { pLayoutFrameToGrow = nullptr; @@ -794,8 +794,8 @@ void SwToContentAnchoredObjectPosition::CalcPosition() aVert.GetRelationOrient() == text::RelOrientation::PAGE_PRINT_AREA ) ) { - nDist = (GetAnchoredObj().GetObjRect().*aRectFnSet->fnBottomDist)( - (pUpperOfOrientFrame->*aRectFnSet->fnGetPrtBottom)() ); + nDist = aRectFnSet.BottomDist( GetAnchoredObj().GetObjRect(), + aRectFnSet.GetPrtBottom(*pUpperOfOrientFrame) ); // #i26945# - floating screen objects, which are // anchored inside a table, doesn't follow the text flow. But, they // have to stay inside its layout environment. @@ -815,22 +815,22 @@ void SwToContentAnchoredObjectPosition::CalcPosition() else { SwTwips nTmpRelPosY( 0L ); - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) nTmpRelPosY = aRelPos.X() - nDist; else nTmpRelPosY = aRelPos.Y() + nDist; const SwLayoutFrame& rVertEnvironLayFrame = aEnvOfObj.GetVertEnvironmentLayoutFrame( *pUpperOfOrientFrame ); - nTmpRelPosY = AdjustVertRelPos( nTopOfAnch, aRectFnSet.bVert, aRectFnSet.bVertL2R, + nTmpRelPosY = AdjustVertRelPos( nTopOfAnch, aRectFnSet.IsVert(), aRectFnSet.IsVertL2R(), rVertEnvironLayFrame, nTmpRelPosY, DoesObjFollowsTextFlow(), false ); - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) { aRelPos.X() = nTmpRelPosY; // --> OD 2009-08-31 #mongolianlayout# - if ( !aRectFnSet.bVertL2R ) + if ( !aRectFnSet.IsVertL2R() ) { GetAnchoredObj().SetObjLeft( nTopOfAnch - aRelPos.X() - @@ -849,8 +849,8 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // If the anchor frame is the first content of the table cell // and the object still doesn't fit, the table frame is notified, // that the object doesn't fit into the table cell. - nDist = (GetAnchoredObj().GetObjRect().*aRectFnSet->fnBottomDist)( - (pUpperOfOrientFrame->*aRectFnSet->fnGetPrtBottom)() ); + nDist = aRectFnSet.BottomDist( GetAnchoredObj().GetObjRect(), + aRectFnSet.GetPrtBottom(*pUpperOfOrientFrame) ); if ( nDist < 0 && pOrientFrame == &rAnchorTextFrame && !pOrientFrame->GetIndPrev() ) { @@ -869,8 +869,8 @@ void SwToContentAnchoredObjectPosition::CalcPosition() if ( bInSct ) { const SwLayoutFrame* pTmp = pUpperOfOrientFrame->FindSctFrame()->GetUpper(); - nDist = (GetAnchoredObj().GetObjRect().*aRectFnSet->fnBottomDist)( - (pTmp->*aRectFnSet->fnGetPrtBottom)() ); + nDist = aRectFnSet.BottomDist( GetAnchoredObj().GetObjRect(), + aRectFnSet.GetPrtBottom(*pTmp) ); // #i23129# - Try to flow into next // section|section column. Thus, do *not* leave section // area, if anchored object doesn't fit into upper of section. @@ -882,8 +882,8 @@ void SwToContentAnchoredObjectPosition::CalcPosition() } } if ( !bInSct && - (GetAnchoredObj().GetObjRect().*aRectFnSet->fnGetTop)() == - (pUpperOfOrientFrame->*aRectFnSet->fnGetPrtTop)() ) + aRectFnSet.GetTop(GetAnchoredObj().GetObjRect()) == + aRectFnSet.GetPrtTop(*pUpperOfOrientFrame) ) // It doesn't fit, moving it would not help either anymore break; @@ -904,22 +904,22 @@ void SwToContentAnchoredObjectPosition::CalcPosition() SwRectFnSet fnRectX(pNextLay); if ( !bInSct || ( pUpperOfOrientFrame->FindSctFrame()->IsAnFollow( pNextLay->FindSctFrame() ) && - (pNextLay->Prt().*fnRectX->fnGetHeight)() ) ) + fnRectX.GetHeight(pNextLay->Prt()) ) ) { SwTwips nTmpRelPosY = - (*aRectFnSet->fnYDiff)( (pNextLay->*aRectFnSet->fnGetPrtTop)(), + aRectFnSet.YDiff( aRectFnSet.GetPrtTop(*pNextLay), nTopOfAnch ); - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) aRelPos.X() = nTmpRelPosY; else aRelPos.Y() = nTmpRelPosY; pUpperOfOrientFrame = pNextLay; aRectFnSet.Refresh(pUpperOfOrientFrame); bMoveable = rAnchorTextFrame.IsMoveable( pUpperOfOrientFrame ); - if( fnRectX.bVert ) + if( fnRectX.IsVert() ) { // --> OD 2009-08-31 #mongolianlayout# - if ( !aRectFnSet.bVertL2R ) + if ( !aRectFnSet.IsVertL2R() ) { GetAnchoredObj().SetObjLeft( nTopOfAnch - aRelPos.X() - @@ -934,15 +934,15 @@ void SwToContentAnchoredObjectPosition::CalcPosition() else GetAnchoredObj().SetObjTop( nTopOfAnch + aRelPos.Y() ); - nDist = (GetAnchoredObj().GetObjRect().*aRectFnSet->fnBottomDist)( - (pUpperOfOrientFrame->*aRectFnSet->fnGetPrtBottom)() ); + nDist = aRectFnSet.BottomDist( GetAnchoredObj().GetObjRect(), + aRectFnSet.GetPrtBottom(*pUpperOfOrientFrame) ); } // #i23129# - leave section area else if ( bInSct ) { const SwLayoutFrame* pTmp = pUpperOfOrientFrame->FindSctFrame()->GetUpper(); - nDist = (GetAnchoredObj().GetObjRect().*aRectFnSet->fnBottomDist)( - (pTmp->*aRectFnSet->fnGetPrtBottom)() ); + nDist = aRectFnSet.BottomDist( GetAnchoredObj().GetObjRect(), + aRectFnSet.GetPrtBottom(*pTmp) ); if( nDist < 0 ) pUpperOfOrientFrame = pTmp; else @@ -954,8 +954,8 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // If we don't have enough room within the Area, we take a look at // the Page const SwLayoutFrame* pTmp = pUpperOfOrientFrame->FindSctFrame()->GetUpper(); - nDist = (GetAnchoredObj().GetObjRect().*aRectFnSet->fnBottomDist)( - (pTmp->*aRectFnSet->fnGetPrtBottom)() ); + nDist = aRectFnSet.BottomDist( GetAnchoredObj().GetObjRect(), + aRectFnSet.GetPrtBottom(*pTmp) ); if( nDist < 0 ) pUpperOfOrientFrame = pTmp; else @@ -979,11 +979,11 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // set calculated vertical position in order to determine correct // frame, the horizontal position is oriented at. - const SwTwips nTopOfAnch = GetTopForObjPos( *pAnchorFrameForVertPos, aRectFnSet.fnRect, aRectFnSet.bVert ); - if( aRectFnSet.bVert ) + const SwTwips nTopOfAnch = GetTopForObjPos( *pAnchorFrameForVertPos, aRectFnSet.FnRect(), aRectFnSet.IsVert() ); + if( aRectFnSet.IsVert() ) { // --> OD 2009-08-31 #mongolianlayout# - if ( !aRectFnSet.bVertL2R ) + if ( !aRectFnSet.IsVertL2R() ) { GetAnchoredObj().SetObjLeft( nTopOfAnch - aRelPos.X() - aObjBoundRect.Width() ); @@ -1007,12 +1007,12 @@ void SwToContentAnchoredObjectPosition::CalcPosition() SwTwips nHoriOffsetToFrameAnchorPos( 0L ); SwTwips nRelPosX = CalcRelPosX( *pHoriOrientFrame, aEnvOfObj, aHori, rLR, rUL, bWrapThrough, - ( aRectFnSet.bVert ? aRelPos.X() : aRelPos.Y() ), + ( aRectFnSet.IsVert() ? aRelPos.X() : aRelPos.Y() ), nHoriOffsetToFrameAnchorPos ); // #i26791# - determine offset to 'horizontal' frame // anchor position, depending on layout-direction - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) { aRelPos.Y() = nRelPosX; maOffsetToFrameAnchorPos.Y() = nHoriOffsetToFrameAnchorPos; @@ -1039,11 +1039,11 @@ void SwToContentAnchoredObjectPosition::CalcPosition() } // set absolute position at object - const SwTwips nTopOfAnch = GetTopForObjPos( *pAnchorFrameForVertPos, aRectFnSet.fnRect, aRectFnSet.bVert ); - if( aRectFnSet.bVert ) + const SwTwips nTopOfAnch = GetTopForObjPos( *pAnchorFrameForVertPos, aRectFnSet.FnRect(), aRectFnSet.IsVert() ); + if( aRectFnSet.IsVert() ) { // --> OD 2009-08-31 #mongolianlayout# - if ( !aRectFnSet.bVertL2R ) + if ( !aRectFnSet.IsVertL2R() ) { GetAnchoredObj().SetObjLeft( nTopOfAnch - aRelPos.X() - aObjBoundRect.Width() ); diff --git a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx index 1186abd52e86..4e6b35352b36 100644 --- a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx @@ -103,11 +103,11 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition() // determine absolute 'vertical' position, depending on layout-direction // #i26791# - determine offset to 'vertical' frame // anchor position, depending on layout-direction - if( aRectFnSet.bVert ) + if( aRectFnSet.IsVert() ) { - OSL_ENSURE( !aRectFnSet.bRev, "<SwToLayoutAnchoredObjectPosition::CalcPosition()> - reverse layout set." ); + OSL_ENSURE( !aRectFnSet.IsRev(), "<SwToLayoutAnchoredObjectPosition::CalcPosition()> - reverse layout set." ); - if ( aRectFnSet.bVertL2R ) + if ( aRectFnSet.IsVertL2R() ) aRelPos.X() = nRelPosY; else aRelPos.X() = -nRelPosY - aObjBoundRect.Width(); @@ -159,7 +159,7 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition() nWidth, nOffset, bDummy ); } - SwTwips nObjWidth = (aObjBoundRect.*aRectFnSet->fnGetWidth)(); + SwTwips nObjWidth = aRectFnSet.GetWidth(aObjBoundRect); // determine relative horizontal position SwTwips nRelPosX; @@ -179,9 +179,9 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition() nRelPosX = (nWidth / 2) - (nObjWidth / 2); else if ( text::HoriOrientation::RIGHT == eHoriOrient ) nRelPosX = nWidth - ( nObjWidth + - ( aRectFnSet.bVert ? rUL.GetLower() : rLR.GetRight() ) ); + ( aRectFnSet.IsVert() ? rUL.GetLower() : rLR.GetRight() ) ); else - nRelPosX = aRectFnSet.bVert ? rUL.GetUpper() : rLR.GetLeft(); + nRelPosX = aRectFnSet.IsVert() ? rUL.GetUpper() : rLR.GetLeft(); nRelPosX += nOffset; // no 'negative' relative horizontal position @@ -195,7 +195,7 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition() // determine absolute 'horizontal' position, depending on layout-direction // #i26791# - determine offset to 'horizontal' frame // anchor position, depending on layout-direction - if( aRectFnSet.bVert || aRectFnSet.bVertL2R ) + if( aRectFnSet.IsVert() || aRectFnSet.IsVertL2R() ) { aRelPos.Y() = nRelPosX; diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index e729e2b659d9..8cdb593e4e0a 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -589,28 +589,28 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType ) if ( bSpaceBefore ) { - nVal = (pFrame->*aRectFnSet->fnGetTopMargin)(); + nVal = aRectFnSet.GetTopMargin(*pFrame); if ( 0 != nVal ) mpPDFExtOutDevData->SetStructureAttributeNumerical( vcl::PDFWriter::SpaceBefore, nVal ); } if ( bSpaceAfter ) { - nVal = (pFrame->*aRectFnSet->fnGetBottomMargin)(); + nVal = aRectFnSet.GetBottomMargin(*pFrame); if ( 0 != nVal ) mpPDFExtOutDevData->SetStructureAttributeNumerical( vcl::PDFWriter::SpaceAfter, nVal ); } if ( bStartIndent ) { - nVal = (pFrame->*aRectFnSet->fnGetLeftMargin)(); + nVal = aRectFnSet.GetLeftMargin(*pFrame); if ( 0 != nVal ) mpPDFExtOutDevData->SetStructureAttributeNumerical( vcl::PDFWriter::StartIndent, nVal ); } if ( bEndIndent ) { - nVal = (pFrame->*aRectFnSet->fnGetRightMargin)(); + nVal = aRectFnSet.GetRightMargin(*pFrame); if ( 0 != nVal ) mpPDFExtOutDevData->SetStructureAttributeNumerical( vcl::PDFWriter::EndIndent, nVal ); } @@ -660,13 +660,13 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType ) if ( bWidth ) { - nVal = (pFrame->Frame().*aRectFnSet->fnGetWidth)(); + nVal = aRectFnSet.GetWidth(pFrame->Frame()); mpPDFExtOutDevData->SetStructureAttributeNumerical( vcl::PDFWriter::Width, nVal ); } if ( bHeight ) { - nVal = (pFrame->Frame().*aRectFnSet->fnGetHeight)(); + nVal = aRectFnSet.GetHeight(pFrame->Frame()); mpPDFExtOutDevData->SetStructureAttributeNumerical( vcl::PDFWriter::Height, nVal ); } @@ -699,8 +699,8 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType ) const TableColumnsMapEntry& rCols = SwEnhancedPDFExportHelper::GetTableColumnsMap()[ pTable ]; - const long nLeft = (pThisCell->Frame().*fnRectX->fnGetLeft)(); - const long nRight = (pThisCell->Frame().*fnRectX->fnGetRight)(); + const long nLeft = fnRectX.GetLeft(pThisCell->Frame()); + const long nRight = fnRectX.GetRight(pThisCell->Frame()); const TableColumnsMapEntry::const_iterator aLeftIter = rCols.find( nLeft ); const TableColumnsMapEntry::const_iterator aRightIter = rCols.find( nRight ); @@ -1190,12 +1190,12 @@ void SwTaggedPDFHelper::BeginBlockStructureElements() { const SwFrame* pCellFrame = pRowFrame->GetLower(); - const long nLeft = (pCellFrame->Frame().*aRectFnSet->fnGetLeft)(); + const long nLeft = aRectFnSet.GetLeft(pCellFrame->Frame()); rCols.insert( nLeft ); while ( pCellFrame ) { - const long nRight = (pCellFrame->Frame().*aRectFnSet->fnGetRight)(); + const long nRight = aRectFnSet.GetRight(pCellFrame->Frame()); rCols.insert( nRight ); pCellFrame = pCellFrame->GetNext(); } diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx index 959dd44cfcd1..bca1e1edfc2e 100644 --- a/sw/source/core/text/frmcrsr.cxx +++ b/sw/source/core/text/frmcrsr.cxx @@ -195,17 +195,17 @@ bool SwTextFrame::GetCharRect( SwRect& rOrig, const SwPosition &rPos, const SwFrame* pTmpFrame = static_cast<SwFrame*>(pFrame->GetUpper()); SwRectFnSet aRectFnSet(pFrame); - const SwTwips nUpperMaxY = (pTmpFrame->*aRectFnSet->fnGetPrtBottom)(); - const SwTwips nFrameMaxY = (pFrame->*aRectFnSet->fnGetPrtBottom)(); + const SwTwips nUpperMaxY = aRectFnSet.GetPrtBottom(*pTmpFrame); + const SwTwips nFrameMaxY = aRectFnSet.GetPrtBottom(*pFrame); // nMaxY is an absolute value - SwTwips nMaxY = aRectFnSet.bVert ? - ( aRectFnSet.bVertL2R ? std::min( nFrameMaxY, nUpperMaxY ) : std::max( nFrameMaxY, nUpperMaxY ) ) : + SwTwips nMaxY = aRectFnSet.IsVert() ? + ( aRectFnSet.IsVertL2R() ? std::min( nFrameMaxY, nUpperMaxY ) : std::max( nFrameMaxY, nUpperMaxY ) ) : std::min( nFrameMaxY, nUpperMaxY ); bool bRet = false; - if ( pFrame->IsEmpty() || ! (pFrame->Prt().*aRectFnSet->fnGetHeight)() ) + if ( pFrame->IsEmpty() || ! aRectFnSet.GetHeight(pFrame->Prt()) ) { Point aPnt1 = pFrame->Frame().Pos() + pFrame->Prt().Pos(); SwTextNode* pTextNd = const_cast<SwTextFrame*>(this)->GetTextNode(); @@ -213,11 +213,11 @@ bool SwTextFrame::GetCharRect( SwRect& rOrig, const SwPosition &rPos, pTextNd->GetFirstLineOfsWithNum( nFirstOffset ); Point aPnt2; - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) { if( nFirstOffset > 0 ) aPnt1.Y() += nFirstOffset; - if ( aPnt1.X() < nMaxY && !aRectFnSet.bVertL2R ) + if ( aPnt1.X() < nMaxY && !aRectFnSet.IsVertL2R() ) aPnt1.X() = nMaxY; aPnt2.X() = aPnt1.X() + pFrame->Prt().Width(); aPnt2.Y() = aPnt1.Y(); @@ -242,7 +242,7 @@ bool SwTextFrame::GetCharRect( SwRect& rOrig, const SwPosition &rPos, if ( pCMS ) { pCMS->m_aRealHeight.X() = 0; - pCMS->m_aRealHeight.Y() = aRectFnSet.bVert ? -rOrig.Width() : rOrig.Height(); + pCMS->m_aRealHeight.Y() = aRectFnSet.IsVert() ? -rOrig.Width() : rOrig.Height(); } if ( pFrame->IsRightToLeft() ) @@ -256,7 +256,7 @@ bool SwTextFrame::GetCharRect( SwRect& rOrig, const SwPosition &rPos, return false; SwFrameSwapper aSwapper( pFrame, true ); - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) nMaxY = pFrame->SwitchVerticalToHorizontal( nMaxY ); bool bGoOn = true; @@ -278,11 +278,11 @@ bool SwTextFrame::GetCharRect( SwRect& rOrig, const SwPosition &rPos, if ( pFrame->IsRightToLeft() ) pFrame->SwitchLTRtoRTL( rOrig ); - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) pFrame->SwitchHorizontalToVertical( rOrig ); if( pFrame->IsUndersized() && pCMS && !pFrame->GetNext() && - (rOrig.*aRectFnSet->fnGetBottom)() == nUpperMaxY && + aRectFnSet.GetBottom(rOrig) == nUpperMaxY && pFrame->GetOfst() < nOffset && !pFrame->IsFollow() && !bNoScroll && pFrame->GetTextNode()->GetText().getLength() != nNextOfst) @@ -304,7 +304,7 @@ bool SwTextFrame::GetCharRect( SwRect& rOrig, const SwPosition &rPos, } } - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) { if ( pCMS->m_bRealHeight ) { @@ -330,19 +330,19 @@ bool SwTextFrame::GetCharRect( SwRect& rOrig, const SwPosition &rPos, { SwPageFrame *pPage = pFrame->FindPageFrame(); OSL_ENSURE( pPage, "Text escaped from page?" ); - const SwTwips nOrigTop = (rOrig.*aRectFnSet->fnGetTop)(); - const SwTwips nPageTop = (pPage->Frame().*aRectFnSet->fnGetTop)(); - const SwTwips nPageBott = (pPage->Frame().*aRectFnSet->fnGetBottom)(); + const SwTwips nOrigTop = aRectFnSet.GetTop(rOrig); + const SwTwips nPageTop = aRectFnSet.GetTop(pPage->Frame()); + const SwTwips nPageBott = aRectFnSet.GetBottom(pPage->Frame()); // We have the following situation: if the frame is in an invalid // sectionframe, it's possible that the frame is outside the page. // If we restrict the cursor position to the page area, we enforce // the formatting of the page, of the section frame and the frame itself. - if( (*aRectFnSet->fnYDiff)( nPageTop, nOrigTop ) > 0 ) - (rOrig.*aRectFnSet->fnSetTop)( nPageTop ); + if( aRectFnSet.YDiff( nPageTop, nOrigTop ) > 0 ) + aRectFnSet.SetTop( rOrig, nPageTop ); - if ( (*aRectFnSet->fnYDiff)( nOrigTop, nPageBott ) > 0 ) - (rOrig.*aRectFnSet->fnSetTop)( nPageBott ); + if ( aRectFnSet.YDiff( nOrigTop, nPageBott ) > 0 ) + aRectFnSet.SetTop( rOrig, nPageBott ); } return bRet; @@ -365,26 +365,26 @@ bool SwTextFrame::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const const SwFrame* pTmpFrame = static_cast<SwFrame*>(pFrame->GetUpper()); SwRectFnSet aRectFnSet(pTmpFrame); - SwTwips nUpperMaxY = (pTmpFrame->*aRectFnSet->fnGetPrtBottom)(); + SwTwips nUpperMaxY = aRectFnSet.GetPrtBottom(*pTmpFrame); // nMaxY is in absolute value SwTwips nMaxY; - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) { - if ( aRectFnSet.bVertL2R ) - nMaxY = std::min( (pFrame->*aRectFnSet->fnGetPrtBottom)(), nUpperMaxY ); + if ( aRectFnSet.IsVertL2R() ) + nMaxY = std::min( aRectFnSet.GetPrtBottom(*pFrame), nUpperMaxY ); else - nMaxY = std::max( (pFrame->*aRectFnSet->fnGetPrtBottom)(), nUpperMaxY ); + nMaxY = std::max( aRectFnSet.GetPrtBottom(*pFrame), nUpperMaxY ); } else - nMaxY = std::min( (pFrame->*aRectFnSet->fnGetPrtBottom)(), nUpperMaxY ); - if ( pFrame->IsEmpty() || ! (pFrame->Prt().*aRectFnSet->fnGetHeight)() ) + nMaxY = std::min( aRectFnSet.GetPrtBottom(*pFrame), nUpperMaxY ); + if ( pFrame->IsEmpty() || ! aRectFnSet.GetHeight(pFrame->Prt()) ) { Point aPnt1 = pFrame->Frame().Pos() + pFrame->Prt().Pos(); Point aPnt2; - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) { - if ( aPnt1.X() < nMaxY && !aRectFnSet.bVertL2R ) + if ( aPnt1.X() < nMaxY && !aRectFnSet.IsVertL2R() ) aPnt1.X() = nMaxY; aPnt2.X() = aPnt1.X() + pFrame->Prt().Width(); @@ -410,7 +410,7 @@ bool SwTextFrame::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const return false; SwFrameSwapper aSwapper( pFrame, true ); - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) nMaxY = pFrame->SwitchVerticalToHorizontal( nMaxY ); SwTextSizeInfo aInf( pFrame ); @@ -428,7 +428,7 @@ bool SwTextFrame::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const if ( pFrame->IsRightToLeft() ) pFrame->SwitchLTRtoRTL( rOrig ); - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) pFrame->SwitchHorizontalToVertical( rOrig ); return true; @@ -458,11 +458,11 @@ bool SwTextFrame::GetTopOfLine( SwTwips& _onTopOfLine, else { SwRectFnSet aRectFnSet(this); - if ( IsEmpty() || !(Prt().*aRectFnSet->fnGetHeight)() ) + if ( IsEmpty() || !aRectFnSet.GetHeight(Prt()) ) { // consider upper space amount considered // for previous frame and the page grid. - _onTopOfLine = (this->*aRectFnSet->fnGetPrtTop)(); + _onTopOfLine = aRectFnSet.GetPrtTop(*this); } else { @@ -480,7 +480,7 @@ bool SwTextFrame::GetTopOfLine( SwTwips& _onTopOfLine, SwRect aCharRect; if ( GetAutoPos( aCharRect, _rPos ) ) { - _onTopOfLine = (aCharRect.*aRectFnSet->fnGetTop)(); + _onTopOfLine = aRectFnSet.GetTop(aCharRect); } else { @@ -497,7 +497,7 @@ bool SwTextFrame::GetTopOfLine( SwTwips& _onTopOfLine, aLine.CharCursorToLine( nOffset ); // determine top of line _onTopOfLine = aLine.Y(); - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) { _onTopOfLine = pFrame->SwitchHorizontalToVertical( _onTopOfLine ); } @@ -1649,12 +1649,12 @@ void SwTextFrame::FillCursorPos( SwFillData& rFill ) const pUp = pUp->GetUpper()->GetUpper()->GetUpper(); } SwRectFnSet aRectFnSet(this); - SwTwips nLimit = (pUp->*aRectFnSet->fnGetPrtBottom)(); + SwTwips nLimit = aRectFnSet.GetPrtBottom(*pUp); SwTwips nRectBottom = rRect.Bottom(); - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) nRectBottom = SwitchHorizontalToVertical( nRectBottom ); - if( (*aRectFnSet->fnYDiff)( nLimit, nRectBottom ) < 0 ) + if( aRectFnSet.YDiff( nLimit, nRectBottom ) < 0 ) bFill = false; else rRect.Width( 1 ); diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index 5d25abac0b13..af58fe2d827e 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -201,8 +201,8 @@ bool SwTextFrame::CalcFollow( const sal_Int32 nTextOfst ) #endif SwRectFnSet aRectFnSet(this); - SwTwips nOldBottom = (GetUpper()->Frame().*aRectFnSet->fnGetBottom)(); - SwTwips nMyPos = (Frame().*aRectFnSet->fnGetTop)(); + SwTwips nOldBottom = aRectFnSet.GetBottom(GetUpper()->Frame()); + SwTwips nMyPos = aRectFnSet.GetTop(Frame()); const SwPageFrame *pPage = nullptr; bool bOldInvaContent = true; @@ -231,7 +231,7 @@ bool SwTextFrame::CalcFollow( const sal_Int32 nTextOfst ) pMyFollow->CalcFootnoteFlag(); if ( !pMyFollow->GetNext() && !pMyFollow->HasFootnote() ) - nOldBottom = aRectFnSet.bVert ? 0 : LONG_MAX; + nOldBottom = aRectFnSet.IsVert() ? 0 : LONG_MAX; while( true ) { @@ -328,9 +328,9 @@ bool SwTextFrame::CalcFollow( const sal_Int32 nTextOfst ) #endif const long nRemaining = - - (GetUpper()->Frame().*aRectFnSet->fnBottomDist)( nOldBottom ); + - aRectFnSet.BottomDist( GetUpper()->Frame(), nOldBottom ); if ( nRemaining > 0 && !GetUpper()->IsSctFrame() && - nRemaining != ( aRectFnSet.bVert ? + nRemaining != ( aRectFnSet.IsVert() ? nMyPos - Frame().Right() : Frame().Top() - nMyPos ) ) { @@ -368,14 +368,14 @@ void SwTextFrame::AdjustFrame( const SwTwips nChgHght, bool bHasToFit ) SwTwips nReal = Grow( nChgHght, true ); if( nReal < nChgHght ) { - SwTwips nBot = (*aRectFnSet->fnYInc)( (Frame().*aRectFnSet->fnGetBottom)(), + SwTwips nBot = aRectFnSet.YInc( aRectFnSet.GetBottom(Frame()), nChgHght - nReal ); SwFrame* pCont = FindFootnoteFrame()->GetUpper(); - if( (pCont->Frame().*aRectFnSet->fnBottomDist)( nBot ) > 0 ) + if( aRectFnSet.BottomDist( pCont->Frame(), nBot ) > 0 ) { - (Frame().*aRectFnSet->fnAddBottom)( nChgHght ); - if( aRectFnSet.bVert ) + aRectFnSet.AddBottom( Frame(), nChgHght ); + if( aRectFnSet.IsVert() ) Prt().SSize().Width() += nChgHght; else Prt().SSize().Height() += nChgHght; @@ -443,8 +443,8 @@ void SwTextFrame::AdjustFrame( const SwTwips nChgHght, bool bHasToFit ) ( GetUpper()->Lower() == this || GetUpper()->Lower()->IsValid() ) ) { - long nAdd = (*aRectFnSet->fnYDiff)( (GetUpper()->Lower()->Frame().*aRectFnSet->fnGetTop)(), - (GetUpper()->*aRectFnSet->fnGetPrtTop)() ); + long nAdd = aRectFnSet.YDiff( aRectFnSet.GetTop(GetUpper()->Lower()->Frame()), + aRectFnSet.GetPrtTop(*GetUpper()) ); OSL_ENSURE( nAdd >= 0, "Ey" ); nRstHeight += nAdd; } @@ -453,8 +453,8 @@ void SwTextFrame::AdjustFrame( const SwTwips nChgHght, bool bHasToFit ) // This can happen, if it's located within a FlyAtContentFrame, which changed sides by a // Grow(). In such a case, it's wrong to execute the following Grow(). // In the case of a bug, we end up with an infinite loop. - SwTwips nFrameHeight = (Frame().*aRectFnSet->fnGetHeight)(); - SwTwips nPrtHeight = (Prt().*aRectFnSet->fnGetHeight)(); + SwTwips nFrameHeight = aRectFnSet.GetHeight(Frame()); + SwTwips nPrtHeight = aRectFnSet.GetHeight(Prt()); if( nRstHeight < nFrameHeight ) { @@ -788,14 +788,14 @@ bool SwTextFrame::CalcPreps() // -> we let our Frame become too big SwTwips nChgHeight = GetParHeight(); - if( nChgHeight >= (Prt().*aRectFnSet->fnGetHeight)() ) + if( nChgHeight >= aRectFnSet.GetHeight(Prt()) ) { if( bPrepMustFit ) { GetFollow()->SetJustWidow( true ); GetFollow()->Prepare(); } - else if ( aRectFnSet.bVert ) + else if ( aRectFnSet.IsVert() ) { Frame().Width( Frame().Width() + Frame().Left() ); Prt().Width( Prt().Width() + Frame().Left() ); @@ -813,17 +813,17 @@ bool SwTextFrame::CalcPreps() } else { - OSL_ENSURE( nChgHeight < (Prt().*aRectFnSet->fnGetHeight)(), + OSL_ENSURE( nChgHeight < aRectFnSet.GetHeight(Prt()), "+SwTextFrame::CalcPrep: want to shrink" ); - nChgHeight = (Prt().*aRectFnSet->fnGetHeight)() - nChgHeight; + nChgHeight = aRectFnSet.GetHeight(Prt()) - nChgHeight; GetFollow()->SetJustWidow( true ); GetFollow()->Prepare(); Shrink( nChgHeight ); SwRect &rRepaint = pPara->GetRepaint(); - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) { SwRect aRepaint( Frame().Pos() + Prt().Pos(), Prt().SSize() ); SwitchVerticalToHorizontal( aRepaint ); @@ -910,17 +910,17 @@ bool SwTextFrame::CalcPreps() // truncate if( bPrepMustFit ) { - const SwTwips nMust = (GetUpper()->*aRectFnSet->fnGetPrtBottom)(); - const SwTwips nIs = (Frame().*aRectFnSet->fnGetBottom)(); + const SwTwips nMust = aRectFnSet.GetPrtBottom(*GetUpper()); + const SwTwips nIs = aRectFnSet.GetBottom(Frame()); - if( aRectFnSet.bVert && nIs < nMust ) + if( aRectFnSet.IsVert() && nIs < nMust ) { Shrink( nMust - nIs ); if( Prt().Width() < 0 ) Prt().Width( 0 ); SetUndersized( true ); } - else if ( ! aRectFnSet.bVert && nIs > nMust ) + else if ( ! aRectFnSet.IsVert() && nIs > nMust ) { Shrink( nIs - nMust ); if( Prt().Height() < 0 ) @@ -1692,16 +1692,16 @@ void SwTextFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderAttr // The range autopilot or the BASIC interface pass us TextFrames with // a width <= 0 from time to time - if( (Prt().*aRectFnSet->fnGetWidth)() <= 0 ) + if( aRectFnSet.GetWidth(Prt()) <= 0 ) { // If MustFit is set, we shrink to the Upper's bottom edge if needed. // Else we just take a standard size of 12 Pt. (240 twip). SwTextLineAccess aAccess( this ); - long nFrameHeight = (Frame().*aRectFnSet->fnGetHeight)(); + long nFrameHeight = aRectFnSet.GetHeight(Frame()); if( aAccess.GetPara()->IsPrepMustFit() ) { - const SwTwips nLimit = (GetUpper()->*aRectFnSet->fnGetPrtBottom)(); - const SwTwips nDiff = - (Frame().*aRectFnSet->fnBottomDist)( nLimit ); + const SwTwips nLimit = aRectFnSet.GetPrtBottom(*GetUpper()); + const SwTwips nDiff = - aRectFnSet.BottomDist( Frame(), nLimit ); if( nDiff > 0 ) Shrink( nDiff ); } @@ -1709,13 +1709,13 @@ void SwTextFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderAttr Shrink( nFrameHeight - 240 ); else if( 240 > nFrameHeight ) Grow( 240 - nFrameHeight ); - nFrameHeight = (Frame().*aRectFnSet->fnGetHeight)(); + nFrameHeight = aRectFnSet.GetHeight(Frame()); - long nTop = (this->*aRectFnSet->fnGetTopMargin)(); + long nTop = aRectFnSet.GetTopMargin(*this); if( nTop > nFrameHeight ) - (this->*aRectFnSet->fnSetYMargins)( nFrameHeight, 0 ); - else if( (Prt().*aRectFnSet->fnGetHeight)() < 0 ) - (Prt().*aRectFnSet->fnSetHeight)( 0 ); + aRectFnSet.SetYMargins( *this, nFrameHeight, 0 ); + else if( aRectFnSet.GetHeight(Prt()) < 0 ) + aRectFnSet.SetHeight( Prt(), 0 ); return; } @@ -1736,7 +1736,7 @@ void SwTextFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderAttr // Attention: Format() could be triggered by GetFormatted() if( IsHiddenNow() ) { - long nPrtHeight = (Prt().*aRectFnSet->fnGetHeight)(); + long nPrtHeight = aRectFnSet.GetHeight(Prt()); if( nPrtHeight ) { HideHidden(); @@ -1780,11 +1780,11 @@ void SwTextFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderAttr OSL_ENSURE( pMaster, "SwTextFrame::Format: homeless follow" ); if( pMaster ) pMaster->Prepare( PREP_FOLLOW_FOLLOWS ); - SwTwips nMaxY = (GetUpper()->*aRectFnSet->fnGetPrtBottom)(); - if( (Frame().*aRectFnSet->fnOverStep)( nMaxY ) ) - (this->*aRectFnSet->fnSetLimit)( nMaxY ); - else if( (Frame().*aRectFnSet->fnBottomDist)( nMaxY ) < 0 ) - (Frame().*aRectFnSet->fnAddBottom)( -(Frame().*aRectFnSet->fnGetHeight)() ); + SwTwips nMaxY = aRectFnSet.GetPrtBottom(*GetUpper()); + if( aRectFnSet.OverStep( Frame(), nMaxY ) ) + aRectFnSet.SetLimit( *this, nMaxY ); + else if( aRectFnSet.BottomDist( Frame(), nMaxY ) < 0 ) + aRectFnSet.AddBottom( Frame(), -aRectFnSet.GetHeight(Frame()) ); } else { @@ -1798,7 +1798,7 @@ void SwTextFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderAttr if( pFootnoteBoss ) { const SwFootnoteContFrame* pCont = pFootnoteBoss->FindFootnoteCont(); - nFootnoteHeight = pCont ? (pCont->Frame().*aRectFnSet->fnGetHeight)() : 0; + nFootnoteHeight = pCont ? aRectFnSet.GetHeight(pCont->Frame()) : 0; } do { @@ -1806,7 +1806,7 @@ void SwTextFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderAttr if( pFootnoteBoss && nFootnoteHeight ) { const SwFootnoteContFrame* pCont = pFootnoteBoss->FindFootnoteCont(); - SwTwips nNewHeight = pCont ? (pCont->Frame().*aRectFnSet->fnGetHeight)() : 0; + SwTwips nNewHeight = pCont ? aRectFnSet.GetHeight(pCont->Frame()) : 0; // If we lost some footnotes, we may have more space // for our main text, so we have to format again ... if( nNewHeight < nFootnoteHeight ) diff --git a/sw/source/core/text/frminf.cxx b/sw/source/core/text/frminf.cxx index ba1e199cefe5..b1ac9c9bb760 100644 --- a/sw/source/core/text/frminf.cxx +++ b/sw/source/core/text/frminf.cxx @@ -117,28 +117,28 @@ SwTwips SwTextFrameInfo::GetCharPos( sal_Int32 nChar, bool bCenter ) const SwRect aRect; if( static_cast<SwTextCursor&>(aLine).GetCharRect( &aRect, nChar ) ) { - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) pFrame->SwitchHorizontalToVertical( aRect ); - nStt = (aRect.*aRectFnSet->fnGetLeft)(); + nStt = aRectFnSet.GetLeft(aRect); } else nStt = aLine.GetLineStart(); if( !bCenter ) - return nStt - (pFrame->Frame().*aRectFnSet->fnGetLeft)(); + return nStt - aRectFnSet.GetLeft(pFrame->Frame()); if( static_cast<SwTextCursor&>(aLine).GetCharRect( &aRect, nChar+1 ) ) { - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) pFrame->SwitchHorizontalToVertical( aRect ); - nNext = (aRect.*aRectFnSet->fnGetLeft)(); + nNext = aRectFnSet.GetLeft(aRect); } else nNext = aLine.GetLineStart(); - return (( nNext + nStt ) / 2 ) - (pFrame->Frame().*aRectFnSet->fnGetLeft)(); + return (( nNext + nStt ) / 2 ) - aRectFnSet.GetLeft(pFrame->Frame()); } SwPaM *AddPam( SwPaM *pPam, const SwTextFrame* pTextFrame, diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index 97dcd117e56e..488fe3360e29 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -1021,8 +1021,8 @@ SwTwips SwTextNode::GetWidthOfLeadingTabs() const SwRect aRect; pFrame->GetCharRect( aRect, aPos ); nRet = pFrame->IsRightToLeft() ? - (pFrame->*aRectFnSet->fnGetPrtRight)() - (aRect.*aRectFnSet->fnGetRight)() : - (aRect.*aRectFnSet->fnGetLeft)() - (pFrame->*aRectFnSet->fnGetPrtLeft)(); + aRectFnSet.GetPrtRight(*pFrame) - aRectFnSet.GetRight(aRect) : + aRectFnSet.GetLeft(aRect) - aRectFnSet.GetPrtLeft(*pFrame); break; } } diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx index 884e5ce50a03..f025acbd3049 100644 --- a/sw/source/core/text/itrcrsr.cxx +++ b/sw/source/core/text/itrcrsr.cxx @@ -1778,10 +1778,10 @@ bool SwTextFrame::FillSelection( SwSelectionList& rSelList, const SwRect& rRect SwTextIter aLine( const_cast<SwTextFrame*>(this), &aInf ); // We have to care for top-to-bottom layout, where right becomes top etc. SwRectFnSet aRectFnSet(this); - SwTwips nTop = (aRect.*aRectFnSet->fnGetTop)(); - SwTwips nBottom = (aRect.*aRectFnSet->fnGetBottom)(); - SwTwips nLeft = (aRect.*aRectFnSet->fnGetLeft)(); - SwTwips nRight = (aRect.*aRectFnSet->fnGetRight)(); + SwTwips nTop = aRectFnSet.GetTop(aRect); + SwTwips nBottom = aRectFnSet.GetBottom(aRect); + SwTwips nLeft = aRectFnSet.GetLeft(aRect); + SwTwips nRight = aRectFnSet.GetRight(aRect); SwTwips nY = aLine.Y(); // Top position of the first line SwTwips nLastY = nY; while( nY < nTop && aLine.Next() ) // line above rectangle @@ -1805,7 +1805,7 @@ bool SwTextFrame::FillSelection( SwSelectionList& rSelList, const SwRect& rRect { nLastY += nY; nLastY /= 2; - if( aRectFnSet.bVert ) + if( aRectFnSet.IsVert() ) { aPoint.X() = nLastY; aPoint.Y() = nLeft; @@ -1820,7 +1820,7 @@ bool SwTextFrame::FillSelection( SwSelectionList& rSelList, const SwRect& rRect SwCursorMoveState aState( MV_UPDOWN ); if( GetCursorOfst( &aPosL, aPoint, &aState ) ) { - if( aRectFnSet.bVert ) + if( aRectFnSet.IsVert() ) { aPoint.X() = nLastY; aPoint.Y() = nRight; diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 4e315b731274..e03d118e47a5 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -484,11 +484,11 @@ void SwTextFormatter::BuildPortions( SwTextFormatInfo &rInf ) SwRectFnSet aRectFnSet(pPageFrame); const long nGridOrigin = pBody ? - (pBody->*aRectFnSet->fnGetPrtLeft)() : - (pPageFrame->*aRectFnSet->fnGetPrtLeft)(); + aRectFnSet.GetPrtLeft(*pBody) : + aRectFnSet.GetPrtLeft(*pPageFrame); SwTwips nStartX = rInf.X() + GetLeftMargin(); - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) { Point aPoint( nStartX, 0 ); m_pFrame->SwitchHorizontalToVertical( aPoint ); @@ -1833,9 +1833,9 @@ void SwTextFormatter::CalcRealHeight( bool bNewLine ) { SwTwips nTmpY = Y() + m_pCurr->GetAscent() + nLineHeight - m_pCurr->Height(); SwRectFnSet aRectFnSet(m_pFrame); - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) nTmpY = m_pFrame->SwitchHorizontalToVertical( nTmpY ); - nTmpY = (*aRectFnSet->fnYDiff)( nTmpY, RegStart() ); + nTmpY = aRectFnSet.YDiff( nTmpY, RegStart() ); const sal_uInt16 nDiff = sal_uInt16( nTmpY % RegDiff() ); if( nDiff ) nLineHeight += RegDiff() - nDiff; @@ -1867,8 +1867,8 @@ void SwTextFormatter::FeedInf( SwTextFormatInfo &rInf ) const nTmpFirst > USHRT_MAX ) { SwRectFnSet aRectFnSet(rInf.GetTextFrame()); - nTmpLeft = (rInf.GetTextFrame()->Frame().*aRectFnSet->fnGetLeft)(); - nTmpRight = (rInf.GetTextFrame()->Frame().*aRectFnSet->fnGetRight)(); + nTmpLeft = aRectFnSet.GetLeft(rInf.GetTextFrame()->Frame()); + nTmpRight = aRectFnSet.GetRight(rInf.GetTextFrame()->Frame()); nTmpFirst = nTmpLeft; } @@ -2445,14 +2445,14 @@ void SwTextFormatter::CalcFlyWidth( SwTextFormatInfo &rInf ) SwRectFnSet aRectFnSet(pPageFrame); const long nGridOrigin = pBody ? - (pBody->*aRectFnSet->fnGetPrtLeft)() : - (pPageFrame->*aRectFnSet->fnGetPrtLeft)(); + aRectFnSet.GetPrtLeft(*pBody) : + aRectFnSet.GetPrtLeft(*pPageFrame); const SwDoc *pDoc = rInf.GetTextFrame()->GetNode()->GetDoc(); const sal_uInt16 nGridWidth = GetGridWidth(*pGrid, *pDoc); SwTwips nStartX = GetLeftMargin(); - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) { Point aPoint( nStartX, 0 ); m_pFrame->SwitchHorizontalToVertical( aPoint ); diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index c881df08f7c9..8521b755837d 100644 --- a/sw/source/core/text/porrst.cxx +++ b/sw/source/core/text/porrst.cxx @@ -319,7 +319,7 @@ bool SwTextFrame::FormatEmpty() } SwRectFnSet aRectFnSet(this); - const SwTwips nChg = nHeight - (Prt().*aRectFnSet->fnGetHeight)(); + const SwTwips nChg = nHeight - aRectFnSet.GetHeight(Prt()); if( !nChg ) SetUndersized( false ); @@ -357,7 +357,7 @@ bool SwTextFrame::FillRegister( SwTwips& rRegStart, sal_uInt16& rRegDiff ) if( ( SwFrameType::Body| SwFrameType::Fly ) & pFrame->GetType() ) { SwRectFnSet aRectFnSet(pFrame); - rRegStart = (pFrame->*aRectFnSet->fnGetPrtTop)(); + rRegStart = aRectFnSet.GetPrtTop(*pFrame); pFrame = pFrame->FindPageFrame(); if( pFrame->IsPageFrame() ) { @@ -447,7 +447,7 @@ bool SwTextFrame::FillRegister( SwTwips& rRegStart, sal_uInt16& rRegDiff ) } } const long nTmpDiff = pDesc->GetRegAscent() - rRegDiff; - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) rRegStart -= nTmpDiff; else rRegStart += nTmpDiff; diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index 2547d9845c32..309e3e3be8a6 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -36,7 +36,6 @@ #include "notxtfrm.hxx" #include "fmtcnct.hxx" #include "inftxt.hxx" -#include <pormulti.hxx> #include <svx/obj3d.hxx> #include <editeng/txtrange.hxx> #include <editeng/lrspitem.hxx> @@ -273,9 +272,9 @@ const SwRect SwContourCache::ContourRect( const SwFormat* pFormat, pTextRanger[ 0 ] = pTmpRanger; } SwRectFnSet aRectFnSet(pFrame); - long nTmpTop = (rLine.*aRectFnSet->fnGetTop)(); + long nTmpTop = aRectFnSet.GetTop(rLine); // fnGetBottom is top + height - long nTmpBottom = (rLine.*aRectFnSet->fnGetBottom)(); + long nTmpBottom = aRectFnSet.GetBottom(rLine); Range aRange( std::min( nTmpTop, nTmpBottom ), std::max( nTmpTop, nTmpBottom ) ); @@ -301,10 +300,10 @@ const SwRect SwContourCache::ContourRect( const SwFormat* pFormat, if( bSet && nIdx < nCount ) { - (aRet.*aRectFnSet->fnSetTopAndHeight)( (rLine.*aRectFnSet->fnGetTop)(), - (rLine.*aRectFnSet->fnGetHeight)() ); - (aRet.*aRectFnSet->fnSetLeft)( (*pTmp)[ nIdx ] ); - (aRet.*aRectFnSet->fnSetRight)( (*pTmp)[ nIdx + 1 ] + 1 ); + aRectFnSet.SetTopAndHeight( aRet, aRectFnSet.GetTop(rLine), + aRectFnSet.GetHeight(rLine) ); + aRectFnSet.SetLeft( aRet, (*pTmp)[ nIdx ] ); + aRectFnSet.SetRight( aRet, (*pTmp)[ nIdx + 1 ] + 1 ); } } return aRet; @@ -394,14 +393,14 @@ SwRect SwTextFly::GetFrame_( const SwRect &rRect ) const if( ForEach( rRect, &aRet, true ) ) { SwRectFnSet aRectFnSet(pCurrFrame); - (aRet.*aRectFnSet->fnSetTop)( (rRect.*aRectFnSet->fnGetTop)() ); + aRectFnSet.SetTop( aRet, aRectFnSet.GetTop(rRect) ); // Do not always adapt the bottom - const SwTwips nRetBottom = (aRet.*aRectFnSet->fnGetBottom)(); - const SwTwips nRectBottom = (rRect.*aRectFnSet->fnGetBottom)(); - if ( (*aRectFnSet->fnYDiff)( nRetBottom, nRectBottom ) > 0 || - (aRet.*aRectFnSet->fnGetHeight)() < 0 ) - (aRet.*aRectFnSet->fnSetBottom)( nRectBottom ); + const SwTwips nRetBottom = aRectFnSet.GetBottom(aRet); + const SwTwips nRectBottom = aRectFnSet.GetBottom(rRect); + if ( aRectFnSet.YDiff( nRetBottom, nRectBottom ) > 0 || + aRectFnSet.GetHeight(aRet) < 0 ) + aRectFnSet.SetBottom( aRet, nRectBottom ); } return aRet; } @@ -876,8 +875,8 @@ SwAnchoredObjList* SwTextFly::InitAnchoredObjList() // Make ourselves a little smaller than we are, // so that 1-Twip-overlappings are ignored (#49532) SwRectFnSet aRectFnSet(pCurrFrame); - const long nRight = (aRect.*aRectFnSet->fnGetRight)() - 1; - const long nLeft = (aRect.*aRectFnSet->fnGetLeft)() + 1; + const long nRight = aRectFnSet.GetRight(aRect) - 1; + const long nLeft = aRectFnSet.GetLeft(aRect) + 1; const bool bR2L = pCurrFrame->IsRightToLeft(); const IDocumentDrawModelAccess& rIDDMA = pCurrFrame->GetTextNode()->getIDocumentDrawModelAccess(); @@ -904,12 +903,12 @@ SwAnchoredObjList* SwTextFly::InitAnchoredObjList() } const SwRect aBound( pAnchoredObj->GetObjRectWithSpaces() ); - if ( nRight < (aBound.*aRectFnSet->fnGetLeft)() || - (*aRectFnSet->fnYDiff)( (aRect.*aRectFnSet->fnGetTop)(), - (aBound.*aRectFnSet->fnGetBottom)() ) > 0 || - nLeft > (aBound.*aRectFnSet->fnGetRight)() || - (aBound.*aRectFnSet->fnGetHeight)() > - 2 * (pPage->Frame().*aRectFnSet->fnGetHeight)() ) + if ( nRight < aRectFnSet.GetLeft(aBound) || + aRectFnSet.YDiff( aRectFnSet.GetTop(aRect), + aRectFnSet.GetBottom(aBound) ) > 0 || + nLeft > aRectFnSet.GetRight(aBound) || + aRectFnSet.GetHeight(aBound) > + 2 * aRectFnSet.GetHeight(pPage->Frame()) ) { continue; } @@ -930,7 +929,7 @@ SwAnchoredObjList* SwTextFly::InitAnchoredObjList() std::lower_bound( mpAnchoredObjList->begin(), mpAnchoredObjList->end(), pAnchoredObj, - AnchoredObjOrder( bR2L, aRectFnSet.fnRect ) ); + AnchoredObjOrder( bR2L, aRectFnSet.FnRect() ) ); mpAnchoredObjList->insert( aInsPosIter, pAnchoredObj ); } @@ -943,9 +942,9 @@ SwAnchoredObjList* SwTextFly::InitAnchoredObjList() const SwFormatVertOrient &rTmpFormat = pAnchoredObj->GetFrameFormat().GetVertOrient(); if( text::VertOrientation::BOTTOM != rTmpFormat.GetVertOrient() ) - nMinBottom = ( aRectFnSet.bVert && nMinBottom ) ? + nMinBottom = ( aRectFnSet.IsVert() && nMinBottom ) ? std::min( nMinBottom, aBound.Left() ) : - std::max( nMinBottom, (aBound.*aRectFnSet->fnGetBottom)() ); + std::max( nMinBottom, aRectFnSet.GetBottom(aBound) ); } bOn = true; @@ -953,8 +952,8 @@ SwAnchoredObjList* SwTextFly::InitAnchoredObjList() } if( nMinBottom ) { - SwTwips nMax = (pCurrFrame->GetUpper()->*aRectFnSet->fnGetPrtBottom)(); - if( (*aRectFnSet->fnYDiff)( nMinBottom, nMax ) > 0 ) + SwTwips nMax = aRectFnSet.GetPrtBottom(*pCurrFrame->GetUpper()); + if( aRectFnSet.YDiff( nMinBottom, nMax ) > 0 ) nMinBottom = nMax; } } @@ -1020,7 +1019,7 @@ bool SwTextFly::ForEach( const SwRect &rRect, SwRect* pRect, bool bAvoid ) const // Optimierung SwRectFnSet aRectFnSet(pCurrFrame); - if( (aRect.*aRectFnSet->fnGetLeft)() > (rRect.*aRectFnSet->fnGetRight)() ) + if( aRectFnSet.GetLeft(aRect) > aRectFnSet.GetRight(rRect) ) break; // #i68520# if ( mpCurrAnchoredObj != pAnchoredObj && aRect.IsOver( rRect ) ) @@ -1064,11 +1063,11 @@ bool SwTextFly::ForEach( const SwRect &rRect, SwRect* pRect, bool bAvoid ) const continue; if( !bRet || ( ( !pCurrFrame->IsRightToLeft() && - ( (aFly.*aRectFnSet->fnGetLeft)() < - (pRect->*aRectFnSet->fnGetLeft)() ) ) || + ( aRectFnSet.GetLeft(aFly) < + aRectFnSet.GetLeft(*pRect) ) ) || ( pCurrFrame->IsRightToLeft() && - ( (aFly.*aRectFnSet->fnGetRight)() > - (pRect->*aRectFnSet->fnGetRight)() ) ) ) ) + ( aRectFnSet.GetRight(aFly) > + aRectFnSet.GetRight(*pRect) ) ) ) ) *pRect = aFly; if( rSur.IsContour() ) { @@ -1105,11 +1104,11 @@ void SwTextFly::CalcRightMargin( SwRect &rFly, "SwTextFly::CalcRightMargin with swapped frame" ); SwRectFnSet aRectFnSet(pCurrFrame); // #118796# - correct determination of right of printing area - SwTwips nRight = (pCurrFrame->*aRectFnSet->fnGetPrtRight)(); - SwTwips nFlyRight = (rFly.*aRectFnSet->fnGetRight)(); + SwTwips nRight = aRectFnSet.GetPrtRight(*pCurrFrame); + SwTwips nFlyRight = aRectFnSet.GetRight(rFly); SwRect aLine( rLine ); - (aLine.*aRectFnSet->fnSetRight)( nRight ); - (aLine.*aRectFnSet->fnSetLeft)( (rFly.*aRectFnSet->fnGetLeft)() ); + aRectFnSet.SetRight( aLine, nRight ); + aRectFnSet.SetLeft( aLine, aRectFnSet.GetLeft(rFly) ); // It is possible that there is another object that is _above_ us // and protrudes into the same line. @@ -1141,7 +1140,7 @@ void SwTextFly::CalcRightMargin( SwRect &rFly, const SwRect aTmp( SwContourCache::CalcBoundRect ( pNext, aLine, pCurrFrame, nFlyRight, true ) ); - SwTwips nTmpRight = (aTmp.*aRectFnSet->fnGetRight)(); + SwTwips nTmpRight = aRectFnSet.GetRight(aTmp); // optimization: // Record in nNextTop at which Y-position frame related changes are @@ -1152,20 +1151,20 @@ void SwTextFly::CalcRightMargin( SwRect &rFly, // Especially in HTML documents there are often (dummy) paragraphs in // 2 pt font, and they used to only evade big frames after huge numbers // of empty lines. - const long nTmpTop = (aTmp.*aRectFnSet->fnGetTop)(); - if( (*aRectFnSet->fnYDiff)( nTmpTop, (aLine.*aRectFnSet->fnGetTop)() ) > 0 ) + const long nTmpTop = aRectFnSet.GetTop(aTmp); + if( aRectFnSet.YDiff( nTmpTop, aRectFnSet.GetTop(aLine) ) > 0 ) { - if( (*aRectFnSet->fnYDiff)( nNextTop, nTmpTop ) > 0 ) + if( aRectFnSet.YDiff( nNextTop, nTmpTop ) > 0 ) SetNextTop( nTmpTop ); // upper border of next frame } - else if (!(aTmp.*aRectFnSet->fnGetWidth)()) // typical for Objects with contour wrap + else if (!aRectFnSet.GetWidth(aTmp)) // typical for Objects with contour wrap { // For Objects with contour wrap that start before the current // line, and end below it, but do not actually overlap it, the // optimization has to be disabled, because the circumstances // can change in the next line. - if( ! (aTmp.*aRectFnSet->fnGetHeight)() || - (*aRectFnSet->fnYDiff)( (aTmp.*aRectFnSet->fnGetBottom)(), - (aLine.*aRectFnSet->fnGetTop)() ) > 0 ) + if( ! aRectFnSet.GetHeight(aTmp) || + aRectFnSet.YDiff( aRectFnSet.GetBottom(aTmp), + aRectFnSet.GetTop(aLine) ) > 0 ) SetNextTop( 0 ); } if( aTmp.IsOver( aLine ) && nTmpRight > nFlyRight ) @@ -1181,7 +1180,7 @@ void SwTextFly::CalcRightMargin( SwRect &rFly, } } } - (rFly.*aRectFnSet->fnSetRight)( nRight ); + aRectFnSet.SetRight( rFly, nRight ); } // #i68520# @@ -1193,14 +1192,14 @@ void SwTextFly::CalcLeftMargin( SwRect &rFly, "SwTextFly::CalcLeftMargin with swapped frame" ); SwRectFnSet aRectFnSet(pCurrFrame); // #118796# - correct determination of left of printing area - SwTwips nLeft = (pCurrFrame->*aRectFnSet->fnGetPrtLeft)(); - const SwTwips nFlyLeft = (rFly.*aRectFnSet->fnGetLeft)(); + SwTwips nLeft = aRectFnSet.GetPrtLeft(*pCurrFrame); + const SwTwips nFlyLeft = aRectFnSet.GetLeft(rFly); if( nLeft > nFlyLeft ) nLeft = rFly.Left(); SwRect aLine( rLine ); - (aLine.*aRectFnSet->fnSetLeft)( nLeft ); + aRectFnSet.SetLeft( aLine, nLeft ); // It is possible that there is another object that is _above_ us // and protrudes into the same line. @@ -1215,7 +1214,7 @@ void SwTextFly::CalcLeftMargin( SwRect &rFly, // #i68520# const SwAnchoredObject* pNext = (*mpAnchoredObjList)[ nFlyPos ]; const SwRect aTmp( pNext->GetObjRectWithSpaces() ); - if( (aTmp.*aRectFnSet->fnGetLeft)() >= nFlyLeft ) + if( aRectFnSet.GetLeft(aTmp) >= nFlyLeft ) break; } @@ -1234,18 +1233,18 @@ void SwTextFly::CalcLeftMargin( SwRect &rFly, const SwRect aTmp( SwContourCache::CalcBoundRect ( pNext, aLine, pCurrFrame, nFlyLeft, false ) ); - if( (aTmp.*aRectFnSet->fnGetLeft)() < nFlyLeft && aTmp.IsOver( aLine ) ) + if( aRectFnSet.GetLeft(aTmp) < nFlyLeft && aTmp.IsOver( aLine ) ) { // #118796# - no '+1', because <..fnGetRight> // returns the correct value. - SwTwips nTmpRight = (aTmp.*aRectFnSet->fnGetRight)(); + SwTwips nTmpRight = aRectFnSet.GetRight(aTmp); if ( nLeft <= nTmpRight ) nLeft = nTmpRight; break; } } - (rFly.*aRectFnSet->fnSetLeft)( nLeft ); + aRectFnSet.SetLeft( rFly, nLeft ); } // #i68520# @@ -1256,7 +1255,7 @@ SwRect SwTextFly::AnchoredObjToRect( const SwAnchoredObject* pAnchoredObj, const long nXPos = pCurrFrame->IsRightToLeft() ? rLine.Right() : - (rLine.*aRectFnSet->fnGetLeft)(); + aRectFnSet.GetLeft(rLine); SwRect aFly = mbIgnoreContour ? pAnchoredObj->GetObjRectWithSpaces() : @@ -1267,7 +1266,7 @@ SwRect SwTextFly::AnchoredObjToRect( const SwAnchoredObject* pAnchoredObj, return aFly; // so the line may grow up to the lower edge of the frame - SetNextTop( (aFly.*aRectFnSet->fnGetBottom)() ); + SetNextTop( aRectFnSet.GetBottom(aFly) ); SwAnchoredObjList::size_type nFlyPos = GetPos( pAnchoredObj ); // LEFT and RIGHT, we grow the rectangle. @@ -1348,11 +1347,11 @@ SwSurround SwTextFly::GetSurroundForTextWrap( const SwAnchoredObject* pAnchoredO if ( SURROUND_IDEAL == eSurroundForTextWrap ) { SwRectFnSet aRectFnSet(pCurrFrame); - const long nCurrLeft = (pCurrFrame->*aRectFnSet->fnGetPrtLeft)(); - const long nCurrRight = (pCurrFrame->*aRectFnSet->fnGetPrtRight)(); + const long nCurrLeft = aRectFnSet.GetPrtLeft(*pCurrFrame); + const long nCurrRight = aRectFnSet.GetPrtRight(*pCurrFrame); const SwRect aRect( pAnchoredObj->GetObjRectWithSpaces() ); - long nFlyLeft = (aRect.*aRectFnSet->fnGetLeft)(); - long nFlyRight = (aRect.*aRectFnSet->fnGetRight)(); + long nFlyLeft = aRectFnSet.GetLeft(aRect); + long nFlyRight = aRectFnSet.GetRight(aRect); if ( nFlyRight < nCurrLeft || nFlyLeft > nCurrRight ) eSurroundForTextWrap = SURROUND_PARALLEL; diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index f1d56772fe76..30117ed2361c 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -545,9 +545,9 @@ bool sw_HideObj( const SwTextFrame& _rFrame, // set needed data structure values for object positioning SwRectFnSet aRectFnSet(&_rFrame); SwRect aLastCharRect( _rFrame.Frame() ); - (aLastCharRect.*aRectFnSet->fnSetWidth)( 1 ); + aRectFnSet.SetWidth( aLastCharRect, 1 ); _pAnchoredObj->maLastCharRect = aLastCharRect; - _pAnchoredObj->mnLastTopOfLine = (aLastCharRect.*aRectFnSet->fnGetTop)(); + _pAnchoredObj->mnLastTopOfLine = aRectFnSet.GetTop(aLastCharRect); } } } @@ -1860,31 +1860,31 @@ SwTestFormat::SwTestFormat( SwTextFrame* pTextFrame, const SwFrame* pPre, SwTwip aOldPrt = pFrame->Prt(); SwRectFnSet aRectFnSet(pFrame); - SwTwips nLower = (pFrame->*aRectFnSet->fnGetBottomMargin)(); + SwTwips nLower = aRectFnSet.GetBottomMargin(*pFrame); pFrame->Frame() = pFrame->GetUpper()->Prt(); pFrame->Frame() += pFrame->GetUpper()->Frame().Pos(); - (pFrame->Frame().*aRectFnSet->fnSetHeight)( nMaxHeight ); + aRectFnSet.SetHeight( pFrame->Frame(), nMaxHeight ); if( pFrame->GetPrev() ) - (pFrame->Frame().*aRectFnSet->fnSetPosY)( - (pFrame->GetPrev()->Frame().*aRectFnSet->fnGetBottom)() - - ( aRectFnSet.bVert ? nMaxHeight + 1 : 0 ) ); + aRectFnSet.SetPosY( pFrame->Frame(), + aRectFnSet.GetBottom(pFrame->GetPrev()->Frame()) - + ( aRectFnSet.IsVert() ? nMaxHeight + 1 : 0 ) ); SwBorderAttrAccess aAccess( SwFrame::GetCache(), pFrame ); const SwBorderAttrs &rAttrs = *aAccess.Get(); - (pFrame->Prt().*aRectFnSet->fnSetPosX)( rAttrs.CalcLeft( pFrame ) ); + aRectFnSet.SetPosX( pFrame->Prt(), rAttrs.CalcLeft( pFrame ) ); if( pPre ) { SwTwips nUpper = pFrame->CalcUpperSpace( &rAttrs, pPre ); - (pFrame->Prt().*aRectFnSet->fnSetPosY)( nUpper ); + aRectFnSet.SetPosY( pFrame->Prt(), nUpper ); } - (pFrame->Prt().*aRectFnSet->fnSetHeight)( - std::max( 0L , (pFrame->Frame().*aRectFnSet->fnGetHeight)() - - (pFrame->Prt().*aRectFnSet->fnGetTop)() - nLower ) ); - (pFrame->Prt().*aRectFnSet->fnSetWidth)( - (pFrame->Frame().*aRectFnSet->fnGetWidth)() - + aRectFnSet.SetHeight( pFrame->Prt(), + std::max( 0L , aRectFnSet.GetHeight(pFrame->Frame()) - + aRectFnSet.GetTop(pFrame->Prt()) - nLower ) ); + aRectFnSet.SetWidth( pFrame->Prt(), + aRectFnSet.GetWidth(pFrame->Frame()) - ( rAttrs.CalcLeft( pFrame ) + rAttrs.CalcRight( pFrame ) ) ); pOldPara = pFrame->HasPara() ? pFrame->GetPara() : nullptr; pFrame->SetPara( new SwParaPortion(), false ); @@ -1956,7 +1956,7 @@ bool SwTextFrame::WouldFit( SwTwips &rMaxHeight, bool &bSplit, bool bTst ) if ( IsEmpty() && !bTst ) { bSplit = false; - SwTwips nHeight = aRectFnSet.bVert ? Prt().SSize().Width() : Prt().SSize().Height(); + SwTwips nHeight = aRectFnSet.IsVert() ? Prt().SSize().Width() : Prt().SSize().Height(); if( rMaxHeight < nHeight ) return false; else @@ -1969,13 +1969,13 @@ bool SwTextFrame::WouldFit( SwTwips &rMaxHeight, bool &bSplit, bool bTst ) // GetPara can still be 0 in edge cases // We return true in order to be reformatted on the new Page OSL_ENSURE( HasPara() || IsHiddenNow(), "WouldFit: GetFormatted() and then !HasPara()" ); - if( !HasPara() || ( !(Frame().*aRectFnSet->fnGetHeight)() && IsHiddenNow() ) ) + if( !HasPara() || ( !aRectFnSet.GetHeight(Frame()) && IsHiddenNow() ) ) return true; // Because the Orphan flag only exists for a short moment, we also check // whether the Framesize is set to very huge by CalcPreps, in order to // force a MoveFwd - if( IsWidow() || ( aRectFnSet.bVert ? + if( IsWidow() || ( aRectFnSet.IsVert() ? ( 0 == Frame().Left() ) : ( LONG_MAX - 20000 < Frame().Bottom() ) ) ) { @@ -1986,8 +1986,8 @@ bool SwTextFrame::WouldFit( SwTwips &rMaxHeight, bool &bSplit, bool bTst ) // whether there's a Follow with a real height at all. // Else (e.g. for newly created SctFrames) we ignore the IsWidow() and // still check if we can find enough room - if( ( ( ! aRectFnSet.bVert && LONG_MAX - 20000 >= Frame().Bottom() ) || - ( aRectFnSet.bVert && 0 < Frame().Left() ) ) && + if( ( ( ! aRectFnSet.IsVert() && LONG_MAX - 20000 >= Frame().Bottom() ) || + ( aRectFnSet.IsVert() && 0 < Frame().Left() ) ) && ( GetFollow()->IsVertical() ? !GetFollow()->Frame().Width() : !GetFollow()->Frame().Height() ) ) @@ -2606,34 +2606,34 @@ static SwTwips lcl_CalcFlyBasePos( const SwTextFrame& rFrame, SwRect aFlyRect, { SwRectFnSet aRectFnSet(&rFrame); SwTwips nRet = rFrame.IsRightToLeft() ? - (rFrame.Frame().*aRectFnSet->fnGetRight)() : - (rFrame.Frame().*aRectFnSet->fnGetLeft)(); + aRectFnSet.GetRight(rFrame.Frame()) : + aRectFnSet.GetLeft(rFrame.Frame()); do { SwRect aRect = rTextFly.GetFrame( aFlyRect ); - if ( 0 != (aRect.*aRectFnSet->fnGetWidth)() ) + if ( 0 != aRectFnSet.GetWidth(aRect) ) { if ( rFrame.IsRightToLeft() ) { - if ( (aRect.*aRectFnSet->fnGetRight)() - - (aFlyRect.*aRectFnSet->fnGetRight)() >= 0 ) + if ( aRectFnSet.GetRight(aRect) - + aRectFnSet.GetRight(aFlyRect) >= 0 ) { - (aFlyRect.*aRectFnSet->fnSetRight)( - (aRect.*aRectFnSet->fnGetLeft)() ); - nRet = (aRect.*aRectFnSet->fnGetLeft)(); + aRectFnSet.SetRight( +aFlyRect, aRectFnSet.GetLeft(aRect) ); + nRet = aRectFnSet.GetLeft(aRect); } else break; } else { - if ( (aFlyRect.*aRectFnSet->fnGetLeft)() - - (aRect.*aRectFnSet->fnGetLeft)() >= 0 ) + if ( aRectFnSet.GetLeft(aFlyRect) - + aRectFnSet.GetLeft(aRect) >= 0 ) { - (aFlyRect.*aRectFnSet->fnSetLeft)( - (aRect.*aRectFnSet->fnGetRight)() + 1 ); - nRet = (aRect.*aRectFnSet->fnGetRight)(); + aRectFnSet.SetLeft( +aFlyRect, aRectFnSet.GetRight(aRect) + 1 ); + nRet = aRectFnSet.GetRight(aRect); } else break; @@ -2642,7 +2642,7 @@ static SwTwips lcl_CalcFlyBasePos( const SwTextFrame& rFrame, SwRect aFlyRect, else break; } - while ( (aFlyRect.*aRectFnSet->fnGetWidth)() > 0 ); + while ( aRectFnSet.GetWidth(aFlyRect) > 0 ); return nRet; } @@ -2665,7 +2665,7 @@ void SwTextFrame::CalcBaseOfstForFly() // (empty paragraph with and without a dummy portion) SwTwips nFlyAnchorVertOfstNoWrap = 0; { - SwTwips nTop = (aFlyRect.*aRectFnSet->fnGetTop)(); + SwTwips nTop = aRectFnSet.GetTop(aFlyRect); const SwLineLayout* pLay = GetPara(); SwTwips nLineHeight = 200; while( pLay && pLay->IsDummy() && pLay->GetNext() ) @@ -2678,7 +2678,7 @@ void SwTextFrame::CalcBaseOfstForFly() { nLineHeight = pLay->Height(); } - (aFlyRect.*aRectFnSet->fnSetTopAndHeight)( nTop, nLineHeight ); + aRectFnSet.SetTopAndHeight( aFlyRect, nTop, nLineHeight ); } SwTextFly aTextFly( this ); @@ -2693,8 +2693,8 @@ void SwTextFrame::CalcBaseOfstForFly() // make values relative to frame start position SwTwips nLeft = IsRightToLeft() ? - (Frame().*aRectFnSet->fnGetRight)() : - (Frame().*aRectFnSet->fnGetLeft)(); + aRectFnSet.GetRight(Frame()) : + aRectFnSet.GetLeft(Frame()); mnFlyAnchorOfst = nRet1 - nLeft; mnFlyAnchorOfstNoWrap = nRet2 - nLeft; diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx index ad523f65755d..7f88c0daa90a 100644 --- a/sw/source/core/text/txtftn.cxx +++ b/sw/source/core/text/txtftn.cxx @@ -133,10 +133,10 @@ bool SwTextFrame::CalcPrepFootnoteAdjust() bool bReArrange = true; SwRectFnSet aRectFnSet(this); - if ( pCont && (*aRectFnSet->fnYDiff)( (pCont->Frame().*aRectFnSet->fnGetTop)(), - (Frame().*aRectFnSet->fnGetBottom)() ) > 0 ) + if ( pCont && aRectFnSet.YDiff( aRectFnSet.GetTop(pCont->Frame()), + aRectFnSet.GetBottom(Frame()) ) > 0 ) { - pBoss->RearrangeFootnotes( (Frame().*aRectFnSet->fnGetBottom)(), false, + pBoss->RearrangeFootnotes( aRectFnSet.GetBottom(Frame()), false, pFootnote->GetAttr() ); ValidateBodyFrame(); ValidateFrame(); @@ -197,21 +197,21 @@ static SwTwips lcl_GetFootnoteLower( const SwTextFrame* pFrame, SwTwips nLower ) SwTwips nMin = 0; if ( bDontSplit ) - nMin = (pTabFrame->Frame().*aRectFnSet->fnGetBottom)(); + nMin = aRectFnSet.GetBottom(pTabFrame->Frame()); else if ( !static_cast<const SwRowFrame*>(pRow)->IsRowSplitAllowed() ) - nMin = (pRow->Frame().*aRectFnSet->fnGetBottom)(); + nMin = aRectFnSet.GetBottom(pRow->Frame()); - if ( nMin && (*aRectFnSet->fnYDiff)( nMin, nLower ) > 0 ) + if ( nMin && aRectFnSet.YDiff( nMin, nLower ) > 0 ) nRet = nMin; - nAdd = (pRow->GetUpper()->*aRectFnSet->fnGetBottomMargin)(); + nAdd = aRectFnSet.GetBottomMargin(*pRow->GetUpper()); } else - nAdd = (pFrame->*aRectFnSet->fnGetBottomMargin)(); + nAdd = aRectFnSet.GetBottomMargin(*pFrame); if( nAdd > 0 ) { - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) nRet -= nAdd; else nRet += nAdd; @@ -221,7 +221,7 @@ static SwTwips lcl_GetFootnoteLower( const SwTextFrame* pFrame, SwTwips nLower ) // the deadline should consider their lower borders. const SwFrame* pStartFrame = pFrame->GetUpper()->GetLower(); OSL_ENSURE( pStartFrame, "Upper has no lower" ); - SwTwips nFlyLower = aRectFnSet.bVert ? LONG_MAX : 0; + SwTwips nFlyLower = aRectFnSet.IsVert() ? LONG_MAX : 0; while ( pStartFrame != pFrame ) { OSL_ENSURE( pStartFrame, "Frame chain is broken" ); @@ -235,8 +235,8 @@ static SwTwips lcl_GetFootnoteLower( const SwTextFrame* pFrame, SwTwips nLower ) if ( dynamic_cast< const SwFlyFrame *>( pAnchoredObj ) == nullptr || static_cast<SwFlyFrame*>(pAnchoredObj)->IsValid() ) { - const SwTwips nBottom = (aRect.*aRectFnSet->fnGetBottom)(); - if ( (*aRectFnSet->fnYDiff)( nBottom, nFlyLower ) > 0 ) + const SwTwips nBottom = aRectFnSet.GetBottom(aRect); + if ( aRectFnSet.YDiff( nBottom, nFlyLower ) > 0 ) nFlyLower = nBottom; } } @@ -245,7 +245,7 @@ static SwTwips lcl_GetFootnoteLower( const SwTextFrame* pFrame, SwTwips nLower ) pStartFrame = pStartFrame->GetNext(); } - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) nRet = std::min( nRet, nFlyLower ); else nRet = std::max( nRet, nFlyLower ); @@ -316,8 +316,8 @@ SwTwips SwTextFrame::GetFootnoteFrameHeight_() const // Height within the Container which we're allowed to consume anyways SwRectFnSet aRectFnSet(pCont); - SwTwips nTmp = (*aRectFnSet->fnYDiff)( (pCont->*aRectFnSet->fnGetPrtBottom)(), - (Frame().*aRectFnSet->fnGetTop)() ); + SwTwips nTmp = aRectFnSet.YDiff( aRectFnSet.GetPrtBottom(*pCont), + aRectFnSet.GetTop(Frame()) ); #if OSL_DEBUG_LEVEL > 0 if( nTmp < 0 ) @@ -336,7 +336,7 @@ SwTwips SwTextFrame::GetFootnoteFrameHeight_() const } #endif - if ( (*aRectFnSet->fnYDiff)( (pCont->Frame().*aRectFnSet->fnGetTop)(), nHeight) > 0 ) + if ( aRectFnSet.YDiff( aRectFnSet.GetTop(pCont->Frame()), nHeight) > 0 ) { // Growth potential of the container if ( !pRef->IsInFootnoteConnect() ) @@ -353,7 +353,7 @@ SwTwips SwTextFrame::GetFootnoteFrameHeight_() const } else { // The container has to shrink - nTmp += (*aRectFnSet->fnYDiff)( (pCont->Frame().*aRectFnSet->fnGetTop)(), nHeight); + nTmp += aRectFnSet.YDiff( aRectFnSet.GetTop(pCont->Frame()), nHeight); if( nTmp > 0 ) nHeight = nTmp; else @@ -689,7 +689,7 @@ void SwTextFrame::ConnectFootnote( SwTextFootnote *pFootnote, const SwTwips nDea SwFrame *pCont = pFootnoteFrame->GetUpper(); SwRectFnSet aRectFnSet(pCont); - long nDiff = (*aRectFnSet->fnYDiff)( (pCont->Frame().*aRectFnSet->fnGetTop)(), + long nDiff = aRectFnSet.YDiff( aRectFnSet.GetTop(pCont->Frame()), nDeadLine ); if( nDiff >= 0 ) @@ -702,12 +702,12 @@ void SwTextFrame::ConnectFootnote( SwTextFootnote *pFootnote, const SwTwips nDea // We have some room left, so the Footnote can grow if ( pFootnoteFrame->GetFollow() && nDiff > 0 ) { - SwTwips nHeight = (pCont->Frame().*aRectFnSet->fnGetHeight)(); + SwTwips nHeight = aRectFnSet.GetHeight(pCont->Frame()); pBoss->RearrangeFootnotes( nDeadLine, false, pFootnote ); ValidateBodyFrame(); ValidateFrame(); SwViewShell *pSh = getRootFrame()->GetCurrShell(); - if ( pSh && nHeight == (pCont->Frame().*aRectFnSet->fnGetHeight)() ) + if ( pSh && nHeight == aRectFnSet.GetHeight(pCont->Frame()) ) // So that we don't miss anything pSh->InvalidateWindows( pCont->Frame() ); } @@ -894,8 +894,8 @@ SwFootnotePortion *SwTextFormatter::NewFootnotePortion( SwTextFormatInfo &rInf, SwRectFnSet aRectFnSet(pFootnoteCont); - const long nDiff = (*aRectFnSet->fnYDiff)( - (pFootnoteCont->Frame().*aRectFnSet->fnGetTop)(), + const long nDiff = aRectFnSet.YDiff( + aRectFnSet.GetTop(pFootnoteCont->Frame()), nTmpBot ); if( pScrFrame && nDiff < 0 ) diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx index 6d8c4f569bf2..7514baaf9c53 100644 --- a/sw/source/core/text/widorp.cxx +++ b/sw/source/core/text/widorp.cxx @@ -60,7 +60,7 @@ SwTextFrameBreak::SwTextFrameBreak( SwTextFrame *pNewFrame, const SwTwips nRst ) { SwSwapIfSwapped swap(m_pFrame); SwRectFnSet aRectFnSet(m_pFrame); - m_nOrigin = (m_pFrame->*aRectFnSet->fnGetPrtTop)(); + m_nOrigin = aRectFnSet.GetPrtTop(*m_pFrame); m_bKeep = !m_pFrame->IsMoveable() || IsNastyFollow( m_pFrame ); if( !m_bKeep && m_pFrame->IsInSct() ) { @@ -74,8 +74,8 @@ SwTextFrameBreak::SwTextFrameBreak( SwTextFrame *pNewFrame, const SwTwips nRst ) if( !m_nRstHeight && !m_pFrame->IsFollow() && m_pFrame->IsInFootnote() && m_pFrame->HasPara() ) { m_nRstHeight = m_pFrame->GetFootnoteFrameHeight(); - m_nRstHeight += (m_pFrame->Prt().*aRectFnSet->fnGetHeight)() - - (m_pFrame->Frame().*aRectFnSet->fnGetHeight)(); + m_nRstHeight += aRectFnSet.GetHeight(m_pFrame->Prt()) - + aRectFnSet.GetHeight(m_pFrame->Frame()); if( m_nRstHeight < 0 ) m_nRstHeight = 0; } @@ -115,10 +115,10 @@ bool SwTextFrameBreak::IsInside( SwTextMargin &rLine ) const else nTmpY = rLine.Y() + rLine.GetLineHeight(); - SwTwips nLineHeight = (*aRectFnSet->fnYDiff)( nTmpY , m_nOrigin ); + SwTwips nLineHeight = aRectFnSet.YDiff( nTmpY , m_nOrigin ); // Calculate extra space for bottom border. - nLineHeight += (m_pFrame->*aRectFnSet->fnGetBottomMargin)(); + nLineHeight += aRectFnSet.GetBottomMargin(*m_pFrame); if( m_nRstHeight ) bFit = m_nRstHeight >= nLineHeight; @@ -126,7 +126,7 @@ bool SwTextFrameBreak::IsInside( SwTextMargin &rLine ) const { // The Frame has a height to fit on the page. SwTwips nHeight = - (*aRectFnSet->fnYDiff)( (m_pFrame->GetUpper()->*aRectFnSet->fnGetPrtBottom)(), m_nOrigin ); + aRectFnSet.YDiff( aRectFnSet.GetPrtBottom(*m_pFrame->GetUpper()), m_nOrigin ); SwTwips nDiff = nHeight - nLineHeight; // Hide whitespace may require not to insert a new page. @@ -208,12 +208,12 @@ void SwTextFrameBreak::SetRstHeight( const SwTextMargin &rLine ) // Consider bottom margin SwRectFnSet aRectFnSet(m_pFrame); - m_nRstHeight = (m_pFrame->*aRectFnSet->fnGetBottomMargin)(); + m_nRstHeight = aRectFnSet.GetBottomMargin(*m_pFrame); - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) { if ( m_pFrame->IsVertLR() ) - m_nRstHeight = (*aRectFnSet->fnYDiff)( m_pFrame->SwitchHorizontalToVertical( rLine.Y() ) , m_nOrigin ); + m_nRstHeight = aRectFnSet.YDiff( m_pFrame->SwitchHorizontalToVertical( rLine.Y() ) , m_nOrigin ); else m_nRstHeight += m_nOrigin - m_pFrame->SwitchHorizontalToVertical( rLine.Y() ); } @@ -375,19 +375,19 @@ bool WidowsAndOrphans::FindWidows( SwTextFrame *pFrame, SwTextMargin &rLine ) // Remaining height of the master SwRectFnSet aRectFnSet(pFrame); - const SwTwips nDocPrtTop = (pFrame->*aRectFnSet->fnGetPrtTop)(); + const SwTwips nDocPrtTop = aRectFnSet.GetPrtTop(*pFrame); SwTwips nOldHeight; SwTwips nTmpY = rLine.Y() + rLine.GetLineHeight(); - if ( aRectFnSet.bVert ) + if ( aRectFnSet.IsVert() ) { nTmpY = pFrame->SwitchHorizontalToVertical( nTmpY ); - nOldHeight = -(pFrame->Prt().*aRectFnSet->fnGetHeight)(); + nOldHeight = -aRectFnSet.GetHeight(pFrame->Prt()); } else - nOldHeight = (pFrame->Prt().*aRectFnSet->fnGetHeight)(); + nOldHeight = aRectFnSet.GetHeight(pFrame->Prt()); - const SwTwips nChg = (*aRectFnSet->fnYDiff)( nTmpY, nDocPrtTop + nOldHeight ); + const SwTwips nChg = aRectFnSet.YDiff( nTmpY, nDocPrtTop + nOldHeight ); // below the Widows-treshold... if( rLine.GetLineNr() >= nWidLines ) @@ -404,8 +404,8 @@ bool WidowsAndOrphans::FindWidows( SwTextFrame *pFrame, SwTextMargin &rLine ) // multiple lines (e.g. via frames). if( !pMaster->IsLocked() && pMaster->GetUpper() ) { - const SwTwips nTmpRstHeight = (pMaster->Frame().*aRectFnSet->fnBottomDist) - ( (pMaster->GetUpper()->*aRectFnSet->fnGetPrtBottom)() ); + const SwTwips nTmpRstHeight = aRectFnSet.BottomDist( pMaster->Frame(), + aRectFnSet.GetPrtBottom(*pMaster->GetUpper()) ); if ( nTmpRstHeight >= SwTwips(rLine.GetInfo().GetParaPortion()->Height() ) ) { @@ -427,8 +427,8 @@ bool WidowsAndOrphans::FindWidows( SwTextFrame *pFrame, SwTextMargin &rLine ) if( 0 > nChg && !pMaster->IsLocked() && pMaster->GetUpper() ) { - SwTwips nTmpRstHeight = (pMaster->Frame().*aRectFnSet->fnBottomDist) - ( (pMaster->GetUpper()->*aRectFnSet->fnGetPrtBottom)() ); + SwTwips nTmpRstHeight = aRectFnSet.BottomDist( pMaster->Frame(), + aRectFnSet.GetPrtBottom(*pMaster->GetUpper()) ); if( nTmpRstHeight >= SwTwips(rLine.GetInfo().GetParaPortion()->Height() ) ) { pMaster->Prepare( PREP_ADJUST_FRM ); diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 7ab42af152d8..9517d953a6bb 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -229,13 +229,13 @@ static SwRect lcl_CalculateRepaintRect( SwTextFrame& rTextFrame, sal_Int32 nChgS { // we are inside a special portion, take left border SwRectFnSet aRectFnSet(pEndFrame); - (aRect.*aRectFnSet->fnSetTop)( (pEnd2Pos->aLine.*aRectFnSet->fnGetTop)() ); + aRectFnSet.SetTop( aRect, aRectFnSet.GetTop(pEnd2Pos->aLine) ); if ( pEndFrame->IsRightToLeft() ) - (aRect.*aRectFnSet->fnSetLeft)( (pEnd2Pos->aPortion.*aRectFnSet->fnGetLeft)() ); + aRectFnSet.SetLeft( aRect, aRectFnSet.GetLeft(pEnd2Pos->aPortion) ); else - (aRect.*aRectFnSet->fnSetLeft)( (pEnd2Pos->aPortion.*aRectFnSet->fnGetRight)() ); - (aRect.*aRectFnSet->fnSetWidth)( 1 ); - (aRect.*aRectFnSet->fnSetHeight)( (pEnd2Pos->aLine.*aRectFnSet->fnGetHeight)() ); + aRectFnSet.SetLeft( aRect, aRectFnSet.GetRight(pEnd2Pos->aPortion) ); + aRectFnSet.SetWidth( aRect, 1 ); + aRectFnSet.SetHeight( aRect, aRectFnSet.GetHeight(pEnd2Pos->aLine) ); delete pEnd2Pos; } @@ -262,13 +262,13 @@ static SwRect lcl_CalculateRepaintRect( SwTextFrame& rTextFrame, sal_Int32 nChgS { // we are inside a special portion, take right border SwRectFnSet aRectFnSet(pStartFrame); - (aTmp.*aRectFnSet->fnSetTop)( (pSt2Pos->aLine.*aRectFnSet->fnGetTop)() ); + aRectFnSet.SetTop( aTmp, aRectFnSet.GetTop(pSt2Pos->aLine) ); if ( pStartFrame->IsRightToLeft() ) - (aTmp.*aRectFnSet->fnSetLeft)( (pSt2Pos->aPortion.*aRectFnSet->fnGetRight)() ); + aRectFnSet.SetLeft( aTmp, aRectFnSet.GetRight(pSt2Pos->aPortion) ); else - (aTmp.*aRectFnSet->fnSetLeft)( (pSt2Pos->aPortion.*aRectFnSet->fnGetLeft)() ); - (aTmp.*aRectFnSet->fnSetWidth)( 1 ); - (aTmp.*aRectFnSet->fnSetHeight)( (pSt2Pos->aLine.*aRectFnSet->fnGetHeight)() ); + aRectFnSet.SetLeft( aTmp, aRectFnSet.GetLeft(pSt2Pos->aPortion) ); + aRectFnSet.SetWidth( aTmp, 1 ); + aRectFnSet.SetHeight( aTmp, aRectFnSet.GetHeight(pSt2Pos->aLine) ); delete pSt2Pos; } @@ -282,16 +282,16 @@ static SwRect lcl_CalculateRepaintRect( SwTextFrame& rTextFrame, sal_Int32 nChgS SwRect aStFrame( pStartFrame->PaintArea() ); { SwRectFnSet aRectFnSet(pStartFrame); - (aTmp.*aRectFnSet->fnSetLeft)( (aStFrame.*aRectFnSet->fnGetLeft)() ); - (aTmp.*aRectFnSet->fnSetRight)( (aStFrame.*aRectFnSet->fnGetRight)() ); - (aTmp.*aRectFnSet->fnSetBottom)( (aStFrame.*aRectFnSet->fnGetBottom)() ); + aRectFnSet.SetLeft( aTmp, aRectFnSet.GetLeft(aStFrame) ); + aRectFnSet.SetRight( aTmp, aRectFnSet.GetRight(aStFrame) ); + aRectFnSet.SetBottom( aTmp, aRectFnSet.GetBottom(aStFrame) ); } aStFrame = pEndFrame->PaintArea(); { SwRectFnSet aRectFnSet(pEndFrame); - (aRect.*aRectFnSet->fnSetTop)( (aStFrame.*aRectFnSet->fnGetTop)() ); - (aRect.*aRectFnSet->fnSetLeft)( (aStFrame.*aRectFnSet->fnGetLeft)() ); - (aRect.*aRectFnSet->fnSetRight)( (aStFrame.*aRectFnSet->fnGetRight)() ); + aRectFnSet.SetTop( aRect, aRectFnSet.GetTop(aStFrame) ); + aRectFnSet.SetLeft( aRect, aRectFnSet.GetLeft(aStFrame) ); + aRectFnSet.SetRight( aRect, aRectFnSet.GetRight(aStFrame) ); } aRect.Union( aTmp ); while( true ) @@ -306,14 +306,14 @@ static SwRect lcl_CalculateRepaintRect( SwTextFrame& rTextFrame, sal_Int32 nChgS if( bSameFrame ) { SwRectFnSet aRectFnSet(pStartFrame); - if( (aTmp.*aRectFnSet->fnGetTop)() == (aRect.*aRectFnSet->fnGetTop)() ) - (aRect.*aRectFnSet->fnSetLeft)( (aTmp.*aRectFnSet->fnGetLeft)() ); + if( aRectFnSet.GetTop(aTmp) == aRectFnSet.GetTop(aRect) ) + aRectFnSet.SetLeft( aRect, aRectFnSet.GetLeft(aTmp) ); else { SwRect aStFrame( pStartFrame->PaintArea() ); - (aRect.*aRectFnSet->fnSetLeft)( (aStFrame.*aRectFnSet->fnGetLeft)() ); - (aRect.*aRectFnSet->fnSetRight)( (aStFrame.*aRectFnSet->fnGetRight)() ); - (aRect.*aRectFnSet->fnSetTop)( (aTmp.*aRectFnSet->fnGetTop)() ); + aRectFnSet.SetLeft( aRect, aRectFnSet.GetLeft(aStFrame) ); + aRectFnSet.SetRight( aRect, aRectFnSet.GetRight(aStFrame) ); + aRectFnSet.SetTop( aRect, aRectFnSet.GetTop(aTmp) ); } if( aTmp.Height() > aRect.Height() ) |