diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-10-25 13:46:44 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-10-30 09:32:22 +0100 |
commit | d64ea2264b5a13bfca8499e08f352af6740e71ff (patch) | |
tree | 10ac991e84ff6bb104f0f576a330c168ca0f8bad | |
parent | feb6cfb1048925ab87485acc4357c3ac23ff944a (diff) |
RotateFlyFrame: Isolate SwFrame members maFrame and maPrtfeature/RotateFlyFrame
To gain more control over changes of the Writer layout,
isolated mentioned members and replaced all calls with
inline methods for read access. Moved to own class to
also identify 'private' accesses reliably. Added access
dedicated classes for write access, the only allowed
way to do changes. Adapted all usages and made test builds
on logerrit and locally
Change-Id: Ib0b7f852f5176744e860e2aad12dd13c9a906d68
RotateFlyFrame: Migrated from SwFrame::FrameWA to setFrame
Change-Id: I01f7b828fe2134411cc76639e880da46b415d767
RotateFlyFrame: Migrated from SwFrame::PrintWA to setPrint
Change-Id: Ieea3b467f296a190de5b5f47721bef148bebf60b
RotateFlyFrame: Adapted to get/setSwFrame and get/setSwPrint
Change-Id: I6cce40ec49dd5bd32d94fe06b9d2dabd368448be
RotateFlyFrame: Adapted to get methods and WriteAccess helpers
Change-Id: Ife3c1b2391ad7beae8c7f31f796b1454709ddd26
RotateFlyFrame: Moved change executers to cxx
Moved SwFrameRect::FrameWriteAccess::~FrameWriteAccess()
and SwFrameRect::PrintWriteAccess::~PrintWriteAccess() to
implementation side and added compare op's for SwRcet to
write only if needed
Change-Id: I85d0e61009116f4b17d1ce0337e3f0d2cc031159
RotateFlyFrame: Moved change executers to cxx
Moved SwFrameRect::FrameWriteAccess::~FrameWriteAccess()
and SwFrameRect::PrintWriteAccess::~PrintWriteAccess() to
implementation side and added compare op's for SwRcet to
write only if needed
Change-Id: I85d0e61009116f4b17d1ce0337e3f0d2cc031159
101 files changed, 3291 insertions, 2453 deletions
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx index a43cd5a75e08..5e56fa85ff44 100644 --- a/sw/source/core/access/acccontext.cxx +++ b/sw/source/core/access/acccontext.cxx @@ -1123,7 +1123,7 @@ void SwAccessibleContext::InvalidatePosOrSize( const SwRect& ) { SolarMutexGuard aGuard; - OSL_ENSURE( GetFrame() && !GetFrame()->Frame().IsEmpty(), "context should have a size" ); + OSL_ENSURE( GetFrame() && !GetFrame()->getSwFrame().IsEmpty(), "context should have a size" ); bool bIsOldShowingState; bool bIsNewShowingState = IsShowing( *(GetMap()) ); @@ -1170,7 +1170,7 @@ void SwAccessibleContext::InvalidateChildPosOrSize( // this happens during layout, e.g. when a page is deleted and next page's // header/footer moves backward such an event is generated SAL_INFO_IF(rChildFrameOrObj.GetSwFrame() && - rChildFrameOrObj.GetSwFrame()->Frame().IsEmpty(), + rChildFrameOrObj.GetSwFrame()->getSwFrame().IsEmpty(), "sw.a11y", "child context should have a size"); if ( rChildFrameOrObj.AlwaysIncludeAsChild() ) diff --git a/sw/source/core/access/accfrmobj.cxx b/sw/source/core/access/accfrmobj.cxx index c6475523de75..f233263694ea 100644 --- a/sw/source/core/access/accfrmobj.cxx +++ b/sw/source/core/access/accfrmobj.cxx @@ -243,16 +243,16 @@ SwRect SwAccessibleChild::GetBox( const SwAccessibleMap& rAccMap ) const if ( mpFrame->IsPageFrame() && static_cast< const SwPageFrame * >( mpFrame )->IsEmptyPage() ) { - aBox = SwRect( mpFrame->Frame().Left(), mpFrame->Frame().Top()-1, 1, 1 ); + aBox = SwRect( mpFrame->getSwFrame().Left(), mpFrame->getSwFrame().Top()-1, 1, 1 ); } else if ( mpFrame->IsTabFrame() ) { - aBox = SwRect( mpFrame->Frame() ); - aBox.Intersection( mpFrame->GetUpper()->Frame() ); + aBox = SwRect( mpFrame->getSwFrame() ); + aBox.Intersection( mpFrame->GetUpper()->getSwFrame() ); } else { - aBox = mpFrame->Frame(); + aBox = mpFrame->getSwFrame(); } } else if( mpDrawObj ) @@ -268,7 +268,7 @@ SwRect SwAccessibleChild::GetBox( const SwAccessibleMap& rAccMap ) const { aBox = SwRect( mpDrawObj->GetCurrentBoundRect() ); // tdf#91260 drawing object may be partially off-page - aBox.Intersection(pPage->Frame()); + aBox.Intersection(pPage->getSwFrame()); } } else if ( mpWindow ) @@ -294,7 +294,7 @@ SwRect SwAccessibleChild::GetBounds( const SwAccessibleMap& rAccMap ) const if( mpFrame->IsPageFrame() && static_cast< const SwPageFrame * >( mpFrame )->IsEmptyPage() ) { - aBound = SwRect( mpFrame->Frame().Left(), mpFrame->Frame().Top()-1, 0, 0 ); + aBound = SwRect( mpFrame->getSwFrame().Left(), mpFrame->getSwFrame().Top()-1, 0, 0 ); } else aBound = mpFrame->PaintArea(); diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx index e03047a9a81e..0abbc829a8cf 100644 --- a/sw/source/core/access/acctable.cxx +++ b/sw/source/core/access/acctable.cxx @@ -156,14 +156,14 @@ void SwAccessibleTableData_Impl::CollectData( const SwFrame *pFrame ) // #i77106# if ( IncludeRow( *pLower ) ) { - maRows.insert( pLower->Frame().Top() - maTabFramePos.getY() ); + maRows.insert( pLower->getSwFrame().Top() - maTabFramePos.getY() ); CollectData( pLower ); } } else if( pLower->IsCellFrame() && rLower.IsAccessible( mbIsInPagePreview ) ) { - maColumns.insert( pLower->Frame().Left() - maTabFramePos.getX() ); + maColumns.insert( pLower->getSwFrame().Left() - maTabFramePos.getX() ); } else { @@ -196,7 +196,7 @@ void SwAccessibleTableData_Impl::CollectRowHeaderData( const SwFrame *pFrame ) //if(mpTabFrame->GetTable()->GetTabLines()[ 0 ] != pLine) //return ; - maRows.insert( pLower->Frame().Top() - maTabFramePos.Y() ); + maRows.insert( pLower->getSwFrame().Top() - maTabFramePos.Y() ); CollectRowHeaderData( pLower ); @@ -206,7 +206,7 @@ void SwAccessibleTableData_Impl::CollectRowHeaderData( const SwFrame *pFrame ) { //Added by yanjun. Can't find the "GetRowHeaderFlag" function (need verify). //if(static_cast<SwCellFrame*>(pLower)->GetRowHeaderFlag()) - // maColumns.insert( pLower->Frame().Left() - maTabFramePos.X() ); + // maColumns.insert( pLower->getSwFrame().Left() - maTabFramePos.X() ); } else { @@ -244,7 +244,7 @@ void SwAccessibleTableData_Impl::CollectColumnHeaderData( const SwFrame *pFrame if(iCurrentRowIndex >= mpTabFrame->GetTable()->GetRowsToRepeat_()) return ; - maRows.insert( pLower->Frame().Top() - maTabFramePos.Y() ); + maRows.insert( pLower->getSwFrame().Top() - maTabFramePos.Y() ); CollectColumnHeaderData( pLower ); @@ -252,7 +252,7 @@ void SwAccessibleTableData_Impl::CollectColumnHeaderData( const SwFrame *pFrame else if( pLower->IsCellFrame() && rLower.IsAccessible( mbIsInPagePreview ) ) { - maColumns.insert( pLower->Frame().Left() - maTabFramePos.X() ); + maColumns.insert( pLower->getSwFrame().Left() - maTabFramePos.X() ); } else { @@ -279,7 +279,7 @@ void SwAccessibleTableData_Impl::CollectExtents( const SwFrame *pFrame ) { sal_Int32 nRow, nCol; Int32Pair_Impl aCellExtents; - GetRowColumnAndExtent( pLower->Frame(), nRow, nCol, + GetRowColumnAndExtent( pLower->getSwFrame(), nRow, nCol, aCellExtents.first, aCellExtents.second ); @@ -318,7 +318,7 @@ bool SwAccessibleTableData_Impl::FindCell( if( rLower.IsAccessible( mbIsInPagePreview ) ) { OSL_ENSURE( pLower->IsCellFrame(), "lower is not a cell frame" ); - const SwRect& rFrame = pLower->Frame(); + const SwRect& rFrame = pLower->getSwFrame(); if( rFrame.Right() >= rPos.X() && rFrame.Bottom() >= rPos.Y() ) { // We have found the cell @@ -432,7 +432,7 @@ void SwAccessibleTableData_Impl::GetSelection( SwAccTableSelHander_Impl& rSelHdl, bool bColumns ) const { - SwRect aArea( mpTabFrame->Frame() ); + SwRect aArea( mpTabFrame->getSwFrame() ); Point aPos( aArea.Pos() ); const Int32Set_Impl& rRowsOrColumns = bColumns ? maColumns : maRows; @@ -463,7 +463,7 @@ void SwAccessibleTableData_Impl::GetSelection( const SwFrame *SwAccessibleTableData_Impl::GetCellAtPos( sal_Int32 nLeft, sal_Int32 nTop ) const { - Point aPos( mpTabFrame->Frame().Pos() ); + Point aPos( mpTabFrame->getSwFrame().Pos() ); aPos.Move( nLeft, nTop ); const SwFrame *pRet = nullptr; FindCell( aPos, mpTabFrame, false/*bExact*/, pRet ); @@ -497,7 +497,7 @@ SwAccessibleTableData_Impl::SwAccessibleTableData_Impl( SwAccessibleMap& rAccMap bool bIsInPagePreview, bool bOnlyTableColumnHeader ) : mrAccMap( rAccMap ) - , maTabFramePos( pTabFrame->Frame().Pos() ) + , maTabFramePos( pTabFrame->getSwFrame().Pos() ) , mpTabFrame( pTabFrame ) , mbIsInPagePreview( bIsInPagePreview ) , mbOnlyTableColumnHeader( bOnlyTableColumnHeader ) @@ -1016,8 +1016,8 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleRowExtentAt( const SwFrame *pCellFrame = GetTableData().GetCellAtPos( *aSttCol, *aSttRow ); if( pCellFrame ) { - sal_Int32 nBottom = pCellFrame->Frame().Bottom(); - nBottom -= GetFrame()->Frame().Top(); + sal_Int32 nBottom = pCellFrame->getSwFrame().Bottom(); + nBottom -= GetFrame()->getSwFrame().Top(); Int32Set_Impl::const_iterator aEndRow( GetTableData().GetRows().upper_bound( nBottom ) ); nExtend = @@ -1046,8 +1046,8 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleColumnExtentAt( const SwFrame *pCellFrame = GetTableData().GetCellAtPos( *aSttCol, *aSttRow ); if( pCellFrame ) { - sal_Int32 nRight = pCellFrame->Frame().Right(); - nRight -= GetFrame()->Frame().Left(); + sal_Int32 nRight = pCellFrame->getSwFrame().Right(); + nRight -= GetFrame()->getSwFrame().Left(); Int32Set_Impl::const_iterator aEndCol( GetTableData().GetColumns().upper_bound( nRight ) ); nExtend = @@ -1271,8 +1271,8 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleRow( sal_Int32 nChildIndex ) SwAccessibleChild aCell( GetChild( *(GetMap()), nChildIndex ) ); if ( aCell.GetSwFrame() ) { - sal_Int32 nTop = aCell.GetSwFrame()->Frame().Top(); - nTop -= GetFrame()->Frame().Top(); + sal_Int32 nTop = aCell.GetSwFrame()->getSwFrame().Top(); + nTop -= GetFrame()->getSwFrame().Top(); Int32Set_Impl::const_iterator aRow( GetTableData().GetRows().lower_bound( nTop ) ); nRet = static_cast< sal_Int32 >( std::distance( @@ -1308,8 +1308,8 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleColumn( SwAccessibleChild aCell( GetChild( *(GetMap()), nChildIndex ) ); if ( aCell.GetSwFrame() ) { - sal_Int32 nLeft = aCell.GetSwFrame()->Frame().Left(); - nLeft -= GetFrame()->Frame().Left(); + sal_Int32 nLeft = aCell.GetSwFrame()->getSwFrame().Left(); + nLeft -= GetFrame()->getSwFrame().Left(); Int32Set_Impl::const_iterator aCol( GetTableData().GetColumns().lower_bound( nLeft ) ); nRet = static_cast< sal_Int32 >( std::distance( @@ -1359,7 +1359,7 @@ void SwAccessibleTable::InvalidatePosOrSize( const SwRect& rOldBox ) FireTableChangeEvent(*mpTableData); } if( HasTableData() ) - GetTableData().SetTablePos( GetFrame()->Frame().Pos() ); + GetTableData().SetTablePos( GetFrame()->getSwFrame().Pos() ); SwAccessibleContext::InvalidatePosOrSize( rOldBox ); } @@ -1405,7 +1405,7 @@ void SwAccessibleTable::InvalidateChildPosOrSize( const SwAccessibleChild& rChil if( HasTableData() ) { SAL_WARN_IF( HasTableData() && - GetFrame()->Frame().Pos() != GetTableData().GetTablePos(), + GetFrame()->getSwFrame().Pos() != GetTableData().GetTablePos(), "sw.a11y", "table has invalid position" ); if( HasTableData() ) { diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx index c727ecd90287..d8619067377a 100644 --- a/sw/source/core/crsr/callnk.cxx +++ b/sw/source/core/crsr/callnk.cxx @@ -230,7 +230,7 @@ long SwCallLink::getLayoutFrame( const SwRootFrame* pRoot, SwTextNode const & rN nCntPos >= pNext->GetOfst() ) pFrame = pNext; - return pFrame->Frame().Left(); + return pFrame->getSwFrame().Left(); } return 0; } diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 8b54f8806398..27e6bbecf45a 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -770,7 +770,7 @@ int SwCursorShell::SetCursor( const Point &rLPt, bool bOnlyText, bool bBlock ) { if( pFrame ) { - if( pFrame->Frame().IsInside( rAktCursorPt )) + if( pFrame->getSwFrame().IsInside( rAktCursorPt )) return bRet; } else if( aPos.nNode.GetNode().IsContentNode() ) @@ -789,7 +789,7 @@ int SwCursorShell::SetCursor( const Point &rLPt, bool bOnlyText, bool bBlock ) { // SSelection over not allowed sections or if in header/footer -> different if( !CheckNodesRange( aPos.nNode, pCursor->GetMark()->nNode, true ) - || ( pFrame && !pFrame->Frame().IsInside( pCursor->GetMkPos() ) )) + || ( pFrame && !pFrame->getSwFrame().IsInside( pCursor->GetMkPos() ) )) return bRet; // is at same position but not in header/footer @@ -1117,7 +1117,7 @@ sal_uInt16 SwCursorShell::GetNextPrevPageNum( bool bNext ) const SwPageFrame *pPg = Imp()->GetFirstVisPage(GetOut()); if( pPg ) { - const SwTwips nPageTop = pPg->Frame().Top(); + const SwTwips nPageTop = pPg->getSwFrame().Top(); if( bNext ) { @@ -1126,7 +1126,7 @@ sal_uInt16 SwCursorShell::GetNextPrevPageNum( bool bNext ) { pPg = static_cast<const SwPageFrame *>(pPg->GetNext()); } - while( pPg && pPg->Frame().Top() == nPageTop ); + while( pPg && pPg->getSwFrame().Top() == nPageTop ); while( pPg && pPg->IsEmptyPage() ) pPg = static_cast<const SwPageFrame *>(pPg->GetNext()); @@ -1138,7 +1138,7 @@ sal_uInt16 SwCursorShell::GetNextPrevPageNum( bool bNext ) { pPg = static_cast<const SwPageFrame *>(pPg->GetPrev()); } - while( pPg && pPg->Frame().Top() == nPageTop ); + while( pPg && pPg->getSwFrame().Top() == nPageTop ); while( pPg && pPg->IsEmptyPage() ) pPg = static_cast<const SwPageFrame *>(pPg->GetPrev()); @@ -1162,13 +1162,13 @@ OUString SwCursorShell::getPageRectangles() OUStringBuffer aBuf; for (const SwFrame* pFrame = pLayout->GetLower(); pFrame; pFrame = pFrame->GetNext()) { - aBuf.append(pFrame->Frame().Left()); + aBuf.append(pFrame->getSwFrame().Left()); aBuf.append(", "); - aBuf.append(pFrame->Frame().Top()); + aBuf.append(pFrame->getSwFrame().Top()); aBuf.append(", "); - aBuf.append(pFrame->Frame().Width()); + aBuf.append(pFrame->getSwFrame().Width()); aBuf.append(", "); - aBuf.append(pFrame->Frame().Height()); + aBuf.append(pFrame->getSwFrame().Height()); aBuf.append("; "); } if (!aBuf.isEmpty()) @@ -1561,8 +1561,8 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool bIdleEnd ) SwFrame* pBoxFrame = pTableFrame; while( pBoxFrame && !pBoxFrame->IsCellFrame() ) pBoxFrame = pBoxFrame->GetUpper(); - if( pBoxFrame && pBoxFrame->Frame().HasArea() ) - MakeVisible( pBoxFrame->Frame() ); + if( pBoxFrame && pBoxFrame->getSwFrame().HasArea() ) + MakeVisible( pBoxFrame->getSwFrame() ); else MakeVisible( m_aCharRect ); } @@ -1807,8 +1807,8 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool bIdleEnd ) DisableCallbackAction a(*GetLayout()); pFrame->Calc(GetOut()); m_nUpDownX = pFrame->IsVertical() ? - m_aCharRect.Top() - pFrame->Frame().Top() : - m_aCharRect.Left() - pFrame->Frame().Left(); + m_aCharRect.Top() - pFrame->getSwFrame().Top() : + m_aCharRect.Left() - pFrame->getSwFrame().Left(); } // scroll Cursor to visible area @@ -1893,9 +1893,9 @@ void SwCursorShell::RefreshBlockCursor() if( pFrame ) { if( pFrame->IsVertical() ) - aPt.setY(pFrame->Frame().Top() + GetUpDownX()); + aPt.setY(pFrame->getSwFrame().Top() + GetUpDownX()); else - aPt.setX(pFrame->Frame().Left() + GetUpDownX()); + aPt.setX(pFrame->getSwFrame().Left() + GetUpDownX()); } aMk = rBlock.GetMkPos(); } diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 606b778387ea..01c3ac4c42e1 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -90,12 +90,12 @@ void SwCursorShell::MoveCursorToNum() if( pFrame->IsVertical() ) { aPt.setX(m_aCharRect.Center().getX()); - aPt.setY(pFrame->Frame().Top() + GetUpDownX()); + aPt.setY(pFrame->getSwFrame().Top() + GetUpDownX()); } else { aPt.setY(m_aCharRect.Center().getY()); - aPt.setX(pFrame->Frame().Left() + GetUpDownX()); + aPt.setX(pFrame->getSwFrame().Left() + GetUpDownX()); } pFrame->GetCursorOfst( m_pCurrentCursor->GetPoint(), aPt ); if ( !m_pCurrentCursor->IsSelOvr( SwCursorSelOverFlags::Toggle | @@ -142,7 +142,7 @@ bool SwCursorShell::GotoHeaderText() SwCursor *pTmpCursor = getShellCursor( true ); SwCursorSaveState aSaveState( *pTmpCursor ); pFrame->Calc(GetOut()); - Point aPt( pFrame->Frame().Pos() + pFrame->Prt().Pos() ); + Point aPt( pFrame->getSwFrame().Pos() + pFrame->getSwPrint().Pos() ); pFrame->GetCursorOfst( pTmpCursor->GetPoint(), aPt ); if( !pTmpCursor->IsSelOvr() ) UpdateCursor(); @@ -174,7 +174,7 @@ bool SwCursorShell::GotoFooterText() SwCallLink aLk( *this ); // watch Cursor-Moves SwCursorSaveState aSaveState( *pTmpCursor ); pLower->Calc(GetOut()); - Point aPt( pLower->Frame().Pos() + pLower->Prt().Pos() ); + Point aPt( pLower->getSwFrame().Pos() + pLower->getSwPrint().Pos() ); pLower->GetCursorOfst( pTmpCursor->GetPoint(), aPt ); if( !pTmpCursor->IsSelOvr() ) UpdateCursor(); @@ -1443,8 +1443,8 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, pFrame->GetCharRect(aEnd, aEndPos, &aTmpState); if (aStart.Top() != aEnd.Top() || aStart.Bottom() != aEnd.Bottom()) { - aStart.Left(pFrame->Frame().Left()); - aEnd.Right(pFrame->Frame().Right()); + aStart.Left(pFrame->getSwFrame().Left()); + aEnd.Right(pFrame->getSwFrame().Right()); } *pFieldRect = aStart.Union(aEnd); } @@ -1471,8 +1471,8 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, pFrame->GetCharRect(aEnd, *pRedl->End(), &aTmpState); if (aStart.Top() != aEnd.Top() || aStart.Bottom() != aEnd.Bottom()) { - aStart.Left(pFrame->Frame().Left()); - aEnd.Right(pFrame->Frame().Right()); + aStart.Left(pFrame->getSwFrame().Left()); + aEnd.Right(pFrame->getSwFrame().Right()); } *pFieldRect = aStart.Union(aEnd); } @@ -1516,7 +1516,7 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, if( aTmpState.m_bPosCorr ) { - if( pF && !pF->Frame().IsInside( aPt )) + if( pF && !pF->getSwFrame().IsInside( aPt )) pF = nullptr; } else if( !pF ) @@ -1551,8 +1551,8 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, { if( pFieldRect ) { - *pFieldRect = pF->Prt(); - *pFieldRect += pF->Frame().Pos(); + *pFieldRect = pF->getSwPrint(); + *pFieldRect += pF->getSwFrame().Pos(); } rContentAtPos.pFndTextAttr = nullptr; rContentAtPos.aFnd.pAttr = pItem; diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index ae04aaa030e7..a3b08fcf80f1 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -338,14 +338,14 @@ bool SwCursor::IsSelOvr( SwCursorSelOverFlags eFlags ) { const SwContentFrame* pFrame = static_cast<const SwContentNode*>(pNd)->getLayoutFrame( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() ); if ( (SwCursorSelOverFlags::ChangePos & eFlags) //allowed to change position if it's a bad one - && pFrame && pFrame->IsValid() && !pFrame->Frame().Height() //a bad zero height position + && pFrame && pFrame->IsValid() && !pFrame->getSwFrame().Height() //a bad zero height position && !InputFieldAtPos(GetPoint()) ) //unless it's a (vertical) input field { // skip to the next/prev valid paragraph with a layout SwNodeIndex& rPtIdx = GetPoint()->nNode; bool bGoNxt = m_pSavePos->nNode < rPtIdx.GetIndex(); while( nullptr != ( pFrame = ( bGoNxt ? pFrame->GetNextContentFrame() : pFrame->GetPrevContentFrame() )) - && 0 == pFrame->Frame().Height() ) + && 0 == pFrame->getSwFrame().Height() ) ; // #i72394# skip to prev/next valid paragraph with a layout in case @@ -354,7 +354,7 @@ bool SwCursor::IsSelOvr( SwCursorSelOverFlags eFlags ) { bGoNxt = !bGoNxt; pFrame = static_cast<const SwContentNode*>(pNd)->getLayoutFrame( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() ); - while ( pFrame && 0 == pFrame->Frame().Height() ) + while ( pFrame && 0 == pFrame->getSwFrame().Height() ) { pFrame = bGoNxt ? pFrame->GetNextContentFrame() : pFrame->GetPrevContentFrame(); @@ -1800,8 +1800,8 @@ bool SwCursor::UpDown( bool bUp, sal_uInt16 nCnt, aPt = aTmpRect.Pos(); nUpDownX = pFrame->IsVertical() ? - aPt.getY() - pFrame->Frame().Top() : - aPt.getX() - pFrame->Frame().Left(); + aPt.getY() - pFrame->getSwFrame().Top() : + aPt.getX() - pFrame->getSwFrame().Left(); } // It is allowed to move footnotes in other footnotes but not sections @@ -1853,13 +1853,13 @@ bool SwCursor::UpDown( bool bUp, sal_uInt16 nCnt, { aPt.setX(aTmpRect.Center().getX()); pFrame->Calc(pFrame->getRootFrame()->GetCurrShell()->GetOut()); - aPt.setY(pFrame->Frame().Top() + nUpDownX); + aPt.setY(pFrame->getSwFrame().Top() + nUpDownX); } else { aPt.setY(aTmpRect.Center().getY()); pFrame->Calc(pFrame->getRootFrame()->GetCurrShell()->GetOut()); - aPt.setX(pFrame->Frame().Left() + nUpDownX); + aPt.setX(pFrame->getSwFrame().Left() + nUpDownX); } pFrame->GetCursorOfst( GetPoint(), aPt, &eTmpState ); } diff --git a/sw/source/core/crsr/trvlcol.cxx b/sw/source/core/crsr/trvlcol.cxx index a62c6ebb37e5..9f5bfd1d1def 100644 --- a/sw/source/core/crsr/trvlcol.cxx +++ b/sw/source/core/crsr/trvlcol.cxx @@ -81,11 +81,11 @@ bool SwCursorShell::MoveColumn( SwWhichColumn fnWhichCol, SwPosColumn fnPosCol ) pCnt->Calc(GetOut()); - Point aPt( pCnt->Frame().Pos() + pCnt->Prt().Pos() ); + Point aPt( pCnt->getSwFrame().Pos() + pCnt->getSwPrint().Pos() ); if( fnPosCol == GetColumnEnd ) { - aPt.setX(aPt.getX() + pCnt->Prt().Width()); - aPt.setY(aPt.getY() + pCnt->Prt().Height()); + aPt.setX(aPt.getX() + pCnt->getSwPrint().Width()); + aPt.setY(aPt.getY() + pCnt->getSwPrint().Height()); } pCnt->GetCursorOfst( m_pCurrentCursor->GetPoint(), aPt ); diff --git a/sw/source/core/crsr/trvlfnfl.cxx b/sw/source/core/crsr/trvlfnfl.cxx index 05685aae6a33..828ed251f069 100644 --- a/sw/source/core/crsr/trvlfnfl.cxx +++ b/sw/source/core/crsr/trvlfnfl.cxx @@ -317,13 +317,13 @@ bool SwCursorShell::GotoFlyAnchor() // jump in BodyFrame closest to FlyFrame SwRect aTmpRect( m_aCharRect ); - if( !pFrame->Frame().IsInside( aTmpRect )) - aTmpRect = pFrame->Frame(); + if( !pFrame->getSwFrame().IsInside( aTmpRect )) + aTmpRect = pFrame->getSwFrame(); Point aPt( aTmpRect.Left(), aTmpRect.Top() + ( aTmpRect.Bottom() - aTmpRect.Top() ) / 2 ); - aPt.setX(aPt.getX() > (pFrame->Frame().Left() + (pFrame->Frame().SSize().Width() / 2 )) - ? pFrame->Frame().Right() - : pFrame->Frame().Left()); + aPt.setX(aPt.getX() > (pFrame->getSwFrame().Left() + (pFrame->getSwFrame().SSize().Width() / 2 )) + ? pFrame->getSwFrame().Right() + : pFrame->getSwFrame().Left()); const SwPageFrame* pPageFrame = pFrame->FindPageFrame(); const SwContentFrame* pFndFrame = pPageFrame->GetContentPos( aPt, false, true ); diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx index da0945f54a4d..941588c2982b 100644 --- a/sw/source/core/crsr/trvltbl.cxx +++ b/sw/source/core/crsr/trvltbl.cxx @@ -242,8 +242,8 @@ bool SwCursorShell::SelTableRowOrCol( bool bRow, bool bRowSimple ) // with the repeated headlines check in UpdateCursor(): if ( !bRow ) m_pTableCursor->GetPtPos() = pMasterTabFrame->IsVertical() - ? pMasterTabFrame->Frame().TopRight() - : pMasterTabFrame->Frame().TopLeft(); + ? pMasterTabFrame->getSwFrame().TopRight() + : pMasterTabFrame->getSwFrame().TopLeft(); UpdateCursor(); return true; @@ -275,7 +275,7 @@ bool SwCursorShell::SelTable() m_pTableCursor->SetMark(); // set MkPos 'close' to the master table, otherwise we might get problems // with the repeated headlines check in UpdateCursor(): - m_pTableCursor->GetMkPos() = pMasterTabFrame->IsVertical() ? pMasterTabFrame->Frame().TopRight() : pMasterTabFrame->Frame().TopLeft(); + m_pTableCursor->GetMkPos() = pMasterTabFrame->IsVertical() ? pMasterTabFrame->getSwFrame().TopRight() : pMasterTabFrame->getSwFrame().TopLeft(); m_pTableCursor->GetPoint()->nNode = *pTableNd->EndOfSectionNode(); m_pTableCursor->Move( fnMoveBackward, GoInContent ); UpdateCursor(); diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 3781029ff74f..52cd65acfd5d 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -779,7 +779,7 @@ void SwShellTableCursor::FillRects() bool bStart = true; SwRegionRects aReg( GetShell()->VisArea() ); if (comphelper::LibreOfficeKit::isActive()) - aReg = GetShell()->getIDocumentLayoutAccess().GetCurrentLayout()->Frame(); + aReg = GetShell()->getIDocumentLayoutAccess().GetCurrentLayout()->getSwFrame(); SwNodes& rNds = GetDoc()->GetNodes(); SwFrame* pEndFrame = nullptr; for (size_t n = 0; n < m_SelectedBoxes.size(); ++n) @@ -812,13 +812,13 @@ void SwShellTableCursor::FillRects() while ( pFrame ) { - if( aReg.GetOrigin().IsOver( pFrame->Frame() ) ) + if( aReg.GetOrigin().IsOver( pFrame->getSwFrame() ) ) { - aReg -= pFrame->Frame(); + aReg -= pFrame->getSwFrame(); if (bStart) { bStart = false; - m_aStart = SwRect(pFrame->Frame().Left(), pFrame->Frame().Top(), 1, pFrame->Frame().Height()); + m_aStart = SwRect(pFrame->getSwFrame().Left(), pFrame->getSwFrame().Top(), 1, pFrame->getSwFrame().Height()); } } @@ -827,7 +827,7 @@ void SwShellTableCursor::FillRects() } } if (pEndFrame) - m_aEnd = SwRect(pEndFrame->Frame().Right(), pEndFrame->Frame().Top(), 1, pEndFrame->Frame().Height()); + m_aEnd = SwRect(pEndFrame->getSwFrame().Right(), pEndFrame->getSwFrame().Top(), 1, pEndFrame->getSwFrame().Height()); aReg.Invert(); insert( begin(), aReg.begin(), aReg.end() ); } @@ -857,7 +857,7 @@ bool SwShellTableCursor::IsInside( const Point& rPt ) const while( pFrame && !pFrame->IsCellFrame() ) pFrame = pFrame->GetUpper(); OSL_ENSURE( pFrame, "Node not in a table" ); - if( pFrame && pFrame->Frame().IsInside( rPt ) ) + if( pFrame && pFrame->getSwFrame().IsInside( rPt ) ) return true; } return false; diff --git a/sw/source/core/doc/DocumentDrawModelManager.cxx b/sw/source/core/doc/DocumentDrawModelManager.cxx index 873d8c9d1d98..7e54c5ac41ea 100644 --- a/sw/source/core/doc/DocumentDrawModelManager.cxx +++ b/sw/source/core/doc/DocumentDrawModelManager.cxx @@ -145,7 +145,7 @@ void DocumentDrawModelManager::InitDrawModel() // mpDrawModel->InsertPage( pDrawPage ); SdrPage* pDrawPage = pMasterPage; pRoot->SetDrawPage( pDrawPage ); - pDrawPage->SetSize( pRoot->Frame().SSize() ); + pDrawPage->SetSize( pRoot->getSwFrame().SSize() ); } } } diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 9239aa5cf809..78b5aadf2c6d 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -668,7 +668,7 @@ void SwDoc::CalculatePagesForPrinting( const bool bPrintThisPage = ( (bPrintRightPages && pStPage->OnRightPage()) || (bPrintLeftPages && !pStPage->OnRightPage()) ) && - ( bPrintEmptyPages || pStPage->Frame().Height() ); + ( bPrintEmptyPages || pStPage->getSwFrame().Height() ); if (bPrintThisPage) { diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index 49d1dc7c16e9..064df47eae6f 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -223,7 +223,7 @@ static Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFormatAnchor& rAnch, { const SwFrame* pOld = static_cast<const SwFlyFrameFormat*>(pFlyFormat)->GetFrame( &aRet ); if( pOld ) - aRet = pOld->Frame().Pos(); + aRet = pOld->getSwFrame().Pos(); } break; @@ -235,7 +235,7 @@ static Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFormatAnchor& rAnch, const SwContentNode* pNd = pPos->nNode.GetNode().GetContentNode(); const SwFrame* pOld = pNd ? pNd->getLayoutFrame( rDoc.getIDocumentLayoutAccess().GetCurrentLayout(), &aRet, nullptr, false ) : nullptr; if( pOld ) - aRet = pOld->Frame().Pos(); + aRet = pOld->getSwFrame().Pos(); } break; @@ -246,7 +246,7 @@ static Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFormatAnchor& rAnch, nNode.GetNode().GetFlyFormat()); const SwFrame* pOld = pFormat ? pFormat->GetFrame( &aRet ) : nullptr; if( pOld ) - aRet = pOld->Frame().Pos(); + aRet = pOld->getSwFrame().Pos(); } break; @@ -258,7 +258,7 @@ static Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFormatAnchor& rAnch, pPage =static_cast<const SwPageFrame*>(pPage->GetNext()) ) if( i == nPgNum ) { - aRet = pPage->Frame().Pos(); + aRet = pPage->getSwFrame().Pos(); break; } } @@ -840,7 +840,7 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, case RndStdIds::FLY_AT_PAGE: { pNewAnchorFrame = getIDocumentLayoutAccess().GetCurrentLayout()->Lower(); - while ( pNewAnchorFrame && !pNewAnchorFrame->Frame().IsInside( aPt ) ) + while ( pNewAnchorFrame && !pNewAnchorFrame->getSwFrame().IsInside( aPt ) ) pNewAnchorFrame = pNewAnchorFrame->GetNext(); if ( !pNewAnchorFrame ) continue; @@ -873,7 +873,7 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, aPoint.setX(aPoint.getX() - 1); // Do not load in the DrawObj! aNewAnch.SetType( RndStdIds::FLY_AS_CHAR ); SwPosition aPos( *static_cast<const SwContentFrame*>(pNewAnchorFrame)->GetNode() ); - if ( pNewAnchorFrame->Frame().IsInside( aPoint ) ) + if ( pNewAnchorFrame->getSwFrame().IsInside( aPoint ) ) { // We need to find a TextNode, because only there we can anchor a // content-bound DrawObject. @@ -884,7 +884,7 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, { SwContentNode &rCNd = const_cast<SwContentNode&>( *static_cast<const SwContentFrame*>(pNewAnchorFrame)->GetNode()); - if ( pNewAnchorFrame->Frame().Bottom() < aPt.Y() ) + if ( pNewAnchorFrame->getSwFrame().Bottom() < aPt.Y() ) rCNd.MakeStartIndex( &aPos.nContent ); else rCNd.MakeEndIndex( &aPos.nContent ); @@ -1096,7 +1096,7 @@ SwChainRet SwDoc::Chain( SwFrameFormat &rSource, const SwFrameFormat &rDest ) { SwFlyFrame *pFly = SwIterator<SwFlyFrame,SwFormat>( rSource ).First(); if ( pFly ) - aSize.SetHeight( pFly->Frame().Height() ); + aSize.SetHeight( pFly->getSwFrame().Height() ); aSize.SetHeightSizeType( ATT_FIX_SIZE ); aSet.Put( aSize ); } diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx index 9ffef39248a3..053446edff4c 100644 --- a/sw/source/core/doc/htmltbl.cxx +++ b/sw/source/core/doc/htmltbl.cxx @@ -340,7 +340,7 @@ sal_uInt16 SwHTMLTableLayout::GetBrowseWidth( const SwDoc& rDoc ) { const SwFrame *pPageFrame = pRootFrame->GetLower(); if( pPageFrame ) - return (sal_uInt16)pPageFrame->Prt().Width(); + return (sal_uInt16)pPageFrame->getSwPrint().Width(); } // #i91658# @@ -364,13 +364,13 @@ sal_uInt16 SwHTMLTableLayout::GetBrowseWidthByTabFrame( // For paragraph-bound frames we don't respect paragraph indents. const SwFrame *pAnchor = static_cast<const SwFlyFrame *>(pUpper)->GetAnchorFrame(); if( pAnchor->IsTextFrame() ) - nWidth = pAnchor->Frame().Width(); + nWidth = pAnchor->getSwFrame().Width(); else - nWidth = pAnchor->Prt().Width(); + nWidth = pAnchor->getSwPrint().Width(); } else { - nWidth = pUpper->Prt().Width(); + nWidth = pUpper->getSwPrint().Width(); } SwTwips nUpperDummy = 0; diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 172187fc83b2..18fa63ca2b99 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -211,7 +211,7 @@ static void lcl_ClearArea( const SwFrame &rFrame, void SwNoTextFrame::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, SwPrintData const*const) const { - if ( Frame().IsEmpty() ) + if ( getSwFrame().IsEmpty() ) return; const SwViewShell* pSh = getRootFrame()->GetCurrShell(); @@ -227,7 +227,7 @@ void SwNoTextFrame::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRec GetRealURL( *static_cast<const SwGrfNode*>(pNd), aText ); if( aText.isEmpty() ) aText = FindFlyFrame()->GetFormat()->GetName(); - lcl_PaintReplacement( Frame(), aText, *pSh, this, false ); + lcl_PaintReplacement( getSwFrame(), aText, *pSh, this, false ); } return; } @@ -263,10 +263,10 @@ void SwNoTextFrame::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRec SwRect aOrigPaint( rRect ); if ( HasAnimation() && pSh->GetWin() ) { - aOrigPaint = Frame(); aOrigPaint += Prt().Pos(); + aOrigPaint = getSwFrame(); aOrigPaint += getSwPrint().Pos(); } - SwRect aGrfArea( Frame() ); + SwRect aGrfArea( getSwFrame() ); SwRect aPaintArea( aGrfArea ); // In case the picture fly frm was clipped, render it with the origin @@ -286,13 +286,13 @@ void SwNoTextFrame::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRec } if( bGetUnclippedFrame ) - aGrfArea = SwRect( Frame().Pos( ), pFly->GetUnclippedFrame( ).SSize( ) ); + aGrfArea = SwRect( getSwFrame().Pos( ), pFly->GetUnclippedFrame( ).SSize( ) ); } } aPaintArea.Intersection_( aOrigPaint ); - SwRect aNormal( Frame().Pos() + Prt().Pos(), Prt().SSize() ); + SwRect aNormal( getSwFrame().Pos() + getSwPrint().Pos(), getSwPrint().SSize() ); aNormal.Justify(); // Normalized rectangle for the comparisons if( aPaintArea.IsOver( aNormal ) ) @@ -374,7 +374,7 @@ void SwNoTextFrame::GetGrfArea( SwRect &rRect, SwRect* pOrigRect ) const Size aOrigSz( static_cast<const SwNoTextNode*>(GetNode())->GetTwipSize() ); if ( !aOrigSz.Width() ) { - aOrigSz.Width() = Prt().Width(); + aOrigSz.Width() = getSwPrint().Width(); nLeftCrop = -rCrop.GetLeft(); nRightCrop = -rCrop.GetRight(); } @@ -382,7 +382,7 @@ void SwNoTextFrame::GetGrfArea( SwRect &rRect, SwRect* pOrigRect ) const { nLeftCrop = std::max( aOrigSz.Width() - (rCrop.GetRight() + rCrop.GetLeft()), long(1) ); - const double nScale = double(Prt().Width()) / double(nLeftCrop); + const double nScale = double(getSwPrint().Width()) / double(nLeftCrop); nLeftCrop = long(nScale * -rCrop.GetLeft() ); nRightCrop = long(nScale * -rCrop.GetRight() ); } @@ -397,14 +397,14 @@ void SwNoTextFrame::GetGrfArea( SwRect &rRect, SwRect* pOrigRect ) const if( !aOrigSz.Height() ) { - aOrigSz.Height() = Prt().Height(); + aOrigSz.Height() = getSwPrint().Height(); nTopCrop = -rCrop.GetTop(); nBottomCrop= -rCrop.GetBottom(); } else { nTopCrop = std::max( aOrigSz.Height() - (rCrop.GetTop() + rCrop.GetBottom()), long(1) ); - const double nScale = double(Prt().Height()) / double(nTopCrop); + const double nScale = double(getSwPrint().Height()) / double(nTopCrop); nTopCrop = long(nScale * -rCrop.GetTop() ); nBottomCrop= long(nScale * -rCrop.GetBottom() ); } @@ -417,9 +417,9 @@ void SwNoTextFrame::GetGrfArea( SwRect &rRect, SwRect* pOrigRect ) const nBottomCrop= nTmpCrop; } - Size aVisSz( Prt().SSize() ); + Size aVisSz( getSwPrint().SSize() ); Size aGrfSz( aVisSz ); - Point aVisPt( Frame().Pos() + Prt().Pos() ); + Point aVisPt( getSwFrame().Pos() + getSwPrint().Pos() ); Point aGrfPt( aVisPt ); // Set the "visible" rectangle first @@ -465,7 +465,7 @@ const Size& SwNoTextFrame::GetSize() const const SwFrame *pFly = FindFlyFrame(); if( !pFly ) pFly = this; - return pFly->Prt().SSize(); + return pFly->getSwPrint().SSize(); } void SwNoTextFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) @@ -479,7 +479,10 @@ void SwNoTextFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) MakePos(); if ( !mbValidSize ) - Frame().Width( GetUpper()->Prt().Width() ); + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Width( GetUpper()->getSwPrint().Width() ); + } MakePrtArea( rAttrs ); @@ -497,12 +500,12 @@ void SwNoTextFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBord // Did the height change? SwTwips nChgHght = IsVertical() ? - (SwTwips)(aNewSize.Width() - Prt().Width()) : - (SwTwips)(aNewSize.Height() - Prt().Height()); + (SwTwips)(aNewSize.Width() - getSwPrint().Width()) : + (SwTwips)(aNewSize.Height() - getSwPrint().Height()); if( nChgHght > 0) Grow( nChgHght ); else if( nChgHght < 0) - Shrink( std::min(Prt().Height(), -nChgHght) ); + Shrink( std::min(getSwPrint().Height(), -nChgHght) ); } bool SwNoTextFrame::GetCharRect( SwRect &rRect, const SwPosition& rPos, @@ -512,10 +515,10 @@ bool SwNoTextFrame::GetCharRect( SwRect &rRect, const SwPosition& rPos, return false; Calc(getRootFrame()->GetCurrShell()->GetOut()); - SwRect aFrameRect( Frame() ); + SwRect aFrameRect( getSwFrame() ); rRect = aFrameRect; - rRect.Pos( Frame().Pos() + Prt().Pos() ); - rRect.SSize( Prt().SSize() ); + rRect.Pos( getSwFrame().Pos() + getSwPrint().Pos() ); + rRect.SSize( getSwPrint().SSize() ); rRect.Justify(); @@ -555,7 +558,7 @@ bool SwNoTextFrame::GetCursorOfst(SwPosition* pPos, Point& , if( pFly && pFly->GetFormat()->GetSurround().IsContour() )\ {\ ClrContourCache( pFly->GetVirtDrawObj() );\ - pFly->NotifyBackground( FindPageFrame(), Prt(), PREP_FLY_ATTR_CHG );\ + pFly->NotifyBackground( FindPageFrame(), getSwPrint(), PREP_FLY_ATTR_CHG );\ }\ } @@ -591,7 +594,7 @@ void SwNoTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { GraphicAttr aAttr; if( pNd->GetGrfObj().IsCached( pVSh->GetOut(), - Prt().SSize(), &pNd->GetGraphicAttr( aAttr, this ) )) + getSwPrint().SSize(), &pNd->GetGraphicAttr( aAttr, this ) )) { for(SwViewShell& rShell : pVSh->GetRingContainer()) { @@ -599,9 +602,9 @@ void SwNoTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) if( rShell.GetWin() ) { if( rShell.IsPreview() ) - ::RepaintPagePreview( &rShell, Frame().SVRect() ); + ::RepaintPagePreview( &rShell, getSwFrame().SVRect() ); else - rShell.GetWin()->Invalidate( Frame().SVRect() ); + rShell.GetWin()->Invalidate( getSwFrame().SVRect() ); } } } @@ -665,7 +668,7 @@ void SwNoTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) CLEARCACHE - SwRect aRect( Frame() ); + SwRect aRect( getSwFrame() ); SwViewShell *pVSh = pNd->GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell(); if( !pVSh ) @@ -1097,7 +1100,7 @@ void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfAr { const SwFlyFrame *pFly = FindFlyFrame(); assert( pFly != nullptr ); - static_cast<SwFEShell*>(pShell)->ConnectObj( pOLENd->GetOLEObj().GetObject(), pFly->Prt(), pFly->Frame()); + static_cast<SwFEShell*>(pShell)->ConnectObj( pOLENd->GetOLEObj().GetObject(), pFly->getSwPrint(), pFly->getSwFrame()); } } diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index f0eecddda7cc..7d6d9087c42d 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -1060,7 +1060,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 ] = aRectFnSet.GetHeight(pRow->Frame()); + pRowHeights[ n ] = aRectFnSet.GetHeight(pRow->getSwFrame()); } } @@ -3549,9 +3549,9 @@ bool SwTable::SetColWidth( SwTableBox& rAktBox, TableChgWidthHeightType eType, { SwTabFrame* pTabFrame = SwIterator<SwTabFrame,SwFormat>( *GetFrameFormat() ).First(); if( pTabFrame && - pTabFrame->Prt().Width() != rSz.GetWidth() ) + pTabFrame->getSwPrint().Width() != rSz.GetWidth() ) { - nFrameWidth = pTabFrame->Prt().Width(); + nFrameWidth = pTabFrame->getSwPrint().Width(); if( bBigger ) nFrameWidth += nAbsDiff; else @@ -3904,7 +3904,7 @@ void SetLineHeight( SwTableLine& rLine, SwTwips nOldHeight, SwTwips nNewHeight, SwFrameFormat* pFormat = rLine.ClaimFrameFormat(); - SwTwips nMyNewH, nMyOldH = pLineFrame->Frame().Height(); + SwTwips nMyNewH, nMyOldH = pLineFrame->getSwFrame().Height(); if( !nOldHeight ) // the BaseLine and absolute nMyNewH = nMyOldH + nNewHeight; else @@ -3967,7 +3967,7 @@ static bool lcl_SetOtherLineHeight( SwTableLine* pLine, CR_SetLineHeight& rParam if( TableChgMode::FixedWidthChangeProp == rParam.nMode ) { - nDist *= pLineFrame->Frame().Height(); + nDist *= pLineFrame->getSwFrame().Height(); nDist /= rParam.nMaxHeight; } bRet = nDist <= CalcRowRstHeight( pLineFrame ); @@ -3987,7 +3987,7 @@ static bool lcl_SetOtherLineHeight( SwTableLine* pLine, CR_SetLineHeight& rParam // via the max height. if( (true) /*!rParam.bBigger*/ ) { - nDist *= pLineFrame->Frame().Height(); + nDist *= pLineFrame->getSwFrame().Height(); nDist /= rParam.nMaxHeight; } else @@ -4152,7 +4152,7 @@ bool SwTable::SetRowHeight( SwTableBox& rAktBox, TableChgWidthHeightType eType, { if( bInsDel && !bBigger ) // By how much does it get higher? { - nAbsDiff = GetRowFrame( *pBaseLine )->Frame().Height(); + nAbsDiff = GetRowFrame( *pBaseLine )->getSwFrame().Height(); } if( TableChgMode::VarWidthChangeAbs == m_eTableChgMode ) @@ -4220,7 +4220,7 @@ bool SwTable::SetRowHeight( SwTableBox& rAktBox, TableChgWidthHeightType eType, SwLayoutFrame* pLineFrame = GetRowFrame( *(*pLines)[ n ] ); OSL_ENSURE( pLineFrame, "Where is the Frame from the SwTableLine??" ); aParam.nMaxSpace += CalcRowRstHeight( pLineFrame ); - aParam.nMaxHeight += pLineFrame->Frame().Height(); + aParam.nMaxHeight += pLineFrame->getSwFrame().Height(); } if( bBigger && aParam.nMaxSpace < nAbsDiff ) bRet = false; diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 2b03155cce3a..5571ae35ae83 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -1043,8 +1043,8 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh, aPosArr.push_back( static_cast<sal_uInt16>(aFInfo.GetFrame()->IsVertical() ? - aFInfo.GetFrame()->Prt().Bottom() : - aFInfo.GetFrame()->Prt().Right()) ); + aFInfo.GetFrame()->getSwPrint().Bottom() : + aFInfo.GetFrame()->getSwPrint().Right()) ); } } @@ -2511,14 +2511,14 @@ void SwDoc::GetTabCols( SwTabCols &rFill, const SwCellFrame* pBoxFrame ) // Set fixed points, LeftMin in Document coordinates, all others relative SwRectFnSet aRectFnSet(pTab); const SwPageFrame* pPage = pTab->FindPageFrame(); - const sal_uLong nLeftMin = aRectFnSet.GetLeft(pTab->Frame()) - - aRectFnSet.GetLeft(pPage->Frame()); - const sal_uLong nRightMax = aRectFnSet.GetRight(pTab->Frame()) - - aRectFnSet.GetLeft(pPage->Frame()); + const sal_uLong nLeftMin = aRectFnSet.GetLeft(pTab->getSwFrame()) - + aRectFnSet.GetLeft(pPage->getSwFrame()); + const sal_uLong nRightMax = aRectFnSet.GetRight(pTab->getSwFrame()) - + aRectFnSet.GetLeft(pPage->getSwFrame()); rFill.SetLeftMin ( nLeftMin ); - rFill.SetLeft ( aRectFnSet.GetLeft(pTab->Prt()) ); - rFill.SetRight ( aRectFnSet.GetRight(pTab->Prt())); + rFill.SetLeft ( aRectFnSet.GetLeft(pTab->getSwPrint()) ); + rFill.SetRight ( aRectFnSet.GetRight(pTab->getSwPrint())); rFill.SetRightMax( nRightMax - nLeftMin ); pTab->GetTable()->GetTabCols( rFill, pBox ); @@ -2590,10 +2590,10 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCellFrame* pBoxFrame ) SwRectFnSet aRectFnSet(pTab); const SwPageFrame* pPage = pTab->FindPageFrame(); const long nLeftMin = ( aRectFnSet.IsVert() ? - pTab->GetPrtLeft() - pPage->Frame().Left() : - pTab->GetPrtTop() - pPage->Frame().Top() ); + pTab->GetPrtLeft() - pPage->getSwFrame().Left() : + pTab->GetPrtTop() - pPage->getSwFrame().Top() ); const long nLeft = aRectFnSet.IsVert() ? LONG_MAX : 0; - const long nRight = aRectFnSet.GetHeight(pTab->Prt()); + const long nRight = aRectFnSet.GetHeight(pTab->getSwPrint()); const long nRightMax = aRectFnSet.IsVert() ? nRight : LONG_MAX; rFill.SetLeftMin( nLeftMin ); @@ -2615,8 +2615,8 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCellFrame* pBoxFrame ) if ( pFrame->IsCellFrame() && pFrame->FindTabFrame() == pTab ) { // upper and lower borders of current cell frame: - long nUpperBorder = aRectFnSet.GetTop(pFrame->Frame()); - long nLowerBorder = aRectFnSet.GetBottom(pFrame->Frame()); + long nUpperBorder = aRectFnSet.GetTop(pFrame->getSwFrame()); + long nLowerBorder = aRectFnSet.GetBottom(pFrame->getSwFrame()); // get boundaries for nUpperBorder: aIter = aBoundaries.find( nUpperBorder ); @@ -2709,7 +2709,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 = aRectFnSet.GetWidth(pTab->Prt()); + SwTwips nPrtWidth = aRectFnSet.GetWidth(pTab->getSwPrint()); { SvxShadowItem aShadow( rTab.GetFrameFormat()->GetShadow() ); nPrtWidth += aShadow.CalcShadowSpace( SvxShadowItemSide::LEFT ) + @@ -2725,15 +2725,15 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, bool bCurRowOnly, SwTabCols aOld( rNew.Count() ); const SwPageFrame* pPage = pTab->FindPageFrame(); - const sal_uLong nLeftMin = aRectFnSet.GetLeft(pTab->Frame()) - - aRectFnSet.GetLeft(pPage->Frame()); - const sal_uLong nRightMax = aRectFnSet.GetRight(pTab->Frame()) - - aRectFnSet.GetLeft(pPage->Frame()); + const sal_uLong nLeftMin = aRectFnSet.GetLeft(pTab->getSwFrame()) - + aRectFnSet.GetLeft(pPage->getSwFrame()); + const sal_uLong nRightMax = aRectFnSet.GetRight(pTab->getSwFrame()) - + aRectFnSet.GetLeft(pPage->getSwFrame()); // Set fixed points, LeftMin in Document coordinates, all others relative aOld.SetLeftMin ( nLeftMin ); - aOld.SetLeft ( aRectFnSet.GetLeft(pTab->Prt()) ); - aOld.SetRight ( aRectFnSet.GetRight(pTab->Prt())); + aOld.SetLeft ( aRectFnSet.GetLeft(pTab->getSwPrint()) ); + aOld.SetRight ( aRectFnSet.GetRight(pTab->getSwPrint())); aOld.SetRightMax( nRightMax - nLeftMin ); rTab.GetTabCols( aOld, pBox ); @@ -2763,18 +2763,18 @@ 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( aRectFnSet.GetHeight(pTab->Prt()) ); + aOld.SetRight( aRectFnSet.GetHeight(pTab->getSwPrint()) ); long nLeftMin; if ( aRectFnSet.IsVert() ) { - nLeftMin = pTab->GetPrtLeft() - pPage->Frame().Left(); + nLeftMin = pTab->GetPrtLeft() - pPage->getSwFrame().Left(); aOld.SetLeft ( LONG_MAX ); aOld.SetRightMax( aOld.GetRight() ); } else { - nLeftMin = pTab->GetPrtTop() - pPage->Frame().Top(); + nLeftMin = pTab->GetPrtTop() - pPage->getSwFrame().Top(); aOld.SetLeft ( 0 ); aOld.SetRightMax( LONG_MAX ); } @@ -2819,7 +2819,7 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, bool bCurColOnly, { if ( pFrame->IsCellFrame() && pFrame->FindTabFrame() == pTab ) { - const long nLowerBorder = aRectFnSet.GetBottom(pFrame->Frame()); + const long nLowerBorder = aRectFnSet.GetBottom(pFrame->getSwFrame()); const sal_uLong nTabTop = aRectFnSet.GetPrtTop(*pTab); if ( std::abs( aRectFnSet.YInc( nTabTop, nOldRowEnd ) - nLowerBorder ) <= ROWFUZZY ) { @@ -2839,7 +2839,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 = aRectFnSet.GetHeight(pFrame->Frame()) + nDiff; + const long nNewSize = aRectFnSet.GetHeight(pFrame->getSwFrame()) + 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 02390f41dff3..2fbfa06f7878 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -441,7 +441,7 @@ bool SwDoc::BalanceRowHeight( const SwCursor& rCursor, bool bTstOnly ) SwFrame* pFrame = aIter.First(); while ( pFrame ) { - nHeight = std::max( nHeight, pFrame->Frame().Height() ); + nHeight = std::max( nHeight, pFrame->getSwFrame().Height() ); pFrame = aIter.Next(); } } @@ -536,7 +536,7 @@ static void lcl_CollectCells( std::vector<SwCellFrame*> &rArr, const SwRect &rUn while ( !pCell->IsCellFrame() ) pCell = pCell->GetUpper(); OSL_ENSURE( pCell, "Frame is not a Cell" ); - if ( rUnion.IsOver( pCell->Frame() ) ) + if ( rUnion.IsOver( pCell->getSwFrame() ) ) ::InsertCell( rArr, static_cast<SwCellFrame*>(pCell) ); // Make sure the Cell is left (Areas) @@ -643,17 +643,17 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet ) bool bTopOver, bLeftOver, bRightOver, bBottomOver; if ( bVert ) { - bTopOver = pCell->Frame().Right() >= rUnion.Right(); - bLeftOver = pCell->Frame().Top() <= rUnion.Top(); - bRightOver = pCell->Frame().Bottom() >= rUnion.Bottom(); - bBottomOver = pCell->Frame().Left() <= rUnion.Left(); + bTopOver = pCell->getSwFrame().Right() >= rUnion.Right(); + bLeftOver = pCell->getSwFrame().Top() <= rUnion.Top(); + bRightOver = pCell->getSwFrame().Bottom() >= rUnion.Bottom(); + bBottomOver = pCell->getSwFrame().Left() <= rUnion.Left(); } else { - bTopOver = pCell->Frame().Top() <= rUnion.Top(); - bLeftOver = pCell->Frame().Left() <= rUnion.Left(); - bRightOver = pCell->Frame().Right() >= rUnion.Right(); - bBottomOver = pCell->Frame().Bottom() >= rUnion.Bottom(); + bTopOver = pCell->getSwFrame().Top() <= rUnion.Top(); + bLeftOver = pCell->getSwFrame().Left() <= rUnion.Left(); + bRightOver = pCell->getSwFrame().Right() >= rUnion.Right(); + bBottomOver = pCell->getSwFrame().Bottom() >= rUnion.Bottom(); } if ( bRTL ) @@ -954,17 +954,17 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) bool bTopOver, bLeftOver, bRightOver, bBottomOver; if ( bVert ) { - bTopOver = pCell->Frame().Right() >= rUnion.Right(); - bLeftOver = pCell->Frame().Top() <= rUnion.Top(); - bRightOver = pCell->Frame().Bottom() >= rUnion.Bottom(); - bBottomOver = pCell->Frame().Left() <= rUnion.Left(); + bTopOver = pCell->getSwFrame().Right() >= rUnion.Right(); + bLeftOver = pCell->getSwFrame().Top() <= rUnion.Top(); + bRightOver = pCell->getSwFrame().Bottom() >= rUnion.Bottom(); + bBottomOver = pCell->getSwFrame().Left() <= rUnion.Left(); } else { - bTopOver = pCell->Frame().Top() <= rUnion.Top(); - bLeftOver = pCell->Frame().Left() <= rUnion.Left(); - bRightOver = pCell->Frame().Right() >= rUnion.Right(); - bBottomOver = pCell->Frame().Bottom() >= rUnion.Bottom(); + bTopOver = pCell->getSwFrame().Top() <= rUnion.Top(); + bLeftOver = pCell->getSwFrame().Left() <= rUnion.Left(); + bRightOver = pCell->getSwFrame().Right() >= rUnion.Right(); + bBottomOver = pCell->getSwFrame().Bottom() >= rUnion.Bottom(); } if ( bRTL ) @@ -1275,20 +1275,20 @@ static sal_uInt16 lcl_CalcCellFit( const SwLayoutFrame *pCell ) SwRectFnSet aRectFnSet(pCell); while ( pFrame ) { - const SwTwips nAdd = aRectFnSet.GetWidth(pFrame->Frame()) - - aRectFnSet.GetWidth(pFrame->Prt()); + const SwTwips nAdd = aRectFnSet.GetWidth(pFrame->getSwFrame()) - + aRectFnSet.GetWidth(pFrame->getSwPrint()); // pFrame does not necessarily have to be a SwTextFrame! const SwTwips nCalcFitToContent = pFrame->IsTextFrame() ? const_cast<SwTextFrame*>(static_cast<const SwTextFrame*>(pFrame))->CalcFitToContent() : - aRectFnSet.GetWidth(pFrame->Prt()); + aRectFnSet.GetWidth(pFrame->getSwPrint()); nRet = std::max( nRet, nCalcFitToContent + nAdd ); pFrame = pFrame->GetNext(); } // Surrounding border as well as left and Right Border also need to be respected - nRet += aRectFnSet.GetWidth(pCell->Frame()) - - aRectFnSet.GetWidth(pCell->Prt()); + nRet += aRectFnSet.GetWidth(pCell->getSwFrame()) - + aRectFnSet.GetWidth(pCell->getSwPrint()); // To compensate for the accuracy of calculation later on in SwTable::SetTabCols // we keep adding up a little. @@ -1315,7 +1315,7 @@ static void lcl_CalcSubColValues( std::vector<sal_uInt16> &rToFill, const SwTabC { const sal_uInt16 nWish = bWishValues ? ::lcl_CalcCellFit( pCell ) : - MINLAY + sal_uInt16(pCell->Frame().Width() - pCell->Prt().Width()); + MINLAY + sal_uInt16(pCell->getSwFrame().Width() - pCell->getSwPrint().Width()); SwRectFnSet aRectFnSet(pTab); @@ -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() != aRectFnSet.GetLeft(pTab->Frame()) ) + if ( rCols.GetLeftMin() != aRectFnSet.GetLeft(pTab->getSwFrame()) ) { - const long nDiff = aRectFnSet.GetLeft(pTab->Frame()) - rCols.GetLeftMin(); + const long nDiff = aRectFnSet.GetLeft(pTab->getSwFrame()) - rCols.GetLeftMin(); nColLeft += nDiff; nColRight += nDiff; } - const long nCellLeft = aRectFnSet.GetLeft(pCell->Frame()); - const long nCellRight = aRectFnSet.GetRight(pCell->Frame()); + const long nCellLeft = aRectFnSet.GetLeft(pCell->getSwFrame()); + const long nCellRight = aRectFnSet.GetRight(pCell->getSwFrame()); // Calculate overlapping value long nWidth = 0; @@ -1344,9 +1344,9 @@ static void lcl_CalcSubColValues( std::vector<sal_uInt16> &rToFill, const SwTabC nWidth = nCellRight - nColLeft; else if ( nColLeft >= nCellLeft && nColRight <= nCellRight ) nWidth = nColRight - nColLeft; - if ( nWidth && pCell->Frame().Width() ) + if ( nWidth && pCell->getSwFrame().Width() ) { - long nTmp = nWidth * nWish / pCell->Frame().Width(); + long nTmp = nWidth * nWish / pCell->getSwFrame().Width(); if ( sal_uInt16(nTmp) > rToFill[i] ) rToFill[i] = sal_uInt16(nTmp); } @@ -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 = aRectFnSet.GetLeft(pCell->Frame()); - const long nCRight = aRectFnSet.GetRight(pCell->Frame()); + const long nCLeft = aRectFnSet.GetLeft(pCell->getSwFrame()); + const long nCRight = aRectFnSet.GetRight(pCell->getSwFrame()); 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(aRectFnSet.GetLeft(pTab->Frame())) ) + if ( rCols.GetLeftMin() != sal_uInt16(aRectFnSet.GetLeft(pTab->getSwFrame())) ) { - const long nDiff = aRectFnSet.GetLeft(pTab->Frame()) - rCols.GetLeftMin(); + const long nDiff = aRectFnSet.GetLeft(pTab->getSwFrame()) - rCols.GetLeftMin(); nLeftA += nDiff; nRightA += nDiff; } @@ -1436,8 +1436,8 @@ static void lcl_CalcColValues( std::vector<sal_uInt16> &rToFill, const SwTabCols nFit = nWish; } else - { const sal_uInt16 nMin = MINLAY + sal_uInt16(pCell->Frame().Width() - - pCell->Prt().Width()); + { const sal_uInt16 nMin = MINLAY + sal_uInt16(pCell->getSwFrame().Width() - + pCell->getSwPrint().Width()); if ( !nFit || nMin < nFit ) nFit = nMin; } @@ -1450,7 +1450,7 @@ static void lcl_CalcColValues( std::vector<sal_uInt16> &rToFill, const SwTabCols } do { pCell = pCell->GetNextLayoutLeaf(); - } while( pCell && pCell->Frame().Width() == 0 ); + } while( pCell && pCell->getSwFrame().Width() == 0 ); } while ( pCell && pTab->IsAnLower( pCell ) ); } } diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index d92c1d86da44..c955dd321ac9 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -391,7 +391,7 @@ bool SwNode::IsInVisibleArea( SwViewShell const * pSh ) const { pFrame = pFrame->FindPrev(); } while ( pFrame && !pFrame->IsValid() ); - if( !pFrame || pSh->VisArea().IsOver( pFrame->Frame() ) ) + if( !pFrame || pSh->VisArea().IsOver( pFrame->getSwFrame() ) ) bRet = true; } } @@ -785,7 +785,7 @@ const SwTextNode* SwNode::FindOutlineNodeOfLevel( sal_uInt8 nLvl ) const * pMyFrame = pCNd ? pCNd->getLayoutFrame( pCNd->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), &aPt, nullptr, false ) : nullptr; const SwPageFrame* pPgFrame = pFrame ? pFrame->FindPageFrame() : nullptr; if( pPgFrame && pMyFrame && - pPgFrame->Frame().Top() > pMyFrame->Frame().Top() ) + pPgFrame->getSwFrame().Top() > pMyFrame->getSwFrame().Top() ) { // The one asking precedes the Page, thus its invalid pRet = nullptr; @@ -1122,7 +1122,7 @@ SwRect SwContentNode::FindLayoutRect( const bool bPrtArea, const Point* pPoint ) SwContentFrame* pFrame = static_cast<SwContentFrame*>( ::GetFrameOfModify( nullptr, *this, FRM_CNTNT, pPoint ) ); if( pFrame ) - aRet = bPrtArea ? pFrame->Prt() : pFrame->Frame(); + aRet = bPrtArea ? pFrame->getSwPrint() : pFrame->getSwFrame(); return aRet; } @@ -1131,7 +1131,7 @@ SwRect SwContentNode::FindPageFrameRect() const SwRect aRet; SwFrame* pFrame = ::GetFrameOfModify( nullptr, *this, FRM_CNTNT ); if( pFrame && nullptr != ( pFrame = pFrame->FindPageFrame() )) - aRet = pFrame->Frame(); + aRet = pFrame->getSwFrame(); return aRet; } diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index 06319ff4d7f3..2b2c486819b6 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -318,7 +318,7 @@ basegfx::B2DRange SwVirtFlyDrawObj::getOuterBound() const if(pFlyFrame) { - const tools::Rectangle aOuterRectangle(pFlyFrame->Frame().Pos(), pFlyFrame->Frame().SSize()); + const tools::Rectangle aOuterRectangle(pFlyFrame->getSwFrame().Pos(), pFlyFrame->getSwFrame().SSize()); if(!aOuterRectangle.IsEmpty()) { @@ -342,7 +342,7 @@ basegfx::B2DRange SwVirtFlyDrawObj::getInnerBound() const if(pFlyFrame) { - const tools::Rectangle aInnerRectangle(pFlyFrame->Frame().Pos() + pFlyFrame->Prt().Pos(), pFlyFrame->Prt().SSize()); + const tools::Rectangle aInnerRectangle(pFlyFrame->getSwFrame().Pos() + pFlyFrame->getSwPrint().Pos(), pFlyFrame->getSwPrint().SSize()); if(!aInnerRectangle.IsEmpty()) { @@ -525,7 +525,7 @@ void SwVirtFlyDrawObj::wrap_DoPaintObject( RestoreMapMode aRestoreMapModeIfNeeded( pShell ); // paint the FlyFrame (use standard VCL-Paint) - m_pFlyFrame->Paint( *pShell->GetOut(), GetFlyFrame()->Frame() ); + m_pFlyFrame->Paint( *pShell->GetOut(), GetFlyFrame()->getSwFrame() ); } } } @@ -549,8 +549,8 @@ void SwVirtFlyDrawObj::TakeObjInfo( SdrObjTransformInfoRec& rInfo ) const void SwVirtFlyDrawObj::SetRect() const { - if ( GetFlyFrame()->Frame().HasArea() ) - const_cast<SwVirtFlyDrawObj*>(this)->aOutRect = GetFlyFrame()->Frame().SVRect(); + if ( GetFlyFrame()->getSwFrame().HasArea() ) + const_cast<SwVirtFlyDrawObj*>(this)->aOutRect = GetFlyFrame()->getSwFrame().SVRect(); else const_cast<SwVirtFlyDrawObj*>(this)->aOutRect = tools::Rectangle(); } @@ -620,7 +620,7 @@ void SwVirtFlyDrawObj::NbcSetLogicRect(const tools::Rectangle& ) ::basegfx::B2DPolyPolygon SwVirtFlyDrawObj::TakeXorPoly() const { - const tools::Rectangle aSourceRectangle(GetFlyFrame()->Frame().SVRect()); + const tools::Rectangle aSourceRectangle(GetFlyFrame()->getSwFrame().SVRect()); const ::basegfx::B2DRange aSourceRange(aSourceRectangle.Left(), aSourceRectangle.Top(), aSourceRectangle.Right(), aSourceRectangle.Bottom()); ::basegfx::B2DPolyPolygon aRetval; @@ -634,7 +634,7 @@ void SwVirtFlyDrawObj::NbcSetLogicRect(const tools::Rectangle& ) void SwVirtFlyDrawObj::NbcMove(const Size& rSiz) { MoveRect( aOutRect, rSiz ); - const Point aOldPos( GetFlyFrame()->Frame().Pos() ); + const Point aOldPos( GetFlyFrame()->getSwFrame().Pos() ); const Point aNewPos( aOutRect.TopLeft() ); const SwRect aFlyRect( aOutRect ); @@ -689,7 +689,7 @@ void SwVirtFlyDrawObj::NbcMove(const Size& rSiz) if( GetFlyFrame()->GetAnchorFrame()->IsRightToLeft() && text::HoriOrientation::NONE != eHori ) - lXDiff = GetFlyFrame()->GetAnchorFrame()->Frame().Width() - + lXDiff = GetFlyFrame()->GetAnchorFrame()->getSwFrame().Width() - aFlyRect.Width() - lXDiff; const Point aTmp( lXDiff, lYDiff ); @@ -722,9 +722,9 @@ void SwVirtFlyDrawObj::NbcMove(const Size& rSiz) bNextLine = true; //Horizontal Align: const bool bLeftFrame = - aFlyRect.Left() < pAnch->Frame().Left() + pAnch->Prt().Left(), + aFlyRect.Left() < pAnch->getSwFrame().Left() + pAnch->getSwPrint().Left(), bLeftPrt = aFlyRect.Left() + aFlyRect.Width() < - pAnch->Frame().Left() + pAnch->Prt().Width()/2; + pAnch->getSwFrame().Left() + pAnch->getSwPrint().Width()/2; if ( bLeftFrame || bLeftPrt ) { aHori.SetHoriOrient( text::HoriOrientation::LEFT ); @@ -733,7 +733,7 @@ void SwVirtFlyDrawObj::NbcMove(const Size& rSiz) else { const bool bRightFrame = aFlyRect.Left() > - pAnch->Frame().Left() + pAnch->Prt().Width(); + pAnch->getSwFrame().Left() + pAnch->getSwPrint().Width(); aHori.SetHoriOrient( text::HoriOrientation::RIGHT ); aHori.SetRelationOrient( bRightFrame ? text::RelOrientation::FRAME : text::RelOrientation::PRINT_AREA ); } @@ -879,7 +879,7 @@ void SwVirtFlyDrawObj::NbcResize(const Point& rRef, Size aSz( aOutRect.Right() - aOutRect.Left() + 1, aOutRect.Bottom()- aOutRect.Top() + 1 ); - if( aSz != GetFlyFrame()->Frame().SSize() ) + if( aSz != GetFlyFrame()->getSwFrame().SSize() ) { //The width of the columns should not be too narrow if ( GetFlyFrame()->Lower() && GetFlyFrame()->Lower()->IsColumnFrame() ) @@ -921,8 +921,8 @@ void SwVirtFlyDrawObj::NbcResize(const Point& rRef, } else { - nRelWidth = pRel->Prt().Width(); - nRelHeight = pRel->Prt().Height(); + nRelWidth = pRel->getSwPrint().Width(); + nRelHeight = pRel->getSwPrint().Height(); } if ( aFrameSz.GetWidthPercent() && aFrameSz.GetWidthPercent() != SwFormatFrameSize::SYNCED && aOldFrameSz.GetWidth() != aFrameSz.GetWidth() ) @@ -936,8 +936,8 @@ void SwVirtFlyDrawObj::NbcResize(const Point& rRef, //Position can also be changed! const Point aOldPos( ( bVertX && !bVertL2RX ) || bRTL ? - GetFlyFrame()->Frame().TopRight() : - GetFlyFrame()->Frame().Pos() ); + GetFlyFrame()->getSwFrame().TopRight() : + GetFlyFrame()->getSwFrame().Pos() ); if ( aNewPos != aOldPos ) { //May have been altered by the ChgSize! @@ -1034,9 +1034,9 @@ SdrObject* SwVirtFlyDrawObj::getFullDragClone() const void SwVirtFlyDrawObj::addCropHandles(SdrHdlList& rTarget) const { // RotGrfFlyFrame: Adapt to possible rotated Graphic contained in FlyFrame - if(GetFlyFrame()->Frame().HasArea()) + if(GetFlyFrame()->getSwFrame().HasArea()) { - // Use InnerBound, OuterBound (same as GetFlyFrame()->Frame().SVRect()) + // Use InnerBound, OuterBound (same as GetFlyFrame()->getSwFrame().SVRect()) // may have a distance to InnerBound which needs to be taken into account. // The Graphic is mapped to InnerBound, as is the rotated Graphic. const basegfx::B2DRange aTargetRange(getInnerBound()); @@ -1095,11 +1095,11 @@ SdrObject* SwVirtFlyDrawObj::CheckMacroHit( const SdrObjMacroHitRec& rRec ) cons SwRect aRect; if ( m_pFlyFrame->Lower() && m_pFlyFrame->Lower()->IsNoTextFrame() ) { - aRect = m_pFlyFrame->Prt(); - aRect += m_pFlyFrame->Frame().Pos(); + aRect = m_pFlyFrame->getSwPrint(); + aRect += m_pFlyFrame->getSwFrame().Pos(); } else - aRect = m_pFlyFrame->Frame(); + aRect = m_pFlyFrame->getSwFrame(); if( aRect.IsInside( rRec.aPos ) ) { diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx index b379362e4688..eb665d39040c 100644 --- a/sw/source/core/draw/dpage.cxx +++ b/sw/source/core/draw/dpage.cxx @@ -116,10 +116,10 @@ SdrObject* SwDPage::ReplaceObject( SdrObject* pNewObj, size_t nObjNum ) void InsertGridFrame( SdrPageGridFrameList *pLst, const SwFrame *pPg ) { - SwRect aPrt( pPg->Prt() ); - aPrt += pPg->Frame().Pos(); + SwRect aPrt( pPg->getSwPrint() ); + aPrt += pPg->getSwFrame().Pos(); const tools::Rectangle aUser( aPrt.SVRect() ); - const tools::Rectangle aPaper( pPg->Frame().SVRect() ); + const tools::Rectangle aPaper( pPg->getSwFrame().SVRect() ); pLst->Insert( SdrPageGridFrame( aPaper, aUser ) ); } @@ -148,7 +148,7 @@ const SdrPageGridFrameList* SwDPage::GetGridFrameList( const SwRect aRect( *pRect ); const SwFrame *pPg = pSh->GetLayout()->Lower(); do - { if ( pPg->Frame().IsOver( aRect ) ) + { if ( pPg->getSwFrame().IsOver( aRect ) ) ::InsertGridFrame( const_cast<SwDPage*>(this)->pGridLst.get(), pPg ); pPg = pPg->GetNext(); } while ( pPg ); @@ -161,7 +161,7 @@ const SdrPageGridFrameList* SwDPage::GetGridFrameList( do { ::InsertGridFrame( const_cast<SwDPage*>(this)->pGridLst.get(), pPg ); pPg = pPg->GetNext(); - } while ( pPg && pPg->Frame().IsOver( pSh->VisArea() ) ); + } while ( pPg && pPg->getSwFrame().IsOver( pSh->VisArea() ) ); } } return pGridLst.get(); @@ -210,7 +210,7 @@ bool SwDPage::RequestHelp( vcl::Window* pWindow, SdrView const * pView, { // then append the relative pixel position!! Point aPt( aPos ); - aPt -= pFly->Frame().Pos(); + aPt -= pFly->getSwFrame().Pos(); // without MapMode-Offset !!!!! // without MapMode-Offset, without Offset, w ... !!!!! aPt = pWindow->LogicToPixel( diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx index 9245c41556c4..1ef5184aa27e 100644 --- a/sw/source/core/draw/dview.cxx +++ b/sw/source/core/draw/dview.cxx @@ -680,7 +680,7 @@ const SwFrame* SwDrawView::CalcAnchor() if ( bFly ) { pAnch = static_cast<SwVirtFlyDrawObj*>(pObj)->GetFlyFrame()->GetAnchorFrame(); - aMyRect = static_cast<SwVirtFlyDrawObj*>(pObj)->GetFlyFrame()->Frame().SVRect(); + aMyRect = static_cast<SwVirtFlyDrawObj*>(pObj)->GetFlyFrame()->getSwFrame().SVRect(); } else { diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 7ce2f7d0a068..4e9b12be7d14 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -251,10 +251,10 @@ SwTextFrame* SwAutoFormat::GetFrame( const SwTextNode& rTextNd ) const if( m_aFlags.bAFormatByInput && !pFrame->IsValid() ) { DisableCallbackAction a(const_cast<SwRootFrame&>(*pFrame->getRootFrame())); - SwRect aTmpFrame( pFrame->Frame() ); - SwRect aTmpPrt( pFrame->Prt() ); + SwRect aTmpFrame( pFrame->getSwFrame() ); + SwRect aTmpPrt( pFrame->getSwPrint() ); pFrame->Calc(pFrame->getRootFrame()->GetCurrShell()->GetOut()); - if( pFrame->Frame() != aTmpFrame || pFrame->Prt() != aTmpPrt || + if( pFrame->getSwFrame() != aTmpFrame || pFrame->getSwPrint() != aTmpPrt || ( pFrame->IsTextFrame() && !const_cast<SwTextFrame*>(static_cast<const SwTextFrame*>(pFrame))->Paint().IsEmpty() ) ) pFrame->SetCompletePaint(); } @@ -652,7 +652,7 @@ bool SwAutoFormat::DoTable() { eHori = text::HoriOrientation::NONE; // then - as last - we need to add the current frame width into the array - aPosArr.push_back( static_cast<sal_uInt16>(m_pCurTextFrame->Frame().Width()) ); + aPosArr.push_back( static_cast<sal_uInt16>(m_pCurTextFrame->getSwFrame().Width()) ); } else eHori = text::HoriOrientation::LEFT; @@ -1374,7 +1374,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) bool bBreak = true; // first, determine current indentation and frame width - SwTwips nFrameWidth = m_pCurTextFrame->Prt().Width(); + SwTwips nFrameWidth = m_pCurTextFrame->getSwPrint().Width(); SwTwips nLeftTextPos; { sal_Int32 nPos(0); diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx index 25d7368dc2d3..494caa87c150 100644 --- a/sw/source/core/edit/edattr.cxx +++ b/sw/source/core/edit/edattr.cxx @@ -503,8 +503,8 @@ bool SwEditShell::IsMoveLeftMargin( bool bRight, bool bModulus ) const if ( pFrame ) { const sal_uInt16 nFrameWidth = static_cast<sal_uInt16>( pFrame->IsVertical() ? - pFrame->Frame().Height() : - pFrame->Frame().Width() ); + pFrame->getSwFrame().Height() : + pFrame->getSwFrame().Width() ); bRet = nFrameWidth > ( nNext + MM50 ); } else diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index f481eacbad09..1ae8b8b29cc4 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -887,7 +887,7 @@ void SwEditShell::SetLineNumberInfo(const SwLineNumberInfo& rInfo) StartAllAction(); SET_CURR_SHELL( this ); GetDoc()->SetLineNumberInfo(rInfo); - AddPaintRect( GetLayout()->Frame() ); + AddPaintRect( GetLayout()->getSwFrame() ); EndAllAction(); } diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx index 8a777c49b9ba..658bfb18e542 100644 --- a/sw/source/core/fields/expfld.cxx +++ b/sw/source/core/fields/expfld.cxx @@ -206,7 +206,7 @@ const SwTextNode* GetBodyTextNode( const SwDoc& rDoc, SwPosition& rPos, else { pLayout->FindPageFrame()->GetContentPosition( - pLayout->Frame().Pos(), rPos ); + pLayout->getSwFrame().Pos(), rPos ); pTextNode = rPos.nNode.GetNode().GetTextNode(); } } @@ -246,7 +246,7 @@ const SwTextNode* GetBodyTextNode( const SwDoc& rDoc, SwPosition& rPos, } else { - Point aPt( pLayout->Frame().Pos() ); + Point aPt( pLayout->getSwFrame().Pos() ); aPt.Y()++; // get out of the header pContentFrame = pPgFrame->GetContentPos( aPt, false, true ); pTextNode = GetFirstTextNode( rDoc, rPos, pContentFrame, aPt ); diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx index 8da466867d28..333cb740cf9a 100644 --- a/sw/source/core/fields/postithelper.cxx +++ b/sw/source/core/fields/postithelper.cxx @@ -74,8 +74,8 @@ SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos( o_rInfo.mnStartNodeIdx = 0; o_rInfo.mnStartContent = -1; } - o_rInfo.mPageFrame = pPage->Frame(); - o_rInfo.mPagePrtArea = pPage->Prt(); + o_rInfo.mPageFrame = pPage->getSwFrame(); + o_rInfo.mPagePrtArea = pPage->getSwPrint(); o_rInfo.mPagePrtArea.Pos() += o_rInfo.mPageFrame.Pos(); o_rInfo.mnPageNumber = pPage->GetPhyPageNum(); o_rInfo.meSidebarPosition = pPage->SidebarPosition(); @@ -105,7 +105,7 @@ SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos( long SwPostItHelper::getLayoutHeight( const SwRootFrame* pRoot ) { - long nRet = pRoot ? pRoot->Frame().Height() : 0; + long nRet = pRoot ? pRoot->getSwFrame().Height() : 0; return nRet; } @@ -126,7 +126,7 @@ unsigned long SwPostItHelper::getPageInfo( SwRect& rPageFrame, const SwRootFrame if( pPage ) { nRet = pPage->GetPhyPageNum(); - rPageFrame = pPage->Frame(); + rPageFrame = pPage->getSwFrame(); } return nRet; } diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index 7302396fe067..182a7097fca4 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -146,22 +146,22 @@ bool IsFrameBehind( const SwTextNode& rMyNd, sal_Int32 nMySttPos, if( bVert ) { if( bR2L ) - bRefIsLower = pRefFrame->Frame().Top() < pFieldFrame->Frame().Top() || - ( pRefFrame->Frame().Top() == pFieldFrame->Frame().Top() && - pRefFrame->Frame().Left() < pFieldFrame->Frame().Left() ); + bRefIsLower = pRefFrame->getSwFrame().Top() < pFieldFrame->getSwFrame().Top() || + ( pRefFrame->getSwFrame().Top() == pFieldFrame->getSwFrame().Top() && + pRefFrame->getSwFrame().Left() < pFieldFrame->getSwFrame().Left() ); else - bRefIsLower = pRefFrame->Frame().Top() < pFieldFrame->Frame().Top() || - ( pRefFrame->Frame().Top() == pFieldFrame->Frame().Top() && - pRefFrame->Frame().Left() > pFieldFrame->Frame().Left() ); + bRefIsLower = pRefFrame->getSwFrame().Top() < pFieldFrame->getSwFrame().Top() || + ( pRefFrame->getSwFrame().Top() == pFieldFrame->getSwFrame().Top() && + pRefFrame->getSwFrame().Left() > pFieldFrame->getSwFrame().Left() ); } else if( bR2L ) - bRefIsLower = pRefFrame->Frame().Left() > pFieldFrame->Frame().Left() || - ( pRefFrame->Frame().Left() == pFieldFrame->Frame().Left() && - pRefFrame->Frame().Top() < pFieldFrame->Frame().Top() ); + bRefIsLower = pRefFrame->getSwFrame().Left() > pFieldFrame->getSwFrame().Left() || + ( pRefFrame->getSwFrame().Left() == pFieldFrame->getSwFrame().Left() && + pRefFrame->getSwFrame().Top() < pFieldFrame->getSwFrame().Top() ); else - bRefIsLower = pRefFrame->Frame().Left() < pFieldFrame->Frame().Left() || - ( pRefFrame->Frame().Left() == pFieldFrame->Frame().Left() && - pRefFrame->Frame().Top() < pFieldFrame->Frame().Top() ); + bRefIsLower = pRefFrame->getSwFrame().Left() < pFieldFrame->getSwFrame().Left() || + ( pRefFrame->getSwFrame().Left() == pFieldFrame->getSwFrame().Left() && + pRefFrame->getSwFrame().Top() < pFieldFrame->getSwFrame().Top() ); pRefFrame = nullptr; } else if( ( SwFrameType::Column | SwFrameType::Cell ) & pFieldFrame->GetType() ) @@ -175,22 +175,22 @@ bool IsFrameBehind( const SwTextNode& rMyNd, sal_Int32 nMySttPos, if( bVert ) { if( bR2L ) - bRefIsLower = pRefFrame->Frame().Left() < pFieldFrame->Frame().Left() || - ( pRefFrame->Frame().Left() == pFieldFrame->Frame().Left() && - pRefFrame->Frame().Top() < pFieldFrame->Frame().Top() ); + bRefIsLower = pRefFrame->getSwFrame().Left() < pFieldFrame->getSwFrame().Left() || + ( pRefFrame->getSwFrame().Left() == pFieldFrame->getSwFrame().Left() && + pRefFrame->getSwFrame().Top() < pFieldFrame->getSwFrame().Top() ); else - bRefIsLower = pRefFrame->Frame().Left() > pFieldFrame->Frame().Left() || - ( pRefFrame->Frame().Left() == pFieldFrame->Frame().Left() && - pRefFrame->Frame().Top() < pFieldFrame->Frame().Top() ); + bRefIsLower = pRefFrame->getSwFrame().Left() > pFieldFrame->getSwFrame().Left() || + ( pRefFrame->getSwFrame().Left() == pFieldFrame->getSwFrame().Left() && + pRefFrame->getSwFrame().Top() < pFieldFrame->getSwFrame().Top() ); } else if( bR2L ) - bRefIsLower = pRefFrame->Frame().Top() < pFieldFrame->Frame().Top() || - ( pRefFrame->Frame().Top() == pFieldFrame->Frame().Top() && - pRefFrame->Frame().Left() > pFieldFrame->Frame().Left() ); + bRefIsLower = pRefFrame->getSwFrame().Top() < pFieldFrame->getSwFrame().Top() || + ( pRefFrame->getSwFrame().Top() == pFieldFrame->getSwFrame().Top() && + pRefFrame->getSwFrame().Left() > pFieldFrame->getSwFrame().Left() ); else - bRefIsLower = pRefFrame->Frame().Top() < pFieldFrame->Frame().Top() || - ( pRefFrame->Frame().Top() == pFieldFrame->Frame().Top() && - pRefFrame->Frame().Left() < pFieldFrame->Frame().Left() ); + bRefIsLower = pRefFrame->getSwFrame().Top() < pFieldFrame->getSwFrame().Top() || + ( pRefFrame->getSwFrame().Top() == pFieldFrame->getSwFrame().Top() && + pRefFrame->getSwFrame().Left() < pFieldFrame->getSwFrame().Left() ); } return bRefIsLower; } diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index b6840d96460f..e2f3ffccd671 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -239,7 +239,7 @@ bool SwFEShell::Copy( SwDoc* pClpDoc, const OUString* pNewClpText ) static const Point &lcl_FindBasePos( const SwFrame *pFrame, const Point &rPt ) { const SwFrame *pF = pFrame; - while ( pF && !pF->Frame().IsInside( rPt ) ) + while ( pF && !pF->getSwFrame().IsInside( rPt ) ) { if ( pF->IsContentFrame() ) pF = static_cast<const SwContentFrame*>(pF)->GetFollow(); @@ -247,9 +247,9 @@ static const Point &lcl_FindBasePos( const SwFrame *pFrame, const Point &rPt ) pF = nullptr; } if ( pF ) - return pF->Frame().Pos(); + return pF->getSwFrame().Pos(); else - return pFrame->Frame().Pos(); + return pFrame->getSwFrame().Pos(); } static bool lcl_SetAnchor( const SwPosition& rPos, const SwNode& rNd, SwFlyFrame const * pFly, @@ -271,14 +271,14 @@ static bool lcl_SetAnchor( const SwPosition& rPos, const SwNode& rNd, SwFlyFrame const SwNodeIndex& rIdx = *pTmpFly->GetFormat()->GetContent().GetContentIdx(); SwPosition aPos( rIdx ); rAnchor.SetAnchor( &aPos ); - rNewPos = pTmpFly->Frame().Pos(); + rNewPos = pTmpFly->getSwFrame().Pos(); } else { rAnchor.SetType( RndStdIds::FLY_AT_PAGE ); rAnchor.SetPageNum( rDestShell.GetPageNumber( rInsPt ) ); const SwFrame *pPg = pTmpFrame->FindPageFrame(); - rNewPos = pPg->Frame().Pos(); + rNewPos = pPg->getSwFrame().Pos(); } } else @@ -377,7 +377,7 @@ bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt, const SwRootFrame* pTmpRoot = pDestShell->GetLayout(); const SwFrame* pPg = pTmpRoot->GetPageAtPos( rInsPt, nullptr, true ); if ( pPg ) - aNewAnch = pPg->Frame().Pos(); + aNewAnch = pPg->getSwFrame().Pos(); } if( bRet ) @@ -496,7 +496,7 @@ bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt, // from the passed DocumentPosition SwPosition aPos( *GetCursor()->GetPoint() ); Point aPt( rInsPt ); - aPt -= rSttPt - pFly->Frame().Pos(); + aPt -= rSttPt - pFly->getSwFrame().Pos(); SwCursorMoveState aState( MV_SETONLYTEXT ); GetLayout()->GetCursorOfst( &aPos, aPt, &aState ); const SwNode *pNd; @@ -533,7 +533,7 @@ bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt, const SwRootFrame* pTmpRoot = pDestShell->GetLayout(); const SwFrame* pPg = pTmpRoot->GetPageAtPos( rInsPt, nullptr, true ); if ( pPg ) - aNewAnch = pPg->Frame().Pos(); + aNewAnch = pPg->getSwFrame().Pos(); } else { OSL_ENSURE( false, "what anchor is it?" ); @@ -548,7 +548,7 @@ bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt, { Point aPos( rInsPt ); aPos -= aNewAnch; - aPos -= rSttPt - pFly->Frame().Pos(); + aPos -= rSttPt - pFly->getSwFrame().Pos(); pFlyFormat->SetFormatAttr( SwFormatHoriOrient( aPos.getX(),text::HoriOrientation::NONE, text::RelOrientation::FRAME ) ); pFlyFormat->SetFormatAttr( SwFormatVertOrient( aPos.getY(),text::VertOrientation::NONE, text::RelOrientation::FRAME ) ); } @@ -1244,7 +1244,7 @@ bool SwFEShell::GetDrawObjGraphic( SotClipboardFormatId nFormat, Graphic& rGrf ) // Not the original size, but the current one. // Otherwise it could happen that for vector graphics // many MB's of memory are allocated. - const Size aSz( GetSelectedFlyFrame()->Prt().SSize() ); + const Size aSz( GetSelectedFlyFrame()->getSwPrint().SSize() ); ScopedVclPtrInstance< VirtualDevice > pVirtDev(*GetWin()); MapMode aTmp( MapUnit::MapTwip ); diff --git a/sw/source/core/frmedt/fedesc.cxx b/sw/source/core/frmedt/fedesc.cxx index 2e0b5b22ead2..da44435f05ed 100644 --- a/sw/source/core/frmedt/fedesc.cxx +++ b/sw/source/core/frmedt/fedesc.cxx @@ -147,7 +147,7 @@ size_t SwFEShell::GetMousePageDesc( const Point &rPt ) const static_cast<const SwPageFrame*>( GetLayout()->Lower() ); if( pPage ) { - while( pPage->GetNext() && rPt.Y() > pPage->Frame().Bottom() ) + while( pPage->GetNext() && rPt.Y() > pPage->getSwFrame().Bottom() ) pPage = static_cast<const SwPageFrame*>( pPage->GetNext() ); SwDoc *pMyDoc = GetDoc(); size_t nPos; diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 8130b7df7bbb..139a1a2ba0dc 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -142,7 +142,7 @@ static bool lcl_FindAnchorPos( if( !pNewAnch->GetCursorOfst( &aPos, aTmpPnt, &aState ) ) { SwContentNode* pCNd = const_cast<SwContentFrame*>(static_cast<const SwContentFrame*>(pNewAnch))->GetNode(); - if( pNewAnch->Frame().Bottom() < aTmpPnt.Y() ) + if( pNewAnch->getSwFrame().Bottom() < aTmpPnt.Y() ) pCNd->MakeStartIndex( &aPos.nContent ); else pCNd->MakeEndIndex( &aPos.nContent ); @@ -220,7 +220,7 @@ bool sw_ChkAndSetNewAnchor( "forbidden anchor change in Head/Foot." ); #endif - return ::lcl_FindAnchorPos( *pDoc, rFly.Frame().Pos(), rFly, rSet ); + return ::lcl_FindAnchorPos( *pDoc, rFly.getSwFrame().Pos(), rFly, rSet ); } void SwFEShell::SelectFlyFrame( SwFlyFrame& rFrame ) @@ -372,7 +372,7 @@ void SwFEShell::SetFlyPos( const Point& rAbsPos ) else { const SwFrame *pAnch = pFly->GetAnchorFrame(); - Point aOrient( pAnch->Frame().Pos() ); + Point aOrient( pAnch->getSwFrame().Pos() ); if ( pFly->IsFlyInContentFrame() ) aOrient.setX(rAbsPos.getX()); @@ -894,8 +894,8 @@ void SwFEShell::InsertDrawObj( SdrObject& rDrawObj, Point aTmpPt( rInsertPosition ); GetLayout()->GetCursorOfst( aPam.GetPoint(), aTmpPt, &aState ); const SwFrame* pFrame = aPam.GetContentNode()->getLayoutFrame( GetLayout(), nullptr, nullptr, false ); - const Point aRelPos( rInsertPosition.X() - pFrame->Frame().Left(), - rInsertPosition.Y() - pFrame->Frame().Top() ); + const Point aRelPos( rInsertPosition.X() - pFrame->getSwFrame().Left(), + rInsertPosition.Y() - pFrame->getSwFrame().Top() ); rDrawObj.SetRelativePos( aRelPos ); ::lcl_FindAnchorPos( *GetDoc(), rInsertPosition, *pFrame, rFlyAttrSet ); } @@ -1036,7 +1036,7 @@ bool SwFEShell::SetFlyFrameAttr( SfxItemSet& rSet ) if (pFly) { StartAllAction(); - const Point aPt( pFly->Frame().Pos() ); + const Point aPt( pFly->getSwFrame().Pos() ); if( SfxItemState::SET == rSet.GetItemState( RES_ANCHOR, false )) sw_ChkAndSetNewAnchor( *pFly, rSet ); @@ -1170,7 +1170,7 @@ void SwFEShell::SetFrameFormat( SwFrameFormat *pNewFormat, bool bKeepOrient, Poi SET_CURR_SHELL( this ); SwFlyFrameFormat* pFlyFormat = pFly->GetFormat(); - const Point aPt( pFly->Frame().Pos() ); + const Point aPt( pFly->getSwFrame().Pos() ); SfxItemSet* pSet = nullptr; const SfxPoolItem* pItem; @@ -1224,7 +1224,7 @@ SwRect SwFEShell::GetFlyRect() const return aRect; } else - return pFly->Frame(); + return pFly->getSwFrame(); } SwRect SwFEShell::GetObjRect() const @@ -1258,7 +1258,7 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference < return aResult; } - aResult = pFly->Prt().SSize(); + aResult = pFly->getSwPrint().SSize(); bool bPosProt = pFly->GetFormat()->GetProtect().IsPosProtected(); bool bSizeProt = pFly->GetFormat()->GetProtect().IsSizeProtected(); @@ -1270,7 +1270,7 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference < // Correct display is done by scaling. // Scaling is done by SwNoTextFrame::Format by calling // SwWrtShell::CalcAndSetScale() - if ( rRect.SSize() != pFly->Prt().SSize() && !bSizeProt ) + if ( rRect.SSize() != pFly->getSwPrint().SSize() && !bSizeProt ) { Size aSz( rRect.SSize() ); @@ -1301,17 +1301,17 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference < SwFlyFrame* pChgFly = const_cast<SwFlyFrame*>(static_cast<const SwFlyFrame*>(pAnchor->GetUpper())); // calculate the changed size: // width must change, height can change - Size aNewSz( aSz.Width() + pChgFly->Frame().Width() - - pFly->Prt().Width(), aSz.Height() ); + Size aNewSz( aSz.Width() + pChgFly->getSwFrame().Width() - + pFly->getSwPrint().Width(), aSz.Height() ); SwFrameFormat *pFormat = pChgFly->GetFormat(); SwFormatFrameSize aFrameSz( pFormat->GetFrameSize() ); aFrameSz.SetWidth( aNewSz.Width() ); if( ATT_MIN_SIZE != aFrameSz.GetHeightSizeType() ) { - aNewSz.Height() += pChgFly->Frame().Height() - - pFly->Prt().Height(); - if( std::abs( aNewSz.Height() - pChgFly->Frame().Height()) > 1 ) + aNewSz.Height() += pChgFly->getSwFrame().Height() - + pFly->getSwPrint().Height(); + if( std::abs( aNewSz.Height() - pChgFly->getSwFrame().Height()) > 1 ) aFrameSz.SetHeight( aNewSz.Height() ); } // via Doc for the Undo! @@ -1322,10 +1322,10 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference < } // set the new Size at the fly themself - if ( pFly->Prt().Height() > 0 && pFly->Prt().Width() > 0 ) + if ( pFly->getSwPrint().Height() > 0 && pFly->getSwPrint().Width() > 0 ) { - aSz.Width() += pFly->Frame().Width() - pFly->Prt().Width(); - aSz.Height()+= pFly->Frame().Height()- pFly->Prt().Height(); + aSz.Width() += pFly->getSwFrame().Width() - pFly->getSwPrint().Width(); + aSz.Height()+= pFly->getSwFrame().Height()- pFly->getSwPrint().Height(); } aResult = pFly->ChgSize( aSz ); @@ -1339,13 +1339,13 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference < // if only the size is to be adjusted, a position is transported with // allocated values - Point aPt( pFly->Prt().Pos() ); - aPt += pFly->Frame().Pos(); + Point aPt( pFly->getSwPrint().Pos() ); + aPt += pFly->getSwFrame().Pos(); if ( rRect.Top() != LONG_MIN && rRect.Pos() != aPt && !bPosProt ) { aPt = rRect.Pos(); - aPt.setX(aPt.getX() - pFly->Prt().Left()); - aPt.setY(aPt.getY() - pFly->Prt().Top()); + aPt.setX(aPt.getX() - pFly->getSwPrint().Left()); + aPt.setY(aPt.getY() - pFly->getSwPrint().Top()); // in case of paragraph-bound Flys, starting from the new position, // a new anchor is to be set. The anchor and the new RelPos are @@ -1357,8 +1357,8 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference < const SwFrameFormat *pFormat = pFly->GetFormat(); const SwFormatVertOrient &rVert = pFormat->GetVertOrient(); const SwFormatHoriOrient &rHori = pFormat->GetHoriOrient(); - const long lXDiff = aPt.getX() - pFly->Frame().Left(); - const long lYDiff = aPt.getY() - pFly->Frame().Top(); + const long lXDiff = aPt.getX() - pFly->getSwFrame().Left(); + const long lYDiff = aPt.getY() - pFly->getSwFrame().Top(); const Point aTmp( rHori.GetPos() + lXDiff, rVert.GetPos() + lYDiff ); pFly->ChgRelPos( aTmp ); @@ -1368,7 +1368,7 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference < SwFlyFrameFormat *pFlyFrameFormat = pFly->GetFormat(); OSL_ENSURE( pFlyFrameFormat, "fly frame format missing!" ); if ( pFlyFrameFormat ) - pFlyFrameFormat->SetLastFlyFramePrtRectPos( pFly->Prt().Pos() ); //stores the value of last Prt rect + pFlyFrameFormat->SetLastFlyFramePrtRectPos( pFly->getSwPrint().Pos() ); //stores the value of last Prt rect EndAllAction(); @@ -1495,7 +1495,7 @@ const SwFrameFormat* SwFEShell::IsURLGrfAtPos( const Point& rPt, OUString* pURL, { // append the relative pixel position !! Point aPt( rPt ); - aPt -= pFly->Frame().Pos(); + aPt -= pFly->getSwFrame().Pos(); // without MapMode-Offset, without Offset, o ... !!!!! aPt = GetOut()->LogicToPixel( aPt, MapMode( MapUnit::MapTwip ) ); diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 50220a561a79..7918f5388c63 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -211,7 +211,7 @@ bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pObj ) // Similar if a fly with protected content is deselected. // For simplicity we put the cursor next to the upper-left // corner. - Point aPt( pOldSelFly->Frame().Pos() ); + Point aPt( pOldSelFly->getSwFrame().Pos() ); aPt.setX(aPt.getX() - 1); bool bUnLockView = !IsViewLocked(); LockView( true ); @@ -222,7 +222,7 @@ bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pObj ) if ( nType & CNT_GRF && static_cast<SwNoTextFrame*>(pOldSelFly->Lower())->HasAnimation() ) { - GetWin()->Invalidate( pOldSelFly->Frame().SVRect() ); + GetWin()->Invalidate( pOldSelFly->getSwFrame().SVRect() ); } // Cancel crop mode @@ -469,8 +469,8 @@ bool SwFEShell::MoveAnchor( SwMove nDir ) if( pPage->GetSortedObjs() ) { bool bOld = false; - Point aCenter( pOld->Frame().Left() + pOld->Frame().Width()/2, - pOld->Frame().Top() + pOld->Frame().Height()/2 ); + Point aCenter( pOld->getSwFrame().Left() + pOld->getSwFrame().Width()/2, + pOld->getSwFrame().Top() + pOld->getSwFrame().Height()/2 ); Point aBest; for(SwAnchoredObject* pAnchObj : *pPage->GetSortedObjs()) { @@ -491,10 +491,10 @@ bool SwFEShell::MoveAnchor( SwMove nDir ) } if( pCheck || pTmp->IsProtected() ) continue; - Point aNew( pTmp->Frame().Left() + - pTmp->Frame().Width()/2, - pTmp->Frame().Top() + - pTmp->Frame().Height()/2 ); + Point aNew( pTmp->getSwFrame().Left() + + pTmp->getSwFrame().Width()/2, + pTmp->getSwFrame().Top() + + pTmp->getSwFrame().Height()/2 ); bool bAccept = false; switch( nDir ) { case SwMove::RIGHT: @@ -800,8 +800,8 @@ const SwFrameFormat* SwFEShell::SelFlyGrabCursor() pCursor->GetPoint()->nContent.Assign( pCNode, 0 ); SwRect& rChrRect = const_cast<SwRect&>(GetCharRect()); - rChrRect = pFly->Prt(); - rChrRect.Pos() += pFly->Frame().Pos(); + rChrRect = pFly->getSwPrint(); + rChrRect.Pos() += pFly->getSwFrame().Pos(); GetCursorDocPos() = rChrRect.Pos(); } return pFly->GetFormat(); @@ -836,11 +836,12 @@ static void lcl_NotifyNeighbours( const SdrMarkList *pLst ) { bCheckNeighbours = true; pFly->InvalidatePos(); - pFly->Frame().Pos().Y() += 1; + SwFrameRect::FrameWriteAccess aFrm(*pFly); + aFrm.Pos().Y() += 1; } pPage = pFly->FindPageFrame(); - aRect = pFly->Frame(); + aRect = pFly->getSwFrame(); } else { @@ -860,15 +861,15 @@ static void lcl_NotifyNeighbours( const SdrMarkList *pLst ) continue; SwFlyFrame* pAct = static_cast<SwFlyFrame*>(pAnchoredObj); - SwRect aTmpCalcPnt( pAct->Prt() ); - aTmpCalcPnt += pAct->Frame().Pos(); + SwRect aTmpCalcPnt( pAct->getSwPrint() ); + aTmpCalcPnt += pAct->getSwFrame().Pos(); if ( aRect.IsOver( aTmpCalcPnt ) ) { SwContentFrame *pCnt = pAct->ContainsContent(); while ( pCnt ) { - aTmpCalcPnt = pCnt->Prt(); - aTmpCalcPnt += pCnt->Frame().Pos(); + aTmpCalcPnt = pCnt->getSwPrint(); + aTmpCalcPnt += pCnt->getSwFrame().Pos(); if ( aRect.IsOver( aTmpCalcPnt ) ) static_cast<SwFrame*>(pCnt)->Prepare( PREP_FLY_ATTR_CHG ); pCnt = pCnt->GetNextContentFrame(); @@ -878,11 +879,12 @@ static void lcl_NotifyNeighbours( const SdrMarkList *pLst ) { const SwFormatHoriOrient &rH = pAct->GetFormat()->GetHoriOrient(); if ( rH.GetHoriOrient() == aHori && - pAct->Frame().Top() <= aRect.Bottom() && - pAct->Frame().Bottom() >= aRect.Top() ) + pAct->getSwFrame().Top() <= aRect.Bottom() && + pAct->getSwFrame().Bottom() >= aRect.Top() ) { pAct->InvalidatePos(); - pAct->Frame().Pos().Y() += 1; + SwFrameRect::FrameWriteAccess aFrm(*pAct); + aFrm.Pos().Y() += 1; } } } @@ -1492,7 +1494,7 @@ const SdrObject* SwFEShell::GetBestObject( bool bNext, GotoObjFlags eType, bool { const SdrObject* pStartObj = rMrkList.GetMark(0)->GetMarkedSdrObj(); if( dynamic_cast<const SwVirtFlyDrawObj*>( pStartObj) != nullptr ) - aPos = static_cast<const SwVirtFlyDrawObj*>(pStartObj)->GetFlyFrame()->Frame().Pos(); + aPos = static_cast<const SwVirtFlyDrawObj*>(pStartObj)->GetFlyFrame()->getSwFrame().Pos(); else aPos = pStartObj->GetSnapRect().TopLeft(); @@ -1563,7 +1565,7 @@ const SdrObject* SwFEShell::GetBestObject( bool bNext, GotoObjFlags eType, bool default: break; } } - aCurPos = pFly->Frame().Pos(); + aCurPos = pFly->getSwFrame().Pos(); } else aCurPos = pObj->GetCurrentBoundRect().TopLeft(); @@ -1585,7 +1587,7 @@ const SdrObject* SwFEShell::GetBestObject( bool bNext, GotoObjFlags eType, bool if( bFlyFrame ) { SwVirtFlyDrawObj *pO = static_cast<SwVirtFlyDrawObj*>(pTmpObj); - aCurPos = pO->GetFlyFrame()->Frame().Pos(); + aCurPos = pO->GetFlyFrame()->getSwFrame().Pos(); } else aCurPos = pTmpObj->GetCurrentBoundRect().TopLeft(); @@ -1647,7 +1649,7 @@ bool SwFEShell::GotoObj( bool bNext, GotoObjFlags eType ) if( bFlyFrame ) { const SwVirtFlyDrawObj *pO = static_cast<const SwVirtFlyDrawObj*>(pBest); - const SwRect& rFrame = pO->GetFlyFrame()->Frame(); + const SwRect& rFrame = pO->GetFlyFrame()->getSwFrame(); SelectObj( rFrame.Pos(), 0, const_cast<SdrObject*>(pBest) ); if( !ActionPend() ) MakeVisible( rFrame ); @@ -1863,7 +1865,7 @@ bool SwFEShell::ImpEndCreate() SwRect aBound( rBound ); while( pTmp ) { - if( pTmp->Frame().IsInside( aBound ) ) + if( pTmp->getSwFrame().IsInside( aBound ) ) { if( !bBodyOnly || !pTmp->FindFooterOrHeader() ) pPage = pTmpFrame; @@ -1912,17 +1914,17 @@ bool SwFEShell::ImpEndCreate() // OD 2004-03-30 #i26791# - determine relative object position SwTwips nXOffset; - SwTwips nYOffset = rBound.Top() - pAnch->Frame().Top(); + SwTwips nYOffset = rBound.Top() - pAnch->getSwFrame().Top(); { if( pAnch->IsVertical() ) { nXOffset = nYOffset; - nYOffset = pAnch->Frame().Left()+pAnch->Frame().Width()-rBound.Right(); + nYOffset = pAnch->getSwFrame().Left()+pAnch->getSwFrame().Width()-rBound.Right(); } else if( pAnch->IsRightToLeft() ) - nXOffset = pAnch->Frame().Left()+pAnch->Frame().Width()-rBound.Right(); + nXOffset = pAnch->getSwFrame().Left()+pAnch->getSwFrame().Width()-rBound.Right(); else - nXOffset = rBound.Left() - pAnch->Frame().Left(); + nXOffset = rBound.Left() - pAnch->getSwFrame().Left(); if( pAnch->IsTextFrame() && static_cast<const SwTextFrame*>(pAnch)->IsFollow() ) { const SwTextFrame* pTmp = static_cast<const SwTextFrame*>(pAnch); @@ -1932,7 +1934,7 @@ bool SwFEShell::ImpEndCreate() // OD 2004-03-30 #i26791# - correction: add frame area height // of master frames. nYOffset += pTmp->IsVertical() ? - pTmp->Frame().Width() : pTmp->Frame().Height(); + pTmp->getSwFrame().Width() : pTmp->getSwFrame().Height(); } while ( pTmp->IsFollow() ); } } @@ -1978,9 +1980,9 @@ bool SwFEShell::ImpEndCreate() SfxItemSet aHtmlSet( GetDoc()->GetAttrPool(), svl::Items<RES_VERT_ORIENT, RES_HORI_ORIENT>{} ); // horizontal orientation: const bool bLeftFrame = aFlyRect.Left() < - pAnch->Frame().Left() + pAnch->Prt().Left(), + pAnch->getSwFrame().Left() + pAnch->getSwPrint().Left(), bLeftPrt = aFlyRect.Left() + aFlyRect.Width() < - pAnch->Frame().Left() + pAnch->Prt().Width()/2; + pAnch->getSwFrame().Left() + pAnch->getSwPrint().Width()/2; if( bLeftFrame || bLeftPrt ) { aHori.SetHoriOrient( text::HoriOrientation::LEFT ); @@ -1989,7 +1991,7 @@ bool SwFEShell::ImpEndCreate() else { const bool bRightFrame = aFlyRect.Left() > - pAnch->Frame().Left() + pAnch->Prt().Width(); + pAnch->getSwFrame().Left() + pAnch->getSwPrint().Width(); aHori.SetHoriOrient( text::HoriOrientation::RIGHT ); aHori.SetRelationOrient( bRightFrame ? text::RelOrientation::FRAME : text::RelOrientation::PRINT_AREA ); } @@ -2022,7 +2024,7 @@ bool SwFEShell::ImpEndCreate() pTmp = pTmp->FindMaster(); assert(pTmp && "Where's my Master?"); nYOffset += pTmp->IsVertical() ? - pTmp->Prt().Width() : pTmp->Prt().Height(); + pTmp->getSwPrint().Width() : pTmp->getSwPrint().Height(); } while ( pTmp->IsFollow() ); } SwFormatVertOrient aVert( nYOffset, text::VertOrientation::NONE, text::RelOrientation::FRAME ); @@ -2286,7 +2288,7 @@ Point SwFEShell::GetAnchorObjDiff() const if ( IsFrameSelected() ) { SwFlyFrame *pFly = GetSelectedFlyFrame(); - aRet -= pFly->GetAnchorFrame()->Frame().Pos(); + aRet -= pFly->GetAnchorFrame()->getSwFrame().Pos(); } else { @@ -2494,8 +2496,8 @@ bool SwFEShell::GotoFly( const OUString& rName, FlyCntType eType, bool bSelFrame { // first make visible, to get a11y events in proper order if (!ActionPend()) - MakeVisible( pFrame->Frame() ); - SelectObj( pFrame->Frame().Pos(), 0, pFrame->GetVirtDrawObj() ); + MakeVisible( pFrame->getSwFrame() ); + SelectObj( pFrame->getSwFrame().Pos(), 0, pFrame->GetVirtDrawObj() ); } else { @@ -2510,8 +2512,8 @@ bool SwFEShell::GotoFly( const OUString& rName, FlyCntType eType, bool bSelFrame pCursor->GetPoint()->nContent.Assign( pCNode, 0 ); SwRect& rChrRect = const_cast<SwRect&>(GetCharRect()); - rChrRect = pFrame->Prt(); - rChrRect.Pos() += pFrame->Frame().Pos(); + rChrRect = pFrame->getSwPrint(); + rChrRect.Pos() += pFrame->getSwFrame().Pos(); GetCursorDocPos() = rChrRect.Pos(); } } @@ -2698,9 +2700,9 @@ void SwFEShell::CheckUnboundObjects() const Point aPt( rBound.TopLeft() ); const SwFrame *pPage = GetLayout()->Lower(); const SwFrame *pLast = pPage; - while ( pPage && !pPage->Frame().IsInside( aPt ) ) + while ( pPage && !pPage->getSwFrame().IsInside( aPt ) ) { - if ( aPt.Y() > pPage->Frame().Bottom() ) + if ( aPt.Y() > pPage->getSwFrame().Bottom() ) pLast = pPage; pPage = pPage->GetNext(); } @@ -2780,7 +2782,7 @@ SwChainRet SwFEShell::Chainable( SwRect &rRect, const SwFrameFormat &rSource, if (pDrawObj) { SwFlyFrame *pFly = pDrawObj->GetFlyFrame(); - rRect = pFly->Frame(); + rRect = pFly->getSwFrame(); // Target and source should not be equal and the list // should not be cyclic @@ -2846,8 +2848,8 @@ void SwFEShell::SetChainMarker() bDelFrom = false; const SwFrame *pPre = pFly->GetPrevLink(); - Point aStart( pPre->Frame().Right(), pPre->Frame().Bottom()); - Point aEnd(pFly->Frame().Pos()); + Point aStart( pPre->getSwFrame().Right(), pPre->getSwFrame().Bottom()); + Point aEnd(pFly->getSwFrame().Pos()); if (!m_pChainFrom) { @@ -2860,8 +2862,8 @@ void SwFEShell::SetChainMarker() bDelTo = false; const SwFlyFrame *pNxt = pFly->GetNextLink(); - Point aStart( pFly->Frame().Right(), pFly->Frame().Bottom()); - Point aEnd(pNxt->Frame().Pos()); + Point aStart( pFly->getSwFrame().Right(), pFly->getSwFrame().Bottom()); + Point aEnd(pNxt->getSwFrame().Pos()); if (!m_pChainTo) { @@ -2893,7 +2895,7 @@ long SwFEShell::GetSectionWidth( SwFormat const & rFormat ) const { // Is it the right one? if( pSect->KnowsFormat( rFormat ) ) - return pSect->Frame().Width(); + return pSect->getSwFrame().Width(); // for nested areas pSect = pSect->GetUpper()->FindSctFrame(); } @@ -2904,7 +2906,7 @@ long SwFEShell::GetSectionWidth( SwFormat const & rFormat ) const { if( !pSct->IsFollow() ) { - return pSct->Frame().Width(); + return pSct->getSwFrame().Width(); } } return 0; @@ -3208,13 +3210,13 @@ Point SwFEShell::GetRelativePagePosition(const Point& rDocPos) { Point aRet(-1, -1); const SwFrame *pPage = GetLayout()->Lower(); - while ( pPage && !pPage->Frame().IsInside( rDocPos ) ) + while ( pPage && !pPage->getSwFrame().IsInside( rDocPos ) ) { pPage = pPage->GetNext(); } if(pPage) { - aRet = rDocPos - pPage->Frame().TopLeft(); + aRet = rDocPos - pPage->getSwFrame().TopLeft(); } return aRet; } diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index 6d2ef198ac40..14dbdff2706b 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -532,18 +532,18 @@ void SwFEShell::GetTabCols_( SwTabCols &rToFill, const SwFrame *pBox ) SwRectFnSet aRectFnSet(pTab); const SwPageFrame* pPage = pTab->FindPageFrame(); - const sal_uLong nLeftMin = aRectFnSet.GetLeft(pTab->Frame()) - - aRectFnSet.GetLeft(pPage->Frame()); - const sal_uLong nRightMax = aRectFnSet.GetRight(pTab->Frame()) - - aRectFnSet.GetLeft(pPage->Frame()); + const sal_uLong nLeftMin = aRectFnSet.GetLeft(pTab->getSwFrame()) - + aRectFnSet.GetLeft(pPage->getSwFrame()); + const sal_uLong nRightMax = aRectFnSet.GetRight(pTab->getSwFrame()) - + aRectFnSet.GetLeft(pPage->getSwFrame()); 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 (fnRectX.GetWidth(g_pColumnCacheLastTabFrame->Frame()) == - aRectFnSet.GetWidth(pTab->Frame()) ) + if (fnRectX.GetWidth(g_pColumnCacheLastTabFrame->getSwFrame()) == + aRectFnSet.GetWidth(pTab->getSwFrame()) ) { pLastCols->SetLeftMin( nLeftMin ); @@ -555,8 +555,8 @@ void SwFEShell::GetTabCols_( SwTabCols &rToFill, const SwFrame *pBox ) if ( !bDel && pLastCols->GetLeftMin () == (sal_uInt16)nLeftMin && - pLastCols->GetLeft () == (sal_uInt16)aRectFnSet.GetLeft(pTab->Prt()) && - pLastCols->GetRight () == (sal_uInt16)aRectFnSet.GetRight(pTab->Prt())&& + pLastCols->GetLeft () == (sal_uInt16)aRectFnSet.GetLeft(pTab->getSwPrint()) && + pLastCols->GetRight () == (sal_uInt16)aRectFnSet.GetRight(pTab->getSwPrint())&& pLastCols->GetRightMax() == (sal_uInt16)nRightMax - pLastCols->GetLeftMin() ) { if (g_pColumnCacheLastCellFrame != pBox) @@ -596,10 +596,10 @@ void SwFEShell::GetTabRows_( SwTabCols &rToFill, const SwFrame *pBox ) SwRectFnSet aRectFnSet(pTab); const SwPageFrame* pPage = pTab->FindPageFrame(); const long nLeftMin = ( aRectFnSet.IsVert() ? - pTab->GetPrtLeft() - pPage->Frame().Left() : - pTab->GetPrtTop() - pPage->Frame().Top() ); + pTab->GetPrtLeft() - pPage->getSwFrame().Left() : + pTab->GetPrtTop() - pPage->getSwFrame().Top() ); const long nLeft = aRectFnSet.IsVert() ? LONG_MAX : 0; - const long nRight = aRectFnSet.GetHeight(pTab->Prt()); + const long nRight = aRectFnSet.GetHeight(pTab->getSwPrint()); const long nRightMax = aRectFnSet.IsVert() ? nRight : LONG_MAX; if (g_pRowCacheLastTabFrame != pTab || g_pRowCacheLastCellFrame != pBox) @@ -1361,7 +1361,7 @@ size_t SwFEShell::GetCurTabColNum() const if( pFrame->FindTabFrame()->IsRightToLeft() ) { - long nX = aRectFnSet.GetRight(pFrame->Frame()) - aRectFnSet.GetLeft(pPage->Frame()); + long nX = aRectFnSet.GetRight(pFrame->getSwFrame()) - aRectFnSet.GetLeft(pPage->getSwFrame()); const long nRight = aTabCols.GetLeftMin() + aTabCols.GetRight(); @@ -1378,8 +1378,8 @@ size_t SwFEShell::GetCurTabColNum() const } else { - const long nX = aRectFnSet.GetLeft(pFrame->Frame()) - - aRectFnSet.GetLeft(pPage->Frame()); + const long nX = aRectFnSet.GetLeft(pFrame->getSwFrame()) - + aRectFnSet.GetLeft(pPage->getSwFrame()); const long nLeft = aTabCols.GetLeftMin(); @@ -1402,7 +1402,7 @@ static const SwFrame *lcl_FindFrameInTab( const SwLayoutFrame *pLay, const Point while( pFrame && pLay->IsAnLower( pFrame ) ) { - if ( pFrame->Frame().IsNear( rPt, nFuzzy ) ) + if ( pFrame->getSwFrame().IsNear( rPt, nFuzzy ) ) { if ( pFrame->IsLayoutFrame() ) { @@ -1463,8 +1463,8 @@ static const SwCellFrame *lcl_FindFrame( const SwLayoutFrame *pLay, const Point SwRectFnSet aRectFnSet(pFrame); const bool bRTL = pFrame->IsRightToLeft(); - SwRect aTabRect = pFrame->Prt(); - aTabRect.Pos() += pFrame->Frame().Pos(); + SwRect aTabRect = pFrame->getSwPrint(); + aTabRect.Pos() += pFrame->getSwFrame().Pos(); const SwTwips nLeft = bRTL ? aRectFnSet.GetRight(aTabRect) : @@ -1485,8 +1485,8 @@ static const SwCellFrame *lcl_FindFrame( const SwLayoutFrame *pLay, const Point const SwFrame* pPrev = pFrame->GetPrev(); if ( pPrev ) { - SwRect aPrevRect = pPrev->Prt(); - aPrevRect.Pos() += pPrev->Frame().Pos(); + SwRect aPrevRect = pPrev->getSwPrint(); + aPrevRect.Pos() += pPrev->getSwFrame().Pos(); if( aPrevRect.IsInside( rPt ) ) { @@ -1571,8 +1571,8 @@ static const SwCellFrame *lcl_FindFrame( const SwLayoutFrame *pLay, const Point { // used for mouse move of columns/rows const SwTabFrame* pTabFrame = pFrame->FindTabFrame(); - SwRect aTabRect = pTabFrame->Prt(); - aTabRect.Pos() += pTabFrame->Frame().Pos(); + SwRect aTabRect = pTabFrame->getSwPrint(); + aTabRect.Pos() += pTabFrame->getSwFrame().Pos(); SwRectFnSet aRectFnSet(pTabFrame); @@ -1582,15 +1582,15 @@ static const SwCellFrame *lcl_FindFrame( const SwLayoutFrame *pLay, const Point // Do not allow to drag upper table border: if ( !::IsSame( nTabTop, nMouseTop ) ) { - if ( ::IsSame( pFrame->Frame().Left(), rPt.X() ) || - ::IsSame( pFrame->Frame().Right(),rPt.X() ) ) + if ( ::IsSame( pFrame->getSwFrame().Left(), rPt.X() ) || + ::IsSame( pFrame->getSwFrame().Right(),rPt.X() ) ) { if ( pbRow ) *pbRow = false; pRet = pFrame; break; } - if ( ::IsSame( pFrame->Frame().Top(), rPt.Y() ) || - ::IsSame( pFrame->Frame().Bottom(),rPt.Y() ) ) + if ( ::IsSame( pFrame->getSwFrame().Top(), rPt.Y() ) || + ::IsSame( pFrame->getSwFrame().Bottom(),rPt.Y() ) ) { if ( pbRow ) *pbRow = true; pRet = pFrame; @@ -1628,7 +1628,7 @@ const SwFrame* SwFEShell::GetBox( const Point &rPt, bool* pbRow, bool* pbCol ) c nFuzzy = aTmp.Width(); } - while ( pPage && !pPage->Frame().IsNear( rPt, nFuzzy ) ) + while ( pPage && !pPage->getSwFrame().IsNear( rPt, nFuzzy ) ) pPage = static_cast<const SwPageFrame*>(pPage->GetNext()); const SwCellFrame *pFrame = nullptr; @@ -1732,8 +1732,8 @@ static Point lcl_ProjectOntoClosestTableFrame( const SwTabFrame& rTab, const Poi while ( pCurrentTab ) { - SwRect aTabRect( pCurrentTab->Prt() ); - aTabRect += pCurrentTab->Frame().Pos(); + SwRect aTabRect( pCurrentTab->getSwPrint() ); + aTabRect += pCurrentTab->getSwFrame().Pos(); if ( bLeft ) { @@ -1826,7 +1826,7 @@ bool SwFEShell::SelTableRowCol( const Point& rPt, const Point* pEnd, bool bRowDr // paPt[i] will not be used any longer, now we use it to store // a position inside the content frame - paPt[i] = pContent->Frame().Center(); + paPt[i] = pContent->getSwFrame().Center(); } } @@ -2076,7 +2076,7 @@ size_t SwFEShell::GetCurMouseTabColNum( const Point &rPt ) const OSL_ENSURE( pFrame, "Table not found" ); if( pFrame ) { - const long nX = pFrame->Frame().Left(); + const long nX = pFrame->getSwFrame().Left(); // get TabCols, only via these we get the position SwTabCols aTabCols; @@ -2179,21 +2179,21 @@ bool SwFEShell::SetColRowWidthHeight( TableChgWidthHeightType eType, sal_uInt16 // then it should be recalculated to absolute values now const SwFormatFrameSize& rTableFrameSz = pTab->GetFormat()->GetFrameSize(); SwRectFnSet aRectFnSet(pTab); - long nPrtWidth = aRectFnSet.GetWidth(pTab->Prt()); + long nPrtWidth = aRectFnSet.GetWidth(pTab->getSwPrint()); if( TableChgMode::VarWidthChangeAbs == pTab->GetTable()->GetTableChgMode() && ( eType & TableChgWidthHeightType::ColLeft || eType & TableChgWidthHeightType::ColRight ) && text::HoriOrientation::NONE == pTab->GetFormat()->GetHoriOrient().GetHoriOrient() && nPrtWidth != rTableFrameSz.GetWidth() ) { SwFormatFrameSize aSz( rTableFrameSz ); - aSz.SetWidth( pTab->Prt().Width() ); + aSz.SetWidth( pTab->getSwPrint().Width() ); pTab->GetFormat()->SetFormatAttr( aSz ); } if( extractPosition(eType) == TableChgWidthHeightType::ColLeft && (eType & (TableChgWidthHeightType::BiggerMode | TableChgWidthHeightType::InsertDeleteMode)) ) { - nDiff = sal_uInt16(aRectFnSet.GetWidth(pFrame->Frame())); + nDiff = sal_uInt16(aRectFnSet.GetWidth(pFrame->getSwFrame())); // 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 9208fea97229..0dff86a6012b 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -106,7 +106,7 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt, } if( !pFrame ) - return GetLayout()->Frame(); + return GetLayout()->getSwFrame(); bool bFrame = true; switch ( eType ) @@ -158,7 +158,7 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt, case CurRectType::HeaderFooter: if( nullptr == (pFrame = pFrame->FindFooterOrHeader()) ) - return GetLayout()->Frame(); + return GetLayout()->getSwFrame(); break; case CurRectType::PagesArea: @@ -166,13 +166,13 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt, default: break; } - return bFrame ? pFrame->Frame() : pFrame->Prt(); + return bFrame ? pFrame->getSwFrame() : pFrame->getSwPrint(); } sal_uInt16 SwFEShell::GetPageNumber( const Point &rPoint ) const { const SwFrame *pPage = GetLayout()->Lower(); - while ( pPage && !pPage->Frame().IsInside( rPoint ) ) + while ( pPage && !pPage->getSwFrame().IsInside( rPoint ) ) pPage = pPage->GetNext(); if ( pPage ) return static_cast<const SwPageFrame*>(pPage)->GetPhyPageNum(); @@ -193,8 +193,8 @@ bool SwFEShell::GetPageNumber( long nYPos, bool bAtCursorPos, sal_uInt16& rPhyNu else if ( nYPos > -1 ) // determine page via the position { pPage = GetLayout()->Lower(); - while( pPage && (pPage->Frame().Bottom() < nYPos || - nYPos < pPage->Frame().Top() ) ) + while( pPage && (pPage->getSwFrame().Bottom() < nYPos || + nYPos < pPage->getSwFrame().Top() ) ) pPage = pPage->GetNext(); } else // first visible page @@ -642,8 +642,8 @@ sal_uInt16 SwFEShell::GetCurColNum_( const SwFrame *pFrame, if( ( SwFrameType::Page | SwFrameType::Fly | SwFrameType::Section ) & pFrame->GetType() ) { pPara->pFrameFormat = static_cast<const SwLayoutFrame*>(pFrame)->GetFormat(); - pPara->pPrtRect = &pFrame->Prt(); - pPara->pFrameRect = &pFrame->Frame(); + pPara->pPrtRect = &pFrame->getSwPrint(); + pPara->pFrameRect = &pFrame->getSwFrame(); break; } pFrame = pFrame->GetUpper(); @@ -761,13 +761,13 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, } if ( !pFrame ) pFrame = pTmp; - _orRect = pFrame->Frame(); + _orRect = pFrame->getSwFrame(); SwRectFnSet aRectFnSet(pFrame); bRTL = pFrame->IsRightToLeft(); if ( bRTL ) - aPos = pFrame->Frame().TopRight(); + aPos = pFrame->getSwFrame().TopRight(); else - aPos = aRectFnSet.GetPos(pFrame->Frame()); + aPos = aRectFnSet.GetPos(pFrame->getSwFrame()); if( aRectFnSet.IsVert() || aRectFnSet.IsVertL2R() ) { @@ -777,10 +777,10 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, switch ( _eHoriRelOrient ) { case text::RelOrientation::PAGE_RIGHT: - case text::RelOrientation::FRAME_RIGHT: aPos.Y() += pFrame->Prt().Height(); + case text::RelOrientation::FRAME_RIGHT: aPos.Y() += pFrame->getSwPrint().Height(); SAL_FALLTHROUGH; case text::RelOrientation::PRINT_AREA: - case text::RelOrientation::PAGE_PRINT_AREA: aPos.Y() += pFrame->Prt().Top(); break; + case text::RelOrientation::PAGE_PRINT_AREA: aPos.Y() += pFrame->getSwPrint().Top(); break; default: break; } } @@ -789,11 +789,11 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, switch ( _eHoriRelOrient ) { case text::RelOrientation::PRINT_AREA: - case text::RelOrientation::PAGE_PRINT_AREA: aPos.X() += pFrame->Prt().Width(); + case text::RelOrientation::PAGE_PRINT_AREA: aPos.X() += pFrame->getSwPrint().Width(); SAL_FALLTHROUGH; case text::RelOrientation::PAGE_RIGHT: - case text::RelOrientation::FRAME_RIGHT: aPos.X() += pFrame->Prt().Left(); break; - default: aPos.X() += pFrame->Frame().Width(); + case text::RelOrientation::FRAME_RIGHT: aPos.X() += pFrame->getSwPrint().Left(); break; + default: aPos.X() += pFrame->getSwFrame().Width(); } } else if ( bRTL ) @@ -801,11 +801,11 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, switch ( _eHoriRelOrient ) { case text::RelOrientation::PRINT_AREA: - case text::RelOrientation::PAGE_PRINT_AREA: aPos.X() += pFrame->Prt().Width(); + case text::RelOrientation::PAGE_PRINT_AREA: aPos.X() += pFrame->getSwPrint().Width(); SAL_FALLTHROUGH; case text::RelOrientation::PAGE_LEFT: - case text::RelOrientation::FRAME_LEFT: aPos.X() += pFrame->Prt().Left() - - pFrame->Frame().Width(); break; + case text::RelOrientation::FRAME_LEFT: aPos.X() += pFrame->getSwPrint().Left() - + pFrame->getSwFrame().Width(); break; default: break; } } @@ -814,10 +814,10 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, switch ( _eHoriRelOrient ) { case text::RelOrientation::PAGE_RIGHT: - case text::RelOrientation::FRAME_RIGHT: aPos.X() += pFrame->Prt().Width(); + case text::RelOrientation::FRAME_RIGHT: aPos.X() += pFrame->getSwPrint().Width(); SAL_FALLTHROUGH; case text::RelOrientation::PRINT_AREA: - case text::RelOrientation::PAGE_PRINT_AREA: aPos.X() += pFrame->Prt().Left(); break; + case text::RelOrientation::PAGE_PRINT_AREA: aPos.X() += pFrame->getSwPrint().Left(); break; default:break; } } @@ -860,14 +860,14 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, } else { - aPos.Y() += pFrame->Prt().Top(); + aPos.Y() += pFrame->getSwPrint().Top(); } } break; } } if ( _opPercent ) - *_opPercent = pFrame->Prt().SSize(); + *_opPercent = pFrame->getSwPrint().SSize(); } else { @@ -878,22 +878,22 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, { // If the size is relative from page, then full size should be counted from the page frame. if (pFormatFrameSize && pFormatFrameSize->GetWidthPercentRelation() == text::RelOrientation::PAGE_FRAME) - _opPercent->setWidth(pPage->Frame().Width()); + _opPercent->setWidth(pPage->getSwFrame().Width()); else - _opPercent->setWidth(pUpper->Prt().Width()); + _opPercent->setWidth(pUpper->getSwPrint().Width()); if (pFormatFrameSize && pFormatFrameSize->GetHeightPercentRelation() == text::RelOrientation::PAGE_FRAME) // If the size is relative from page, then full size should be counted from the page frame. - _opPercent->setHeight(pPage->Frame().Height()); + _opPercent->setHeight(pPage->getSwFrame().Height()); else - _opPercent->setHeight(pUpper->Prt().Height()); + _opPercent->setHeight(pUpper->getSwPrint().Height()); } bRTL = pFrame->IsRightToLeft(); if ( bRTL ) - aPos = pFrame->Frame().TopRight(); + aPos = pFrame->getSwFrame().TopRight(); else - aPos = aRectFnSet.GetPos(pFrame->Frame()); + aPos = aRectFnSet.GetPos(pFrame->getSwFrame()); // #i17567# - allow negative positions // for fly frames anchor to paragraph/to character. if ((_nAnchorId == RndStdIds::FLY_AT_PARA) || (_nAnchorId == RndStdIds::FLY_AT_CHAR)) @@ -910,12 +910,12 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, aEnvOfObj.GetHoriEnvironmentLayoutFrame( *pFrame ); const SwLayoutFrame& rVertEnvironLayFrame = aEnvOfObj.GetVertEnvironmentLayoutFrame( *pFrame ); - const SwRect& aHoriEnvironRect( rHoriEnvironLayFrame.Frame() ); + const SwRect& aHoriEnvironRect( rHoriEnvironLayFrame.getSwFrame() ); SwRect aVertEnvironRect; if ( _bFollowTextFlow ) { - aVertEnvironRect = rVertEnvironLayFrame.Prt(); - aVertEnvironRect.Pos() += rVertEnvironLayFrame.Frame().Pos(); + aVertEnvironRect = rVertEnvironLayFrame.getSwPrint(); + aVertEnvironRect.Pos() += rVertEnvironLayFrame.getSwFrame().Pos(); // #i18732# - adjust vertical 'virtual' anchor position // (<aPos.Y()> respectively <aPos.X()>), if object is vertical aligned // to page areas. @@ -939,7 +939,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, { OSL_ENSURE( rVertEnvironLayFrame.IsPageFrame(), "<SwFEShell::CalcBoundRect(..)> - not following text flow, but vertical environment *not* page!" ); - aVertEnvironRect = rVertEnvironLayFrame.Frame(); + aVertEnvironRect = rVertEnvironLayFrame.getSwFrame(); // #i18732# - adjustment vertical 'virtual' anchor position // (<aPos.Y()> respectively <aPos.X()>), if object is vertical aligned // to page areas. @@ -971,7 +971,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, const SwFrame* pTmpFrame = rVertEnvironLayFrame.Lower(); if ( pTmpFrame->IsHeaderFrame() ) { - aPos.setY(aPos.getY() + pTmpFrame->Frame().Height()); + aPos.setY(aPos.getY() + pTmpFrame->getSwFrame().Height()); } } } @@ -1078,11 +1078,11 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, if( _opRef && pFly && pFly->IsFlyInContentFrame() ) *_opRef = static_cast<const SwFlyInContentFrame*>( pFly )->GetRefPoint(); - _orRect = pUpper->Frame(); + _orRect = pUpper->getSwFrame(); if( !pUpper->IsBodyFrame() ) { - _orRect += pUpper->Prt().Pos(); - _orRect.SSize( pUpper->Prt().SSize() ); + _orRect += pUpper->getSwPrint().Pos(); + _orRect.SSize( pUpper->getSwPrint().SSize() ); if ( pUpper->IsCellFrame() )//MA_FLY_HEIGHT { const SwFrame* pTab = pUpper->FindTabFrame(); @@ -1112,30 +1112,30 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, { case text::RelOrientation::FRAME_RIGHT: { - aPos.setY(aPos.getY() + pFrame->Prt().Height()); - aPos += aRectFnSet.GetPos(pFrame->Prt()); + aPos.setY(aPos.getY() + pFrame->getSwPrint().Height()); + aPos += aRectFnSet.GetPos(pFrame->getSwPrint()); break; } case text::RelOrientation::PRINT_AREA: { - aPos += aRectFnSet.GetPos(pFrame->Prt()); + aPos += aRectFnSet.GetPos(pFrame->getSwPrint()); aPos.setY(aPos.getY() + nBaseOfstForFly); break; } case text::RelOrientation::PAGE_RIGHT: { - aPos.setY(pPage->Frame().Top() + pPage->Prt().Bottom()); + aPos.setY(pPage->getSwFrame().Top() + pPage->getSwPrint().Bottom()); break; } case text::RelOrientation::PAGE_PRINT_AREA: { - aPos.setY(pPage->Frame().Top() + pPage->Prt().Top()); + aPos.setY(pPage->getSwFrame().Top() + pPage->getSwPrint().Top()); break; } case text::RelOrientation::PAGE_LEFT: case text::RelOrientation::PAGE_FRAME: { - aPos.setY(pPage->Frame().Top()); + aPos.setY(pPage->getSwFrame().Top()); break; } case text::RelOrientation::FRAME: @@ -1150,14 +1150,14 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, { switch ( _eHoriRelOrient ) { - case text::RelOrientation::FRAME_RIGHT: aPos.setX(aPos.getX() + pFrame->Prt().Left()); break; + case text::RelOrientation::FRAME_RIGHT: aPos.setX(aPos.getX() + pFrame->getSwPrint().Left()); break; case text::RelOrientation::FRAME: - case text::RelOrientation::FRAME_LEFT: aPos.setX(aPos.getX() + pFrame->Frame().Width()); break; - case text::RelOrientation::PRINT_AREA: aPos.setX(aPos.getX() + pFrame->Prt().Right()); break; + case text::RelOrientation::FRAME_LEFT: aPos.setX(aPos.getX() + pFrame->getSwFrame().Width()); break; + case text::RelOrientation::PRINT_AREA: aPos.setX(aPos.getX() + pFrame->getSwPrint().Right()); break; case text::RelOrientation::PAGE_LEFT: - case text::RelOrientation::PAGE_FRAME: aPos.setX(pPage->Frame().Right()); break; - case text::RelOrientation::PAGE_PRINT_AREA: aPos.setX(pPage->Frame().Left() - + pPage->Prt().Left()); break; + case text::RelOrientation::PAGE_FRAME: aPos.setX(pPage->getSwFrame().Right()); break; + case text::RelOrientation::PAGE_PRINT_AREA: aPos.setX(pPage->getSwFrame().Left() + + pPage->getSwPrint().Left()); break; default: break; } } @@ -1166,28 +1166,28 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, switch ( _eHoriRelOrient ) { case text::RelOrientation::FRAME_LEFT: - aPos.setX(pFrame->Frame().Left() + - pFrame->Prt().Left()); + aPos.setX(pFrame->getSwFrame().Left() + + pFrame->getSwPrint().Left()); break; case text::RelOrientation::PRINT_AREA: - aPos.setX(pFrame->Frame().Left() + pFrame->Prt().Left() + - pFrame->Prt().Width()); + aPos.setX(pFrame->getSwFrame().Left() + pFrame->getSwPrint().Left() + + pFrame->getSwPrint().Width()); aPos.setX(aPos.getX() + nBaseOfstForFly); break; case text::RelOrientation::PAGE_LEFT: - aPos.setX(pPage->Frame().Left() + pPage->Prt().Left()); + aPos.setX(pPage->getSwFrame().Left() + pPage->getSwPrint().Left()); break; case text::RelOrientation::PAGE_PRINT_AREA: - aPos.setX(pPage->Frame().Left() + pPage->Prt().Left() + - pPage->Prt().Width()); + aPos.setX(pPage->getSwFrame().Left() + pPage->getSwPrint().Left() + + pPage->getSwPrint().Width()); break; case text::RelOrientation::PAGE_RIGHT: case text::RelOrientation::PAGE_FRAME: - aPos.setX(pPage->Frame().Right()); + aPos.setX(pPage->getSwFrame().Right()); break; case text::RelOrientation::FRAME: @@ -1201,22 +1201,22 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, switch ( _eHoriRelOrient ) { case text::RelOrientation::FRAME_RIGHT: - aPos.X() += pFrame->Prt().Width(); - aPos += pFrame->Prt().Pos(); + aPos.X() += pFrame->getSwPrint().Width(); + aPos += pFrame->getSwPrint().Pos(); break; case text::RelOrientation::PRINT_AREA: - aPos += pFrame->Prt().Pos(); + aPos += pFrame->getSwPrint().Pos(); aPos.setX(aPos.getX() + nBaseOfstForFly); break; case text::RelOrientation::PAGE_RIGHT: - aPos.setX(pPage->Frame().Left() + pPage->Prt().Right()); + aPos.setX(pPage->getSwFrame().Left() + pPage->getSwPrint().Right()); break; case text::RelOrientation::PAGE_PRINT_AREA: - aPos.setX(pPage->Frame().Left() + pPage->Prt().Left()); + aPos.setX(pPage->getSwFrame().Left() + pPage->getSwPrint().Left()); break; case text::RelOrientation::PAGE_LEFT: case text::RelOrientation::PAGE_FRAME: - aPos.setX(pPage->Frame().Left()); + aPos.setX(pPage->getSwFrame().Left()); break; case text::RelOrientation::FRAME: aPos.setX(aPos.getX() + nBaseOfstForFly); @@ -1254,11 +1254,11 @@ Size SwFEShell::GetGraphicDefaultSize() const // size is (0,0). If this is the case the printing area of the upper // of the anchor frame is taken. const SwFrame* pAnchorFrame = pFly->GetAnchorFrame(); - aRet = pAnchorFrame->Prt().SSize(); + aRet = pAnchorFrame->getSwPrint().SSize(); if ( aRet.Width() == 0 && aRet.Height() == 0 && pAnchorFrame->GetUpper() ) { - aRet = pAnchorFrame->GetUpper()->Prt().SSize(); + aRet = pAnchorFrame->GetUpper()->getSwPrint().SSize(); } SwRect aBound; diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index 0d8ffeba54c6..c4248c71c0d6 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -293,7 +293,7 @@ void GetTableSel( const SwLayoutFrame* pStart, const SwLayoutFrame* pEnd, break; } - if ( pRow->Frame().IsOver( pUnion->GetUnion() ) ) + if ( pRow->getSwFrame().IsOver( pUnion->GetUnion() ) ) { const SwLayoutFrame *pCell = pRow->FirstCell(); @@ -317,10 +317,10 @@ void GetTableSel( const SwLayoutFrame* pStart, const SwLayoutFrame* pEnd, if ( pCells ) { - const Point aTopLeft( pCell->Frame().TopLeft() ); - const Point aTopRight( pCell->Frame().TopRight() ); - const Point aBottomLeft( pCell->Frame().BottomLeft() ); - const Point aBottomRight( pCell->Frame().BottomRight() ); + const Point aTopLeft( pCell->getSwFrame().TopLeft() ); + const Point aTopRight( pCell->getSwFrame().TopRight() ); + const Point aBottomLeft( pCell->getSwFrame().BottomLeft() ); + const Point aBottomRight( pCell->getSwFrame().BottomRight() ); if ( aTopLeft.getY() < aCurrentTopLeft.getY() || ( aTopLeft.getY() == aCurrentTopLeft.getY() && @@ -497,7 +497,7 @@ bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd ) break; } - if( pRow->Frame().IsOver( pUnion->GetUnion() ) ) + if( pRow->getSwFrame().IsOver( pUnion->GetUnion() ) ) { const SwLayoutFrame *pCell = pRow->FirstCell(); @@ -512,7 +512,7 @@ bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd ) OSL_ENSURE( pCell->IsCellFrame(), "Frame without Cell" ); const SwRect& rUnion = pUnion->GetUnion(), - & rFrameRect = pCell->Frame(); + & rFrameRect = pCell->getSwFrame(); const long nUnionRight = rUnion.Right(); const long nUnionBottom = rUnion.Bottom(); @@ -576,7 +576,7 @@ bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd ) for( n = 0 ; n < aCellFrames.size(); ++n ) { const Sort_CellFrame& rCF = aCellFrames[ n ]; - if( aRectFnSet.GetTop(rCF.pFrame->Frame()) != nYPos ) + if( aRectFnSet.GetTop(rCF.pFrame->getSwFrame()) != nYPos ) { // new row if( n ) @@ -590,20 +590,20 @@ bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd ) } } nCellCnt = 1; - nYPos = aRectFnSet.GetTop(rCF.pFrame->Frame()); - nHeight = aRectFnSet.GetHeight(rCF.pFrame->Frame()); + nYPos = aRectFnSet.GetTop(rCF.pFrame->getSwFrame()); + nHeight = aRectFnSet.GetHeight(rCF.pFrame->getSwFrame()); nXPos = bRTL ? - aRectFnSet.GetLeft(rCF.pFrame->Frame()) : - aRectFnSet.GetRight(rCF.pFrame->Frame()); + aRectFnSet.GetLeft(rCF.pFrame->getSwFrame()) : + aRectFnSet.GetRight(rCF.pFrame->getSwFrame()); } else if( nXPos == ( bRTL ? - aRectFnSet.GetRight(rCF.pFrame->Frame()) : - aRectFnSet.GetLeft(rCF.pFrame->Frame()) ) && - nHeight == aRectFnSet.GetHeight(rCF.pFrame->Frame()) ) + aRectFnSet.GetRight(rCF.pFrame->getSwFrame()) : + aRectFnSet.GetLeft(rCF.pFrame->getSwFrame()) ) && + nHeight == aRectFnSet.GetHeight(rCF.pFrame->getSwFrame()) ) { nXPos += ( bRTL ? (-1) : 1 ) * - aRectFnSet.GetWidth(rCF.pFrame->Frame()); + aRectFnSet.GetWidth(rCF.pFrame->getSwFrame()); ++nCellCnt; } else @@ -649,22 +649,22 @@ bool IsFrameInTableSel( const SwRect& rUnion, const SwFrame* pCell ) OSL_ENSURE( pCell->IsCellFrame(), "Frame without Gazelle" ); if( pCell->FindTabFrame()->IsVertical() ) - return rUnion.Right() >= pCell->Frame().Right() && - rUnion.Left() <= pCell->Frame().Left() && - (( rUnion.Top() <= pCell->Frame().Top()+20 && - rUnion.Bottom() > pCell->Frame().Top() ) || - ( rUnion.Top() >= pCell->Frame().Top() && - rUnion.Bottom() < pCell->Frame().Bottom() )); + return rUnion.Right() >= pCell->getSwFrame().Right() && + rUnion.Left() <= pCell->getSwFrame().Left() && + (( rUnion.Top() <= pCell->getSwFrame().Top()+20 && + rUnion.Bottom() > pCell->getSwFrame().Top() ) || + ( rUnion.Top() >= pCell->getSwFrame().Top() && + rUnion.Bottom() < pCell->getSwFrame().Bottom() )); return - rUnion.Top() <= pCell->Frame().Top() && - rUnion.Bottom() >= pCell->Frame().Bottom() && + rUnion.Top() <= pCell->getSwFrame().Top() && + rUnion.Bottom() >= pCell->getSwFrame().Bottom() && - (( rUnion.Left() <= pCell->Frame().Left()+20 && - rUnion.Right() > pCell->Frame().Left() ) || + (( rUnion.Left() <= pCell->getSwFrame().Left()+20 && + rUnion.Right() > pCell->getSwFrame().Left() ) || - ( rUnion.Left() >= pCell->Frame().Left() && - rUnion.Right() < pCell->Frame().Right() )); + ( rUnion.Left() >= pCell->getSwFrame().Left() && + rUnion.Right() < pCell->getSwFrame().Right() )); } bool GetAutoSumSel( const SwCursorShell& rShell, SwCellFrames& rBoxes ) @@ -703,7 +703,7 @@ bool GetAutoSumSel( const SwCursorShell& rShell, SwCellFrames& rBoxes ) while( pRow ) { - if( pRow->Frame().IsOver( pUnion->GetUnion() ) ) + if( pRow->getSwFrame().IsOver( pUnion->GetUnion() ) ) { const SwCellFrame* pUpperCell = nullptr; const SwLayoutFrame *pCell = pRow->FirstCell(); @@ -772,7 +772,7 @@ bool GetAutoSumSel( const SwCursorShell& rShell, SwCellFrames& rBoxes ) while( pRow ) { - if( pRow->Frame().IsOver( pUnion->GetUnion() ) ) + if( pRow->getSwFrame().IsOver( pUnion->GetUnion() ) ) { const SwLayoutFrame *pCell = pRow->FirstCell(); @@ -946,7 +946,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes, while ( pRow ) { - if ( pRow->Frame().IsOver( rUnion ) ) + if ( pRow->getSwFrame().IsOver( rUnion ) ) { const SwLayoutFrame *pCell = pRow->FirstCell(); @@ -954,25 +954,25 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes, { OSL_ENSURE( pCell->IsCellFrame(), "Frame without cell" ); // overlap in full width? - if( rUnion.Top() <= pCell->Frame().Top() && - rUnion.Bottom() >= pCell->Frame().Bottom() ) + if( rUnion.Top() <= pCell->getSwFrame().Top() && + rUnion.Bottom() >= pCell->getSwFrame().Bottom() ) { SwTableBox* pBox = const_cast<SwTableBox*>(static_cast<const SwCellFrame*>(pCell)->GetTabBox()); // only overlap to the right? - if( ( rUnion.Left() - COLFUZZY ) <= pCell->Frame().Left() && - ( rUnion.Right() - COLFUZZY ) > pCell->Frame().Left() ) + if( ( rUnion.Left() - COLFUZZY ) <= pCell->getSwFrame().Left() && + ( rUnion.Right() - COLFUZZY ) > pCell->getSwFrame().Left() ) { - if( ( rUnion.Right() + COLFUZZY ) < pCell->Frame().Right() ) + if( ( rUnion.Right() + COLFUZZY ) < pCell->getSwFrame().Right() ) { sal_uInt16 nInsPos = pBox->GetUpper()->GetBoxPos( pBox )+1; lcl_InsTableBox( pTableNd, pDoc, pBox, nInsPos ); pBox->ClaimFrameFormat(); SwFormatFrameSize aNew( pBox->GetFrameFormat()->GetFrameSize() ); - nWidth = rUnion.Right() - pCell->Frame().Left(); + nWidth = rUnion.Right() - pCell->getSwFrame().Left(); nWidth = nWidth * aNew.GetWidth() / - pCell->Frame().Width(); + pCell->getSwFrame().Width(); long nTmpWidth = aNew.GetWidth() - nWidth; aNew.SetWidth( nWidth ); pBox->GetFrameFormat()->SetFormatAttr( aNew ); @@ -980,7 +980,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes, pLastBox = pBox; rBoxes.insert( pBox ); aPosArr.insert( - CmpLPt( aRectFnSet.GetPos(pCell->Frame()), + CmpLPt( aRectFnSet.GetPos(pCell->getSwFrame()), pBox, aRectFnSet.IsVert() ) ); pBox = pBox->GetUpper()->GetTabBoxes()[ nInsPos ]; @@ -997,25 +997,25 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes, pLastBox = pBox; rBoxes.insert( pBox ); aPosArr.insert( - CmpLPt( aRectFnSet.GetPos(pCell->Frame()), + CmpLPt( aRectFnSet.GetPos(pCell->getSwFrame()), pBox, aRectFnSet.IsVert() ) ); } } // overlapping on left- or right-side - else if( ( rUnion.Left() - COLFUZZY ) >= pCell->Frame().Left() && - ( rUnion.Right() + COLFUZZY ) < pCell->Frame().Right() ) + else if( ( rUnion.Left() - COLFUZZY ) >= pCell->getSwFrame().Left() && + ( rUnion.Right() + COLFUZZY ) < pCell->getSwFrame().Right() ) { sal_uInt16 nInsPos = pBox->GetUpper()->GetBoxPos( pBox )+1; lcl_InsTableBox( pTableNd, pDoc, pBox, nInsPos, 2 ); pBox->ClaimFrameFormat(); SwFormatFrameSize aNew( pBox->GetFrameFormat()->GetFrameSize() ); - long nLeft = rUnion.Left() - pCell->Frame().Left(); + long nLeft = rUnion.Left() - pCell->getSwFrame().Left(); nLeft = nLeft * aNew.GetWidth() / - pCell->Frame().Width(); - long nRight = pCell->Frame().Right() - rUnion.Right(); + pCell->getSwFrame().Width(); + long nRight = pCell->getSwFrame().Right() - rUnion.Right(); nRight = nRight * aNew.GetWidth() / - pCell->Frame().Width(); + pCell->getSwFrame().Width(); nWidth = aNew.GetWidth() - nLeft - nRight; aNew.SetWidth( nLeft ); @@ -1044,7 +1044,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes, pLastBox = pBox; rBoxes.insert( pBox ); aPosArr.insert( - CmpLPt( aRectFnSet.GetPos(pCell->Frame()), + CmpLPt( aRectFnSet.GetPos(pCell->getSwFrame()), pBox, aRectFnSet.IsVert() ) ); pBox = pBox->GetUpper()->GetTabBoxes()[ nInsPos+1 ]; @@ -1056,22 +1056,22 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes, pUndo->AddNewBox( pBox->GetSttIdx() ); } // is right side of box part of the selected area? - else if( ( pCell->Frame().Right() - COLFUZZY ) < rUnion.Right() && - ( pCell->Frame().Right() - COLFUZZY ) > rUnion.Left() && - ( pCell->Frame().Left() + COLFUZZY ) < rUnion.Left() ) + else if( ( pCell->getSwFrame().Right() - COLFUZZY ) < rUnion.Right() && + ( pCell->getSwFrame().Right() - COLFUZZY ) > rUnion.Left() && + ( pCell->getSwFrame().Left() + COLFUZZY ) < rUnion.Left() ) { // then we should insert a new box and adjust the widths sal_uInt16 nInsPos = pBox->GetUpper()->GetBoxPos( pBox )+1; lcl_InsTableBox( pTableNd, pDoc, pBox, nInsPos ); SwFormatFrameSize aNew(pBox->GetFrameFormat()->GetFrameSize() ); - long nLeft = rUnion.Left() - pCell->Frame().Left(), - nRight = pCell->Frame().Right() - rUnion.Left(); + long nLeft = rUnion.Left() - pCell->getSwFrame().Left(), + nRight = pCell->getSwFrame().Right() - rUnion.Left(); nLeft = nLeft * aNew.GetWidth() / - pCell->Frame().Width(); + pCell->getSwFrame().Width(); nRight = nRight * aNew.GetWidth() / - pCell->Frame().Width(); + pCell->getSwFrame().Width(); aNew.SetWidth( nLeft ); pBox->ClaimFrameFormat()->SetFormatAttr( aNew ); @@ -1085,7 +1085,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes, pLastBox = pBox; rBoxes.insert( pBox ); aPosArr.insert( CmpLPt( Point( rUnion.Left(), - pCell->Frame().Top()), pBox, aRectFnSet.IsVert() )); + pCell->getSwFrame().Top()), pBox, aRectFnSet.IsVert() )); if( pUndo ) pUndo->AddNewBox( pBox->GetSttIdx() ); @@ -1490,7 +1490,7 @@ static SwTwips lcl_CalcWish( const SwLayoutFrame *pCell, long nWish, const bool bRTL = pCell->IsRightToLeft(); SwTwips nRet = bRTL ? - nAct - pCell->Frame().Width() : + nAct - pCell->getSwFrame().Width() : 0; while ( pTmp ) @@ -1608,12 +1608,12 @@ static void lcl_FindStartEndCol( const SwLayoutFrame *&rpStart, if ( pTab->GetTable()->IsNewModel() ) { - nSX = aRectFnSet.GetLeft(rpStart->Frame()); - nSX2 = aRectFnSet.GetRight(rpStart->Frame()); + nSX = aRectFnSet.GetLeft(rpStart->getSwFrame()); + nSX2 = aRectFnSet.GetRight(rpStart->getSwFrame()); } else { - const SwTwips nPrtWidth = aRectFnSet.GetWidth(pTab->Prt()); + const SwTwips nPrtWidth = aRectFnSet.GetWidth(pTab->getSwPrint()); nSX = ::lcl_CalcWish( rpStart, nWish, nPrtWidth ) + aRectFnSet.GetPrtLeft(*pTab); nSX2 = nSX + (rpStart->GetFormat()->GetFrameSize().GetWidth() * nPrtWidth / nWish); } @@ -1622,10 +1622,10 @@ static void lcl_FindStartEndCol( const SwLayoutFrame *&rpStart, while ( pTmp && (!pTmp->IsCellFrame() || - ( ( ! bRTL && aRectFnSet.GetLeft(pTmp->Frame()) < nSX && - aRectFnSet.GetRight(pTmp->Frame())< nSX2 ) || - ( bRTL && aRectFnSet.GetLeft(pTmp->Frame()) > nSX && - aRectFnSet.GetRight(pTmp->Frame())> nSX2 ) ) ) ) + ( ( ! bRTL && aRectFnSet.GetLeft(pTmp->getSwFrame()) < nSX && + aRectFnSet.GetRight(pTmp->getSwFrame())< nSX2 ) || + ( bRTL && aRectFnSet.GetLeft(pTmp->getSwFrame()) > nSX && + aRectFnSet.GetRight(pTmp->getSwFrame())> nSX2 ) ) ) ) pTmp = pTmp->GetNextLayoutLeaf(); if ( pTmp ) @@ -1657,11 +1657,11 @@ static void lcl_FindStartEndCol( const SwLayoutFrame *&rpStart, if ( pTab->GetTable()->IsNewModel() ) { - nEX = aRectFnSet.GetLeft(rpEnd->Frame()); + nEX = aRectFnSet.GetLeft(rpEnd->getSwFrame()); } else { - const SwTwips nPrtWidth = aRectFnSet.GetWidth(pTab->Prt()); + const SwTwips nPrtWidth = aRectFnSet.GetWidth(pTab->getSwPrint()); nEX = ::lcl_CalcWish( rpEnd, nWish, nPrtWidth ) + aRectFnSet.GetPrtLeft(*pTab); } @@ -1674,8 +1674,8 @@ static void lcl_FindStartEndCol( const SwLayoutFrame *&rpStart, while( !rpEnd->IsCellFrame() ) rpEnd = rpEnd->GetUpper(); - while ( ( bRTL && aRectFnSet.GetLeft(rpEnd->Frame()) < nEX ) || - ( ! bRTL && aRectFnSet.GetLeft(rpEnd->Frame()) > nEX ) ) + while ( ( bRTL && aRectFnSet.GetLeft(rpEnd->getSwFrame()) < nEX ) || + ( ! bRTL && aRectFnSet.GetLeft(rpEnd->getSwFrame()) > nEX ) ) { const SwLayoutFrame* pTmpLeaf = rpEnd->GetPrevLayoutLeaf(); if( !pTmpLeaf || !pTab->IsAnLower( pTmpLeaf ) ) @@ -1692,10 +1692,10 @@ static void lcl_FindStartEndCol( const SwLayoutFrame *&rpStart, { const SwLayoutFrame *pTmpLeaf = rpStart; pTmpLeaf = pTmpLeaf->GetNextLayoutLeaf(); - while ( pTmpLeaf && aRectFnSet.GetLeft(pTmpLeaf->Frame()) > nEX ) // first skip line + while ( pTmpLeaf && aRectFnSet.GetLeft(pTmpLeaf->getSwFrame()) > nEX ) // first skip line pTmpLeaf = pTmpLeaf->GetNextLayoutLeaf(); - while ( pTmpLeaf && aRectFnSet.GetLeft(pTmpLeaf->Frame()) < nSX && - aRectFnSet.GetRight(pTmpLeaf->Frame())< nSX2 ) + while ( pTmpLeaf && aRectFnSet.GetLeft(pTmpLeaf->getSwFrame()) < nSX && + aRectFnSet.GetRight(pTmpLeaf->getSwFrame())< nSX2 ) pTmpLeaf = pTmpLeaf->GetNextLayoutLeaf(); const SwTabFrame *pTmpTab = rpStart->FindTabFrame(); if ( !pTmpTab->IsAnLower( pTmpLeaf ) ) @@ -1703,8 +1703,8 @@ static void lcl_FindStartEndCol( const SwLayoutFrame *&rpStart, pTmpTab = pTmpTab->GetFollow(); rpStart = pTmpTab->FirstCell(); while ( rpStart && - aRectFnSet.GetLeft(rpStart->Frame()) < nSX && - aRectFnSet.GetRight(rpStart->Frame())< nSX2 ) + aRectFnSet.GetLeft(rpStart->getSwFrame()) < nSX && + aRectFnSet.GetRight(rpStart->getSwFrame())< nSX2 ) rpStart = rpStart->GetNextLayoutLeaf(); } else @@ -1714,9 +1714,9 @@ static void lcl_FindStartEndCol( const SwLayoutFrame *&rpStart, { const SwLayoutFrame *pTmpLeaf = rpEnd; pTmpLeaf = pTmpLeaf->GetPrevLayoutLeaf(); - while ( pTmpLeaf && aRectFnSet.GetLeft(pTmpLeaf->Frame()) < nEX ) // skip the line for now + while ( pTmpLeaf && aRectFnSet.GetLeft(pTmpLeaf->getSwFrame()) < nEX ) // skip the line for now pTmpLeaf = pTmpLeaf->GetPrevLayoutLeaf(); - while ( pTmpLeaf && aRectFnSet.GetLeft(pTmpLeaf->Frame()) > nEX ) + while ( pTmpLeaf && aRectFnSet.GetLeft(pTmpLeaf->getSwFrame()) > nEX ) pTmpLeaf = pTmpLeaf->GetPrevLayoutLeaf(); const SwTabFrame *pTmpTab = rpEnd->FindTabFrame(); if ( !pTmpLeaf || !pTmpTab->IsAnLower( pTmpLeaf ) ) @@ -1726,7 +1726,7 @@ static void lcl_FindStartEndCol( const SwLayoutFrame *&rpStart, rpEnd = pTmpTab->FindLastContent()->GetUpper(); while( !rpEnd->IsCellFrame() ) rpEnd = rpEnd->GetUpper(); - while ( aRectFnSet.GetLeft(rpEnd->Frame()) > nEX ) + while ( aRectFnSet.GetLeft(rpEnd->getSwFrame()) > nEX ) rpEnd = rpEnd->GetPrevLayoutLeaf(); } else @@ -1765,12 +1765,12 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrame *pStart, else { SwRectFnSet aRectFnSet(pTable); - long nSttTop = aRectFnSet.GetTop(pStart->Frame()); - long nEndTop = aRectFnSet.GetTop(pEnd->Frame()); + long nSttTop = aRectFnSet.GetTop(pStart->getSwFrame()); + long nEndTop = aRectFnSet.GetTop(pEnd->getSwFrame()); if( nSttTop == nEndTop ) { - if( aRectFnSet.GetLeft(pStart->Frame()) > - aRectFnSet.GetLeft(pEnd->Frame()) ) + if( aRectFnSet.GetLeft(pStart->getSwFrame()) > + aRectFnSet.GetLeft(pEnd->getSwFrame()) ) bExchange = true; } else if( aRectFnSet.IsVert() == ( nSttTop < nEndTop ) ) @@ -1805,7 +1805,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrame *pStart, { SwRectFnSet aRectFnSet(pTable); const long nOfst = aRectFnSet.GetPrtLeft(*pTable); - const long nPrtWidth = aRectFnSet.GetWidth(pTable->Prt()); + const long nPrtWidth = aRectFnSet.GetWidth(pTable->getSwPrint()); long nSt1 = ::lcl_CalcWish( pStart, nWish, nPrtWidth ) + nOfst; long nEd1 = ::lcl_CalcWish( pEnd, nWish, nPrtWidth ) + nOfst; @@ -1817,13 +1817,13 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrame *pStart, long nSt2; long nEd2; if( pTable->IsAnLower( pStart ) ) - nSt2 = aRectFnSet.GetTop(pStart->Frame()); + nSt2 = aRectFnSet.GetTop(pStart->getSwFrame()); else - nSt2 = aRectFnSet.GetTop(pTable->Frame()); + nSt2 = aRectFnSet.GetTop(pTable->getSwFrame()); if( pTable->IsAnLower( pEnd ) ) - nEd2 = aRectFnSet.GetBottom(pEnd->Frame()); + nEd2 = aRectFnSet.GetBottom(pEnd->getSwFrame()); else - nEd2 = aRectFnSet.GetBottom(pTable->Frame()); + nEd2 = aRectFnSet.GetBottom(pTable->getSwFrame()); Point aSt, aEd; if( nSt1 > nEd1 ) { @@ -1862,7 +1862,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrame *pStart, pTable->GetFirstNonHeadlineRow() : static_cast<const SwLayoutFrame*>(pTable->Lower()); - while ( pRow && !pRow->Frame().IsOver( aUnion ) ) + while ( pRow && !pRow->getSwFrame().IsOver( aUnion ) ) pRow = static_cast<const SwLayoutFrame*>(pRow->GetNext()); // #i31976# @@ -1908,8 +1908,8 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrame *pStart, if ( pFirst && pLast ) //Robust { - aUnion = pFirst->Frame(); - aUnion.Union( pLast->Frame() ); + aUnion = pFirst->getSwFrame(); + aUnion.Union( pLast->getSwFrame() ); } else aUnion.Width( 0 ); @@ -1978,7 +1978,7 @@ bool CheckSplitCells( const SwCursor& rCursor, sal_uInt16 nDiv, while ( pRow ) { - if ( pRow->Frame().IsOver( rSelUnion.GetUnion() ) ) + if ( pRow->getSwFrame().IsOver( rSelUnion.GetUnion() ) ) { const SwLayoutFrame *pCell = pRow->FirstCell(); @@ -1987,7 +1987,7 @@ bool CheckSplitCells( const SwCursor& rCursor, sal_uInt16 nDiv, OSL_ENSURE( pCell->IsCellFrame(), "Frame without cell" ); if( ::IsFrameInTableSel( rSelUnion.GetUnion(), pCell ) ) { - if( aRectFnSet.GetWidth(pCell->Frame()) < nMinValue ) + if( aRectFnSet.GetWidth(pCell->getSwFrame()) < nMinValue ) return false; } diff --git a/sw/source/core/inc/flyfrms.hxx b/sw/source/core/inc/flyfrms.hxx index 7c8425064957..2fab06c595d8 100644 --- a/sw/source/core/inc/flyfrms.hxx +++ b/sw/source/core/inc/flyfrms.hxx @@ -104,7 +104,7 @@ public: if ( maUnclippedFrame.HasArea( ) ) return maUnclippedFrame; else - return Frame(); + return getSwFrame(); } /** method to determine, if a format on the Writer fly frame is possible diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index bf3ea789dd4d..a46a50bf8326 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -116,6 +116,58 @@ namespace drawinglayer { namespace attribute { typedef std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr; }} +/// Helper class to isolate gerometry-defining members of SwFrame +/// and to control their accesses. Moved to own class to have no +/// hidden accesses to 'private' members anymore +class SW_DLLPUBLIC SwFrameRect +{ +private: + SwRect maFrameRect; // absolute position in document and size of the Frame + SwRect maPrintRect; // position relatively to Frame and size of PrtArea + +public: + SwFrameRect(); + + // read accesses - only const access allowed. Do *not* const_cast results, + // it is necessary to track changes. use The 'set' methods instead + const SwRect& getSwFrame() const { return maFrameRect; } + const SwRect& getSwPrint() const { return maPrintRect; } + + // helper class(es) for FrameRect/PrintRect manipulation. These + // have to be used to apply changes. They hold a copy of the SwRect + // for manipulation, it gets written back at destruction. Thus this + // mechanism depends on scope usage, take care. It prevents errors using + // different instances of SwFrame in get/set methods which is more safe + class FrameWriteAccess : public SwRect + { + private: + SwFrameRect& mrTarget; + + FrameWriteAccess(const FrameWriteAccess&) = delete; + FrameWriteAccess& operator=(const FrameWriteAccess&) = delete; + + public: + FrameWriteAccess(SwFrameRect& rTarget) : SwRect(rTarget.getSwFrame()), mrTarget(rTarget) {} + ~FrameWriteAccess(); + void setSwRect(const SwRect& rNew) { *reinterpret_cast< SwRect* >(this) = rNew; } + }; + + // same for print + class PrintWriteAccess : public SwRect + { + private: + SwFrameRect& mrTarget; + + PrintWriteAccess(const PrintWriteAccess&) = delete; + PrintWriteAccess& operator=(const PrintWriteAccess&) = delete; + + public: + PrintWriteAccess(SwFrameRect& rTarget) : SwRect(rTarget.getSwPrint()), mrTarget(rTarget) {} + ~PrintWriteAccess(); + void setSwRect(const SwRect& rNew) { *reinterpret_cast< SwRect* >(this) = rNew; } + }; +}; + /** * Base class of the Writer layout elements. * @@ -123,7 +175,7 @@ namespace drawinglayer { namespace attribute { * level: pages, headers, footers, etc. (Inside a paragraph SwLinePortion * instances are used.) */ -class SW_DLLPUBLIC SwFrame: public SwClient, public SfxBroadcaster +class SW_DLLPUBLIC SwFrame : public SwFrameRect, public SwClient, public SfxBroadcaster { // the hidden Frame friend class SwFlowFrame; @@ -144,8 +196,6 @@ class SW_DLLPUBLIC SwFrame: public SwClient, public SfxBroadcaster // cache for (border) attributes static SwCache *mpCache; - bool mbInDtor; - // #i65250# // frame ID is now in general available - used for layout loop control static sal_uInt32 mnLastFrameId; @@ -225,12 +275,9 @@ class SW_DLLPUBLIC SwFrame: public SwClient, public SfxBroadcaster protected: SwSortedObjs* mpDrawObjs; // draw objects, can be 0 - - SwRect maFrame; // absolute position in document and size of the Frame - SwRect maPrt; // position relatively to Frame and size of PrtArea - SwFrameType mnFrameType; //Who am I? + bool mbInDtor : 1; bool mbReverse : 1; // Next line above/at the right side instead // under/at the left side of the previous line bool mbInvalidR2L : 1; @@ -548,10 +595,7 @@ public: virtual void Calc(vcl::RenderContext* pRenderContext) const; // here might be "formatted" inline void OptCalc() const; // here we assume (for optimization) that // the predecessors are already formatted - Point GetRelPos() const; - const SwRect &Frame() const { return maFrame; } - const SwRect &Prt() const { return maPrt; } // PaintArea is the area where content might be displayed. // The margin of a page or the space between columns belongs to it. @@ -560,13 +604,6 @@ public: // to the FrameArea except in case of negative Prt margins. const SwRect UnionFrame( bool bBorder = false ) const; - // HACK: Here we exceptionally allow direct access to members. - // This should not delude into changing those value randomly; it is the - // only option to circumvent compiler problems (same method with public - // and protected). - SwRect &Frame() { return maFrame; } - SwRect &Prt() { return maPrt; } - virtual Size ChgSize( const Size& aNewSize ); virtual void Cut() = 0; diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx index a382ba3e5f25..d2e276a598f6 100644 --- a/sw/source/core/inc/frmtool.hxx +++ b/sw/source/core/inc/frmtool.hxx @@ -187,7 +187,7 @@ public: SwFrameNotify( SwFrame *pFrame ); ~SwFrameNotify() COVERITY_NOEXCEPT_FALSE; - const SwRect &Frame() const { return maFrame; } + const SwRect &getSwFrame() const { return maFrame; } void SetInvaKeep() { mbInvaKeep = true; } }; diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx index fded8b5e3335..104716e14133 100644 --- a/sw/source/core/layout/anchoreddrawobject.cxx +++ b/sw/source/core/layout/anchoreddrawobject.cxx @@ -237,7 +237,7 @@ bool SwAnchoredDrawObject::IsOutsidePage() const { SwRect aTmpRect( GetObjRect() ); bOutsidePage = - ( aTmpRect.Intersection( GetPageFrame()->Frame() ) != GetObjRect() ); + ( aTmpRect.Intersection( GetPageFrame()->getSwFrame() ) != GetObjRect() ); } return bOutsidePage; @@ -351,7 +351,7 @@ void SwAnchoredDrawObject::MakeObjPos() if ( mbCaptureAfterLayoutDirChange && GetPageFrame() ) { - SwRect aPageRect( GetPageFrame()->Frame() ); + SwRect aPageRect( GetPageFrame()->getSwFrame() ); SwRect aObjRect( GetObjRect() ); if ( aObjRect.Right() >= aPageRect.Right() + 10 ) { @@ -491,7 +491,7 @@ void SwAnchoredDrawObject::MakeObjPosAnchoredAtLayout() SetCurrRelPos( aObjPositioning.GetRelPos() ); const SwFrame* pAnchorFrame = GetAnchorFrame(); SwRectFnSet aRectFnSet(pAnchorFrame); - const Point aAnchPos( aRectFnSet.GetPos(pAnchorFrame->Frame()) ); + const Point aAnchPos( aRectFnSet.GetPos(pAnchorFrame->getSwFrame()) ); SetObjLeft( aAnchPos.X() + GetCurrRelPos().X() ); SetObjTop( aAnchPos.Y() + GetCurrRelPos().Y() ); } @@ -637,7 +637,7 @@ const SwRect SwAnchoredDrawObject::GetObjBoundRect() const tools::Rectangle aPageRect; if (GetDrawObj()->GetRelativeWidthRelation() == text::RelOrientation::FRAME) // Exclude margins. - aPageRect = GetPageFrame()->Prt().SVRect(); + aPageRect = GetPageFrame()->getSwPrint().SVRect(); else aPageRect = GetPageFrame( )->GetBoundRect( GetPageFrame()->getRootFrame()->GetCurrShell()->GetOut() ).SVRect(); nTargetWidth = aPageRect.GetWidth( ) * (*GetDrawObj( )->GetRelativeWidth()); @@ -649,7 +649,7 @@ const SwRect SwAnchoredDrawObject::GetObjBoundRect() const tools::Rectangle aPageRect; if (GetDrawObj()->GetRelativeHeightRelation() == text::RelOrientation::FRAME) // Exclude margins. - aPageRect = GetPageFrame()->Prt().SVRect(); + aPageRect = GetPageFrame()->getSwPrint().SVRect(); else aPageRect = GetPageFrame( )->GetBoundRect( GetPageFrame()->getRootFrame()->GetCurrShell()->GetOut() ).SVRect(); nTargetHeight = aPageRect.GetHeight( ) * (*GetDrawObj( )->GetRelativeHeight()); diff --git a/sw/source/core/layout/anchoredobject.cxx b/sw/source/core/layout/anchoredobject.cxx index 5d40c5b9600f..159dcd6e22b2 100644 --- a/sw/source/core/layout/anchoredobject.cxx +++ b/sw/source/core/layout/anchoredobject.cxx @@ -163,12 +163,12 @@ void SwAnchoredObject::SetPageFrame( SwPageFrame* _pNewPageFrame ) SwTwips SwAnchoredObject::GetRelCharX( const SwFrame* pFrame ) const { - return maLastCharRect.Left() - pFrame->Frame().Left(); + return maLastCharRect.Left() - pFrame->getSwFrame().Left(); } SwTwips SwAnchoredObject::GetRelCharY( const SwFrame* pFrame ) const { - return maLastCharRect.Bottom() - pFrame->Frame().Top(); + return maLastCharRect.Bottom() - pFrame->getSwFrame().Top(); } void SwAnchoredObject::AddLastCharY( long nDiff ) @@ -783,7 +783,7 @@ bool SwAnchoredObject::OverlapsPrevColumn() const SwRect aChkRect; while ( pTmpColFrame ) { - aChkRect.Union( pTmpColFrame->Frame() ); + aChkRect.Union( pTmpColFrame->getSwFrame() ); pTmpColFrame = pTmpColFrame->GetPrev(); } bOverlapsPrevColumn = GetObjRect().IsOver( aChkRect ); @@ -805,7 +805,7 @@ Point SwAnchoredObject::GetRelPosToAnchorFrame() const assert(GetAnchorFrame()); aRelPos = GetObjRect().Pos(); - aRelPos -= GetAnchorFrame()->Frame().Pos(); + aRelPos -= GetAnchorFrame()->getSwFrame().Pos(); return aRelPos; } @@ -848,12 +848,12 @@ Point SwAnchoredObject::GetRelPosToPageFrame( const bool _bFollowTextFlow, } if ( pFrame->IsCellFrame() ) { - aRelPos -= ( pFrame->Frame().Pos() + pFrame->Prt().Pos() ); + aRelPos -= ( pFrame->getSwFrame().Pos() + pFrame->getSwPrint().Pos() ); _obRelToTableCell = true; } else { - aRelPos -= pFrame->Frame().Pos(); + aRelPos -= pFrame->getSwFrame().Pos(); } return aRelPos; diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 7b994dbfb138..ea6c830da0a0 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -2686,10 +2686,10 @@ SwRect SwFrameFormat::FindLayoutRect( const bool bPrtArea, const Point* pPoint ) // PROBLEM: what happens if SectionFrames overlaps multiple // pages? if( bPrtArea ) - aRet = pFrame->Prt(); + aRet = pFrame->getSwPrint(); else { - aRet = pFrame->Frame(); + aRet = pFrame->getSwFrame(); --aRet.Pos().Y(); } pFrame = nullptr; // the rect is finished by now @@ -2705,9 +2705,9 @@ SwRect SwFrameFormat::FindLayoutRect( const bool bPrtArea, const Point* pPoint ) if( pFrame ) { if( bPrtArea ) - aRet = pFrame->Prt(); + aRet = pFrame->getSwPrint(); else - aRet = pFrame->Frame(); + aRet = pFrame->getSwFrame(); } return aRet; } @@ -3414,13 +3414,13 @@ IMapObject* SwFrameFormat::GetIMapObject( const Point& rPoint, if( aOrigSz.Width() != 0 && aOrigSz.Height() != 0 ) { Point aPos( rPoint ); - Size aActSz ( pRef == pFly ? pFly->Frame().SSize() : pRef->Prt().SSize() ); + Size aActSz ( pRef == pFly ? pFly->getSwFrame().SSize() : pRef->getSwPrint().SSize() ); const MapMode aSrc ( MapUnit::MapTwip ); const MapMode aDest( MapUnit::Map100thMM ); aOrigSz = OutputDevice::LogicToLogic( aOrigSz, aSrc, aDest ); aActSz = OutputDevice::LogicToLogic( aActSz, aSrc, aDest ); - aPos -= pRef->Frame().Pos(); - aPos -= pRef->Prt().Pos(); + aPos -= pRef->getSwFrame().Pos(); + aPos -= pRef->getSwPrint().Pos(); aPos = OutputDevice::LogicToLogic( aPos, aSrc, aDest ); sal_uInt32 nFlags = 0; if ( pFly != pRef && pNd->IsGrfNode() ) diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 90660e93553f..09b6a56793ac 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -94,24 +94,24 @@ bool SwContentFrame::ShouldBwdMoved( SwLayoutFrame *pNewUpper, bool, bool & ) } SwRectFnSet aRectFnSet(this); SwRectFnSet fnRectX(pNewUpper); - if( std::abs( fnRectX.GetWidth(pNewUpper->Prt()) - - aRectFnSet.GetWidth(GetUpper()->Prt()) ) > 1 ) { + if( std::abs( fnRectX.GetWidth(pNewUpper->getSwPrint()) - + aRectFnSet.GetWidth(GetUpper()->getSwPrint()) ) > 1 ) { // In this case, only a WouldFit_ with test move is possible nMoveAnyway = 2; } // OD 2004-05-26 #i25904# - do *not* move backward, // if <nMoveAnyway> equals 3 and no space is left in new upper. - nMoveAnyway |= BwdMoveNecessary( pOldPage, Frame() ); + nMoveAnyway |= BwdMoveNecessary( pOldPage, getSwFrame() ); { const IDocumentSettingAccess& rIDSA = pNewPage->GetFormat()->getIDocumentSettingAccess(); SwTwips nSpace = 0; - SwRect aRect( pNewUpper->Prt() ); - aRect.Pos() += pNewUpper->Frame().Pos(); + SwRect aRect( pNewUpper->getSwPrint() ); + aRect.Pos() += pNewUpper->getSwFrame().Pos(); const SwFrame *pPrevFrame = pNewUpper->Lower(); while ( pPrevFrame ) { - SwTwips nNewTop = fnRectX.GetBottom(pPrevFrame->Frame()); + SwTwips nNewTop = fnRectX.GetBottom(pPrevFrame->getSwFrame()); // OD 2004-03-01 #106629#: // consider lower spacing of last frame in a table cell { @@ -187,7 +187,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() && - !fnRectX.GetWidth(pNewUpper->Prt()) && + !fnRectX.GetWidth(pNewUpper->getSwPrint()) && ( pNewUpper->GetUpper()->GetPrev() || pNewUpper->GetUpper()->GetNext() ); } @@ -489,7 +489,7 @@ void SwFrame::MakePos() { pPrv->Calc(getRootFrame()->GetCurrShell() ? getRootFrame()->GetCurrShell()->GetOut() : nullptr); // This may cause Prev to vanish! } - else if ( pPrv->Frame().Top() == 0 ) + else if ( pPrv->getSwFrame().Top() == 0 ) { bUseUpper = true; } @@ -500,35 +500,50 @@ void SwFrame::MakePos() SwRectFnSet aRectFnSet((IsCellFrame() && GetUpper() ? GetUpper() : this)); if ( !bUseUpper && pPrv ) { - maFrame.Pos( pPrv->Frame().Pos() ); + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Pos( pPrv->getSwFrame().Pos() ); + if( FRM_NEIGHBOUR & nMyType ) { - bool bR2L = IsRightToLeft(); + const bool bR2L = IsRightToLeft(); + if( bR2L ) - aRectFnSet.SetPosX( maFrame, aRectFnSet.GetLeft(maFrame) - - aRectFnSet.GetWidth(maFrame) ); + { + aRectFnSet.SetPosX( aFrm, aRectFnSet.GetLeft(aFrm) - aRectFnSet.GetWidth(aFrm) ); + } else - aRectFnSet.SetPosX( maFrame, aRectFnSet.GetLeft(maFrame) + - aRectFnSet.GetWidth(pPrv->Frame()) ); + { + aRectFnSet.SetPosX( aFrm, aRectFnSet.GetLeft(aFrm) + aRectFnSet.GetWidth(pPrv->getSwFrame()) ); + } // cells may now leave their uppers if( aRectFnSet.IsVert() && SwFrameType::Cell & nMyType && !mbReverse ) - maFrame.Pos().setX(maFrame.Pos().getX() - maFrame.Width() + pPrv->Frame().Width()); + { + aFrm.Pos().setX(aFrm.Pos().getX() - aFrm.Width() + pPrv->getSwFrame().Width()); + } } else if( aRectFnSet.IsVert() && FRM_NOTE_VERT & nMyType ) { if( mbReverse ) - maFrame.Pos().setX(maFrame.Pos().getX() + pPrv->Frame().Width()); + { + aFrm.Pos().setX(aFrm.Pos().getX() + pPrv->getSwFrame().Width()); + } else { if ( aRectFnSet.IsVertL2R() ) - maFrame.Pos().setX(maFrame.Pos().getX() + pPrv->Frame().Width()); + { + aFrm.Pos().setX(aFrm.Pos().getX() + pPrv->getSwFrame().Width()); + } else - maFrame.Pos().setX(maFrame.Pos().getX() - maFrame.Width()); - } + { + aFrm.Pos().setX(aFrm.Pos().getX() - aFrm.Width()); + } + } } else - maFrame.Pos().setY(maFrame.Pos().getY() + pPrv->Frame().Height()); + { + aFrm.Pos().setY(aFrm.Pos().getY() + pPrv->getSwFrame().Height()); + } } else if ( GetUpper() ) { @@ -554,60 +569,88 @@ void SwFrame::MakePos() pPrv = lcl_Prev( this, false ); if ( !bUseUpper && pPrv ) { - maFrame.Pos( pPrv->Frame().Pos() ); + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Pos( pPrv->getSwFrame().Pos() ); + if( FRM_NEIGHBOUR & nMyType ) { - bool bR2L = IsRightToLeft(); + const bool bR2L = IsRightToLeft(); + if( bR2L ) - aRectFnSet.SetPosX( maFrame, aRectFnSet.GetLeft(maFrame) - - aRectFnSet.GetWidth(maFrame) ); + { + aRectFnSet.SetPosX( aFrm, aRectFnSet.GetLeft(aFrm) - aRectFnSet.GetWidth(aFrm) ); + } else - aRectFnSet.SetPosX( maFrame, aRectFnSet.GetLeft(maFrame) + - aRectFnSet.GetWidth(pPrv->Frame()) ); + { + aRectFnSet.SetPosX( aFrm, aRectFnSet.GetLeft(aFrm) + aRectFnSet.GetWidth(pPrv->getSwFrame()) ); + } // cells may now leave their uppers if( aRectFnSet.IsVert() && SwFrameType::Cell & nMyType && !mbReverse ) - maFrame.Pos().setX(maFrame.Pos().getX() - maFrame.Width() + pPrv->Frame().Width()); + { + aFrm.Pos().setX(aFrm.Pos().getX() - aFrm.Width() + pPrv->getSwFrame().Width()); + } } else if( aRectFnSet.IsVert() && FRM_NOTE_VERT & nMyType ) { if( mbReverse ) - maFrame.Pos().setX(maFrame.Pos().getX() + pPrv->Frame().Width()); + { + aFrm.Pos().setX(aFrm.Pos().getX() + pPrv->getSwFrame().Width()); + } else - maFrame.Pos().setX(maFrame.Pos().getX() - maFrame.Width()); + { + aFrm.Pos().setX(aFrm.Pos().getX() - aFrm.Width()); + } } else - maFrame.Pos().setY(maFrame.Pos().getY() + pPrv->Frame().Height()); + { + aFrm.Pos().setY(aFrm.Pos().getY() + pPrv->getSwFrame().Height()); + } } else { - maFrame.Pos( GetUpper()->Frame().Pos() ); + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Pos( GetUpper()->getSwFrame().Pos() ); + if( GetUpper()->IsFlyFrame() ) - maFrame.Pos() += static_cast<SwFlyFrame*>(GetUpper())->ContentPos(); + { + aFrm.Pos() += static_cast<SwFlyFrame*>(GetUpper())->ContentPos(); + } else - maFrame.Pos() += GetUpper()->Prt().Pos(); + { + aFrm.Pos() += GetUpper()->getSwPrint().Pos(); + } if( FRM_NEIGHBOUR & nMyType && IsRightToLeft() ) { if( aRectFnSet.IsVert() ) - maFrame.Pos().setY(maFrame.Pos().getY() + GetUpper()->Prt().Height() - - maFrame.Height()); + { + aFrm.Pos().setY(aFrm.Pos().getY() + GetUpper()->getSwPrint().Height() - aFrm.Height()); + } else - maFrame.Pos().setX(maFrame.Pos().getX() + GetUpper()->Prt().Width() - - maFrame.Width()); + { + aFrm.Pos().setX(aFrm.Pos().getX() + GetUpper()->getSwPrint().Width() - aFrm.Width()); + } } else if( aRectFnSet.IsVert() && !aRectFnSet.IsVertL2R() && FRM_NOTE_VERT & nMyType && !mbReverse ) - maFrame.Pos().setX(maFrame.Pos().getX() - maFrame.Width() + GetUpper()->Prt().Width()); + { + aFrm.Pos().setX(aFrm.Pos().getX() - aFrm.Width() + GetUpper()->getSwPrint().Width()); + } } } else { - maFrame.Pos().setX(0); - maFrame.Pos().setY(0); + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Pos().setX(0); + aFrm.Pos().setY(0); } if( IsBodyFrame() && aRectFnSet.IsVert() && !aRectFnSet.IsVertL2R() && !mbReverse && GetUpper() ) - maFrame.Pos().setX(maFrame.Pos().getX() + GetUpper()->Prt().Width() - maFrame.Width()); + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Pos().setX(aFrm.Pos().getX() + GetUpper()->getSwPrint().Width() - aFrm.Width()); + } + mbValidPos = true; } } @@ -625,13 +668,13 @@ static void lcl_CheckObjects( SwSortedObjs* pSortedObjs, const SwFrame* pFrame, if ( dynamic_cast<const SwFlyFrame*>( pObj) != nullptr ) { SwFlyFrame *pFly = static_cast<SwFlyFrame*>(pObj); - if( pFly->Frame().Top() != FAR_AWAY && + if( pFly->getSwFrame().Top() != FAR_AWAY && ( pFrame->IsPageFrame() ? pFly->IsFlyLayFrame() : ( pFly->IsFlyAtContentFrame() && ( pFrame->IsBodyFrame() ? pFly->GetAnchorFrame()->IsInDocBody() : pFly->GetAnchorFrame()->IsInFootnote() ) ) ) ) { - nTmp = pFly->Frame().Bottom(); + nTmp = pFly->getSwFrame().Bottom(); } } else @@ -648,7 +691,7 @@ size_t SwPageFrame::GetContentHeight(const long nTop, const long nBottom) const "SwPageFrame::GetContentHeight(): No support for columns."); // In pages without columns, the content defines the size. - long nBot = Frame().Top() + nTop; + long nBot = getSwFrame().Top() + nTop; const SwFrame *pFrame = Lower(); while (pFrame) { @@ -657,13 +700,13 @@ size_t SwPageFrame::GetContentHeight(const long nTop, const long nBottom) const while (pCnt && (pCnt->GetUpper() == pFrame || static_cast<const SwLayoutFrame*>(pFrame)->IsAnLower(pCnt))) { - nTmp += pCnt->Frame().Height(); + nTmp += pCnt->getSwFrame().Height(); if (pCnt->IsTextFrame() && static_cast<const SwTextFrame*>(pCnt)->IsUndersized()) { // This TextFrame would like to be a bit bigger. nTmp += static_cast<const SwTextFrame*>(pCnt)->GetParHeight() - - pCnt->Prt().Height(); + - pCnt->getSwPrint().Height(); } else if (pCnt->IsSctFrame()) { @@ -679,20 +722,20 @@ size_t SwPageFrame::GetContentHeight(const long nTop, const long nBottom) const if (pFrame->IsBodyFrame() && (!pFrame->GetValidSizeFlag() || !pFrame->GetValidPrtAreaFlag()) && - (pFrame->Frame().Height() < pFrame->Prt().Height()) + (pFrame->getSwFrame().Height() < pFrame->getSwPrint().Height()) ) { - nTmp = std::min(nTmp, pFrame->Frame().Height()); + nTmp = std::min(nTmp, pFrame->getSwFrame().Height()); } else { // OD 30.10.2002 #97265# - assert invalid lower property - OSL_ENSURE(!(pFrame->Frame().Height() < pFrame->Prt().Height()), + OSL_ENSURE(!(pFrame->getSwFrame().Height() < pFrame->getSwPrint().Height()), "SwPageFrame::GetContentHeight(): Lower with frame height < printing height"); - nTmp += pFrame->Frame().Height() - pFrame->Prt().Height(); + nTmp += pFrame->getSwFrame().Height() - pFrame->getSwPrint().Height(); } if (!pFrame->IsBodyFrame()) - nTmp = std::min(nTmp, pFrame->Frame().Height()); + nTmp = std::min(nTmp, pFrame->getSwFrame().Height()); nBot += nTmp; // Here we check whether paragraph anchored objects // protrude outside the Body/FootnoteCont. @@ -705,7 +748,7 @@ size_t SwPageFrame::GetContentHeight(const long nTop, const long nBottom) const // And the page anchored ones if (m_pSortedObjs) lcl_CheckObjects(m_pSortedObjs, this, nBot); - nBot -= Frame().Top(); + nBot -= getSwFrame().Top(); return nBot; } @@ -714,7 +757,7 @@ void SwPageFrame::MakeAll(vcl::RenderContext* pRenderContext) { PROTOCOL_ENTER( this, PROT::MakeAll, DbgAction::NONE, nullptr ) - const SwRect aOldRect( Frame() ); // Adjust root size + const SwRect aOldRect( getSwFrame() ); // Adjust root size const SwLayNotify aNotify( this ); // takes care of the notification in the dtor std::unique_ptr<SwBorderAttrAccess> pAccess; const SwBorderAttrs*pAttrs = nullptr; @@ -730,9 +773,16 @@ void SwPageFrame::MakeAll(vcl::RenderContext* pRenderContext) { if ( IsEmptyPage() ) { - Frame().Width( 0 ); Prt().Width( 0 ); - Frame().Height( 0 ); Prt().Height( 0 ); - Prt().Left( 0 ); Prt().Top( 0 ); + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Width( 0 ); + aFrm.Width( 0 ); + + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Height( 0 ); + aPrt.Height( 0 ); + aPrt.Left( 0 ); + aPrt.Top( 0 ); + mbValidSize = mbValidPrtArea = true; } else @@ -758,37 +808,44 @@ void SwPageFrame::MakeAll(vcl::RenderContext* pRenderContext) if (nWidth < nDefWidth) nWidth = nDefWidth; nWidth += + 2 * aBorder.Width(); - nWidth = std::max( nWidth, 2L * aBorder.Width() + 4*MM50 ); - Frame().Width( nWidth ); - SwLayoutFrame *pBody = FindBodyCont(); - if ( pBody && pBody->Lower() && pBody->Lower()->IsColumnFrame() ) { - // Columns have a fixed height - Frame().Height( pAttrs->GetSize().Height() ); - } - else - { - // In pages without columns, the content defines the size. - long nBot = GetContentHeight(nTop, nBottom); + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Width( nWidth ); - // #i35143# - If second page frame - // exists, the first page doesn't have to fulfill the - // visible area. - if ( !GetPrev() && !GetNext() ) + SwLayoutFrame *pBody = FindBodyCont(); + if ( pBody && pBody->Lower() && pBody->Lower()->IsColumnFrame() ) { - nBot = std::max( nBot, pSh->VisArea().Height() ); + // Columns have a fixed height + aFrm.Height( pAttrs->GetSize().Height() ); } - // #i35143# - Assure, that the page - // doesn't exceed the defined browse height. - Frame().Height( std::min( nBot, BROWSE_HEIGHT ) ); + else + { + // In pages without columns, the content defines the size. + long nBot = GetContentHeight(nTop, nBottom); + + // #i35143# - If second page frame + // exists, the first page doesn't have to fulfill the + // visible area. + if ( !GetPrev() && !GetNext() ) + { + nBot = std::max( nBot, pSh->VisArea().Height() ); + } + // #i35143# - Assure, that the page + // doesn't exceed the defined browse height. + aFrm.Height( std::min( nBot, BROWSE_HEIGHT ) ); + } + } + + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Left ( pAttrs->CalcLeftLine() + aBorder.Width() ); + aPrt.Top ( nTop ); + aPrt.Width( getSwFrame().Width() - ( aPrt.Left() + pAttrs->CalcRightLine() + aBorder.Width() ) ); + aPrt.Height( getSwFrame().Height() - (nTop + nBottom) ); } - Prt().Left ( pAttrs->CalcLeftLine() + aBorder.Width() ); - Prt().Top ( nTop ); - Prt().Width( Frame().Width() - ( Prt().Left() - + pAttrs->CalcRightLine() + aBorder.Width() ) ); - Prt().Height( Frame().Height() - (nTop + nBottom) ); + mbValidSize = mbValidPrtArea = true; continue; } @@ -809,10 +866,10 @@ void SwPageFrame::MakeAll(vcl::RenderContext* pRenderContext) if (height > 0) { - ChgSize(Size(Frame().Width(), height)); - Prt().Top(0); - Prt().Height(height); - + ChgSize(Size(getSwFrame().Width(), height)); + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Top(0); + aPrt.Height(height); mbValidSize = mbValidPrtArea = true; continue; } @@ -825,16 +882,19 @@ void SwPageFrame::MakeAll(vcl::RenderContext* pRenderContext) // Set FixSize. For pages, this is not done from Upper, but from // the attribute. //FIXME: This resets the size when (mbValidSize && !mbValidPrtArea). - Frame().SSize( pAttrs->GetSize() ); + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.SSize( pAttrs->GetSize() ); + } Format( pRenderContext, pAttrs ); } } } //while ( !mbValidPos || !mbValidSize || !mbValidPrtArea ) - if ( Frame() != aOldRect && GetUpper() ) + if ( getSwFrame() != aOldRect && GetUpper() ) static_cast<SwRootFrame*>(GetUpper())->CheckViewLayout( nullptr, nullptr ); - OSL_ENSURE( !GetUpper() || GetUpper()->Prt().Width() >= maFrame.Width(), + OSL_ENSURE( !GetUpper() || GetUpper()->getSwPrint().Width() >= getSwFrame().Width(), "Upper (Root) must be wide enough to contain the widest page"); } @@ -871,33 +931,38 @@ void SwLayoutFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) // Set FixSize; VarSize is set by Format() after calculating the PrtArea mbValidPrtArea = false; - SwTwips nPrtWidth = (GetUpper()->Prt().*fnRect->fnGetWidth)(); + SwTwips nPrtWidth = (GetUpper()->getSwPrint().*fnRect->fnGetWidth)(); if( bVert && ( IsBodyFrame() || IsFootnoteContFrame() ) ) { SwFrame* pNxt = GetPrev(); while( pNxt && !pNxt->IsHeaderFrame() ) pNxt = pNxt->GetPrev(); if( pNxt ) - nPrtWidth -= pNxt->Frame().Height(); + nPrtWidth -= pNxt->getSwFrame().Height(); pNxt = GetNext(); while( pNxt && !pNxt->IsFooterFrame() ) pNxt = pNxt->GetNext(); if( pNxt ) - nPrtWidth -= pNxt->Frame().Height(); + nPrtWidth -= pNxt->getSwFrame().Height(); } - const long nDiff = nPrtWidth - (Frame().*fnRect->fnGetWidth)(); + const long nDiff = nPrtWidth - (getSwFrame().*fnRect->fnGetWidth)(); + SwFrameRect::FrameWriteAccess aFrm(*this); if( IsNeighbourFrame() && IsRightToLeft() ) - (Frame().*fnRect->fnSubLeft)( nDiff ); + { + (aFrm.*fnRect->fnSubLeft)( nDiff ); + } else - (Frame().*fnRect->fnAddRight)( nDiff ); + { + (aFrm.*fnRect->fnAddRight)( nDiff ); + } } else { // Don't leave your upper const SwTwips nDeadLine = (GetUpper()->*fnRect->fnGetPrtBottom)(); - if( (Frame().*fnRect->fnOverStep)( nDeadLine ) ) + if( (getSwFrame().*fnRect->fnOverStep)( nDeadLine ) ) mbValidSize = false; } } @@ -962,13 +1027,20 @@ bool SwContentFrame::MakePrtArea( const SwBorderAttrs &rAttrs ) if ( static_cast<SwTextFrame*>(this)->HasFollow() ) static_cast<SwTextFrame*>(this)->JoinFrame(); - if( aRectFnSet.GetHeight(Prt()) ) + if( aRectFnSet.GetHeight(getSwPrint()) ) + { static_cast<SwTextFrame*>(this)->HideHidden(); - Prt().Pos().setX(0); - Prt().Pos().setY(0); - aRectFnSet.SetWidth( Prt(), aRectFnSet.GetWidth(Frame()) ); - aRectFnSet.SetHeight( Prt(), 0 ); - nUpper = -( aRectFnSet.GetHeight(Frame()) ); + } + + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Pos().setX(0); + aPrt.Pos().setY(0); + aRectFnSet.SetWidth( aPrt, aRectFnSet.GetWidth(getSwFrame()) ); + aRectFnSet.SetHeight( aPrt, 0 ); + } + + nUpper = -( aRectFnSet.GetHeight(getSwFrame()) ); } else { @@ -1014,21 +1086,26 @@ bool SwContentFrame::MakePrtArea( const SwBorderAttrs &rAttrs ) const Size aBorder = pSh->GetOut()->PixelToLogic( pSh->GetBrowseBorder() ); long nWidth = nWidthArea - 2 * ( IsVertical() ? aBorder.Height() : aBorder.Width() ); - nWidth -= aRectFnSet.GetLeft(Prt()); + nWidth -= aRectFnSet.GetLeft(getSwPrint()); nWidth -= rAttrs.CalcRightLine(); nWidth = std::max( nMinWidth, nWidth ); - aRectFnSet.SetWidth( Prt(), std::min( nWidth, aRectFnSet.GetWidth(Prt()) ) ); + + SwFrameRect::PrintWriteAccess aPrt(*this); + aRectFnSet.SetWidth( aPrt, std::min( nWidth, aRectFnSet.GetWidth(aPrt) ) ); } - if ( aRectFnSet.GetWidth(Prt()) <= MINLAY ) + if ( aRectFnSet.GetWidth(getSwPrint()) <= MINLAY ) { // The PrtArea should already be at least MINLAY wide, matching the // minimal values of the UI - 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 ); + SwFrameRect::PrintWriteAccess aPrt(*this); + aRectFnSet.SetWidth( aPrt, std::min( long(MINLAY), aRectFnSet.GetWidth(getSwFrame()) ) ); + SwTwips nTmp = aRectFnSet.GetWidth(getSwFrame()) - aRectFnSet.GetWidth(aPrt); + + if( aRectFnSet.GetLeft(aPrt) > nTmp ) + { + aRectFnSet.SetLeft( aPrt, nTmp ); + } } // The following rules apply for VarSize: @@ -1051,10 +1128,13 @@ bool SwContentFrame::MakePrtArea( const SwBorderAttrs &rAttrs ) nLower=0; } - aRectFnSet.SetPosY( Prt(), (!aRectFnSet.IsVert() || mbReverse) ? nUpper : nLower); + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aRectFnSet.SetPosY( aPrt, (!aRectFnSet.IsVert() || mbReverse) ? nUpper : nLower); + } + nUpper += nLower; - nUpper -= aRectFnSet.GetHeight(Frame()) - - aRectFnSet.GetHeight(Prt()); + nUpper -= aRectFnSet.GetHeight(getSwFrame()) - aRectFnSet.GetHeight(getSwPrint()); } // If there's a difference between old and new size, call Grow() or // Shrink() respectively. @@ -1242,8 +1322,8 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) while ( !mbValidPos || !mbValidSize || !mbValidPrtArea ) { // - loop prevention - SwRect aOldFrame_StopFormat( Frame() ); - SwRect aOldPrt_StopFormat( Prt() ); + SwRect aOldFrame_StopFormat( getSwFrame() ); + SwRect aOldPrt_StopFormat( getSwPrint() ); bool bMoveable = IsMoveable(); if (bMoveable) { @@ -1267,8 +1347,8 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) } } - aOldFramePos = aRectFnSet.GetPos(Frame()); - aOldPrtPos = aRectFnSet.GetPos(Prt()); + aOldFramePos = aRectFnSet.GetPos(getSwFrame()); + aOldPrtPos = aRectFnSet.GetPos(getSwPrint()); if ( !mbValidPos ) MakePos(); @@ -1287,15 +1367,18 @@ 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 = aRectFnSet.GetWidth(GetUpper()->Prt()); + const SwTwips nNewFrameWidth = aRectFnSet.GetWidth(GetUpper()->getSwPrint()); if ( mbValidPrtArea && nNewFrameWidth > 0 && - aRectFnSet.GetWidth(Frame()) == 0 && - aRectFnSet.GetWidth(Prt()) == 0 ) + aRectFnSet.GetWidth(getSwFrame()) == 0 && + aRectFnSet.GetWidth(getSwPrint()) == 0 ) { mbValidPrtArea = false; } - aRectFnSet.SetWidth( Frame(), nNewFrameWidth ); + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.SetWidth( aFrm, nNewFrameWidth ); + } // When a lower of a vertically aligned fly frame changes its size we need to recalculate content pos. if( GetUpper() && GetUpper()->IsFlyFrame() && @@ -1307,11 +1390,11 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) } if ( !mbValidPrtArea ) { - const long nOldW = aRectFnSet.GetWidth(Prt()); + const long nOldW = aRectFnSet.GetWidth(getSwPrint()); // #i34730# - keep current frame height - const SwTwips nOldH = aRectFnSet.GetHeight(Frame()); + const SwTwips nOldH = aRectFnSet.GetHeight(getSwFrame()); MakePrtArea( rAttrs ); - if ( nOldW != aRectFnSet.GetWidth(Prt()) ) + if ( nOldW != aRectFnSet.GetWidth(getSwPrint()) ) Prepare( PREP_FIXSIZE_CHG ); // #i34730# - check, if frame height has changed. // If yes, send a PREP_ADJUST_FRM and invalidate the size flag to @@ -1320,16 +1403,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 != aRectFnSet.GetHeight(Frame()) ) + nOldH != aRectFnSet.GetHeight(getSwFrame()) ) { // #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 - aRectFnSet.GetHeight(Frame()); + const SwTwips nHDiff = nOldH - aRectFnSet.GetHeight(getSwFrame()); const bool bNoPrepAdjustFrame = nHDiff > 0 && IsInTab() && GetFollow() && - ( 1 == static_cast<SwTextFrame*>(GetFollow())->GetLineCount( COMPLETE_STRING ) || aRectFnSet.GetWidth(static_cast<SwTextFrame*>(GetFollow())->Frame()) < 0 ) && + ( 1 == static_cast<SwTextFrame*>(GetFollow())->GetLineCount( COMPLETE_STRING ) || aRectFnSet.GetWidth(static_cast<SwTextFrame*>(GetFollow())->getSwFrame()) < 0 ) && GetFollow()->CalcAddLowerSpaceAsLastInTableCell() == nHDiff; if ( !bNoPrepAdjustFrame ) { @@ -1348,13 +1431,13 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) bool bWidow = true; const SwTwips nDeadLine = aRectFnSet.GetPrtBottom(*GetUpper()); if( bMoveable && !bFormatted && - ( GetFollow() || aRectFnSet.OverStep( Frame(), nDeadLine ) ) ) + ( GetFollow() || aRectFnSet.OverStep( getSwFrame(), nDeadLine ) ) ) { Prepare( PREP_WIDOWS_ORPHANS, nullptr, false ); mbValidSize = bWidow = false; } - if( aRectFnSet.GetPos(Frame()) != aOldFramePos || - aRectFnSet.GetPos(Prt()) != aOldPrtPos ) + if( aRectFnSet.GetPos(getSwFrame()) != aOldFramePos || + aRectFnSet.GetPos(getSwPrint()) != aOldPrtPos ) { // In this Prepare, an InvalidateSize_() might happen. // mbValidSize becomes false and Format() gets called. @@ -1415,19 +1498,23 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) bMoveable = IsMoveable(); aRectFnSet.Refresh(this); } - Point aOldPos = aRectFnSet.GetPos(Frame()); + Point aOldPos = aRectFnSet.GetPos(getSwFrame()); MakePos(); - if( aOldPos != aRectFnSet.GetPos(Frame()) ) + if( aOldPos != aRectFnSet.GetPos(getSwFrame()) ) { Prepare( PREP_POS_CHGD, static_cast<const void*>(&bFormatted), false ); if ( !mbValidSize ) { - aRectFnSet.SetWidth( Frame(), aRectFnSet.GetWidth(GetUpper()->Prt()) ); + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.SetWidth( aFrm, aRectFnSet.GetWidth(GetUpper()->getSwPrint()) ); + } + if ( !mbValidPrtArea ) { - const long nOldW = aRectFnSet.GetWidth(Prt()); + const long nOldW = aRectFnSet.GetWidth(getSwPrint()); MakePrtArea( rAttrs ); - if( nOldW != aRectFnSet.GetWidth(Prt()) ) + if( nOldW != aRectFnSet.GetWidth(getSwPrint()) ) Prepare( PREP_FIXSIZE_CHG, nullptr, false ); } if( GetFollow() ) @@ -1487,15 +1574,15 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) { mbValidPos = false; MakePos(); - aOldFramePos = aRectFnSet.GetPos(Frame()); - aOldPrtPos = aRectFnSet.GetPos(Prt()); + aOldFramePos = aRectFnSet.GetPos(getSwFrame()); + aOldPrtPos = aRectFnSet.GetPos(getSwPrint()); } } // - loop prevention { - if ( aOldFrame_StopFormat == Frame() && - aOldPrt_StopFormat == Prt() ) + if ( aOldFrame_StopFormat == getSwFrame() && + aOldPrt_StopFormat == getSwPrint() ) { ++nConsecutiveFormatsWithoutChange; } @@ -1514,7 +1601,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) // Bottom(). This might happen with undersized TextFrames on the lower edge of a // multi-column section const long nPrtBottom = aRectFnSet.GetPrtBottom(*GetUpper()); - long nBottomDist = aRectFnSet.BottomDist(Frame(), nPrtBottom); + long nBottomDist = aRectFnSet.BottomDist(getSwFrame(), nPrtBottom); // Hide whitespace may require not to insert a new page. SwPageFrame* pPageFrame = FindPageFrame(); @@ -1553,7 +1640,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) { const bool bMoveFwdInvalid = nullptr != GetIndNext(); const bool bNxtNew = - ( 0 == aRectFnSet.GetHeight(pNxt->Prt()) ) && + ( 0 == aRectFnSet.GetHeight(pNxt->getSwPrint()) ) && (!pNxt->IsTextFrame() ||!static_cast<SwTextFrame*>(pNxt)->IsHiddenNow()); pNxt->Calc(getRootFrame()->GetCurrShell()->GetOut()); @@ -1581,7 +1668,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) { if( !bMoveable && IsInTab() ) { - long nDiff = -aRectFnSet.BottomDist( Frame(), aRectFnSet.GetPrtBottom(*GetUpper()) ); + long nDiff = -aRectFnSet.BottomDist( getSwFrame(), aRectFnSet.GetPrtBottom(*GetUpper()) ); long nReal = GetUpper()->Grow( nDiff ); if( nReal ) continue; @@ -1613,13 +1700,13 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) nullptr != GetNextCellLeaf() ) bDontMoveMe = false; - if ( bDontMoveMe && aRectFnSet.GetHeight(Frame()) > - aRectFnSet.GetHeight(GetUpper()->Prt()) ) + if ( bDontMoveMe && aRectFnSet.GetHeight(getSwFrame()) > + aRectFnSet.GetHeight(GetUpper()->getSwPrint()) ) { if ( !bFitPromise ) { - SwTwips nTmp = aRectFnSet.GetHeight(GetUpper()->Prt()) - - aRectFnSet.GetTop(Prt()); + SwTwips nTmp = aRectFnSet.GetHeight(GetUpper()->getSwPrint()) - + aRectFnSet.GetTop(getSwPrint()); bool bSplit = !IsFwdMoveAllowed(); if ( nTmp > 0 && WouldFit( nTmp, bSplit, false ) ) { @@ -1669,7 +1756,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) } const bool bCheckForGrownBody = pOldUp->IsBodyFrame(); - const long nOldBodyHeight = aRectFnSet.GetHeight(pOldUp->Frame()); + const long nOldBodyHeight = aRectFnSet.GetHeight(pOldUp->getSwFrame()); if ( !bMovedFwd && !MoveFwd( bMakePage, false ) ) bMakePage = false; @@ -1703,7 +1790,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. bMovedFwd = !bCheckForGrownBody || bMovedBwd || pOldUp == GetUpper() || - aRectFnSet.GetHeight(pOldUp->Frame()) <= nOldBodyHeight; + aRectFnSet.GetHeight(pOldUp->getSwFrame()) <= nOldBodyHeight; bFormatted = false; if ( bMoveOrFit && GetUpper() == pOldUp ) @@ -1780,10 +1867,16 @@ void MakeNxt( SwFrame *pFrame, SwFrame *pNxt ) const SwBorderAttrs &rAttrs = *aAccess.Get(); if ( !pNxt->GetValidSizeFlag() ) { + SwFrameRect::FrameWriteAccess aFrm(*pNxt); + if( pNxt->IsVertical() ) - pNxt->Frame().Height( pNxt->GetUpper()->Prt().Height() ); + { + aFrm.Height( pNxt->GetUpper()->getSwPrint().Height() ); + } else - pNxt->Frame().Width( pNxt->GetUpper()->Prt().Width() ); + { + aFrm.Width( pNxt->GetUpper()->getSwPrint().Width() ); + } } static_cast<SwContentFrame*>(pNxt)->MakePrtArea( rAttrs ); pNxt->Format( pNxt->getRootFrame()->GetCurrShell()->GetOut(), &rAttrs ); @@ -1795,10 +1888,16 @@ void MakeNxt( SwFrame *pFrame, SwFrame *pNxt ) const SwBorderAttrs &rAttrs = *aAccess.Get(); if ( !pNxt->GetValidSizeFlag() ) { + SwFrameRect::FrameWriteAccess aFrm(*pNxt); + if( pNxt->IsVertical() ) - pNxt->Frame().Height( pNxt->GetUpper()->Prt().Height() ); + { + aFrm.Height( pNxt->GetUpper()->getSwPrint().Height() ); + } else - pNxt->Frame().Width( pNxt->GetUpper()->Prt().Width() ); + { + aFrm.Width( pNxt->GetUpper()->getSwPrint().Width() ); + } } pNxt->Format( pNxt->getRootFrame()->GetCurrShell()->GetOut(), &rAttrs ); } @@ -1948,9 +2047,9 @@ bool SwContentFrame::WouldFit_( SwTwips nSpace, nSecondCheck = 0; if( pFrame->IsVertical() ) - nUpper = pFrame->Frame().Width() - pFrame->Prt().Width(); + nUpper = pFrame->getSwFrame().Width() - pFrame->getSwPrint().Width(); else - nUpper = pFrame->Frame().Height() - pFrame->Prt().Height(); + nUpper = pFrame->getSwFrame().Height() - pFrame->getSwPrint().Height(); } nSpace -= nUpper; diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx index b12b03afdacf..49c7cc35b279 100644 --- a/sw/source/core/layout/colfrm.cxx +++ b/sw/source/core/layout/colfrm.cxx @@ -294,7 +294,7 @@ void SwLayoutFrame::AdjustColumns( const SwFormatCol *pAttr, bool bAdjustAttribu { if( !Lower()->GetNext() ) { - Lower()->ChgSize( Prt().SSize() ); + Lower()->ChgSize( getSwPrint().SSize() ); return; } @@ -309,11 +309,11 @@ void SwLayoutFrame::AdjustColumns( const SwFormatCol *pAttr, bool bAdjustAttribu pAttr = &GetFormat()->GetCol(); if ( !bAdjustAttributes ) { - long nAvail = (Prt().*fnRect->fnGetWidth)(); + long nAvail = (getSwPrint().*fnRect->fnGetWidth)(); for ( SwLayoutFrame *pCol = static_cast<SwLayoutFrame*>(Lower()); pCol; pCol = static_cast<SwLayoutFrame*>(pCol->GetNext()) ) - nAvail -= (pCol->Frame().*fnRect->fnGetWidth)(); + nAvail -= (pCol->getSwFrame().*fnRect->fnGetWidth)(); if ( !nAvail ) return; } @@ -321,7 +321,7 @@ void SwLayoutFrame::AdjustColumns( const SwFormatCol *pAttr, bool bAdjustAttribu //The columns can now be easily adjusted. //The widths get counted so we can give the reminder to the last one. - SwTwips nAvail = (Prt().*fnRect->fnGetWidth)(); + SwTwips nAvail = (getSwPrint().*fnRect->fnGetWidth)(); const bool bLine = pAttr->GetLineAdj() != COLADJ_NONE; const sal_uInt16 nMin = bLine ? sal_uInt16( 20 + ( pAttr->GetLineWidth() / 2) ) : 0; @@ -340,11 +340,11 @@ void SwLayoutFrame::AdjustColumns( const SwFormatCol *pAttr, bool bAdjustAttribu { const SwTwips nWidth = i == (pAttr->GetNumCols() - 1) ? nAvail : - pAttr->CalcColWidth( i, sal_uInt16( (Prt().*fnRect->fnGetWidth)() ) ); + pAttr->CalcColWidth( i, sal_uInt16( (getSwPrint().*fnRect->fnGetWidth)() ) ); const Size aColSz = bVert ? - Size( Prt().Width(), nWidth ) : - Size( nWidth, Prt().Height() ); + Size( getSwPrint().Width(), nWidth ) : + Size( nWidth, getSwPrint().Height() ); pCol->ChgSize( aColSz ); @@ -425,8 +425,8 @@ void SwLayoutFrame::AdjustColumns( const SwFormatCol *pAttr, bool bAdjustAttribu nWidth = 0; const Size aColSz = bVert ? - Size( Prt().Width(), nWidth ) : - Size( nWidth, Prt().Height() ); + Size( getSwPrint().Width(), nWidth ) : + Size( nWidth, getSwPrint().Height() ); pCol->ChgSize( aColSz ); diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx index 4e3df4b918a5..af7ac968694e 100644 --- a/sw/source/core/layout/dbg_lay.cxx +++ b/sw/source/core/layout/dbg_lay.cxx @@ -176,7 +176,7 @@ class SwSizeEnterLeave : public SwImplEnterLeave long nFrameHeight; public: SwSizeEnterLeave( const SwFrame* pF, PROT nFunct, DbgAction nAct, void* pPar ) - : SwImplEnterLeave( pF, nFunct, nAct, pPar ), nFrameHeight( pF->Frame().Height() ) {} + : SwImplEnterLeave( pF, nFunct, nAct, pPar ), nFrameHeight( pF->getSwFrame().Height() ) {} virtual void Leave() override; // resize message }; @@ -197,7 +197,7 @@ class SwFrameChangesLeave : public SwImplEnterLeave SwRect aFrame; public: SwFrameChangesLeave( const SwFrame* pF, PROT nFunct, DbgAction nAct, void* pPar ) - : SwImplEnterLeave( pF, nFunct, nAct, pPar ), aFrame( pF->Frame() ) {} + : SwImplEnterLeave( pF, nFunct, nAct, pPar ), aFrame( pF->getSwFrame() ) {} virtual void Enter() override; // no message virtual void Leave() override; // message when resizing the Frame area @@ -588,7 +588,7 @@ void SwImplProtocol::Record_( const SwFrame* pFrame, PROT nFunction, DbgAction n case PROT::Size: aOut.append("PROT::Size"); lcl_Start( aOut, aLayer, nAct ); aOut.append(' '); - aOut.append(static_cast<sal_Int64>(pFrame->Frame().Height())); + aOut.append(static_cast<sal_Int64>(pFrame->getSwFrame().Height())); break; case PROT::Leaf: aOut.append("SwFrame::GetPrev/NextSctLeaf"); lcl_Start( aOut, aLayer, nAct ); @@ -624,32 +624,32 @@ void SwImplProtocol::Record_( const SwFrame* pFrame, PROT nFunction, DbgAction n case PROT::FrmChanges: { SwRect& rFrame = *static_cast<SwRect*>(pParam); - if( pFrame->Frame().Pos() != rFrame.Pos() ) + if( pFrame->getSwFrame().Pos() != rFrame.Pos() ) { aOut.append("PosChg: ("); aOut.append(static_cast<sal_Int64>(rFrame.Left())); aOut.append(", "); aOut.append(static_cast<sal_Int64>(rFrame.Top())); aOut.append(") -> ("); - aOut.append(static_cast<sal_Int64>(pFrame->Frame().Left())); + aOut.append(static_cast<sal_Int64>(pFrame->getSwFrame().Left())); aOut.append(", "); - aOut.append(static_cast<sal_Int64>(pFrame->Frame().Top())); + aOut.append(static_cast<sal_Int64>(pFrame->getSwFrame().Top())); aOut.append(") "); } - if( pFrame->Frame().Height() != rFrame.Height() ) + if( pFrame->getSwFrame().Height() != rFrame.Height() ) { aOut.append("Height: "); aOut.append(static_cast<sal_Int64>(rFrame.Height())); aOut.append(" -> "); - aOut.append(static_cast<sal_Int64>(pFrame->Frame().Height())); + aOut.append(static_cast<sal_Int64>(pFrame->getSwFrame().Height())); aOut.append(" "); } - if( pFrame->Frame().Width() != rFrame.Width() ) + if( pFrame->getSwFrame().Width() != rFrame.Width() ) { aOut.append("Width: "); aOut.append(static_cast<sal_Int64>(rFrame.Width())); aOut.append(" -> "); - aOut.append(static_cast<sal_Int64>(pFrame->Frame().Width())); + aOut.append(static_cast<sal_Int64>(pFrame->getSwFrame().Width())); aOut.append(' '); } break; @@ -768,7 +768,7 @@ void SwImplEnterLeave::Leave() void SwSizeEnterLeave::Leave() { - nFrameHeight = pFrame->Frame().Height() - nFrameHeight; + nFrameHeight = pFrame->getSwFrame().Height() - nFrameHeight; SwProtocol::Record( pFrame, nFunction, DbgAction::End, &nFrameHeight ); } @@ -790,7 +790,7 @@ void SwFrameChangesLeave::Enter() void SwFrameChangesLeave::Leave() { - if( pFrame->Frame() != aFrame ) + if( pFrame->getSwFrame() != aFrame ) SwProtocol::Record( pFrame, PROT::FrmChanges, DbgAction::NONE, &aFrame ); } diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index 10d9faf95928..d465d29965b7 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -554,11 +554,11 @@ const SwPageFrame* SwRootFrame::GetPageAtPos( const Point& rPt, const Size* pSiz if ( !bExtend ) { - if( !Frame().IsInside( rPt ) ) + if( !getSwFrame().IsInside( rPt ) ) return nullptr; // skip pages above point: - while( pPage && rPt.Y() > pPage->Frame().Bottom() ) + while( pPage && rPt.Y() > pPage->getSwFrame().Bottom() ) pPage = pPage->GetNext(); } @@ -567,7 +567,7 @@ const SwPageFrame* SwRootFrame::GetPageAtPos( const Point& rPt, const Size* pSiz while ( pPage && !pRet ) { - const SwRect& rBoundRect = bExtend ? maPageRects[ nPageIdx++ ] : pPage->Frame(); + const SwRect& rBoundRect = bExtend ? maPageRects[ nPageIdx++ ] : pPage->getSwFrame(); if ( (!pSize && rBoundRect.IsInside(rPt)) || (pSize && rBoundRect.IsOver(aRect)) ) @@ -583,7 +583,7 @@ const SwPageFrame* SwRootFrame::GetPageAtPos( const Point& rPt, const Size* pSiz bool SwRootFrame::IsBetweenPages(const Point& rPt) const { - if (!Frame().IsInside(rPt)) + if (!getSwFrame().IsInside(rPt)) return false; // top visible page @@ -592,15 +592,15 @@ bool SwRootFrame::IsBetweenPages(const Point& rPt) const return false; // skip pages above point: - while (pPage && rPt.Y() > pPage->Frame().Bottom()) + while (pPage && rPt.Y() > pPage->getSwFrame().Bottom()) pPage = pPage->GetNext(); if (pPage && - rPt.X() >= pPage->Frame().Left() && - rPt.X() <= pPage->Frame().Right()) + rPt.X() >= pPage->getSwFrame().Left() && + rPt.X() <= pPage->getSwFrame().Right()) { // Trivial case when we're right in between. - if (!pPage->Frame().IsInside(rPt)) + if (!pPage->getSwFrame().IsInside(rPt)) return true; // In normal mode the gap is large enough and @@ -612,8 +612,8 @@ bool SwRootFrame::IsBetweenPages(const Point& rPt) const if (pSh && pSh->GetViewOptions()->IsWhitespaceHidden()) { // If we are really close to the bottom or top of a page. - const auto toEdge = std::min(std::abs(pPage->Frame().Top() - rPt.Y()), - std::abs(pPage->Frame().Bottom() - rPt.Y())); + const auto toEdge = std::min(std::abs(pPage->getSwFrame().Top() - rPt.Y()), + std::abs(pPage->getSwFrame().Bottom() - rPt.Y())); return toEdge <= MmToTwips(2.0); } } diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index b7deab921ecf..b0e85e4db50b 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -523,7 +523,7 @@ bool SwFlowFrame::PasteTree( SwFrame *pStart, SwLayoutFrame *pParent, SwFrame *p else bRet = true; - nGrowVal += aRectFnSet.GetHeight(pFloat->Frame()); + nGrowVal += aRectFnSet.GetHeight(pFloat->getSwFrame()); if ( pFloat->GetNext() ) pFloat = pFloat->GetNext(); else @@ -1555,7 +1555,7 @@ SwTwips SwFlowFrame::GetUpperSpaceAmountConsideredForPageGrid_( SwRectFnSet aRectFnSet(&m_rThis); const SwTwips nBodyPrtTop = aRectFnSet.GetPrtTop(*pBodyFrame); const SwTwips nProposedPrtTop = - aRectFnSet.YInc( aRectFnSet.GetTop(m_rThis.Frame()), + aRectFnSet.YInc( aRectFnSet.GetTop(m_rThis.getSwFrame()), _nUpperSpaceWithoutGrid ); const SwTwips nSpaceAbovePrtTop = @@ -1571,7 +1571,7 @@ SwTwips SwFlowFrame::GetUpperSpaceAmountConsideredForPageGrid_( const SwTwips nNewUpperSpace = aRectFnSet.YDiff( nNewPrtTop, - aRectFnSet.GetTop(m_rThis.Frame()) ); + aRectFnSet.GetTop(m_rThis.getSwFrame()) ); nUpperSpaceAmountConsideredForPageGrid = nNewUpperSpace - _nUpperSpaceWithoutGrid; @@ -1915,7 +1915,7 @@ bool SwFlowFrame::MoveFwd( bool bMakePage, bool bPageBreak, bool bMoveAlways ) // silly things... SwRectFnSet aRectFnSet(pOldBoss); SwSaveFootnoteHeight aHeight( pOldBoss, - aRectFnSet.GetBottom(pOldBoss->Frame()) ); + aRectFnSet.GetBottom(pOldBoss->getSwFrame()) ); 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 36d74c245623..8e425948d0c6 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -129,8 +129,11 @@ SwFlyFrame::SwFlyFrame( SwFlyFrameFormat *pFormat, SwFrame* pSib, SwFrame *pAnch mbRightToLeft = false; } - Frame().Width( rFrameSize.GetWidth() ); - Frame().Height( rFrameSize.GetHeightSizeType() == ATT_VAR_SIZE ? MINFLY : rFrameSize.GetHeight() ); + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Width( rFrameSize.GetWidth() ); + aFrm.Height( rFrameSize.GetHeightSizeType() == ATT_VAR_SIZE ? MINFLY : rFrameSize.GetHeight() ); + } // Fixed or variable Height? if ( rFrameSize.GetHeightSizeType() == ATT_MIN_SIZE ) @@ -151,8 +154,9 @@ SwFlyFrame::SwFlyFrame( SwFlyFrameFormat *pFormat, SwFrame* pSib, SwFrame *pAnch InsertCnt(); // Put it somewhere outside so that out document is not formatted unnecessarily often - Frame().Pos().setX(FAR_AWAY); - Frame().Pos().setY(FAR_AWAY); + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Pos().setX(FAR_AWAY); + aFrm.Pos().setY(FAR_AWAY); } void SwFlyFrame::Chain( SwFrame* _pAnch ) @@ -224,8 +228,12 @@ void SwFlyFrame::InsertColumns() { // Start off PrtArea to be as large as Frame, so that we can put in the columns // properly. It'll adjust later on. - Prt().Width( Frame().Width() ); - Prt().Height( Frame().Height() ); + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Width( getSwFrame().Width() ); + aPrt.Height( getSwFrame().Height() ); + } + const SwFormatCol aOld; // ChgColumns() also needs an old value passed ChgColumns( aOld, rCol ); } @@ -386,7 +394,7 @@ void SwFlyFrame::ChainFrames( SwFlyFrame *pMaster, SwFlyFrame *pFollow ) const long nBottom = aRectFnSet.GetPrtBottom(*pMaster); while ( pInva ) { - if( aRectFnSet.BottomDist( pInva->Frame(), nBottom ) <= 0 ) + if( aRectFnSet.BottomDist( pInva->getSwFrame(), nBottom ) <= 0 ) { pInva->InvalidateSize(); pInva->Prepare(); @@ -525,7 +533,7 @@ SwFrame *SwFlyFrame::FindLastLower() bool SwFlyFrame::FrameSizeChg( const SwFormatFrameSize &rFrameSize ) { bool bRet = false; - SwTwips nDiffHeight = Frame().Height(); + SwTwips nDiffHeight = getSwFrame().Height(); if ( rFrameSize.GetHeightSizeType() == ATT_VAR_SIZE ) mbFixSize = m_bMinHeight = false; else @@ -549,14 +557,24 @@ bool SwFlyFrame::FrameSizeChg( const SwFormatFrameSize &rFrameSize ) if ( Lower()->IsColumnFrame() ) { const SwRect aOld( GetObjRectWithSpaces() ); - const Size aOldSz( Prt().SSize() ); - const SwTwips nDiffWidth = Frame().Width() - rFrameSize.GetWidth(); - maFrame.Height( maFrame.Height() - nDiffHeight ); - maFrame.Width ( maFrame.Width() - nDiffWidth ); + const Size aOldSz( getSwPrint().SSize() ); + const SwTwips nDiffWidth = getSwFrame().Width() - rFrameSize.GetWidth(); + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Height( aFrm.Height() - nDiffHeight ); + aFrm.Width ( aFrm.Width() - nDiffWidth ); + } + // #i68520# InvalidateObjRectWithSpaces(); - maPrt.Height( maPrt.Height() - nDiffHeight ); - maPrt.Width ( maPrt.Width() - nDiffWidth ); + + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Height( aPrt.Height() - nDiffHeight ); + aPrt.Width ( aPrt.Width() - nDiffWidth ); + } + ChgLowersProp( aOldSz ); ::Notify( this, FindPageFrame(), aOld ); mbValidPos = false; @@ -740,7 +758,7 @@ void SwFlyFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew, if ( RES_FMT_CHG == nWhich ) { SwRect aNew( GetObjRectWithSpaces() ); - SwRect aOld( maFrame ); + SwRect aOld( getSwFrame() ); const SvxULSpaceItem &rUL = static_cast<const SwFormatChg*>(pOld)->pChangedFormat->GetULSpace(); aOld.Top( std::max( aOld.Top() - long(rUL.GetUpper()), 0L ) ); aOld.SSize().Height()+= rUL.GetLower(); @@ -800,7 +818,7 @@ void SwFlyFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew, GetVirtDrawObj()->SetResizeProtect( rP.IsSizeProtected() ); if ( pSh ) - pSh->InvalidateWindows( Frame() ); + pSh->InvalidateWindows( getSwFrame() ); const IDocumentDrawModelAccess& rIDDMA = GetFormat()->getIDocumentDrawModelAccess(); const SdrLayerID nId = GetFormat()->GetOpaque().GetValue() ? rIDDMA.GetHeavenId() : @@ -838,7 +856,7 @@ void SwFlyFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew, if( pSh && pSh->GetViewOptions()->getBrowseMode() ) getRootFrame()->InvalidateBrowseWidth(); SwRect aNew( GetObjRectWithSpaces() ); - SwRect aOld( maFrame ); + SwRect aOld( getSwFrame() ); if (pNew) { if ( RES_UL_SPACE == nWhich ) @@ -880,7 +898,7 @@ void SwFlyFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew, case RES_OPAQUE: { if ( pSh ) - pSh->InvalidateWindows( Frame() ); + pSh->InvalidateWindows( getSwFrame() ); const IDocumentDrawModelAccess& rIDDMA = GetFormat()->getIDocumentDrawModelAccess(); const SdrLayerID nId = static_cast<const SvxOpaqueItem*>(pNew)->GetValue() ? @@ -909,12 +927,12 @@ void SwFlyFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew, static_cast<const SwFormatURL*>(pNew)->GetMap() && static_cast<const SwFormatURL*>(pOld)->GetMap() ) { const SwFormatFrameSize &rSz = GetFormat()->GetFrameSize(); - if ( rSz.GetHeight() != Frame().Height() || - rSz.GetWidth() != Frame().Width() ) + if ( rSz.GetHeight() != getSwFrame().Height() || + rSz.GetWidth() != getSwFrame().Width() ) { SwFormatURL aURL( GetFormat()->GetURL() ); - Fraction aScaleX( Frame().Width(), rSz.GetWidth() ); - Fraction aScaleY( Frame().Height(), rSz.GetHeight() ); + Fraction aScaleX( getSwFrame().Width(), rSz.GetWidth() ); + Fraction aScaleY( getSwFrame().Height(), rSz.GetHeight() ); aURL.GetMap()->Scale( aScaleX, aScaleY ); SwFrameFormat *pFormat = GetFormat(); pFormat->LockModify(); @@ -1068,7 +1086,7 @@ void SwFlyFrame::ChgRelPos( const Point &rNewPos ) { if( pAutoFrame == GetAnchorFrame() ) nTmpY += pAutoFrame->GetRelPos().Y(); - nTmpY -= pAutoFrame->GetUpper()->Prt().Height(); + nTmpY -= pAutoFrame->GetUpper()->getSwPrint().Height(); pAutoFrame = pAutoFrame->GetFollow(); } nTmpY = static_cast<SwFlyAtContentFrame*>(this)->GetRelCharY(pAutoFrame)-nTmpY; @@ -1150,11 +1168,15 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA if ( !mbValidSize ) { - if ( Frame().Top() == FAR_AWAY && Frame().Left() == FAR_AWAY ) + if ( getSwFrame().Top() == FAR_AWAY && getSwFrame().Left() == FAR_AWAY ) { // Remove safety switch (see SwFrame::CTor) - Frame().Pos().setX(0); - Frame().Pos().setY(0); + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Pos().setX(0); + aFrm.Pos().setY(0); + } + // #i68520# InvalidateObjRectWithSpaces(); } @@ -1193,9 +1215,18 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA if ( nRemaining < MINFLY ) nRemaining = MINFLY; - aRectFnSet.SetHeight( Prt(), nRemaining ); - nRemaining -= aRectFnSet.GetHeight(Frame()); - aRectFnSet.AddBottom( Frame(), nRemaining + nUL ); + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aRectFnSet.SetHeight( aPrt, nRemaining ); + } + + nRemaining -= aRectFnSet.GetHeight(getSwFrame()); + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.AddBottom( aFrm, nRemaining + nUL ); + } + // #i68520# if ( nRemaining + nUL != 0 ) { @@ -1210,7 +1241,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(aRectFnSet.GetWidth(Frame()), aRectFnSet.GetHeight(Frame())); + Size aSize(aRectFnSet.GetWidth(getSwFrame()), aRectFnSet.GetHeight(getSwFrame())); pCustomShape->SuggestTextFrameSize(aSize); // Do the calculations normally done after touching editeng text of the shape. pCustomShape->NbcSetOutlinerParaObjectForText(nullptr, nullptr); @@ -1225,9 +1256,19 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA nNewSize -= nUL; if( nNewSize < MINFLY ) nNewSize = MINFLY; - aRectFnSet.SetHeight( Prt(), nNewSize ); - nNewSize += nUL - aRectFnSet.GetHeight(Frame()); - aRectFnSet.AddBottom( Frame(), nNewSize ); + + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aRectFnSet.SetHeight( aPrt, nNewSize ); + } + + nNewSize += nUL - aRectFnSet.GetHeight(getSwFrame()); + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.AddBottom( aFrm, nNewSize ); + } + // #i68520# if ( nNewSize != 0 ) { @@ -1257,9 +1298,19 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA if( nNewSize < MINFLY ) nNewSize = MINFLY; - aRectFnSet.SetWidth( Prt(), nNewSize ); - nNewSize += nLR - aRectFnSet.GetWidth(Frame()); - aRectFnSet.AddRight( Frame(), nNewSize ); + + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aRectFnSet.SetWidth( aPrt, nNewSize ); + } + + nNewSize += nLR - aRectFnSet.GetWidth(getSwFrame()); + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.AddRight( aFrm, nNewSize ); + } + // #i68520# if ( nNewSize != 0 ) { @@ -1342,8 +1393,8 @@ void CalcContent( SwLayoutFrame *pLay, bool bNoColl ) { pLast = pFrame; if( pFrame->IsVertical() ? - ( pFrame->GetUpper()->Prt().Height() != pFrame->Frame().Height() ) - : ( pFrame->GetUpper()->Prt().Width() != pFrame->Frame().Width() ) ) + ( pFrame->GetUpper()->getSwPrint().Height() != pFrame->getSwFrame().Height() ) + : ( pFrame->GetUpper()->getSwPrint().Width() != pFrame->getSwFrame().Width() ) ) { pFrame->Prepare( PREP_FIXSIZE_CHG ); pFrame->InvalidateSize_(); @@ -1604,9 +1655,13 @@ void SwFlyFrame::MakeObjPos() // update relative position SetCurrRelPos( aObjPositioning.GetRelPos() ); - SwRectFnSet aRectFnSet(GetAnchorFrame()); - maFrame.Pos( aObjPositioning.GetRelPos() ); - maFrame.Pos() += aRectFnSet.GetPos(GetAnchorFrame()->Frame()); + { + SwRectFnSet aRectFnSet(GetAnchorFrame()); + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Pos( aObjPositioning.GetRelPos() ); + aFrm.Pos() += aRectFnSet.GetPos(GetAnchorFrame()->getSwFrame()); + } + // #i69335# InvalidateObjRectWithSpaces(); } @@ -1642,7 +1697,7 @@ void SwFlyFrame::MakeContentPos( const SwBorderAttrs &rAttrs ) nMinHeight = aRectFnSet.IsVert() ? aRelSize.Width() : aRelSize.Height(); Point aNewContentPos; - aNewContentPos = Prt().Pos(); + aNewContentPos = getSwPrint().Pos(); const SdrTextVertAdjust nAdjust = GetFormat()->GetTextVertAdjust().GetValue(); if( nAdjust != SDRTEXTVERTADJUST_TOP ) @@ -1651,7 +1706,7 @@ void SwFlyFrame::MakeContentPos( const SwBorderAttrs &rAttrs ) SwTwips nDiff = 0; if( nContentHeight != 0) - nDiff = aRectFnSet.GetHeight(Prt()) - nContentHeight; + nDiff = aRectFnSet.GetHeight(getSwPrint()) - nContentHeight; if( nDiff > 0 ) { @@ -1697,7 +1752,7 @@ SwTwips SwFlyFrame::Grow_( SwTwips nDist, bool bTst ) SwRectFnSet aRectFnSet(this); if ( Lower() && !IsColLocked() && !HasFixSize() ) { - SwTwips nSize = aRectFnSet.GetHeight(Frame()); + SwTwips nSize = aRectFnSet.GetHeight(getSwFrame()); if( nSize > 0 && nDist > ( LONG_MAX - nSize ) ) nDist = LONG_MAX - nSize; @@ -1776,7 +1831,7 @@ SwTwips SwFlyFrame::Shrink_( SwTwips nDist, bool bTst ) if( Lower() && !IsColLocked() && !HasFixSize() ) { SwRectFnSet aRectFnSet(this); - SwTwips nHeight = aRectFnSet.GetHeight(Frame()); + SwTwips nHeight = aRectFnSet.GetHeight(getSwFrame()); if ( nDist > nHeight ) nDist = nHeight; @@ -1798,14 +1853,25 @@ SwTwips SwFlyFrame::Shrink_( SwTwips nDist, bool bTst ) if ( !bTst ) { SwRect aOld( GetObjRectWithSpaces() ); - aRectFnSet.SetHeight( Frame(), nHeight - nVal ); + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.SetHeight( aFrm, nHeight - nVal ); + } + // #i68520# if ( nHeight - nVal != 0 ) { InvalidateObjRectWithSpaces(); } - nHeight = aRectFnSet.GetHeight(Prt()); - aRectFnSet.SetHeight( Prt(), nHeight - nVal ); + + nHeight = aRectFnSet.GetHeight(getSwPrint()); + + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aRectFnSet.SetHeight( aPrt, nHeight - nVal ); + } + InvalidatePos_(); InvalidateSize(); ::Notify( this, FindPageFrame(), aOld ); @@ -1895,7 +1961,7 @@ Size SwFlyFrame::ChgSize( const Size& aNewSize ) } } } - if ( aAdjustedNewSize != Frame().SSize() ) + if ( aAdjustedNewSize != getSwFrame().SSize() ) { SwFrameFormat *pFormat = GetFormat(); SwFormatFrameSize aSz( pFormat->GetFrameSize() ); @@ -1906,7 +1972,7 @@ Size SwFlyFrame::ChgSize( const Size& aNewSize ) return aSz.GetSize(); } else - return Frame().SSize(); + return getSwFrame().SSize(); } bool SwFlyFrame::IsLowerOf( const SwLayoutFrame* pUpperFrame ) const @@ -2174,7 +2240,7 @@ void SwLayoutFrame::NotifyLowerObjs( const bool _bUnlockPosOfObjs ) { SwFlyFrame* pFly = static_cast<SwFlyFrame*>(pObj); - if ( pFly->Frame().Left() == FAR_AWAY ) + if ( pFly->getSwFrame().Left() == FAR_AWAY ) continue; if ( pFly->IsAnLower( this ) ) @@ -2249,11 +2315,11 @@ Size SwFlyFrame::CalcRel( const SwFormatFrameSize &rSz ) const nRelWidth = pSh->GetBrowseWidth(); nRelHeight = pSh->VisArea().Height(); Size aBorder = pSh->GetOut()->PixelToLogic( pSh->GetBrowseBorder() ); - long nDiff = nRelWidth - pRel->Prt().Width(); + long nDiff = nRelWidth - pRel->getSwPrint().Width(); if ( nDiff > 0 ) nRelWidth -= nDiff; nRelHeight -= 2*aBorder.Height(); - nDiff = nRelHeight - pRel->Prt().Height(); + nDiff = nRelHeight - pRel->getSwPrint().Height(); if ( nDiff > 0 ) nRelHeight -= nDiff; } @@ -2261,9 +2327,9 @@ Size SwFlyFrame::CalcRel( const SwFormatFrameSize &rSz ) const // At the moment only the "== PAGE_FRAME" and "!= PAGE_FRAME" cases are handled. // When size is a relative to page size, ignore size of SwBodyFrame. if (rSz.GetWidthPercentRelation() != text::RelOrientation::PAGE_FRAME) - nRelWidth = std::min( nRelWidth, pRel->Prt().Width() ); + nRelWidth = std::min( nRelWidth, pRel->getSwPrint().Width() ); if (rSz.GetHeightPercentRelation() != text::RelOrientation::PAGE_FRAME) - nRelHeight = std::min( nRelHeight, pRel->Prt().Height() ); + nRelHeight = std::min( nRelHeight, pRel->getSwPrint().Height() ); if( !pRel->IsPageFrame() ) { const SwPageFrame* pPage = FindPageFrame(); @@ -2271,14 +2337,14 @@ Size SwFlyFrame::CalcRel( const SwFormatFrameSize &rSz ) const { if (rSz.GetWidthPercentRelation() == text::RelOrientation::PAGE_FRAME) // Ignore margins of pPage. - nRelWidth = std::min( nRelWidth, pPage->Frame().Width() ); + nRelWidth = std::min( nRelWidth, pPage->getSwFrame().Width() ); else - nRelWidth = std::min( nRelWidth, pPage->Prt().Width() ); + nRelWidth = std::min( nRelWidth, pPage->getSwPrint().Width() ); if (rSz.GetHeightPercentRelation() == text::RelOrientation::PAGE_FRAME) // Ignore margins of pPage. - nRelHeight = std::min( nRelHeight, pPage->Frame().Height() ); + nRelHeight = std::min( nRelHeight, pPage->getSwFrame().Height() ); else - nRelHeight = std::min( nRelHeight, pPage->Prt().Height() ); + nRelHeight = std::min( nRelHeight, pPage->getSwPrint().Height() ); } } @@ -2334,8 +2400,8 @@ static SwTwips lcl_CalcAutoWidth( const SwLayoutFrame& rFrame ) const SwPageFrame* pPage = rFrame.FindPageFrame(); // auto width table nMin = pFrame->GetUpper()->IsVertical() ? - pPage->Prt().Height() : - pPage->Prt().Width(); + pPage->getSwPrint().Height() : + pPage->getSwPrint().Width(); } else { @@ -2490,7 +2556,7 @@ const SwFrameFormat& SwFlyFrame::GetFrameFormat() const const SwRect SwFlyFrame::GetObjRect() const { - return Frame(); + return getSwFrame(); } // #i70122# @@ -2503,17 +2569,17 @@ const SwRect SwFlyFrame::GetObjBoundRect() const // #i68520# bool SwFlyFrame::SetObjTop_( const SwTwips _nTop ) { - const bool bChanged( Frame().Pos().getY() != _nTop ); - - Frame().Pos().setY(_nTop); + const bool bChanged( getSwFrame().Pos().getY() != _nTop ); + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Pos().setY(_nTop); return bChanged; } bool SwFlyFrame::SetObjLeft_( const SwTwips _nLeft ) { - const bool bChanged( Frame().Pos().getX() != _nLeft ); - - Frame().Pos().setX(_nLeft); + const bool bChanged( getSwFrame().Pos().getX() != _nLeft ); + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Pos().setX(_nLeft); return bChanged; } @@ -2572,18 +2638,18 @@ SwTwips SwFlyFrame::CalcContentHeight(const SwBorderAttrs *pAttrs, const SwTwips if ( Lower()->IsColumnFrame() ) { FormatWidthCols( *pAttrs, nUL, nMinHeight ); - nHeight = aRectFnSet.GetHeight(Lower()->Frame()); + nHeight = aRectFnSet.GetHeight(Lower()->getSwFrame()); } else { SwFrame *pFrame = Lower(); while ( pFrame ) { - nHeight += aRectFnSet.GetHeight(pFrame->Frame()); + nHeight += aRectFnSet.GetHeight(pFrame->getSwFrame()); if( pFrame->IsTextFrame() && static_cast<SwTextFrame*>(pFrame)->IsUndersized() ) // This TextFrame would like to be a bit larger nHeight += static_cast<SwTextFrame*>(pFrame)->GetParHeight() - - aRectFnSet.GetHeight(pFrame->Prt()); + - aRectFnSet.GetHeight(pFrame->getSwPrint()); else if( pFrame->IsSctFrame() && static_cast<SwSectionFrame*>(pFrame)->IsUndersized() ) nHeight += static_cast<SwSectionFrame*>(pFrame)->Undersize(); pFrame = pFrame->GetNext(); @@ -2592,9 +2658,9 @@ SwTwips SwFlyFrame::CalcContentHeight(const SwBorderAttrs *pAttrs, const SwTwips if ( GetDrawObjs() ) { const size_t nCnt = GetDrawObjs()->size(); - SwTwips nTop = aRectFnSet.GetTop(Frame()); - SwTwips nBorder = aRectFnSet.GetHeight(Frame()) - - aRectFnSet.GetHeight(Prt()); + SwTwips nTop = aRectFnSet.GetTop(getSwFrame()); + SwTwips nBorder = aRectFnSet.GetHeight(getSwFrame()) - + aRectFnSet.GetHeight(getSwPrint()); for ( size_t i = 0; i < nCnt; ++i ) { SwAnchoredObject* pAnchoredObj = (*GetDrawObjs())[i]; @@ -2604,10 +2670,10 @@ SwTwips SwFlyFrame::CalcContentHeight(const SwBorderAttrs *pAttrs, const SwTwips // OD 06.11.2003 #i22305# - consider // only Writer fly frames, which follow the text flow. if ( pFly->IsFlyLayFrame() && - pFly->Frame().Top() != FAR_AWAY && + pFly->getSwFrame().Top() != FAR_AWAY && pFly->GetFormat()->GetFollowTextFlow().GetValue() ) { - SwTwips nDist = -aRectFnSet.BottomDist( pFly->Frame(), nTop ); + SwTwips nDist = -aRectFnSet.BottomDist( pFly->getSwFrame(), 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 31a6a2b0c742..ed1b139b48ba 100644 --- a/sw/source/core/layout/flycnt.cxx +++ b/sw/source/core/layout/flycnt.cxx @@ -53,15 +53,15 @@ inline SwTwips lcl_GetTopForObjPos(const SwContentFrame* pCnt, const bool bVert, { if ( bVert ) { - SwTwips aResult = pCnt->Frame().Left(); + SwTwips aResult = pCnt->getSwFrame().Left(); if ( bVertL2R ) aResult += pCnt->GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid(); else - aResult += pCnt->Frame().Width() - pCnt->GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid(); + aResult += pCnt->getSwFrame().Width() - pCnt->GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid(); return aResult; } else - return pCnt->Frame().Top() + pCnt->GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid(); + return pCnt->getSwFrame().Top() + pCnt->GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid(); } } @@ -160,7 +160,7 @@ void SwFlyAtContentFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pN if ( !pContent ) { SwContentNode *pNode = aNewIdx.GetNode().GetContentNode(); - pContent = pNode->getLayoutFrame( getRootFrame(), &pOldAnchor->Frame().Pos(), nullptr, false ); + pContent = pNode->getLayoutFrame( getRootFrame(), &pOldAnchor->getSwFrame().Pos(), nullptr, false ); OSL_ENSURE( pContent, "New anchor not found" ); } //Flys are never attached to a follow, but always on the master which @@ -385,10 +385,10 @@ void SwFlyAtContentFrame::MakeAll(vcl::RenderContext* pRenderContext) bool bConsiderWrapInfluenceDueToMovedFwdAnchor( false ); do { SwRectFnSet aRectFnSet(this); - Point aOldPos( aRectFnSet.GetPos(Frame()) ); + Point aOldPos( aRectFnSet.GetPos(getSwFrame()) ); SwFlyFreeFrame::MakeAll(pRenderContext); const bool bPosChgDueToOwnFormat = - aOldPos != aRectFnSet.GetPos(Frame()); + aOldPos != aRectFnSet.GetPos(getSwFrame()); // #i3317# if ( !ConsiderObjWrapInfluenceOnObjPos() && OverlapsPrevColumn() ) @@ -446,7 +446,7 @@ void SwFlyAtContentFrame::MakeAll(vcl::RenderContext* pRenderContext) } } - if ( aOldPos != aRectFnSet.GetPos(Frame()) || + if ( aOldPos != aRectFnSet.GetPos(getSwFrame()) || ( !GetValidPosFlag() && ( pFooter || bPosChgDueToOwnFormat ) ) ) { @@ -507,8 +507,8 @@ void SwFlyAtContentFrame::MakeAll(vcl::RenderContext* pRenderContext) if ( pCellFrame ) { SwRectFnSet aRectFnSet(pCellFrame); - if ( aRectFnSet.GetTop(pCellFrame->Frame()) == 0 && - aRectFnSet.GetHeight(pCellFrame->Frame()) == 0 ) + if ( aRectFnSet.GetTop(pCellFrame->getSwFrame()) == 0 && + aRectFnSet.GetHeight(pCellFrame->getSwFrame()) == 0 ) { bConsiderWrapInfluenceDueToMovedFwdAnchor = false; } @@ -559,7 +559,7 @@ static const SwFrame * lcl_CalcDownDist( SwDistance &rRet, rRet.nSub = 0; //If the point stays inside the Cnt everything is clear already; the Content //automatically has a distance of 0. - if ( pCnt->Frame().IsInside( rPt ) ) + if ( pCnt->getSwFrame().IsInside( rPt ) ) { rRet.nMain = 0; return pCnt; @@ -578,7 +578,7 @@ static const SwFrame * lcl_CalcDownDist( SwDistance &rRet, // #i70582# // --> OD 2009-03-05 - adopted for Support for Classical Mongolian Script const SwTwips nTopForObjPos = lcl_GetTopForObjPos(pCnt, bVert, bVertL2R); - if ( pUp->Frame().IsInside( rPt ) ) + if ( pUp->getSwFrame().IsInside( rPt ) ) { // <rPt> point is inside environment of given content frame // #i70582# @@ -593,21 +593,21 @@ static const SwFrame * lcl_CalcDownDist( SwDistance &rRet, rRet.nMain = rPt.Y() - nTopForObjPos; return pCnt; } - else if ( rPt.Y() <= pUp->Frame().Top() ) + else if ( rPt.Y() <= pUp->getSwFrame().Top() ) { // <rPt> point is above environment of given content frame // correct for vertical layout? rRet.nMain = LONG_MAX; } - else if( rPt.X() < pUp->Frame().Left() && - rPt.Y() <= ( bVert ? pUp->Frame().Top() : pUp->Frame().Bottom() ) ) + else if( rPt.X() < pUp->getSwFrame().Left() && + rPt.Y() <= ( bVert ? pUp->getSwFrame().Top() : pUp->getSwFrame().Bottom() ) ) { // <rPt> point is left of environment of given content frame // seems not to be correct for vertical layout!? const SwFrame *pLay = pUp->GetLeaf( MAKEPAGE_NONE, false, pCnt ); if( !pLay || - (bVert && (pLay->Frame().Top() + pLay->Prt().Bottom()) <rPt.Y())|| - (!bVert && (pLay->Frame().Left() + pLay->Prt().Right())<rPt.X()) ) + (bVert && (pLay->getSwFrame().Top() + pLay->getSwPrint().Bottom()) <rPt.Y())|| + (!bVert && (pLay->getSwFrame().Left() + pLay->getSwPrint().Right())<rPt.X()) ) { // <rPt> point is in left border of environment // #i70582# @@ -629,9 +629,9 @@ static const SwFrame * lcl_CalcDownDist( SwDistance &rRet, { rRet.nMain = bVert ? ( bVertL2R - ? ( (pUp->Frame().Left() + pUp->Prt().Right()) - nTopForObjPos ) - : ( nTopForObjPos - (pUp->Frame().Left() + pUp->Prt().Left() ) ) ) - : ( (pUp->Frame().Top() + pUp->Prt().Bottom()) - nTopForObjPos ); + ? ( (pUp->getSwFrame().Left() + pUp->getSwPrint().Right()) - nTopForObjPos ) + : ( nTopForObjPos - (pUp->getSwFrame().Left() + pUp->getSwPrint().Left() ) ) ) + : ( (pUp->getSwFrame().Top() + pUp->getSwPrint().Bottom()) - nTopForObjPos ); const SwFrame *pPre = pCnt; const SwFrame *pLay = pUp->GetLeaf( MAKEPAGE_NONE, true, pCnt ); @@ -653,15 +653,15 @@ static const SwFrame * lcl_CalcDownDist( SwDistance &rRet, if( pLay->IsVertical() ) { if ( pLay->IsVertLR() ) - nFrameTop = pLay->Frame().Left(); + nFrameTop = pLay->getSwFrame().Left(); else - nFrameTop = pLay->Frame().Left() + pLay->Frame().Width(); - nPrtHeight = pLay->Prt().Width(); + nFrameTop = pLay->getSwFrame().Left() + pLay->getSwFrame().Width(); + nPrtHeight = pLay->getSwPrint().Width(); } else { - nFrameTop = pLay->Frame().Top(); - nPrtHeight = pLay->Prt().Height(); + nFrameTop = pLay->getSwFrame().Top(); + nPrtHeight = pLay->getSwPrint().Height(); } pSect = pNxtSect; } @@ -672,24 +672,24 @@ static const SwFrame * lcl_CalcDownDist( SwDistance &rRet, { if ( pLay->IsVertLR() ) { - nFrameTop = pSect->Frame().Right(); - nPrtHeight = pLay->Frame().Left() + pLay->Prt().Left() - + pLay->Prt().Width() - pSect->Frame().Left() - - pSect->Frame().Width(); + nFrameTop = pSect->getSwFrame().Right(); + nPrtHeight = pLay->getSwFrame().Left() + pLay->getSwPrint().Left() + + pLay->getSwPrint().Width() - pSect->getSwFrame().Left() + - pSect->getSwFrame().Width(); } else { - nFrameTop = pSect->Frame().Left(); - nPrtHeight = pSect->Frame().Left() - pLay->Frame().Left() - - pLay->Prt().Left(); + nFrameTop = pSect->getSwFrame().Left(); + nPrtHeight = pSect->getSwFrame().Left() - pLay->getSwFrame().Left() + - pLay->getSwPrint().Left(); } } else { - nFrameTop = pSect->Frame().Bottom(); - nPrtHeight = pLay->Frame().Top() + pLay->Prt().Top() - + pLay->Prt().Height() - pSect->Frame().Top() - - pSect->Frame().Height(); + nFrameTop = pSect->getSwFrame().Bottom(); + nPrtHeight = pLay->getSwFrame().Top() + pLay->getSwPrint().Top() + + pLay->getSwPrint().Height() - pSect->getSwFrame().Top() + - pSect->getSwFrame().Height(); } pSect = nullptr; } @@ -700,26 +700,26 @@ static const SwFrame * lcl_CalcDownDist( SwDistance &rRet, { if ( pLay->IsVertLR() ) { - nFrameTop = pLay->Frame().Left(); - nPrtHeight = pLay->Prt().Width(); + nFrameTop = pLay->getSwFrame().Left(); + nPrtHeight = pLay->getSwPrint().Width(); } else { - nFrameTop = pLay->Frame().Left() + pLay->Frame().Width(); - nPrtHeight = pLay->Prt().Width(); + nFrameTop = pLay->getSwFrame().Left() + pLay->getSwFrame().Width(); + nPrtHeight = pLay->getSwPrint().Width(); } } else { - nFrameTop = pLay->Frame().Top(); - nPrtHeight = pLay->Prt().Height(); + nFrameTop = pLay->getSwFrame().Top(); + nPrtHeight = pLay->getSwPrint().Height(); } bSct = nullptr != pSect; } - while ( pLay && !pLay->Frame().IsInside( rPt ) && - ( pLay->Frame().Top() <= rPt.Y() || pLay->IsInFly() || + while ( pLay && !pLay->getSwFrame().IsInside( rPt ) && + ( pLay->getSwFrame().Top() <= rPt.Y() || pLay->IsInFly() || ( pLay->IsInSct() && - pLay->FindSctFrame()->GetUpper()->Frame().Top() <= rPt.Y())) ) + pLay->FindSctFrame()->GetUpper()->getSwFrame().Top() <= rPt.Y())) ) { if ( pLay->IsFootnoteContFrame() ) { @@ -753,19 +753,19 @@ static const SwFrame * lcl_CalcDownDist( SwDistance &rRet, { if ( pLay->IsVertLR() ) { - nFrameTop = pLay->Frame().Left(); - nPrtHeight = pLay->Prt().Width(); + nFrameTop = pLay->getSwFrame().Left(); + nPrtHeight = pLay->getSwPrint().Width(); } else { - nFrameTop = pLay->Frame().Left() + pLay->Frame().Width(); - nPrtHeight = pLay->Prt().Width(); + nFrameTop = pLay->getSwFrame().Left() + pLay->getSwFrame().Width(); + nPrtHeight = pLay->getSwPrint().Width(); } } else { - nFrameTop = pLay->Frame().Top(); - nPrtHeight = pLay->Prt().Height(); + nFrameTop = pLay->getSwFrame().Top(); + nPrtHeight = pLay->getSwPrint().Height(); } } else @@ -775,24 +775,24 @@ static const SwFrame * lcl_CalcDownDist( SwDistance &rRet, { if ( pLay->IsVertLR() ) { - nFrameTop = pSect->Frame().Right(); - nPrtHeight = pLay->Frame().Left()+pLay->Prt().Left() - + pLay->Prt().Width() - pSect->Frame().Left() - - pSect->Frame().Width(); + nFrameTop = pSect->getSwFrame().Right(); + nPrtHeight = pLay->getSwFrame().Left()+pLay->getSwPrint().Left() + + pLay->getSwPrint().Width() - pSect->getSwFrame().Left() + - pSect->getSwFrame().Width(); } else { - nFrameTop = pSect->Frame().Left(); - nPrtHeight = pSect->Frame().Left() - - pLay->Frame().Left() - pLay->Prt().Left(); + nFrameTop = pSect->getSwFrame().Left(); + nPrtHeight = pSect->getSwFrame().Left() - + pLay->getSwFrame().Left() - pLay->getSwPrint().Left(); } } else { - nFrameTop = pSect->Frame().Bottom(); - nPrtHeight = pLay->Frame().Top()+pLay->Prt().Top() - + pLay->Prt().Height() - pSect->Frame().Top() - - pSect->Frame().Height(); + nFrameTop = pSect->getSwFrame().Bottom(); + nPrtHeight = pLay->getSwFrame().Top()+pLay->getSwPrint().Top() + + pLay->getSwPrint().Height() - pSect->getSwFrame().Top() + - pSect->getSwFrame().Height(); } pSect = nullptr; } @@ -803,19 +803,19 @@ static const SwFrame * lcl_CalcDownDist( SwDistance &rRet, { if ( pLay->IsVertLR() ) { - nFrameTop = pLay->Frame().Left(); - nPrtHeight = pLay->Prt().Width(); + nFrameTop = pLay->getSwFrame().Left(); + nPrtHeight = pLay->getSwPrint().Width(); } else { - nFrameTop = pLay->Frame().Left() + pLay->Frame().Width(); - nPrtHeight = pLay->Prt().Width(); + nFrameTop = pLay->getSwFrame().Left() + pLay->getSwFrame().Width(); + nPrtHeight = pLay->getSwPrint().Width(); } } else { - nFrameTop = pLay->Frame().Top(); - nPrtHeight = pLay->Prt().Height(); + nFrameTop = pLay->getSwFrame().Top(); + nPrtHeight = pLay->getSwPrint().Height(); } bSct = nullptr != pSect; } @@ -823,7 +823,7 @@ static const SwFrame * lcl_CalcDownDist( SwDistance &rRet, } if ( pLay ) { - if ( pLay->Frame().IsInside( rPt ) ) + if ( pLay->getSwFrame().IsInside( rPt ) ) { SwTwips nDiff = pLay->IsVertical() ? ( pLay->IsVertLR() ? ( rPt.X() - nFrameTop ) : ( nFrameTop - rPt.X() ) ) : ( rPt.Y() - nFrameTop ); @@ -874,13 +874,13 @@ static sal_uInt64 lcl_FindCntDiff( const Point &rPt, const SwLayoutFrame *pLay, { //Calculate the distance between those two points. //'delta' X^2 + 'delta' Y^2 = 'distance'^2 - sal_uInt64 dX = std::max( pCnt->Frame().Left(), rPt.X() ) - - std::min( pCnt->Frame().Left(), rPt.X() ), - dY = std::max( pCnt->Frame().Top(), rPt.Y() ) - - std::min( pCnt->Frame().Top(), rPt.Y() ); + sal_uInt64 dX = std::max( pCnt->getSwFrame().Left(), rPt.X() ) - + std::min( pCnt->getSwFrame().Left(), rPt.X() ), + dY = std::max( pCnt->getSwFrame().Top(), rPt.Y() ) - + std::min( pCnt->getSwFrame().Top(), rPt.Y() ); // square of the difference will do fine here const sal_uInt64 nDiff = (dX * dX) + (dY * dY); - if ( pCnt->Frame().Top() <= rPt.Y() ) + if ( pCnt->getSwFrame().Top() <= rPt.Y() ) { if ( nDiff < nDistance ) { @@ -943,7 +943,7 @@ static const SwContentFrame * lcl_FindCnt( const Point &rPt, const SwContentFram const sal_uInt64 nNew = ::lcl_FindCntDiff( rPt, pPge, pNew, bBody, bFootnote ); if ( nNew < nDist ) { - if ( pNew->Frame().Top() <= rPt.Y() ) + if ( pNew->getSwFrame().Top() <= rPt.Y() ) { pRet = pNearest = pNew; nDist = nNearest = nNew; @@ -968,7 +968,7 @@ static const SwContentFrame * lcl_FindCnt( const Point &rPt, const SwContentFram const sal_uInt64 nNew = ::lcl_FindCntDiff( rPt, pPge, pNew, bBody, bFootnote ); if ( nNew < nDist ) { - if ( pNew->Frame().Top() <= rPt.Y() ) + if ( pNew->getSwFrame().Top() <= rPt.Y() ) { pRet = pNearest = pNew; nDist = nNearest = nNew; @@ -985,7 +985,7 @@ static const SwContentFrame * lcl_FindCnt( const Point &rPt, const SwContentFram nOldNew = nNew; } } - if ( pRet->Frame().Top() > rPt.Y() ) + if ( pRet->getSwFrame().Top() > rPt.Y() ) return pNearest; else return pRet; @@ -993,8 +993,8 @@ static const SwContentFrame * lcl_FindCnt( const Point &rPt, const SwContentFram static void lcl_PointToPrt( Point &rPoint, const SwFrame *pFrame ) { - SwRect aTmp( pFrame->Prt() ); - aTmp += pFrame->Frame().Pos(); + SwRect aTmp( pFrame->getSwPrint() ); + aTmp += pFrame->getSwFrame().Pos(); if ( rPoint.getX() < aTmp.Left() ) rPoint.setX(aTmp.Left()); else if ( rPoint.getX() > aTmp.Right() ) @@ -1049,7 +1049,7 @@ const SwContentFrame *FindAnchor( const SwFrame *pOldAnch, const Point &rNew, ::lcl_PointToPrt( aNew, pPage ); } - if ( pCnt->IsInDocBody() == bBody && pCnt->Frame().IsInside( aNew ) ) + if ( pCnt->IsInDocBody() == bBody && pCnt->getSwFrame().IsInside( aNew ) ) return pCnt; else if ( pOldAnch->IsInDocBody() || pOldAnch->IsPageFrame() ) { @@ -1058,7 +1058,7 @@ const SwContentFrame *FindAnchor( const SwFrame *pOldAnch, const Point &rNew, Point aTmp( aNew ); const SwContentFrame *pTmp = pCnt->FindPageFrame()-> GetContentPos( aTmp, false, true ); - if ( pTmp && pTmp->Frame().IsInside( aNew ) ) + if ( pTmp && pTmp->getSwFrame().IsInside( aNew ) ) return pTmp; } @@ -1169,7 +1169,7 @@ void SwFlyAtContentFrame::SetAbsPos( const Point &rNew ) Point aNew( rNew ); if( ( GetAnchorFrame()->IsVertical() && !GetAnchorFrame()->IsVertLR() ) || GetAnchorFrame()->IsRightToLeft() ) - aNew.setX(aNew.getX() + Frame().Width()); + aNew.setX(aNew.getX() + getSwFrame().Width()); SwContentFrame *pCnt = const_cast<SwContentFrame*>(::FindAnchor( GetAnchorFrame(), aNew )); if( pCnt->IsProtected() ) pCnt = const_cast<SwContentFrame*>(static_cast<const SwContentFrame*>(GetAnchorFrame())); @@ -1184,9 +1184,9 @@ void SwFlyAtContentFrame::SetAbsPos( const Point &rNew ) ( !bRTL != !GetAnchorFrame()->IsRightToLeft() ) ) { if( bVert || bRTL ) - aNew.setX(aNew.getX() + Frame().Width()); + aNew.setX(aNew.getX() + getSwFrame().Width()); else - aNew.setX(aNew.getX() - Frame().Width()); + aNew.setX(aNew.getX() - getSwFrame().Width()); } if ( pCnt->IsInDocBody() ) @@ -1205,20 +1205,20 @@ void SwFlyAtContentFrame::SetAbsPos( const Point &rNew ) //!!!!!We can optimize here: FindAnchor could also return RelPos! const SwFrame *pFrame = nullptr; SwTwips nY; - if ( pCnt->Frame().IsInside( aNew ) ) + if ( pCnt->getSwFrame().IsInside( aNew ) ) { // #i70582# if ( bVert ) { - nY = pCnt->Frame().Left() - rNew.X(); + nY = pCnt->getSwFrame().Left() - rNew.X(); if ( bVertL2R ) nY = -nY; else - nY += pCnt->Frame().Width() - Frame().Width(); + nY += pCnt->getSwFrame().Width() - getSwFrame().Width(); nY -= pCnt->GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid(); } else - nY = rNew.Y() - pCnt->Frame().Top() - pCnt->GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid(); + nY = rNew.Y() - pCnt->getSwFrame().Top() - pCnt->GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid(); } else { @@ -1256,20 +1256,20 @@ void SwFlyAtContentFrame::SetAbsPos( const Point &rNew ) if( pUp->IsVertical() ) { if ( pUp->IsVertLR() ) - nDiff += pUp->Prt().Width() - pFollow->GetRelPos().getX(); + nDiff += pUp->getSwPrint().Width() - pFollow->GetRelPos().getX(); else - nDiff += pFollow->Frame().Left() + pFollow->Frame().Width() - - pUp->Frame().Left() - pUp->Prt().Left(); + nDiff += pFollow->getSwFrame().Left() + pFollow->getSwFrame().Width() + - pUp->getSwFrame().Left() - pUp->getSwPrint().Left(); } else - nDiff += pUp->Prt().Height() - pFollow->GetRelPos().Y(); + nDiff += pUp->getSwPrint().Height() - pFollow->GetRelPos().Y(); pFollow = pFollow->GetFollow(); } while ( pFollow != pOriginal ); nY += nDiff; if( bVert ) - nX = pCnt->Frame().Top() - pOriginal->Frame().Top(); + nX = pCnt->getSwFrame().Top() - pOriginal->getSwFrame().Top(); else - nX = pCnt->Frame().Left() - pOriginal->Frame().Left(); + nX = pCnt->getSwFrame().Left() - pOriginal->getSwFrame().Left(); } if ( nY == LONG_MAX ) @@ -1294,25 +1294,25 @@ void SwFlyAtContentFrame::SetAbsPos( const Point &rNew ) if( bVert ) { if( !pFrame ) - nX += rNew.Y() - pCnt->Frame().Top(); + nX += rNew.Y() - pCnt->getSwFrame().Top(); else - nX = rNew.Y() - pFrame->Frame().Top(); + nX = rNew.Y() - pFrame->getSwFrame().Top(); } else { if( !pFrame ) { if ( pCnt->IsRightToLeft() ) - nX += pCnt->Frame().Right() - rNew.X() - Frame().Width(); + nX += pCnt->getSwFrame().Right() - rNew.X() - getSwFrame().Width(); else - nX += rNew.X() - pCnt->Frame().Left(); + nX += rNew.X() - pCnt->getSwFrame().Left(); } else { if ( pFrame->IsRightToLeft() ) - nX += pFrame->Frame().Right() - rNew.X() - Frame().Width(); + nX += pFrame->getSwFrame().Right() - rNew.X() - getSwFrame().Width(); else - nX = rNew.X() - pFrame->Frame().Left(); + nX = rNew.X() - pFrame->getSwFrame().Left(); } } GetFormat()->GetDoc()->GetIDocumentUndoRedo().StartUndo( SwUndoId::START, nullptr ); diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx index 9d62960e6fd5..6544bad582ab 100644 --- a/sw/source/core/layout/flyincnt.cxx +++ b/sw/source/core/layout/flyincnt.cxx @@ -73,7 +73,12 @@ void SwFlyInContentFrame::SetRefPoint( const Point& rPoint, aRef = rPoint; SetCurrRelPos( rRelAttr ); SwRectFnSet aRectFnSet(GetAnchorFrame()); - aRectFnSet.SetPos( Frame(), rPoint + rRelPos ); + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.SetPos( aFrm, rPoint + rRelPos ); + } + // #i68520# InvalidateObjRectWithSpaces(); if( pNotify ) @@ -130,7 +135,7 @@ void SwFlyInContentFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pN /// Here the content gets formatted initially. void SwFlyInContentFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderAttrs *pAttrs ) { - if ( !Frame().Height() ) + if ( !getSwFrame().Height() ) { Lock(); //don't format the anchor on the crook. SwContentFrame *pContent = ContainsContent(); @@ -255,10 +260,11 @@ void SwFlyInContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) GetFormat()->getIDocumentSettingAccess().get( DocumentSettingId::CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME ) ) { SwFrame* pFrame = AnchorFrame(); - if ( Frame().Left() == (pFrame->Frame().Left()+pFrame->Prt().Left()) && - Frame().Width() > pFrame->Prt().Width() ) + if ( getSwFrame().Left() == (pFrame->getSwFrame().Left()+pFrame->getSwPrint().Left()) && + getSwFrame().Width() > pFrame->getSwPrint().Width() ) { - Frame().Width( pFrame->Prt().Width() ); + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Width( pFrame->getSwPrint().Width() ); mbValidPrtArea = false; m_bWidthClipped = true; } diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx index 4d27654eaf3c..9226ee283336 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( aRectFnSet.GetPos(Frame()) ); + const Point aOldPos( aRectFnSet.GetPos(getSwFrame()) ); // #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 == aRectFnSet.GetPos(Frame()) ) + if( aOldPos == aRectFnSet.GetPos(getSwFrame()) ) { 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 || ( aRectFnSet.GetHeight(Frame()) > 0 && - aRectFnSet.GetHeight(Prt()) > 0), + OSL_ENSURE( m_bHeightClipped || ( aRectFnSet.GetHeight(getSwFrame()) > 0 && + aRectFnSet.GetHeight(getSwPrint()) > 0), "SwFlyFreeFrame::Format(), flipping Fly." ); #endif @@ -275,8 +275,8 @@ void SwFlyFreeFrame::CheckClip( const SwFormatFrameSize &rSz ) ::CalcClipRect( pObj, aTmpStretch, false ); aClip.Intersection_( aTmpStretch ); - const long nBot = Frame().Top() + Frame().Height(); - const long nRig = Frame().Left() + Frame().Width(); + const long nBot = getSwFrame().Top() + getSwFrame().Height(); + const long nRig = getSwFrame().Left() + getSwFrame().Width(); const long nClipBot = aClip.Top() + aClip.Height(); const long nClipRig = aClip.Left() + aClip.Width(); @@ -296,26 +296,44 @@ void SwFlyFreeFrame::CheckClip( const SwFormatFrameSize &rSz ) // now the flyframe can change its position and so on ... if ( !pHeader || !pHeader->IsHeaderFrame() ) { - const long nOld = Frame().Top(); - Frame().Pos().Y() = std::max( aClip.Top(), nClipBot - Frame().Height() ); - if ( Frame().Top() != nOld ) + const long nOld = getSwFrame().Top(); + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Pos().Y() = std::max( aClip.Top(), nClipBot - aFrm.Height() ); + } + + if ( getSwFrame().Top() != nOld ) + { bAgain = true; + } + m_bHeightClipped = true; } } if ( bRig ) { - const long nOld = Frame().Left(); - Frame().Pos().X() = std::max( aClip.Left(), nClipRig - Frame().Width() ); - if ( Frame().Left() != nOld ) + const long nOld = getSwFrame().Left(); + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Pos().X() = std::max( aClip.Left(), nClipRig - aFrm.Width() ); + } + + if ( getSwFrame().Left() != nOld ) { const SwFormatHoriOrient &rH = GetFormat()->GetHoriOrient(); // Left-aligned ones may not be moved to the left when they // are avoiding another one. if( rH.GetHoriOrient() == text::HoriOrientation::LEFT ) - Frame().Pos().X() = nOld; + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Pos().X() = nOld; + } else + { bAgain = true; + } } m_bWidthClipped = true; } @@ -329,10 +347,10 @@ void SwFlyFreeFrame::CheckClip( const SwFormatFrameSize &rSz ) // For Flys with OLE objects as lower, we make sure that // we always resize proportionally - Size aOldSize( Frame().SSize() ); + Size aOldSize( getSwFrame().SSize() ); // First, setup the FrameRect, then transfer it to the Frame. - SwRect aFrameRect( Frame() ); + SwRect aFrameRect( getSwFrame() ); if ( bBot ) { @@ -417,17 +435,27 @@ void SwFlyFreeFrame::CheckClip( const SwFormatFrameSize &rSz ) // Now change the Frame; for columns, we put the new values into the attributes, // otherwise we'll end up with unwanted side-effects/oscillations - const long nPrtHeightDiff = Frame().Height() - Prt().Height(); - const long nPrtWidthDiff = Frame().Width() - Prt().Width(); - maUnclippedFrame = Frame(); - Frame().Height( aFrameRect.Height() ); - Frame().Width ( std::max( long(MINLAY), aFrameRect.Width() ) ); + const long nPrtHeightDiff = getSwFrame().Height() - getSwPrint().Height(); + const long nPrtWidthDiff = getSwFrame().Width() - getSwPrint().Width(); + maUnclippedFrame = getSwFrame(); + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Height( aFrameRect.Height() ); + aFrm.Width ( std::max( long(MINLAY), aFrameRect.Width() ) ); + } + if ( Lower() && Lower()->IsColumnFrame() ) { ColLock(); //lock grow/shrink - const Size aTmpOldSize( Prt().SSize() ); - Prt().Height( Frame().Height() - nPrtHeightDiff ); - Prt().Width ( Frame().Width() - nPrtWidthDiff ); + const Size aTmpOldSize( getSwPrint().SSize() ); + + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Height( getSwFrame().Height() - nPrtHeightDiff ); + aPrt.Width ( getSwFrame().Width() - nPrtWidthDiff ); + } + ChgLowersProp( aTmpOldSize ); SwFrame *pLow = Lower(); do @@ -444,14 +472,15 @@ void SwFlyFreeFrame::CheckClip( const SwFormatFrameSize &rSz ) } else { - Prt().Height( Frame().Height() - nPrtHeightDiff ); - Prt().Width ( Frame().Width() - nPrtWidthDiff ); + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Height( getSwFrame().Height() - nPrtHeightDiff ); + aPrt.Width ( getSwFrame().Width() - nPrtWidthDiff ); } } } // #i26945# - OSL_ENSURE( Frame().Height() >= 0, + OSL_ENSURE( getSwFrame().Height() >= 0, "<SwFlyFreeFrame::CheckClip(..)> - fly frame has negative height now." ); } @@ -925,7 +954,7 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) pClip = pFly->GetAnchorFrame(); } - rRect = pClip->Frame(); + rRect = pClip->getSwFrame(); SwRectFnSet aRectFnSet(pClip); // vertical clipping: Top and Bottom, also to PrtArea if necessary @@ -964,8 +993,8 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) "if you can reproduce this please file a bug"); return false; } - rRect = bMove ? pClipFrame->GetUpper()->Frame() - : pClipFrame->Frame(); + rRect = bMove ? pClipFrame->GetUpper()->getSwFrame() + : pClipFrame->getSwFrame(); // #i26945# - consider that a table, during // its format, can exceed its upper printing area bottom. // Thus, enlarge the clip rectangle, if such a case occurred @@ -973,8 +1002,8 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) { const SwTabFrame* pTabFrame = const_cast<SwFlyFrame*>(pFly) ->GetAnchorFrameContainingAnchPos()->FindTabFrame(); - SwRect aTmp( pTabFrame->Prt() ); - aTmp += pTabFrame->Frame().Pos(); + SwRect aTmp( pTabFrame->getSwPrint() ); + aTmp += pTabFrame->getSwFrame().Pos(); rRect.Union( aTmp ); // #i43913# - consider also the cell frame const SwFrame* pCellFrame = const_cast<SwFlyFrame*>(pFly) @@ -985,8 +1014,8 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) } if ( pCellFrame ) { - aTmp = pCellFrame->Prt(); - aTmp += pCellFrame->Frame().Pos(); + aTmp = pCellFrame->getSwPrint(); + aTmp += pCellFrame->getSwFrame().Pos(); rRect.Union( aTmp ); } } @@ -1001,7 +1030,7 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) aEnvOfObj.GetVertEnvironmentLayoutFrame( *pVertPosOrientFrame ); if ( rV.GetRelationOrient() == text::RelOrientation::PAGE_FRAME ) { - rRect = rVertClipFrame.Frame(); + rRect = rVertClipFrame.getSwFrame(); } else if ( rV.GetRelationOrient() == text::RelOrientation::PAGE_PRINT_AREA ) { @@ -1011,14 +1040,14 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) } else { - rRect = rVertClipFrame.Frame(); + rRect = rVertClipFrame.getSwFrame(); } } const SwLayoutFrame* pHoriClipFrame = pFly->GetAnchorFrame()->FindPageFrame()->GetUpper(); SwRectFnSet aRectFnSet(pFly->GetAnchorFrame()); - aRectFnSet.SetLeft( rRect, aRectFnSet.GetLeft(pHoriClipFrame->Frame()) ); - aRectFnSet.SetRight(rRect, aRectFnSet.GetRight(pHoriClipFrame->Frame())); + aRectFnSet.SetLeft( rRect, aRectFnSet.GetLeft(pHoriClipFrame->getSwFrame()) ); + aRectFnSet.SetRight(rRect, aRectFnSet.GetRight(pHoriClipFrame->getSwFrame())); } else { @@ -1044,8 +1073,8 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) { if ( pUp->IsRootFrame() ) { - rRect = pUp->Prt(); - rRect += pUp->Frame().Pos(); + rRect = pUp->getSwPrint(); + rRect += pUp->getSwFrame().Pos(); pUp = nullptr; } } @@ -1058,7 +1087,7 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) pUp = pPg->FindBodyCont(); if (pUp) { - rRect = pUp->GetUpper()->Frame(); + rRect = pUp->GetUpper()->getSwFrame(); aRectFnSet.SetTop( rRect, aRectFnSet.GetPrtTop(*pUp) ); aRectFnSet.SetBottom(rRect, aRectFnSet.GetPrtBottom(*pUp)); } @@ -1066,7 +1095,7 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) else { if( ( pUp->GetType() & (SwFrameType::Fly | SwFrameType::Ftn ) ) && - !pUp->Frame().IsInside( pFly->Frame().Pos() ) ) + !pUp->getSwFrame().IsInside( pFly->getSwFrame().Pos() ) ) { if( pUp->IsFlyFrame() ) { @@ -1074,7 +1103,7 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) while( pTmpFly->GetNextLink() ) { pTmpFly = pTmpFly->GetNextLink(); - if( pTmpFly->Frame().IsInside( pFly->Frame().Pos() ) ) + if( pTmpFly->getSwFrame().IsInside( pFly->getSwFrame().Pos() ) ) break; } pUp = pTmpFly; @@ -1085,26 +1114,26 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) while( pTmp->GetFollow() ) { pTmp = pTmp->GetFollow(); - if( pTmp->Frame().IsInside( pFly->Frame().Pos() ) ) + if( pTmp->getSwFrame().IsInside( pFly->getSwFrame().Pos() ) ) break; } pUp = pTmp; } } - rRect = pUp->Prt(); - rRect.Pos() += pUp->Frame().Pos(); + rRect = pUp->getSwPrint(); + rRect.Pos() += pUp->getSwFrame().Pos(); if ( pUp->GetType() & (SwFrameType::Header | SwFrameType::Footer) ) { - rRect.Left ( pUp->GetUpper()->Frame().Left() ); - rRect.Width( pUp->GetUpper()->Frame().Width()); + rRect.Left ( pUp->GetUpper()->getSwFrame().Left() ); + rRect.Width( pUp->GetUpper()->getSwFrame().Width()); } else if ( pUp->IsCellFrame() ) //MA_FLY_HEIGHT { const SwFrame *pTab = pUp->FindTabFrame(); aRectFnSet.SetBottom( rRect, aRectFnSet.GetPrtBottom(*pTab->GetUpper()) ); // expand to left and right cell border - rRect.Left ( pUp->Frame().Left() ); - rRect.Width( pUp->Frame().Width() ); + rRect.Left ( pUp->getSwFrame().Left() ); + rRect.Width( pUp->getSwFrame().Width() ); } } } @@ -1112,8 +1141,8 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) { // CellFrames might also sit in unallowed areas. In this case, // the Fly is allowed to do so as well - SwRect aTmp( pCell->Prt() ); - aTmp += pCell->Frame().Pos(); + SwRect aTmp( pCell->getSwPrint() ); + aTmp += pCell->getSwFrame().Pos(); rRect.Union( aTmp ); } } @@ -1124,11 +1153,11 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) SwRectFnSet aRectFnSet(pFly->GetAnchorFrame()); while( pUp->IsColumnFrame() || pUp->IsSctFrame() || pUp->IsColBodyFrame()) pUp = pUp->GetUpper(); - rRect = pUp->Frame(); + rRect = pUp->getSwFrame(); if( !pUp->IsBodyFrame() ) { - rRect += pUp->Prt().Pos(); - rRect.SSize( pUp->Prt().SSize() ); + rRect += pUp->getSwPrint().Pos(); + rRect.SSize( pUp->getSwPrint().SSize() ); if ( pUp->IsCellFrame() ) { const SwFrame *pTab = pUp->FindTabFrame(); @@ -1139,7 +1168,7 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) { // Objects anchored as character may exceed right margin // of body frame: - aRectFnSet.SetRight( rRect, aRectFnSet.GetRight(pUp->GetUpper()->Frame()) ); + aRectFnSet.SetRight( rRect, aRectFnSet.GetRight(pUp->GetUpper()->getSwFrame()) ); } long nHeight = (9*aRectFnSet.GetHeight(rRect))/10; long nTop; @@ -1150,7 +1179,7 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) nTop = aRectFnSet.IsVert() ? static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().X() : static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().Y(); nTop = aRectFnSet.YInc( nTop, -nHeight ); - long nWidth = aRectFnSet.GetWidth(pFly->Frame()); + long nWidth = aRectFnSet.GetWidth(pFly->getSwFrame()); aRectFnSet.SetLeftAndWidth( rRect, aRectFnSet.IsVert() ? static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().Y() : static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().X(), nWidth ); @@ -1158,9 +1187,9 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) } else { - nTop = aRectFnSet.YInc( aRectFnSet.GetBottom(pFly->Frame()), + nTop = aRectFnSet.YInc( aRectFnSet.GetBottom(pFly->getSwFrame()), rUL.GetLower() - nHeight ); - nHeight = 2*nHeight - aRectFnSet.GetHeight(pFly->Frame()) + nHeight = 2*nHeight - aRectFnSet.GetHeight(pFly->getSwFrame()) - rUL.GetLower() - rUL.GetUpper(); } aRectFnSet.SetTopAndHeight( rRect, nTop, nHeight ); @@ -1181,8 +1210,8 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) pAnchorFrame = pC->GetAnchorFrame(); } const SwFrame* pUp = pAnchorFrame->GetUpper(); - rRect = pUp->Prt(); - rRect += pUp->Frame().Pos(); + rRect = pUp->getSwPrint(); + rRect += pUp->getSwFrame().Pos(); SwRectFnSet aRectFnSet(pAnchorFrame); long nHeight = (9*aRectFnSet.GetHeight(rRect))/10; long nTop; @@ -1220,7 +1249,7 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) { // clip frame is the page frame the header/footer is on. const SwFrame* pClipFrame = pAnchorFrame->FindPageFrame(); - rRect = pClipFrame->Frame(); + rRect = pClipFrame->getSwFrame(); } else { diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index d95e755899b2..471f46a851b8 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -80,8 +80,8 @@ bool StackHack::bLocked = false; SwFrameNotify::SwFrameNotify( SwFrame *pF ) : mpFrame( pF ), - maFrame( pF->Frame() ), - maPrt( pF->Prt() ), + maFrame( pF->getSwFrame() ), + maPrt( pF->getSwPrint() ), mbInvaKeep( false ), mbValidSize( pF->GetValidSizeFlag() ) { @@ -102,11 +102,11 @@ SwFrameNotify::SwFrameNotify( SwFrame *pF ) : SwFrameNotify::~SwFrameNotify() COVERITY_NOEXCEPT_FALSE { SwRectFnSet aRectFnSet(mpFrame); - const bool bAbsP = aRectFnSet.PosDiff(maFrame, mpFrame->Frame()); + const bool bAbsP = aRectFnSet.PosDiff(maFrame, mpFrame->getSwFrame()); const bool bChgWidth = - aRectFnSet.GetWidth(maFrame) != aRectFnSet.GetWidth(mpFrame->Frame()); + aRectFnSet.GetWidth(maFrame) != aRectFnSet.GetWidth(mpFrame->getSwFrame()); const bool bChgHeight = - aRectFnSet.GetHeight(maFrame)!=aRectFnSet.GetHeight(mpFrame->Frame()); + aRectFnSet.GetHeight(maFrame)!=aRectFnSet.GetHeight(mpFrame->getSwFrame()); const bool bChgFlyBasePos = mpFrame->IsTextFrame() && ( ( mnFlyAnchorOfst != static_cast<SwTextFrame*>(mpFrame)->GetBaseOfstForFly( true ) ) || ( mnFlyAnchorOfstNoWrap != static_cast<SwTextFrame*>(mpFrame)->GetBaseOfstForFly( false ) ) ); @@ -147,7 +147,7 @@ SwFrameNotify::~SwFrameNotify() COVERITY_NOEXCEPT_FALSE else if ( !pFlow->HasFollow() ) { long nOldHeight = aRectFnSet.GetHeight(maFrame); - long nNewHeight = aRectFnSet.GetHeight(mpFrame->Frame()); + long nNewHeight = aRectFnSet.GetHeight(mpFrame->getSwFrame()); if( (nOldHeight > nNewHeight) || (!nOldHeight && nNewHeight) ) pFlow->CheckKeep(); } @@ -173,7 +173,7 @@ SwFrameNotify::~SwFrameNotify() COVERITY_NOEXCEPT_FALSE // #104100# - correct condition for setting retouche // flag for vertical layout. if( mpFrame->IsRetoucheFrame() && - aRectFnSet.TopDist( maFrame, aRectFnSet.GetTop(mpFrame->Frame()) ) > 0 ) + aRectFnSet.TopDist( maFrame, aRectFnSet.GetTop(mpFrame->getSwFrame()) ) > 0 ) { mpFrame->SetRetouche(); } @@ -190,9 +190,9 @@ SwFrameNotify::~SwFrameNotify() COVERITY_NOEXCEPT_FALSE //For each resize of the background graphics is a repaint necessary. const bool bPrtWidth = - aRectFnSet.GetWidth(maPrt) != aRectFnSet.GetWidth(mpFrame->Prt()); + aRectFnSet.GetWidth(maPrt) != aRectFnSet.GetWidth(mpFrame->getSwPrint()); const bool bPrtHeight = - aRectFnSet.GetHeight(maPrt)!=aRectFnSet.GetHeight(mpFrame->Prt()); + aRectFnSet.GetHeight(maPrt)!=aRectFnSet.GetHeight(mpFrame->getSwPrint()); if ( bPrtWidth || bPrtHeight ) { bool bUseNewFillProperties(false); @@ -227,7 +227,7 @@ SwFrameNotify::~SwFrameNotify() COVERITY_NOEXCEPT_FALSE } } - const bool bPrtP = aRectFnSet.PosDiff( maPrt, mpFrame->Prt() ); + const bool bPrtP = aRectFnSet.PosDiff( maPrt, mpFrame->getSwPrint() ); if ( bAbsP || bPrtP || bChgWidth || bChgHeight || bPrtWidth || bPrtHeight || bChgFlyBasePos ) { @@ -445,7 +445,7 @@ SwLayNotify::~SwLayNotify() SwLayoutFrame *pLay = static_cast<SwLayoutFrame*>(mpFrame); SwRectFnSet aRectFnSet(pLay); bool bNotify = false; - if ( pLay->Prt().SSize() != maPrt.SSize() ) + if ( pLay->getSwPrint().SSize() != maPrt.SSize() ) { if ( !IsLowersComplete() ) { @@ -454,10 +454,10 @@ SwLayNotify::~SwLayNotify() if ( pLay->IsRowFrame() ) { bInvaPercent = true; - long nNew = aRectFnSet.GetHeight(pLay->Prt()); + long nNew = aRectFnSet.GetHeight(pLay->getSwPrint()); if( nNew != aRectFnSet.GetHeight(maPrt) ) static_cast<SwRowFrame*>(pLay)->AdjustCells( nNew, true); - if( aRectFnSet.GetWidth(pLay->Prt()) + if( aRectFnSet.GetWidth(pLay->getSwPrint()) != aRectFnSet.GetWidth(maPrt) ) static_cast<SwRowFrame*>(pLay)->AdjustCells( 0, false ); } @@ -476,8 +476,8 @@ SwLayNotify::~SwLayNotify() if ( pLay->Lower() ) { bLow = !pLay->Lower()->IsColumnFrame() || - aRectFnSet.GetHeight(pLay->Lower()->Frame()) - != aRectFnSet.GetHeight(pLay->Prt()); + aRectFnSet.GetHeight(pLay->Lower()->getSwFrame()) + != aRectFnSet.GetHeight(pLay->getSwPrint()); } else bLow = false; @@ -487,15 +487,15 @@ SwLayNotify::~SwLayNotify() if ( pLay->Lower() ) { if( pLay->Lower()->IsColumnFrame() && pLay->Lower()->GetNext() ) - bLow = pLay->Lower()->Frame().Height() != pLay->Prt().Height(); + bLow = pLay->Lower()->getSwFrame().Height() != pLay->getSwPrint().Height(); else - bLow = pLay->Prt().Width() != maPrt.Width(); + bLow = pLay->getSwPrint().Width() != maPrt.Width(); } else bLow = false; } else if( pLay->IsFooterFrame() && !pLay->HasFixSize() ) - bLow = pLay->Prt().Width() != maPrt.Width(); + bLow = pLay->getSwPrint().Width() != maPrt.Width(); else bLow = true; bInvaPercent = bLow; @@ -507,8 +507,8 @@ SwLayNotify::~SwLayNotify() // can take another frame. As a result, the "possible right one" needs to be // invalidated. This only pays off if this or its Uppers are moveable sections. // A PrtArea has been extended if width or height are larger than before. - if ( (pLay->Prt().Height() > maPrt.Height() || - pLay->Prt().Width() > maPrt.Width()) && + if ( (pLay->getSwPrint().Height() > maPrt.Height() || + pLay->getSwPrint().Width() > maPrt.Width()) && (pLay->IsMoveable() || pLay->IsFlyFrame()) ) { SwFrame *pTmpFrame = pLay->Lower(); @@ -523,7 +523,7 @@ SwLayNotify::~SwLayNotify() bNotify = true; //EXPENSIVE!! But how we do it more elegant? if( bInvaPercent ) - pLay->InvaPercentLowers( pLay->Prt().Height() - maPrt.Height() ); + pLay->InvaPercentLowers( pLay->getSwPrint().Height() - maPrt.Height() ); } if ( pLay->IsTabFrame() ) //So that _only_ the shadow is drawn while resizing. @@ -540,9 +540,9 @@ SwLayNotify::~SwLayNotify() } } //Notify Lower if the position has changed. - const bool bPrtPos = aRectFnSet.PosDiff( maPrt, pLay->Prt() ); - const bool bPos = bPrtPos || aRectFnSet.PosDiff( maFrame, pLay->Frame() ); - const bool bSize = pLay->Frame().SSize() != maFrame.SSize(); + const bool bPrtPos = aRectFnSet.PosDiff( maPrt, pLay->getSwPrint() ); + const bool bPos = bPrtPos || aRectFnSet.PosDiff( maFrame, pLay->getSwFrame() ); + const bool bSize = pLay->getSwFrame().SSize() != maFrame.SSize(); if ( bPos && pLay->Lower() && !IsLowersComplete() ) pLay->Lower()->InvalidatePos(); @@ -645,9 +645,9 @@ SwFlyNotify::~SwFlyNotify() //Have the size or the position changed, //so should the view know this. SwRectFnSet aRectFnSet(pFly); - const bool bPosChgd = aRectFnSet.PosDiff( maFrame, pFly->Frame() ); - const bool bFrameChgd = pFly->Frame().SSize() != maFrame.SSize(); - const bool bPrtChgd = maPrt != pFly->Prt(); + const bool bPosChgd = aRectFnSet.PosDiff( maFrame, pFly->getSwFrame() ); + const bool bFrameChgd = pFly->getSwFrame().SSize() != maFrame.SSize(); + const bool bPrtChgd = maPrt != pFly->getSwPrint(); if ( bPosChgd || bFrameChgd || bPrtChgd ) { pFly->NotifyDrawObj(); @@ -748,8 +748,8 @@ SwContentNotify::~SwContentNotify() pCnt->SetCompletePaint(); SwRectFnSet aRectFnSet(pCnt); - if ( pCnt->IsInTab() && ( aRectFnSet.PosDiff( pCnt->Frame(), maFrame ) || - pCnt->Frame().SSize() != maFrame.SSize())) + if ( pCnt->IsInTab() && ( aRectFnSet.PosDiff( pCnt->getSwFrame(), maFrame ) || + pCnt->getSwFrame().SSize() != maFrame.SSize())) { SwLayoutFrame* pCell = pCnt->GetUpper(); while( !pCell->IsCellFrame() && pCell->GetUpper() ) @@ -823,7 +823,7 @@ SwContentNotify::~SwContentNotify() const bool bNoTextFramePrtAreaChanged = ( maPrt.SSize().Width() != 0 && maPrt.SSize().Height() != 0 ) && - maPrt.SSize() != pCnt->Prt().SSize(); + maPrt.SSize() != pCnt->getSwPrint().SSize(); OSL_ENSURE( pCnt->IsInFly(), "OLE not in FlyFrame" ); SwFlyFrame *pFly = pCnt->FindFlyFrame(); svt::EmbeddedObjectRef& xObj = pNd->GetOLEObj().GetObject(); @@ -850,7 +850,7 @@ SwContentNotify::~SwContentNotify() if ( !pNd->IsOLESizeInvalid() && !pSh->GetDoc()->getIDocumentState().IsUpdateExpField() ) pFESh->CalcAndSetScale( xObj, - &pFly->Prt(), &pFly->Frame(), + &pFly->getSwPrint(), &pFly->getSwFrame(), bNoTextFramePrtAreaChanged ); } } @@ -862,10 +862,10 @@ SwContentNotify::~SwContentNotify() } } //dito animated graphics - if ( Frame().HasArea() && static_cast<SwNoTextFrame*>(pCnt)->HasAnimation() ) + if ( getSwFrame().HasArea() && static_cast<SwNoTextFrame*>(pCnt)->HasAnimation() ) { static_cast<SwNoTextFrame*>(pCnt)->StopAnimation(); - pSh->InvalidateWindows( Frame() ); + pSh->InvalidateWindows( getSwFrame() ); } } } @@ -936,7 +936,7 @@ SwContentNotify::~SwContentNotify() } // #i44049# - if ( pCnt->IsTextFrame() && aRectFnSet.PosDiff( maFrame, pCnt->Frame() ) ) + if ( pCnt->IsTextFrame() && aRectFnSet.PosDiff( maFrame, pCnt->getSwFrame() ) ) { pCnt->InvalidateObjs(); } @@ -1120,13 +1120,19 @@ static void lcl_SetPos( SwFrame& _rNewFrame, const SwLayoutFrame& _rLayFrame ) { SwRectFnSet aRectFnSet(&_rLayFrame); - aRectFnSet.SetPos( _rNewFrame.Frame(), aRectFnSet.GetPos(_rLayFrame.Frame()) ); + SwFrameRect::FrameWriteAccess aFrm(_rNewFrame); + aRectFnSet.SetPos( aFrm, aRectFnSet.GetPos(_rLayFrame.getSwFrame()) ); + // move position by one SwTwip in text flow direction in order to get // notifications for a new calculated position after its formatting. if ( aRectFnSet.IsVert() ) - _rNewFrame.Frame().Pos().X() -= 1; + { + aFrm.Pos().X() -= 1; + } else - _rNewFrame.Frame().Pos().Y() += 1; + { + aFrm.Pos().Y() += 1; + } } void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc, @@ -2510,7 +2516,7 @@ void RestoreContent( SwFrame *pSav, SwLayoutFrame *pParent, SwFrame *pSibling ) SwFrame* pLast; do { pSav->mpUpper = pParent; - nGrowVal += aRectFnSet.GetHeight(pSav->Frame()); + nGrowVal += aRectFnSet.GetHeight(pSav->getSwFrame()); pSav->InvalidateAll_(); // register Flys, if TextFrames than also invalidate appropriately @@ -2734,7 +2740,7 @@ void Notify( SwFlyFrame *pFly, SwPageFrame *pOld, const SwRect &rOld, pFly->NotifyBackground( pOld, aTmp, PREP_FLY_CHGD ); } } - else if ( pOldPrt && *pOldPrt != pFly->Prt() && + else if ( pOldPrt && *pOldPrt != pFly->getSwPrint() && pFly->GetFormat()->GetSurround().IsContour() ) { // #i24097# @@ -2749,10 +2755,10 @@ static void lcl_CheckFlowBack( SwFrame* pFrame, const SwRect &rRect ) { if( pFrame->IsLayoutFrame() ) { - if( rRect.IsOver( pFrame->Frame() ) ) + if( rRect.IsOver( pFrame->getSwFrame() ) ) lcl_CheckFlowBack( static_cast<SwLayoutFrame*>(pFrame)->Lower(), rRect ); } - else if( !pFrame->GetNext() && nBottom > pFrame->Frame().Bottom() ) + else if( !pFrame->GetNext() && nBottom > pFrame->getSwFrame().Bottom() ) { if( pFrame->IsContentFrame() && static_cast<SwContentFrame*>(pFrame)->HasFollow() ) pFrame->InvalidateSize(); @@ -2768,8 +2774,8 @@ static void lcl_NotifyContent( const SdrObject *pThis, SwContentFrame *pCnt, { if ( pCnt->IsTextFrame() ) { - SwRect aCntPrt( pCnt->Prt() ); - aCntPrt.Pos() += pCnt->Frame().Pos(); + SwRect aCntPrt( pCnt->getSwPrint() ); + aCntPrt.Pos() += pCnt->getSwFrame().Pos(); if ( eHint == PREP_FLY_ATTR_CHG ) { // #i35640# - use given rectangle <rRect> instead @@ -2890,8 +2896,8 @@ void Notify_Background( const SdrObject* pObj, // instead of <GetCurrentBoundRect()>, because a recalculation // of the bounding rectangle isn't intended here. if (!isValidTableBeforeAnchor - && (pTab->Frame().IsOver(pObj->GetLastBoundRect()) || - pTab->Frame().IsOver(rRect))) + && (pTab->getSwFrame().IsOver(pObj->GetLastBoundRect()) || + pTab->getSwFrame().IsOver(rRect))) { if ( !pFlyFrame || !pFlyFrame->IsLowerOf( pTab ) ) pTab->InvalidatePrt(); @@ -2902,8 +2908,8 @@ void Notify_Background( const SdrObject* pObj, // instead of <GetCurrentBoundRect()>, because a recalculation // of the bounding rectangle isn't intended here. if (!isValidTableBeforeAnchor && pCell->IsCellFrame() && - ( pCell->Frame().IsOver( pObj->GetLastBoundRect() ) || - pCell->Frame().IsOver( rRect ) ) ) + ( pCell->getSwFrame().IsOver( pObj->GetLastBoundRect() ) || + pCell->getSwFrame().IsOver( rRect ) ) ) { const SwFormatVertOrient &rOri = pCell->GetFormat()->GetVertOrient(); if ( text::VertOrientation::NONE != rOri.GetVertOrient() ) @@ -2924,7 +2930,7 @@ void Notify_Background( const SdrObject* pObj, if( pAnchoredObj->GetDrawObj() == pObj ) continue; SwFlyFrame *pFly = static_cast<SwFlyFrame*>(pAnchoredObj); - if ( pFly->Frame().Top() == FAR_AWAY ) + if ( pFly->getSwFrame().Top() == FAR_AWAY ) continue; if ( !pFlyFrame || @@ -2941,10 +2947,10 @@ void Notify_Background( const SdrObject* pObj, if( pFly->IsFlyLayFrame() ) { if( pFly->Lower() && pFly->Lower()->IsColumnFrame() && - pFly->Frame().Bottom() >= rRect.Top() && - pFly->Frame().Top() <= rRect.Bottom() && - pFly->Frame().Right() >= rRect.Left() && - pFly->Frame().Left() <= rRect.Right() ) + pFly->getSwFrame().Bottom() >= rRect.Top() && + pFly->getSwFrame().Top() <= rRect.Bottom() && + pFly->getSwFrame().Right() >= rRect.Left() && + pFly->getSwFrame().Left() <= rRect.Right() ) { pFly->InvalidateSize(); } @@ -2961,8 +2967,8 @@ void Notify_Background( const SdrObject* pObj, if ( text::HoriOrientation::NONE != rH.GetHoriOrient() && text::HoriOrientation::CENTER != rH.GetHoriOrient() && ( !pFly->IsAutoPos() || text::RelOrientation::CHAR != rH.GetRelationOrient() ) && - (pFly->Frame().Bottom() >= rRect.Top() && - pFly->Frame().Top() <= rRect.Bottom()) ) + (pFly->getSwFrame().Bottom() >= rRect.Top() && + pFly->getSwFrame().Top() <= rRect.Bottom()) ) pFly->InvalidatePos(); } } @@ -2987,14 +2993,14 @@ const SwFrame* GetVirtualUpper( const SwFrame* pFrame, const Point& rPos ) if( pFrame->IsTextFrame() ) { pFrame = pFrame->GetUpper(); - if( !pFrame->Frame().IsInside( rPos ) ) + if( !pFrame->getSwFrame().IsInside( rPos ) ) { if( pFrame->IsFootnoteFrame() ) { const SwFootnoteFrame* pTmp = static_cast<const SwFootnoteFrame*>(pFrame)->GetFollow(); while( pTmp ) { - if( pTmp->Frame().IsInside( rPos ) ) + if( pTmp->getSwFrame().IsInside( rPos ) ) return pTmp; pTmp = pTmp->GetFollow(); } @@ -3004,7 +3010,7 @@ const SwFrame* GetVirtualUpper( const SwFrame* pFrame, const Point& rPos ) SwFlyFrame* pTmp = const_cast<SwFlyFrame*>(pFrame->FindFlyFrame()); while( pTmp ) { - if( pTmp->Frame().IsInside( rPos ) ) + if( pTmp->getSwFrame().IsInside( rPos ) ) return pTmp; pTmp = pTmp->GetNextLink(); } @@ -3022,7 +3028,7 @@ bool Is_Lower_Of(const SwFrame *pCurrFrame, const SdrObject* pObj) { const SwFlyFrame* pFly = pFlyDrawObj->GetFlyFrame(); pFrame = pFly->GetAnchorFrame(); - aPos = pFly->Frame().Pos(); + aPos = pFly->getSwFrame().Pos(); } else { @@ -3036,7 +3042,7 @@ bool Is_Lower_Of(const SwFrame *pCurrFrame, const SdrObject* pObj) return true; if( pFrame->IsFlyFrame() ) { - aPos = pFrame->Frame().Pos(); + aPos = pFrame->getSwFrame().Pos(); pFrame = GetVirtualUpper( static_cast<const SwFlyFrame*>(pFrame)->GetAnchorFrame(), aPos ); } else @@ -3077,7 +3083,7 @@ bool IsFrameInSameContext( const SwFrame *pInnerFrame, const SwFrame *pFrame ) } if( pFrame->IsFlyFrame() ) { - Point aPos( pFrame->Frame().Pos() ); + Point aPos( pFrame->getSwFrame().Pos() ); pFrame = GetVirtualUpper( static_cast<const SwFlyFrame*>(pFrame)->GetAnchorFrame(), aPos ); } else @@ -3095,9 +3101,9 @@ static SwTwips lcl_CalcCellRstHeight( SwLayoutFrame *pCell ) long nHeight = 0, nFlyAdd = 0; do { - long nLow = pLow->Frame().Height(); + long nLow = pLow->getSwFrame().Height(); if( pLow->IsTextFrame() && static_cast<SwTextFrame*>(pLow)->IsUndersized() ) - nLow += static_cast<SwTextFrame*>(pLow)->GetParHeight()-pLow->Prt().Height(); + nLow += static_cast<SwTextFrame*>(pLow)->GetParHeight()-pLow->getSwPrint().Height(); else if( pLow->IsSctFrame() && static_cast<SwSectionFrame*>(pLow)->IsUndersized() ) nLow += static_cast<SwSectionFrame*>(pLow)->Undersize(); nFlyAdd = std::max( 0L, nFlyAdd - nLow ); @@ -3113,7 +3119,7 @@ static SwTwips lcl_CalcCellRstHeight( SwLayoutFrame *pCell ) const SwBorderAttrs &rAttrs = *aAccess.Get(); nHeight += rAttrs.CalcTop() + rAttrs.CalcBottom(); - return pCell->Frame().Height() - nHeight; + return pCell->getSwFrame().Height() - nHeight; } else { @@ -3142,7 +3148,7 @@ SwTwips CalcRowRstHeight( SwLayoutFrame *pRow ) const SwFrame* FindPage( const SwRect &rRect, const SwFrame *pPage ) { - if ( !rRect.IsOver( pPage->Frame() ) ) + if ( !rRect.IsOver( pPage->getSwFrame() ) ) { const SwRootFrame* pRootFrame = static_cast<const SwRootFrame*>(pPage->GetUpper()); const SwFrame* pTmpPage = pRootFrame ? pRootFrame->GetPageAtPos( rRect.TopLeft(), &rRect.SSize(), true ) : nullptr; @@ -3233,8 +3239,8 @@ SwFrame* GetFrameOfModify( const SwRootFrame* pLayout, SwModify const& rMod, SwF // Note: The Writer fly frame could be the frame itself. SwFlyFrame* pFlyFrame( pTmpFrame->FindFlyFrame() ); if ( pFlyFrame && - pFlyFrame->Frame().Pos().X() == FAR_AWAY && - pFlyFrame->Frame().Pos().Y() == FAR_AWAY ) + pFlyFrame->getSwFrame().Pos().X() == FAR_AWAY && + pFlyFrame->getSwFrame().Pos().Y() == FAR_AWAY ) { SwObjectFormatter::FormatObj( *pFlyFrame ); } @@ -3254,11 +3260,11 @@ SwFrame* GetFrameOfModify( const SwRootFrame* pLayout, SwModify const& rMod, SwF // for Flys go via the parent if the Fly is not yet "formatted" if( !bCalcFrame && pTmpFrame->GetType() & SwFrameType::Fly && static_cast<SwFlyFrame*>(pTmpFrame)->GetAnchorFrame() && - FAR_AWAY == pTmpFrame->Frame().Pos().getX() && - FAR_AWAY == pTmpFrame->Frame().Pos().getY() ) - aCalcRect = static_cast<SwFlyFrame*>(pTmpFrame)->GetAnchorFrame()->Frame(); + FAR_AWAY == pTmpFrame->getSwFrame().Pos().getX() && + FAR_AWAY == pTmpFrame->getSwFrame().Pos().getY() ) + aCalcRect = static_cast<SwFlyFrame*>(pTmpFrame)->GetAnchorFrame()->getSwFrame(); else - aCalcRect = pTmpFrame->Frame(); + aCalcRect = pTmpFrame->getSwFrame(); if ( aCalcRect.IsInside( *pPoint ) ) { @@ -3304,8 +3310,8 @@ bool IsExtraData( const SwDoc *pDoc ) // OD 22.09.2003 #110978# const SwRect SwPageFrame::PrtWithoutHeaderAndFooter() const { - SwRect aPrtWithoutHeaderFooter( Prt() ); - aPrtWithoutHeaderFooter.Pos() += Frame().Pos(); + SwRect aPrtWithoutHeaderFooter( getSwPrint() ); + aPrtWithoutHeaderFooter.Pos() += getSwFrame().Pos(); const SwFrame* pLowerFrame = Lower(); while ( pLowerFrame ) @@ -3315,12 +3321,12 @@ const SwRect SwPageFrame::PrtWithoutHeaderAndFooter() const if ( pLowerFrame->IsHeaderFrame() ) { aPrtWithoutHeaderFooter.Top( aPrtWithoutHeaderFooter.Top() + - pLowerFrame->Frame().Height() ); + pLowerFrame->getSwFrame().Height() ); } if ( pLowerFrame->IsFooterFrame() ) { aPrtWithoutHeaderFooter.Bottom( aPrtWithoutHeaderFooter.Bottom() - - pLowerFrame->Frame().Height() ); + pLowerFrame->getSwFrame().Height() ); } pLowerFrame = pLowerFrame->GetNext(); diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index d1a973f03033..a1b8dcef7768 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() - - aRectFnSet.GetHeight(pFrame->Prt()); + aRectFnSet.GetHeight(pFrame->getSwPrint()); if( nRet < 0 ) nRet = 0; } @@ -191,11 +191,16 @@ void SwFootnoteContFrame::Format( vcl::RenderContext* /*pRenderContext*/, const if ( !mbValidPrtArea ) { mbValidPrtArea = true; - aRectFnSet.SetTop( Prt(), nBorder ); - aRectFnSet.SetWidth( Prt(), aRectFnSet.GetWidth(Frame()) ); - aRectFnSet.SetHeight(Prt(), aRectFnSet.GetHeight(Frame()) - nBorder ); - if( aRectFnSet.GetHeight(Prt()) < 0 && !pPage->IsFootnotePage() ) + SwFrameRect::PrintWriteAccess aPrt(*this); + + aRectFnSet.SetTop( aPrt, nBorder ); + aRectFnSet.SetWidth( aPrt, aRectFnSet.GetWidth(getSwFrame()) ); + aRectFnSet.SetHeight(aPrt, aRectFnSet.GetHeight(getSwFrame()) - nBorder ); + + if( aRectFnSet.GetHeight(aPrt) < 0 && !pPage->IsFootnotePage() ) + { mbValidSize = false; + } } if ( !mbValidSize ) @@ -219,7 +224,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 += aRectFnSet.GetHeight(pFrame->Frame()) + lcl_Undersize( pFrame ); + nRemaining += aRectFnSet.GetHeight(pFrame->getSwFrame()) + lcl_Undersize( pFrame ); pFrame = pFrame->GetNext(); } // add the own border @@ -228,16 +233,20 @@ void SwFootnoteContFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwTwips nDiff; if( IsInSct() ) { - nDiff = -aRectFnSet.BottomDist( Frame(), aRectFnSet.GetPrtBottom(*GetUpper()) ); + nDiff = -aRectFnSet.BottomDist( getSwFrame(), aRectFnSet.GetPrtBottom(*GetUpper()) ); if( nDiff > 0 ) { - if( nDiff > aRectFnSet.GetHeight(Frame()) ) - nDiff = aRectFnSet.GetHeight(Frame()); - aRectFnSet.AddBottom( Frame(), -nDiff ); - aRectFnSet.AddHeight( Prt(), -nDiff ); + if( nDiff > aRectFnSet.GetHeight(getSwFrame()) ) + { + nDiff = aRectFnSet.GetHeight(getSwFrame()); + } + + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.AddBottom( aFrm, -nDiff ); + aRectFnSet.AddHeight( aFrm, -nDiff ); } } - nDiff = aRectFnSet.GetHeight(Frame()) - nRemaining; + nDiff = aRectFnSet.GetHeight(getSwFrame()) - nRemaining; if ( nDiff > 0 ) Shrink( nDiff ); else if ( nDiff < 0 ) @@ -246,12 +255,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 = aRectFnSet.GetHeight(Prt()); + SwTwips nPrtHeight = aRectFnSet.GetHeight(getSwPrint()); if( nPrtHeight < 0 ) { - const SwTwips nTmpDiff = std::max( aRectFnSet.GetTop(Prt()), - -nPrtHeight ); - aRectFnSet.SubTop( Prt(), nTmpDiff ); + const SwTwips nTmpDiff = std::max( aRectFnSet.GetTop(getSwPrint()), -nPrtHeight ); + SwFrameRect::PrintWriteAccess aPrt(*this); + aRectFnSet.SubTop( aPrt, nTmpDiff ); } } } @@ -267,9 +276,9 @@ SwTwips SwFootnoteContFrame::GrowFrame( SwTwips nDist, bool bTst, bool ) assert(GetUpper() && GetUpper()->IsFootnoteBossFrame()); SwRectFnSet aRectFnSet(this); - if( aRectFnSet.GetHeight(Frame()) > 0 && - nDist > ( LONG_MAX - aRectFnSet.GetHeight(Frame()) ) ) - nDist = LONG_MAX - aRectFnSet.GetHeight(Frame()); + if( aRectFnSet.GetHeight(getSwFrame()) > 0 && + nDist > ( LONG_MAX - aRectFnSet.GetHeight(getSwFrame()) ) ) + nDist = LONG_MAX - aRectFnSet.GetHeight(getSwFrame()); SwFootnoteBossFrame *pBoss = static_cast<SwFootnoteBossFrame*>(GetUpper()); if( IsInSct() ) @@ -293,7 +302,7 @@ SwTwips SwFootnoteContFrame::GrowFrame( SwTwips nDist, bool bTst, bool ) if ( pBoss->GetMaxFootnoteHeight() != LONG_MAX ) { nDist = std::min( nDist, pBoss->GetMaxFootnoteHeight() - - aRectFnSet.GetHeight(Frame()) ); + - aRectFnSet.GetHeight(getSwFrame()) ); if ( nDist <= 0 ) return 0L; } @@ -307,17 +316,17 @@ SwTwips SwFootnoteContFrame::GrowFrame( SwTwips nDist, bool bTst, bool ) return 0L; } } - else if( nDist > aRectFnSet.GetHeight(GetPrev()->Frame()) ) + else if( nDist > aRectFnSet.GetHeight(GetPrev()->getSwFrame()) ) // do not use more space than the body has - nDist = aRectFnSet.GetHeight(GetPrev()->Frame()); + nDist = aRectFnSet.GetHeight(GetPrev()->getSwFrame()); long nAvail = 0; if ( bBrowseMode ) { - nAvail = GetUpper()->Prt().Height(); + nAvail = GetUpper()->getSwPrint().Height(); const SwFrame *pAvail = GetUpper()->Lower(); do - { nAvail -= pAvail->Frame().Height(); + { nAvail -= pAvail->getSwFrame().Height(); pAvail = pAvail->GetNext(); } while ( pAvail ); if ( nAvail > nDist ) @@ -326,10 +335,13 @@ SwTwips SwFootnoteContFrame::GrowFrame( SwTwips nDist, bool bTst, bool ) if ( !bTst ) { - aRectFnSet.SetHeight( Frame(), aRectFnSet.GetHeight(Frame()) + nDist ); + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.SetHeight( aFrm, aRectFnSet.GetHeight(aFrm) + nDist ); if( IsVertical() && !IsVertLR() && !IsReverse() ) - Frame().Pos().X() -= nDist; + { + aFrm.Pos().X() -= nDist; + } } long nGrow = nDist - nAvail, nReal = 0; @@ -368,11 +380,15 @@ SwTwips SwFootnoteContFrame::GrowFrame( SwTwips nDist, bool bTst, bool ) if ( nReal != nDist ) { nDist -= nReal; + // We can only respect the boundless wish so much - Frame().SSize().Height() -= nDist; + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.SSize().Height() -= nDist; if( IsVertical() && !IsVertLR() && !IsReverse() ) - Frame().Pos().X() += nDist; + { + aFrm.Pos().X() += nDist; + } } // growing happens upwards, so successors to not need to be invalidated @@ -496,8 +512,8 @@ void SwFootnoteFrame::Cut() pSect->InvalidateSize_(); } else - { if ( Frame().Height() ) - pUp->Shrink( Frame().Height() ); + { if ( getSwFrame().Height() ) + pUp->Shrink( getSwFrame().Height() ); pUp->SetCompletePaint(); pUp->InvalidatePage(); } @@ -517,15 +533,15 @@ void SwFootnoteFrame::Paste( SwFrame* pParent, SwFrame* pSibling ) InsertBefore( static_cast<SwLayoutFrame*>(pParent), pSibling ); SwRectFnSet aRectFnSet(this); - if( aRectFnSet.GetWidth(Frame())!=aRectFnSet.GetWidth(pParent->Prt()) ) + if( aRectFnSet.GetWidth(getSwFrame())!=aRectFnSet.GetWidth(pParent->getSwPrint()) ) InvalidateSize_(); InvalidatePos_(); SwPageFrame *pPage = FindPageFrame(); InvalidatePage( pPage ); if ( GetNext() ) GetNext()->InvalidatePos_(); - if( aRectFnSet.GetHeight(Frame()) ) - pParent->Grow( aRectFnSet.GetHeight(Frame()) ); + if( aRectFnSet.GetHeight(getSwFrame()) ) + pParent->Grow( aRectFnSet.GetHeight(getSwFrame()) ); // If the predecessor is the master and/or the successor is the Follow, // then take their content and destroy them. @@ -1900,19 +1916,40 @@ void SwFootnoteBossFrame::MoveFootnotes_( SwFootnoteFrames &rFootnoteArr, bool b while( pTmp && static_cast<SwLayoutFrame*>(pCnt)->IsAnLower( pTmp ) ) { pTmp->Prepare( PREP_MOVEFTN ); - aRectFnSet.SetHeight(pTmp->Frame(), 0); - aRectFnSet.SetHeight(pTmp->Prt(), 0); + + SwFrameRect::FrameWriteAccess aFrm(*pTmp); + aRectFnSet.SetHeight(aFrm, 0); + + SwFrameRect::PrintWriteAccess aPrt(*pTmp); + aRectFnSet.SetHeight(aPrt, 0); + pTmp = pTmp->FindNext(); } } else + { pCnt->Prepare( PREP_MOVEFTN ); - aRectFnSet.SetHeight(pCnt->Frame(), 0); - aRectFnSet.SetHeight(pCnt->Prt(), 0); + } + + SwFrameRect::FrameWriteAccess aFrm(*pCnt); + aRectFnSet.SetHeight(aFrm, 0); + + SwFrameRect::PrintWriteAccess aPrt(*pCnt); + aRectFnSet.SetHeight(aPrt, 0); + pCnt = pCnt->GetNext(); } - aRectFnSet.SetHeight(pFootnote->Frame(), 0); - aRectFnSet.SetHeight(pFootnote->Prt(), 0); + + { + SwFrameRect::FrameWriteAccess aFrm(*pFootnote); + aRectFnSet.SetHeight(aFrm, 0); + } + + { + SwFrameRect::PrintWriteAccess aPrt(*pFootnote); + aRectFnSet.SetHeight(aPrt, 0); + } + pFootnote->Calc(getRootFrame()->GetCurrShell()->GetOut()); pFootnote->GetUpper()->Calc(getRootFrame()->GetCurrShell()->GetOut()); @@ -2175,7 +2212,7 @@ void SwFootnoteBossFrame::RearrangeFootnotes( const SwTwips nDeadLine, const boo { SwRectFnSet aRectFnSet(this); SwFrame* pFootnoteContFrame = pFootnoteFrame->GetUpper(); - if ( aRectFnSet.TopDist(pFootnoteFrame->Frame(), aRectFnSet.GetPrtBottom(*pFootnoteContFrame)) > 0 ) + if ( aRectFnSet.TopDist(pFootnoteFrame->getSwFrame(), aRectFnSet.GetPrtBottom(*pFootnoteContFrame)) > 0 ) { pFootnoteFrame->InvalidatePos_(); } @@ -2366,10 +2403,10 @@ void SwFootnoteBossFrame::SetFootnoteDeadLine( const SwTwips nDeadLine ) if ( pCont ) { pCont->Calc(getRootFrame()->GetCurrShell()->GetOut()); - m_nMaxFootnoteHeight = -aRectFnSet.BottomDist( pCont->Frame(), nDeadLine ); + m_nMaxFootnoteHeight = -aRectFnSet.BottomDist( pCont->getSwFrame(), nDeadLine ); } else - m_nMaxFootnoteHeight = -aRectFnSet.BottomDist( pBody->Frame(), nDeadLine ); + m_nMaxFootnoteHeight = -aRectFnSet.BottomDist( pBody->getSwFrame(), nDeadLine ); const SwViewShell *pSh = getRootFrame() ? getRootFrame()->GetCurrShell() : nullptr; if( pSh && pSh->GetViewOptions()->getBrowseMode() ) @@ -2400,7 +2437,7 @@ SwTwips SwFootnoteBossFrame::GetVarSpace() const { nRet = 0; SwTwips nTmp = aRectFnSet.YDiff( aRectFnSet.GetPrtTop(*pBody), - aRectFnSet.GetTop(Frame()) ); + aRectFnSet.GetTop(getSwFrame()) ); const SwSectionFrame* pSect = FindSctFrame(); // Endnotes in a ftncontainer causes a deadline: // the bottom of the last contentfrm @@ -2423,8 +2460,8 @@ SwTwips SwFootnoteBossFrame::GetVarSpace() const while( pFrame->GetNext() ) pFrame = pFrame->GetNext(); // last cntntfrm nTmp += aRectFnSet.YDiff( - aRectFnSet.GetTop(Frame()), - aRectFnSet.GetBottom(pFrame->Frame()) ); + aRectFnSet.GetTop(getSwFrame()), + aRectFnSet.GetBottom(pFrame->getSwFrame()) ); } break; } @@ -2436,8 +2473,8 @@ SwTwips SwFootnoteBossFrame::GetVarSpace() const nRet = nTmp; } else - nRet = - aRectFnSet.GetHeight(pPg->Prt())/5; - nRet += aRectFnSet.GetHeight(pBody->Frame()); + nRet = - aRectFnSet.GetHeight(pPg->getSwPrint())/5; + nRet += aRectFnSet.GetHeight(pBody->getSwFrame()); if( nRet < 0 ) nRet = 0; } @@ -2447,7 +2484,7 @@ SwTwips SwFootnoteBossFrame::GetVarSpace() const { const SwViewShell *pSh = getRootFrame() ? getRootFrame()->GetCurrShell() : nullptr; if( pSh && pSh->GetViewOptions()->getBrowseMode() ) - nRet += BROWSE_HEIGHT - Frame().Height(); + nRet += BROWSE_HEIGHT - getSwFrame().Height(); } return nRet; } @@ -2700,8 +2737,12 @@ bool SwContentFrame::MoveFootnoteCntFwd( bool bMakePage, SwFootnoteBossFrame *pO pNewUp = new SwSectionFrame( *pSect, false ); pNewUp->InsertBefore( pTmpFootnote, pTmpFootnote->Lower() ); static_cast<SwSectionFrame*>(pNewUp)->Init(); - pNewUp->Frame().Pos() = pTmpFootnote->Frame().Pos(); - pNewUp->Frame().Pos().Y() += 1; // for notifications + + { + SwFrameRect::FrameWriteAccess aFrm(*pNewUp); + aFrm.Pos() = pTmpFootnote->getSwFrame().Pos(); + aFrm.Pos().Y() += 1; // for notifications + } // If the section frame has a successor then the latter needs // to be moved behind the new Follow of the section frame. diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx index 150730c3423b..6a066db2db36 100644 --- a/sw/source/core/layout/hffrm.cxx +++ b/sw/source/core/layout/hffrm.cxx @@ -61,12 +61,12 @@ static SwTwips lcl_CalcContentHeight(SwLayoutFrame & frm) { SwTwips nTmp; - nTmp = pFrame->Frame().Height(); + nTmp = pFrame->getSwFrame().Height(); nRemaining += nTmp; if( pFrame->IsTextFrame() && static_cast<SwTextFrame*>(pFrame)->IsUndersized() ) { nTmp = static_cast<SwTextFrame*>(pFrame)->GetParHeight() - - pFrame->Prt().Height(); + - pFrame->getSwPrint().Height(); // This TextFrame would like to be a bit bigger nRemaining += nTmp; } @@ -85,9 +85,9 @@ static void lcl_LayoutFrameEnsureMinHeight(SwLayoutFrame & rFrame) { SwTwips nMinHeight = lcl_GetFrameMinHeight(rFrame); - if (rFrame.Frame().Height() < nMinHeight) + if (rFrame.getSwFrame().Height() < nMinHeight) { - rFrame.Grow(nMinHeight - rFrame.Frame().Height()); + rFrame.Grow(nMinHeight - rFrame.getSwFrame().Height()); } } @@ -171,38 +171,47 @@ void SwHeadFootFrame::FormatPrt(SwTwips & nUL, const SwBorderAttrs * pAttrs) /* set print area */ // OD 23.01.2003 #106895# - add first parameter to <SwBorderAttrs::CalcRight(..)> SwTwips nLR = pAttrs->CalcLeft( this ) + pAttrs->CalcRight( this ); + SwFrameRect::PrintWriteAccess aPrt(*this); - maPrt.Left(pAttrs->CalcLeft(this)); + aPrt.Left(pAttrs->CalcLeft(this)); if (IsHeaderFrame()) - maPrt.Top(pAttrs->CalcTop()); + { + aPrt.Top(pAttrs->CalcTop()); + } else - maPrt.Top(nSpace); + { + aPrt.Top(nSpace); + } - maPrt.Width(maFrame.Width() - nLR); + aPrt.Width(getSwFrame().Width() - nLR); SwTwips nNewHeight; - if (nUL < maFrame.Height()) - nNewHeight = maFrame.Height() - nUL; + if (nUL < getSwFrame().Height()) + { + nNewHeight = getSwFrame().Height() - nUL; + } else + { nNewHeight = 0; + } - maPrt.Height(nNewHeight); + aPrt.Height(nNewHeight); } else { // Set position - maPrt.Left( pAttrs->CalcLeft( this ) ); - maPrt.Top ( pAttrs->CalcTop() ); + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Left( pAttrs->CalcLeft( this ) ); + aPrt.Top ( pAttrs->CalcTop() ); // Set sizes - the sizes are given by the surrounding Frame, just // subtract the borders. // OD 23.01.2003 #106895# - add first parameter to <SwBorderAttrs::CalcRight(..)> SwTwips nLR = pAttrs->CalcLeft( this ) + pAttrs->CalcRight( this ); - maPrt.Width ( maFrame.Width() - nLR ); - maPrt.Height( maFrame.Height()- nUL ); - + aPrt.Width ( getSwFrame().Width() - nLR ); + aPrt.Height( getSwFrame().Height()- nUL ); } mbValidPrtArea = true; @@ -235,14 +244,14 @@ void SwHeadFootFrame::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs) do { - nOldHeight = Prt().Height(); + nOldHeight = getSwPrint().Height(); SwFrame* pFrame = Lower(); // #i64301# if ( pFrame && - aOldFooterPrtPos != ( Frame().Pos() + Prt().Pos() ) ) + aOldFooterPrtPos != ( getSwFrame().Pos() + getSwPrint().Pos() ) ) { pFrame->InvalidatePos_(); - aOldFooterPrtPos = Frame().Pos() + Prt().Pos(); + aOldFooterPrtPos = getSwFrame().Pos() + getSwPrint().Pos(); } int nLoopControl = 0; while( pFrame ) @@ -279,13 +288,13 @@ void SwHeadFootFrame::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs) while ( pFrame ) { - nRemaining += pFrame->Frame().Height(); + nRemaining += pFrame->getSwFrame().Height(); if( pFrame->IsTextFrame() && static_cast<SwTextFrame*>(pFrame)->IsUndersized() ) // This TextFrame would like to be a bit bigger nRemaining += static_cast<SwTextFrame*>(pFrame)->GetParHeight() - - pFrame->Prt().Height(); + - pFrame->getSwPrint().Height(); else if( pFrame->IsSctFrame() && static_cast<SwSectionFrame*>(pFrame)->IsUndersized() ) nRemaining += static_cast<SwSectionFrame*>(pFrame)->Undersize(); @@ -362,19 +371,22 @@ void SwHeadFootFrame::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs) else break; // Don't overwrite the lower edge of the upper - if ( GetUpper() && Frame().Height() ) + if ( GetUpper() && getSwFrame().Height() ) { - const SwTwips nDeadLine = GetUpper()->Frame().Top() + - GetUpper()->Prt().Bottom(); - const SwTwips nBot = Frame().Bottom(); + const SwTwips nDeadLine = GetUpper()->getSwFrame().Top() + GetUpper()->getSwPrint().Bottom(); + const SwTwips nBot = getSwFrame().Bottom(); + if ( nBot > nDeadLine ) { - Frame().Bottom( nDeadLine ); - Prt().SSize().Height() = Frame().Height() - nBorder; + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Bottom( nDeadLine ); + + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.SSize().Height() = getSwFrame().Height() - nBorder; } } mbValidSize = mbValidPrtArea = true; - } while( nRemaining<=nMaxHeight && nOldHeight!=Prt().Height() ); + } while( nRemaining<=nMaxHeight && nOldHeight!=getSwPrint().Height() ); ColUnlock(); } mbValidSize = mbValidPrtArea = true; @@ -383,8 +395,8 @@ void SwHeadFootFrame::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs) { do { - if ( Frame().Height() != pAttrs->GetSize().Height() ) - ChgSize( Size( Frame().Width(), pAttrs->GetSize().Height())); + if ( getSwFrame().Height() != pAttrs->GetSize().Height() ) + ChgSize( Size( getSwFrame().Width(), pAttrs->GetSize().Height())); mbValidSize = true; MakePos(); } while ( !mbValidSize ); @@ -444,9 +456,9 @@ SwTwips SwHeadFootFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) /* calculate maximum eatable spacing */ if (IsHeaderFrame()) - nMaxEat = maFrame.Height() - maPrt.Top() - maPrt.Height() - pAttrs->CalcBottomLine(); + nMaxEat = getSwFrame().Height() - getSwPrint().Top() - getSwPrint().Height() - pAttrs->CalcBottomLine(); else - nMaxEat = maPrt.Top() - pAttrs->CalcTopLine(); + nMaxEat = getSwPrint().Top() - pAttrs->CalcTopLine(); if (nMaxEat < 0) nMaxEat = 0; @@ -454,7 +466,7 @@ SwTwips SwHeadFootFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) /* If the frame is too small, eat less spacing thus letting the frame grow more. */ SwTwips nMinHeight = lcl_GetFrameMinHeight(*this); - SwTwips nFrameTooSmall = nMinHeight - Frame().Height(); + SwTwips nFrameTooSmall = nMinHeight - getSwFrame().Height(); if (nFrameTooSmall > 0) nEat -= nFrameTooSmall; @@ -475,8 +487,9 @@ SwTwips SwHeadFootFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) { if (! IsHeaderFrame()) { - maPrt.Top(maPrt.Top() - nEat); - maPrt.Height(maPrt.Height() - nEat); + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Top(aPrt.Top() - nEat); + aPrt.Height(aPrt.Height() - nEat); } InvalidateAll(); @@ -532,7 +545,7 @@ SwTwips SwHeadFootFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) nResult = 0; SwTwips nMinHeight = lcl_GetFrameMinHeight(*this); - SwTwips nOldHeight = Frame().Height(); + SwTwips nOldHeight = getSwFrame().Height(); SwTwips nRest = 0; // Amount to shrink by spitting out spacing if ( nOldHeight >= nMinHeight ) @@ -578,7 +591,7 @@ SwTwips SwHeadFootFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) SwTwips nShrink = nRest; /* calculate maximum shrinking */ - SwTwips nMaxShrink = maPrt.Height() - nMinPrtHeight; + SwTwips nMaxShrink = getSwPrint().Height() - nMinPrtHeight; /* shrink no more than maximum shrinking */ if (nShrink > nMaxShrink) @@ -591,8 +604,9 @@ SwTwips SwHeadFootFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) { if (! IsHeaderFrame() ) { - maPrt.Top(maPrt.Top() + nShrink); - maPrt.Height(maPrt.Height() - nShrink); + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Top(aPrt.Top() + nShrink); + aPrt.Height(aPrt.Height() - nShrink); } InvalidateAll(); diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index bae8b8390df1..b2169e48bf70 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -122,7 +122,7 @@ bool SwLayAction::PaintWithoutFlys( const SwRect &rRect, const SwContentFrame *p SwFlyFrame *pFly = static_cast<SwVirtFlyDrawObj*>(pO)->GetFlyFrame(); - if ( pFly == pSelfFly || !rRect.IsOver( pFly->Frame() ) ) + if ( pFly == pSelfFly || !rRect.IsOver( pFly->getSwFrame() ) ) continue; if ( pSelfFly && pSelfFly->IsLowerOf( pFly ) ) @@ -169,7 +169,7 @@ bool SwLayAction::PaintWithoutFlys( const SwRect &rRect, const SwContentFrame *p continue; } - aTmp -= pFly->Frame(); + aTmp -= pFly->getSwFrame(); } bool bRetPaint = false; @@ -214,7 +214,7 @@ 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 = aRectFnSet.GetHeight(rOldRect); - long nNewHeight = aRectFnSet.GetHeight(pCnt->Frame()); + long nNewHeight = aRectFnSet.GetHeight(pCnt->getSwFrame()); const bool bHeightDiff = nOldHeight != nNewHeight; if( bHeightDiff ) { @@ -675,7 +675,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext) XCHECKPAGE; const SwRect &rVis = m_pImp->GetShell()->VisArea(); - while( pPg && pPg->Frame().Bottom() < rVis.Top() ) + while( pPg && pPg->getSwFrame().Bottom() < rVis.Top() ) pPg = static_cast<SwPageFrame*>(pPg->GetNext()); if( pPg != pPage ) pPg = pPg ? static_cast<SwPageFrame*>(pPg->GetPrev()) : pPage; @@ -686,7 +686,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext) // #i42586# - format current page, if idle action is active // This is an optimization for the case that the interrupt is created by // the move of a form control object, which is represented by a window. - while ( pPg && ( pPg->Frame().Top() < nBottom || + while ( pPg && ( pPg->getSwFrame().Top() < nBottom || ( IsIdle() && pPg == pPage ) ) ) { unlockPositionOfObjects( pPg ); @@ -780,9 +780,9 @@ bool SwLayAction::TurboAction_( const SwContentFrame *pCnt ) if ( !pCnt->IsValid() || pCnt->IsCompletePaint() || pCnt->IsRetouche() ) { const SwRect aOldRect( pCnt->UnionFrame( true ) ); - const long nOldBottom = pCnt->Frame().Top() + pCnt->Prt().Bottom(); + const long nOldBottom = pCnt->getSwFrame().Top() + pCnt->getSwPrint().Bottom(); pCnt->Calc(m_pImp->GetShell()->GetOut()); - if ( pCnt->Frame().Bottom() < aOldRect.Bottom() ) + if ( pCnt->getSwFrame().Bottom() < aOldRect.Bottom() ) pCnt->SetRetouche(); pPage = pCnt->FindPageFrame(); @@ -795,7 +795,7 @@ bool SwLayAction::TurboAction_( const SwContentFrame *pCnt ) if ( nAllLines != static_cast<const SwTextFrame*>(pCnt)->GetAllLines() ) { if ( IsPaintExtraData() ) - m_pImp->GetShell()->AddPaintRect( pCnt->Frame() ); + m_pImp->GetShell()->AddPaintRect( pCnt->getSwFrame() ); // This is to calculate the remaining LineNums on the page, // and we don't stop processing here. To perform this inside RecalcAllLines // would be expensive, because we would have to notify the page even @@ -850,7 +850,7 @@ bool SwLayAction::TurboAction() static bool lcl_IsInvaLay( const SwFrame *pFrame, long nBottom ) { return !pFrame->IsValid() || - (pFrame->IsCompletePaint() && ( pFrame->Frame().Top() < nBottom ) ); + (pFrame->IsCompletePaint() && ( pFrame->getSwFrame().Top() < nBottom ) ); } static const SwFrame *lcl_FindFirstInvaLay( const SwFrame *pFrame, long nBottom ) @@ -884,7 +884,7 @@ static const SwFrame *lcl_FindFirstInvaContent( const SwLayoutFrame *pLay, long { if ( !pCnt->IsValid() || pCnt->IsCompletePaint() ) { - if ( pCnt->Frame().Top() <= nBottom ) + if ( pCnt->getSwFrame().Top() <= nBottom ) return pCnt; } @@ -901,17 +901,17 @@ static const SwFrame *lcl_FindFirstInvaContent( const SwLayoutFrame *pLay, long if ( static_cast<const SwFlyInContentFrame*>(pFly)->IsInvalid() || pFly->IsCompletePaint() ) { - if ( pFly->Frame().Top() <= nBottom ) + if ( pFly->getSwFrame().Top() <= nBottom ) return pFly; } const SwFrame *pFrame = lcl_FindFirstInvaContent( pFly, nBottom, nullptr ); - if ( pFrame && pFrame->Frame().Bottom() <= nBottom ) + if ( pFrame && pFrame->getSwFrame().Bottom() <= nBottom ) return pFrame; } } } } - if ( pCnt->Frame().Top() > nBottom && !pCnt->IsInTab() ) + if ( pCnt->getSwFrame().Top() > nBottom && !pCnt->IsInTab() ) return nullptr; pCnt = pCnt->GetNextContentFrame(); if ( !pLay->IsAnLower( pCnt ) ) @@ -931,14 +931,14 @@ static const SwAnchoredObject* lcl_FindFirstInvaObj( const SwPageFrame* _pPage, if ( dynamic_cast< const SwFlyFrame *>( pObj ) != nullptr ) { const SwFlyFrame* pFly = static_cast<const SwFlyFrame*>(pObj); - if ( pFly->Frame().Top() <= _nBottom ) + if ( pFly->getSwFrame().Top() <= _nBottom ) { if ( pFly->IsInvalid() || pFly->IsCompletePaint() ) return pFly; const SwFrame* pTmp; if ( nullptr != (pTmp = lcl_FindFirstInvaContent( pFly, _nBottom, nullptr )) && - pTmp->Frame().Top() <= _nBottom ) + pTmp->getSwFrame().Top() <= _nBottom ) return pFly; } } @@ -994,8 +994,8 @@ bool SwLayAction::IsShortCut( SwPageFrame *&prPage ) } const SwRect &rVis = m_pImp->GetShell()->VisArea(); - if ( (prPage->Frame().Top() >= rVis.Bottom()) || - (prPage->Frame().Left()>= rVis.Right()) ) + if ( (prPage->getSwFrame().Top() >= rVis.Bottom()) || + (prPage->getSwFrame().Left()>= rVis.Right()) ) { bRet = true; @@ -1040,8 +1040,8 @@ bool SwLayAction::IsShortCut( SwPageFrame *&prPage ) pLst = pContent->FindSctFrame(); pLst = pLst->FindPrev(); if ( pLst && - (pLst->Frame().Top() >= rVis.Bottom() || - pLst->Frame().Left()>= rVis.Right()) ) + (pLst->getSwFrame().Top() >= rVis.Bottom() || + pLst->getSwFrame().Left()>= rVis.Right()) ) { bTstCnt = false; } @@ -1160,13 +1160,13 @@ bool SwLayAction::IsShortCut( SwPageFrame *&prPage ) const SwFrame* pFrame( nullptr ); if ( prPage->IsInvalidLayout() && nullptr != (pFrame = lcl_FindFirstInvaLay( prPage, nBottom )) && - pFrame->Frame().Top() <= nBottom ) + pFrame->getSwFrame().Top() <= nBottom ) { return false; } if ( (prPage->IsInvalidContent() || prPage->IsInvalidFlyInCnt()) && nullptr != (pFrame = lcl_FindFirstInvaContent( prPage, nBottom, nullptr )) && - pFrame->Frame().Top() <= nBottom ) + pFrame->getSwFrame().Top() <= nBottom ) { return false; } @@ -1192,7 +1192,7 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame *pLa if ( pLay->GetPrev() && !pLay->GetPrev()->IsValid() ) pLay->GetPrev()->SetCompletePaint(); - SwRect aOldFrame( pLay->Frame() ); + SwRect aOldFrame( pLay->getSwFrame() ); SwRect aOldRect( aOldFrame ); if( pLay->IsPageFrame() ) { @@ -1204,12 +1204,12 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame *pLa pLay->Calc(pRenderContext); } - if ( aOldFrame != pLay->Frame() ) + if ( aOldFrame != pLay->getSwFrame() ) bChanged = true; bool bNoPaint = false; if ( pLay->IsPageBodyFrame() && - pLay->Frame().Pos() == aOldRect.Pos() && + pLay->getSwFrame().Pos() == aOldRect.Pos() && pLay->Lower() ) { const SwViewShell *pSh = pLay->getRootFrame()->GetCurrShell(); @@ -1221,7 +1221,7 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame *pLa if ( !bNoPaint && IsPaint() && bAddRect && (pLay->IsCompletePaint() || bChanged) ) { - SwRect aPaint( pLay->Frame() ); + SwRect aPaint( pLay->getSwFrame() ); // consider border and shadow for // page frames -> enlarge paint rectangle correspondingly. if ( pLay->IsPageFrame() ) @@ -1265,7 +1265,7 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame *pLa m_pImp->GetShell()->AddPaintRect( aPaint ); bAlreadyPainted = true; // remember frame at complete paint - aFrameAtCompletePaint = pLay->Frame(); + aFrameAtCompletePaint = pLay->getSwFrame(); } // provide paint of spacing @@ -1279,7 +1279,7 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame *pLa const bool bPrev = bLeftToRightViewLayout ? pLay->GetPrev() : pLay->GetNext(); const bool bNext = bLeftToRightViewLayout ? pLay->GetNext() : pLay->GetPrev(); SwPageFrame* pPageFrame = static_cast<SwPageFrame*>(pLay); - SwRect aPageRect( pLay->Frame() ); + SwRect aPageRect( pLay->getSwFrame() ); if(pSh) { @@ -1294,14 +1294,14 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame *pLa // top SwRect aSpaceToPrevPage( aPageRect ); aSpaceToPrevPage.Top( aSpaceToPrevPage.Top() - nHalfDocBorder ); - aSpaceToPrevPage.Bottom( pLay->Frame().Top() ); + aSpaceToPrevPage.Bottom( pLay->getSwFrame().Top() ); if(aSpaceToPrevPage.Height() > 0 && aSpaceToPrevPage.Width() > 0) m_pImp->GetShell()->AddPaintRect( aSpaceToPrevPage ); // left aSpaceToPrevPage = aPageRect; aSpaceToPrevPage.Left( aSpaceToPrevPage.Left() - nHalfDocBorder ); - aSpaceToPrevPage.Right( pLay->Frame().Left() ); + aSpaceToPrevPage.Right( pLay->getSwFrame().Left() ); if(aSpaceToPrevPage.Height() > 0 && aSpaceToPrevPage.Width() > 0) m_pImp->GetShell()->AddPaintRect( aSpaceToPrevPage ); } @@ -1310,14 +1310,14 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame *pLa // bottom SwRect aSpaceToNextPage( aPageRect ); aSpaceToNextPage.Bottom( aSpaceToNextPage.Bottom() + nHalfDocBorder ); - aSpaceToNextPage.Top( pLay->Frame().Bottom() ); + aSpaceToNextPage.Top( pLay->getSwFrame().Bottom() ); if(aSpaceToNextPage.Height() > 0 && aSpaceToNextPage.Width() > 0) m_pImp->GetShell()->AddPaintRect( aSpaceToNextPage ); // right aSpaceToNextPage = aPageRect; aSpaceToNextPage.Right( aSpaceToNextPage.Right() + nHalfDocBorder ); - aSpaceToNextPage.Left( pLay->Frame().Right() ); + aSpaceToNextPage.Left( pLay->getSwFrame().Right() ); if(aSpaceToNextPage.Height() > 0 && aSpaceToNextPage.Width() > 0) m_pImp->GetShell()->AddPaintRect( aSpaceToNextPage ); } @@ -1374,7 +1374,7 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame *pLa // add complete frame area as paint area, if frame // area has been already added and after formatting its lowers the frame area // is enlarged. - SwRect aBoundRect(pLay->IsPageFrame() ? static_cast<SwPageFrame*>(pLay)->GetBoundRect(pRenderContext) : pLay->Frame() ); + SwRect aBoundRect(pLay->IsPageFrame() ? static_cast<SwPageFrame*>(pLay)->GetBoundRect(pRenderContext) : pLay->getSwFrame() ); if ( bAlreadyPainted && ( aBoundRect.Width() > aFrameAtCompletePaint.Width() || @@ -1399,13 +1399,13 @@ bool SwLayAction::FormatLayoutFly( SwFlyFrame* pFly ) if ( !pFly->IsValid() || pFly->IsCompletePaint() || pFly->IsInvalid() ) { // The Frame has changed, now it's getting formatted. - const SwRect aOldRect( pFly->Frame() ); + const SwRect aOldRect( pFly->getSwFrame() ); pFly->Calc(pRenderContext); - bChanged = aOldRect != pFly->Frame(); + bChanged = aOldRect != pFly->getSwFrame(); if ( IsPaint() && (pFly->IsCompletePaint() || bChanged) && - pFly->Frame().Top() > 0 && pFly->Frame().Left() > 0 ) - m_pImp->GetShell()->AddPaintRect( pFly->Frame() ); + pFly->getSwFrame().Top() > 0 && pFly->getSwFrame().Left() > 0 ) + m_pImp->GetShell()->AddPaintRect( pFly->getSwFrame() ); if ( bChanged ) pFly->Invalidate(); @@ -1462,10 +1462,10 @@ bool SwLayAction::FormatLayoutTab( SwTabFrame *pTab, bool bAddRect ) pTab->GetPrev()->SetCompletePaint(); } - const SwRect aOldRect( pTab->Frame() ); + const SwRect aOldRect( pTab->getSwFrame() ); pTab->SetLowersFormatted( false ); pTab->Calc(pRenderContext); - if ( aOldRect != pTab->Frame() ) + if ( aOldRect != pTab->getSwFrame() ) { bChanged = true; } @@ -1473,13 +1473,13 @@ bool SwLayAction::FormatLayoutTab( SwTabFrame *pTab, bool bAddRect ) if ( IsPaint() && bAddRect ) { - // add condition <pTab->Frame().HasArea()> + // add condition <pTab->getSwFrame().HasArea()> if ( !pTab->IsCompletePaint() && pTab->IsComplete() && - ( pTab->Frame().SSize() != pTab->Prt().SSize() || + ( pTab->getSwFrame().SSize() != pTab->getSwPrint().SSize() || // vertical layout support aRectFnSet.GetLeftMargin(*pTab) ) && - pTab->Frame().HasArea() + pTab->getSwFrame().HasArea() ) { // re-implement calculation of margin rectangles. @@ -1488,14 +1488,14 @@ bool SwLayAction::FormatLayoutTab( SwTabFrame *pTab, bool bAddRect ) SwTwips nLeftMargin = aRectFnSet.GetLeftMargin(*pTab); if ( nLeftMargin > 0) { - aMarginRect = pTab->Frame(); + aMarginRect = pTab->getSwFrame(); aRectFnSet.SetWidth( aMarginRect, nLeftMargin ); m_pImp->GetShell()->AddPaintRect( aMarginRect ); } if ( aRectFnSet.GetRightMargin(*pTab) > 0) { - aMarginRect = pTab->Frame(); + aMarginRect = pTab->getSwFrame(); aRectFnSet.SetLeft( aMarginRect, aRectFnSet.GetPrtRight(*pTab) ); m_pImp->GetShell()->AddPaintRect( aMarginRect ); } @@ -1503,14 +1503,14 @@ bool SwLayAction::FormatLayoutTab( SwTabFrame *pTab, bool bAddRect ) SwTwips nTopMargin = aRectFnSet.GetTopMargin(*pTab); if ( nTopMargin > 0) { - aMarginRect = pTab->Frame(); + aMarginRect = pTab->getSwFrame(); aRectFnSet.SetHeight( aMarginRect, nTopMargin ); m_pImp->GetShell()->AddPaintRect( aMarginRect ); } if ( aRectFnSet.GetBottomMargin(*pTab) > 0) { - aMarginRect = pTab->Frame(); + aMarginRect = pTab->getSwFrame(); aRectFnSet.SetTop( aMarginRect, aRectFnSet.GetPrtBottom(*pTab) ); m_pImp->GetShell()->AddPaintRect( aMarginRect ); } @@ -1555,7 +1555,7 @@ bool SwLayAction::FormatLayoutTab( SwTabFrame *pTab, bool bAddRect ) // Ugly shortcut! if ( pTab->IsLowersFormatted() && - (bPainted || !m_pImp->GetShell()->VisArea().IsOver( pTab->Frame())) ) + (bPainted || !m_pImp->GetShell()->VisArea().IsOver( pTab->getSwFrame())) ) return false; // Now, deal with the lowers @@ -1631,7 +1631,7 @@ bool SwLayAction::FormatContent( const SwPageFrame *pPage ) const_cast<SwTextFrame*>(static_cast<const SwTextFrame*>(pContent))->RecalcAllLines(); if ( IsPaintExtraData() && IsPaint() && nAllLines != static_cast<const SwTextFrame*>(pContent)->GetAllLines() ) - m_pImp->GetShell()->AddPaintRect( pContent->Frame() ); + m_pImp->GetShell()->AddPaintRect( pContent->getSwFrame() ); } if ( IsAgain() ) @@ -1690,7 +1690,7 @@ bool SwLayAction::FormatContent( const SwPageFrame *pPage ) if ( bSetContent ) { if ( bBrowse && !IsIdle() && !IsCalcLayout() && !IsComplete() && - pContent->Frame().Top() > m_pImp->GetShell()->VisArea().Bottom()) + pContent->getSwFrame().Top() > m_pImp->GetShell()->VisArea().Bottom()) { const long nBottom = m_pImp->GetShell()->VisArea().Bottom(); const SwFrame *pTmp = lcl_FindFirstInvaContent( pPage, @@ -1725,13 +1725,13 @@ bool SwLayAction::FormatContent( const SwPageFrame *pPage ) const_cast<SwTextFrame*>(static_cast<const SwTextFrame*>(pContent))->RecalcAllLines(); if ( IsPaintExtraData() && IsPaint() && nAllLines != static_cast<const SwTextFrame*>(pContent)->GetAllLines() ) - m_pImp->GetShell()->AddPaintRect( pContent->Frame() ); + m_pImp->GetShell()->AddPaintRect( pContent->getSwFrame() ); } // Do this if the frame has been formatted before. if ( pContent->IsTextFrame() && static_cast<const SwTextFrame*>(pContent)->HasRepaint() && IsPaint() ) - PaintContent( pContent, pPage, pContent->Frame(), pContent->Frame().Bottom()); + PaintContent( pContent, pPage, pContent->getSwFrame(), pContent->getSwFrame().Bottom()); if ( IsIdle() ) { CheckIdleEnd(); @@ -1740,7 +1740,7 @@ bool SwLayAction::FormatContent( const SwPageFrame *pPage ) return false; } if ( bBrowse && !IsIdle() && !IsCalcLayout() && !IsComplete() && - pContent->Frame().Top() > m_pImp->GetShell()->VisArea().Bottom()) + pContent->getSwFrame().Top() > m_pImp->GetShell()->VisArea().Bottom()) { const long nBottom = m_pImp->GetShell()->VisArea().Bottom(); const SwFrame *pTmp = lcl_FindFirstInvaContent( pPage, @@ -1781,7 +1781,7 @@ void SwLayAction::FormatContent_( const SwContentFrame *pContent, pContent->OptCalc(); if( IsAgain() ) return; - if( aRectFnSet.YDiff( aRectFnSet.GetBottom(pContent->Frame()), + if( aRectFnSet.YDiff( aRectFnSet.GetBottom(pContent->getSwFrame()), aRectFnSet.GetBottom(aOldRect) ) < 0 ) { pContent->SetRetouche(); @@ -1791,8 +1791,8 @@ void SwLayAction::FormatContent_( const SwContentFrame *pContent, else { if ( IsPaint() && pContent->IsTextFrame() && static_cast<const SwTextFrame*>(pContent)->HasRepaint() ) - PaintContent( pContent, pPage, pContent->Frame(), - aRectFnSet.GetBottom(pContent->Frame()) ); + PaintContent( pContent, pPage, pContent->getSwFrame(), + aRectFnSet.GetBottom(pContent->getSwFrame()) ); pContent->OptCalc(); } } @@ -1825,7 +1825,7 @@ bool SwLayAction::FormatFlyContent( const SwFlyFrame *pFly ) const_cast<SwTextFrame*>(static_cast<const SwTextFrame*>(pContent))->RecalcAllLines(); if ( IsPaintExtraData() && IsPaint() && nAllLines != static_cast<const SwTextFrame*>(pContent)->GetAllLines() ) - m_pImp->GetShell()->AddPaintRect( pContent->Frame() ); + m_pImp->GetShell()->AddPaintRect( pContent->getSwFrame() ); } if ( IsAgain() ) @@ -2047,7 +2047,7 @@ bool SwLayIdle::DoIdleJob( IdleJobType eJob, bool bVisAreaOnly ) pPage = static_cast<SwPageFrame*>(pPage->GetNext()); if ( pPage && bVisAreaOnly && - !pPage->Frame().IsOver( pImp->GetShell()->VisArea())) + !pPage->getSwFrame().IsOver( pImp->GetShell()->VisArea())) break; } return false; diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx index fb3b14b403b7..32e2643deb3b 100644 --- a/sw/source/core/layout/laycache.cxx +++ b/sw/source/core/layout/laycache.cxx @@ -281,7 +281,7 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc ) { if (SwFlyFrame *pFly = dynamic_cast<SwFlyFrame*>(pAnchoredObj)) { - if( pFly->Frame().Left() != FAR_AWAY && + if( pFly->getSwFrame().Left() != FAR_AWAY && !pFly->GetAnchorFrame()->FindFooterOrHeader() ) { const SwContact *pC = @@ -294,9 +294,9 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc ) aIo.OpenRec( SW_LAYCACHE_IO_REC_FLY ); aIo.OpenFlagRec( 0, 0 ); aIo.CloseFlagRec(); - SwRect &rRct = pFly->Frame(); - sal_Int32 nX = rRct.Left() - pPage->Frame().Left(); - sal_Int32 nY = rRct.Top() - pPage->Frame().Top(); + const SwRect& rRct = pFly->getSwFrame(); + sal_Int32 nX = rRct.Left() - pPage->getSwFrame().Left(); + sal_Int32 nY = rRct.Top() - pPage->getSwFrame().Top(); aIo.GetStream().WriteUInt16( nPageNum ).WriteUInt32( nOrdNum ) .WriteInt32( nX ).WriteInt32( nY ) .WriteInt32( rRct.Width() ) @@ -805,8 +805,13 @@ bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex ) if( bSplit ) { mrpFrame->InsertBehind( mrpLay, mrpPrv ); - mrpFrame->Frame().Pos() = mrpLay->Frame().Pos(); - mrpFrame->Frame().Pos().Y() += 1; + + { + SwFrameRect::FrameWriteAccess aFrm(*mrpFrame); + aFrm.Pos() = mrpLay->getSwFrame().Pos(); + aFrm.Pos().Y() += 1; + } + mrpPrv = mrpFrame; if( mrpFrame->IsTabFrame() ) { @@ -876,7 +881,10 @@ bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex ) { CheckFlyCache_( pLastPage ); if( mrpPrv && mrpPrv->IsTextFrame() && !mrpPrv->GetValidSizeFlag() ) - mrpPrv->Frame().Height( mrpPrv->GetUpper()->Prt().Height() ); + { + SwFrameRect::FrameWriteAccess aFrm(*mrpPrv); + aFrm.Height( mrpPrv->GetUpper()->getSwPrint().Height() ); + } bRet = true; mrpPrv = nullptr; @@ -902,10 +910,17 @@ bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex ) } mrpActualSection->SetSectionFrame( pSct ); pSct->InsertBehind( mrpLay, nullptr ); + if( bInit ) + { pSct->Init(); - pSct->Frame().Pos() = mrpLay->Frame().Pos(); - pSct->Frame().Pos().Y() += 1; //because of the notifications + } + + { + SwFrameRect::FrameWriteAccess aFrm(*pSct); + aFrm.Pos() = mrpLay->getSwFrame().Pos(); + aFrm.Pos().Y() += 1; //because of the notifications + } mrpLay = pSct; if ( mrpLay->Lower() && mrpLay->Lower()->IsLayoutFrame() ) @@ -1001,17 +1016,17 @@ void SwLayHelper::CheckFlyCache_( SwPageFrame* pPage ) const SwFlyCache* pFlyCache = *aFlyCacheSetIt; SwFlyFrame* pFly = const_cast<SwVirtFlyDrawObj*>(static_cast<const SwVirtFlyDrawObj*>(*aFlySetIt))->GetFlyFrame(); - if ( pFly->Frame().Left() == FAR_AWAY ) + if ( pFly->getSwFrame().Left() == FAR_AWAY ) { // we get the stored information - pFly->Frame().Pos().X() = pFlyCache->Left() + - pPage->Frame().Left(); - pFly->Frame().Pos().Y() = pFlyCache->Top() + - pPage->Frame().Top(); + SwFrameRect::FrameWriteAccess aFrm(*pFly); + aFrm.Pos().X() = pFlyCache->Left() + pPage->getSwFrame().Left(); + aFrm.Pos().Y() = pFlyCache->Top() + pPage->getSwFrame().Top(); + if ( mpImpl->IsUseFlyCache() ) { - pFly->Frame().Width( pFlyCache->Width() ); - pFly->Frame().Height( pFlyCache->Height() ); + aFrm.Width( pFlyCache->Width() ); + aFrm.Height( pFlyCache->Height() ); } } diff --git a/sw/source/core/layout/layouter.cxx b/sw/source/core/layout/layouter.cxx index f0b9159bb004..722f3d8d204f 100644 --- a/sw/source/core/layout/layouter.cxx +++ b/sw/source/core/layout/layouter.cxx @@ -437,10 +437,10 @@ bool SwLayouter::MoveBwdSuppressed( const SwDoc& p_rDoc, // create hash map key tMoveBwdLayoutInfoKey aMoveBwdLayoutInfo; aMoveBwdLayoutInfo.mnFrameId = p_rFlowFrame.GetFrame().GetFrameId(); - aMoveBwdLayoutInfo.mnNewUpperPosX = p_rNewUpperFrame.Frame().Pos().X(); - aMoveBwdLayoutInfo.mnNewUpperPosY = p_rNewUpperFrame.Frame().Pos().Y(); - aMoveBwdLayoutInfo.mnNewUpperWidth = p_rNewUpperFrame.Frame().Width(); - aMoveBwdLayoutInfo.mnNewUpperHeight = p_rNewUpperFrame.Frame().Height(); + aMoveBwdLayoutInfo.mnNewUpperPosX = p_rNewUpperFrame.getSwFrame().Pos().X(); + aMoveBwdLayoutInfo.mnNewUpperPosY = p_rNewUpperFrame.getSwFrame().Pos().Y(); + aMoveBwdLayoutInfo.mnNewUpperWidth = p_rNewUpperFrame.getSwFrame().Width(); + aMoveBwdLayoutInfo.mnNewUpperHeight = p_rNewUpperFrame.getSwFrame().Height(); SwRectFnSet aRectFnSet(&p_rNewUpperFrame); const SwFrame* pLastLower( p_rNewUpperFrame.Lower() ); while ( pLastLower && pLastLower->GetNext() ) @@ -449,8 +449,8 @@ bool SwLayouter::MoveBwdSuppressed( const SwDoc& p_rDoc, } aMoveBwdLayoutInfo.mnFreeSpaceInNewUpper = pLastLower - ? aRectFnSet.BottomDist( pLastLower->Frame(), aRectFnSet.GetPrtBottom(p_rNewUpperFrame) ) - : aRectFnSet.GetHeight(p_rNewUpperFrame.Frame()); + ? aRectFnSet.BottomDist( pLastLower->getSwFrame(), aRectFnSet.GetPrtBottom(p_rNewUpperFrame) ) + : aRectFnSet.GetHeight(p_rNewUpperFrame.getSwFrame()); // check for moving backward suppress threshold const sal_uInt16 cMoveBwdCountSuppressThreshold = 20; diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx index 23c068c0dd7f..ad81a3e91b6f 100644 --- a/sw/source/core/layout/newfrm.cxx +++ b/sw/source/core/layout/newfrm.cxx @@ -501,7 +501,7 @@ void SwRootFrame::Init( SwFrameFormat* pFormat ) // Disable "multiple layout" mpDrawPage = pMd->GetPage(0); - mpDrawPage->SetSize( Frame().SSize() ); + mpDrawPage->SetSize( getSwFrame().SSize() ); } // Initialize the layout: create pages, link content with Content etc. @@ -565,7 +565,7 @@ void SwRootFrame::Init( SwFrameFormat* pFormat ) //b6433357: Update page fields after loading if ( !mpCurrShell || !mpCurrShell->Imp()->IsUpdateExpFields() ) { - SwDocPosUpdate aMsgHint( pPage->Frame().Top() ); + SwDocPosUpdate aMsgHint( pPage->getSwFrame().Top() ); rFieldsAccess.UpdatePageFields( &aMsgHint ); } @@ -654,7 +654,7 @@ void SwRootFrame::AllInvalidateAutoCompleteWords() const void SwRootFrame::AllAddPaintRect() const { - GetCurrShell()->AddPaintRect( Frame() ); + GetCurrShell()->AddPaintRect( getSwFrame() ); } void SwRootFrame::AllRemoveFootnotes() diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index d689eaf6e4df..b63190b1d38e 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -76,27 +76,35 @@ void SwBodyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder if ( !mbValidSize ) { - SwTwips nHeight = GetUpper()->Prt().Height(); - SwTwips nWidth = GetUpper()->Prt().Width(); + SwTwips nHeight = GetUpper()->getSwPrint().Height(); + SwTwips nWidth = GetUpper()->getSwPrint().Width(); const SwFrame *pFrame = GetUpper()->Lower(); do { if ( pFrame != this ) { if( pFrame->IsVertical() ) - nWidth -= pFrame->Frame().Width(); + nWidth -= pFrame->getSwFrame().Width(); else - nHeight -= pFrame->Frame().Height(); + nHeight -= pFrame->getSwFrame().Height(); } pFrame = pFrame->GetNext(); } while ( pFrame ); + if ( nHeight < 0 ) + { nHeight = 0; - Frame().Height( nHeight ); + } + + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Height( nHeight ); + + if( IsVertical() && !IsVertLR() && !IsReverse() && nWidth != aFrm.Width() ) + { + aFrm.Pos().setX(aFrm.Pos().getX() + aFrm.Width() - nWidth); + } - if( IsVertical() && !IsVertLR() && !IsReverse() && nWidth != Frame().Width() ) - Frame().Pos().setX(Frame().Pos().getX() + Frame().Width() - nWidth); - Frame().Width( nWidth ); + aFrm.Width( nWidth ); } bool bNoGrid = true; @@ -109,7 +117,7 @@ void SwBodyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder bNoGrid = false; long nSum = pGrid->GetBaseHeight() + pGrid->GetRubyHeight(); SwRectFnSet aRectFnSet(this); - long nSize = aRectFnSet.GetWidth(Frame()); + long nSize = aRectFnSet.GetWidth(getSwFrame()); long nBorder = 0; if( GRID_LINES_CHARS == pGrid->GetGridType() ) { @@ -119,11 +127,13 @@ void SwBodyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder nSize -= nBorder; nBorder /= 2; } - aRectFnSet.SetPosX( Prt(), nBorder ); - aRectFnSet.SetWidth( Prt(), nSize ); + + SwFrameRect::PrintWriteAccess aPrt(*this); + aRectFnSet.SetPosX( aPrt, nBorder ); + aRectFnSet.SetWidth( aPrt, nSize ); // Height of body frame: - nBorder = aRectFnSet.GetHeight(Frame()); + nBorder = aRectFnSet.GetHeight(getSwFrame()); // Number of possible lines in area of body frame: long nNumberOfLines = nBorder / nSum; @@ -139,17 +149,20 @@ void SwBodyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder const bool bAdjust = static_cast<SwPageFrame*>(GetUpper())->GetFormat()->GetDoc()-> GetFootnoteIdxs().empty(); - aRectFnSet.SetPosY( Prt(), bAdjust ? nBorder : 0 ); - aRectFnSet.SetHeight( Prt(), nSize ); + aRectFnSet.SetPosY( aPrt, bAdjust ? nBorder : 0 ); + aRectFnSet.SetHeight( aPrt, nSize ); } } + if( bNoGrid ) { - Prt().Pos().setX(0); - Prt().Pos().setY(0); - Prt().Height( Frame().Height() ); - Prt().Width( Frame().Width() ); + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Pos().setX(0); + aPrt.Pos().setY(0); + aPrt.Height( getSwFrame().Height() ); + aPrt.Width( getSwFrame().Width() ); } + mbValidSize = mbValidPrtArea = true; } @@ -179,16 +192,27 @@ SwPageFrame::SwPageFrame( SwFrameFormat *pFormat, SwFrame* pSib, SwPageDesc *pPg SwViewShell *pSh = getRootFrame()->GetCurrShell(); const bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); vcl::RenderContext* pRenderContext = pSh ? pSh->GetOut() : nullptr; - if ( bBrowseMode ) + { - Frame().Height( 0 ); - long nWidth = pSh->VisArea().Width(); - if ( !nWidth ) - nWidth = 5000; // changes anyway - Frame().Width ( nWidth ); + SwFrameRect::FrameWriteAccess aFrm(*this); + + if ( bBrowseMode ) + { + aFrm.Height( 0 ); + long nWidth = pSh->VisArea().Width(); + + if ( !nWidth ) + { + nWidth = 5000; // changes anyway + } + + aFrm.Width ( nWidth ); + } + else + { + aFrm.SSize( pFormat->GetFrameSize().GetSize() ); + } } - else - Frame().SSize( pFormat->GetFrameSize().GetSize() ); // create and insert body area if it is not a blank page SwDoc *pDoc = pFormat->GetDoc(); @@ -198,7 +222,7 @@ SwPageFrame::SwPageFrame( SwFrameFormat *pFormat, SwFrame* pSib, SwPageDesc *pPg m_bEmptyPage = false; Calc(pRenderContext); // so that the PrtArea is correct SwBodyFrame *pBodyFrame = new SwBodyFrame( pDoc->GetDfltFrameFormat(), this ); - pBodyFrame->ChgSize( Prt().SSize() ); + pBodyFrame->ChgSize( getSwPrint().SSize() ); pBodyFrame->Paste( this ); pBodyFrame->Calc(pRenderContext); // so that the columns can be inserted correctly pBodyFrame->InvalidatePos(); @@ -261,7 +285,7 @@ void SwPageFrame::DestroyImpl() // including border and shadow area. const bool bRightSidebar = (SidebarPosition() == sw::sidebarwindows::SidebarPosition::RIGHT); SwRect aRetoucheRect; - SwPageFrame::GetBorderAndShadowBoundRect( Frame(), pSh, pSh->GetOut(), aRetoucheRect, IsLeftShadowNeeded(), IsRightShadowNeeded(), bRightSidebar ); + SwPageFrame::GetBorderAndShadowBoundRect( getSwFrame(), pSh, pSh->GetOut(), aRetoucheRect, IsLeftShadowNeeded(), IsRightShadowNeeded(), bRightSidebar ); pSh->AddPaintRect( aRetoucheRect ); } } @@ -578,7 +602,7 @@ void SwPageFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew, } case RES_FRM_SIZE: { - const SwRect aOldPageFrameRect( Frame() ); + const SwRect aOldPageFrameRect( getSwFrame() ); SwViewShell *pSh = getRootFrame()->GetCurrShell(); if( pSh && pSh->GetViewOptions()->getBrowseMode() ) { @@ -600,11 +624,16 @@ void SwPageFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew, static_cast<const SwFormatChg*>(pNew)->pChangedFormat->GetFrameSize() : static_cast<const SwFormatFrameSize&>(*pNew); - Frame().Height( std::max( rSz.GetHeight(), long(MINLAY) ) ); - Frame().Width ( std::max( rSz.GetWidth(), long(MINLAY) ) ); + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Height( std::max( rSz.GetHeight(), long(MINLAY) ) ); + aFrm.Width ( std::max( rSz.GetWidth(), long(MINLAY) ) ); + } if ( GetUpper() ) + { static_cast<SwRootFrame*>(GetUpper())->CheckViewLayout( nullptr, nullptr ); + } } // cleanup Window if( pSh && pSh->GetWin() && aOldPageFrameRect.HasArea() ) @@ -618,7 +647,7 @@ void SwPageFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew, pSh->InvalidateWindows( aOldRectWithBorderAndShadow ); } rInvFlags |= 0x03; - if ( aOldPageFrameRect.Height() != Frame().Height() ) + if ( aOldPageFrameRect.Height() != getSwFrame().Height() ) rInvFlags |= 0x04; } break; @@ -771,7 +800,7 @@ void AdjustSizeChgNotify( SwRootFrame *pRoot ) { rSh.SizeChgNotify(); if ( rSh.Imp() ) - rSh.Imp()->NotifySizeChg( pRoot->Frame().SSize() ); + rSh.Imp()->NotifySizeChg( pRoot->getSwFrame().SSize() ); } } } @@ -819,7 +848,7 @@ void SwPageFrame::Cut() } // cleanup Window if ( pSh && pSh->GetWin() ) - pSh->InvalidateWindows( Frame() ); + pSh->InvalidateWindows( getSwFrame() ); } // decrease the root's page number @@ -877,7 +906,7 @@ void SwPageFrame::Paste( SwFrame* pParent, SwFrame* pSibling ) else ::SetLastPage( this ); - if( Frame().Width() != pParent->Prt().Width() ) + if( getSwFrame().Width() != pParent->getSwPrint().Width() ) InvalidateSize_(); InvalidatePos(); @@ -1002,7 +1031,7 @@ void SwFrame::CheckPageDescs( SwPageFrame *pStart, bool bNotifyFields, SwPageFra // invalidate the field, starting from here if ( nDocPos == LONG_MAX ) - nDocPos = pPrevPage ? pPrevPage->Frame().Top() : pPage->Frame().Top(); + nDocPos = pPrevPage ? pPrevPage->getSwFrame().Top() : pPage->getSwFrame().Top(); // Cases: // 1. Empty page should be "normal" page -> remove empty page and take next one @@ -1298,7 +1327,7 @@ SwPageFrame *SwFrame::InsertPage( SwPageFrame *pPrevPage, bool bFootnote ) SwViewShell *pSh = getRootFrame()->GetCurrShell(); if ( !pSh || !pSh->Imp()->IsUpdateExpFields() ) { - SwDocPosUpdate aMsgHint( pPrevPage->Frame().Top() ); + SwDocPosUpdate aMsgHint( pPrevPage->getSwFrame().Top() ); pDoc->getIDocumentFieldsAccess().UpdatePageFields( &aMsgHint ); } return pPage; @@ -1326,17 +1355,25 @@ sw::sidebarwindows::SidebarPosition SwPageFrame::SidebarPosition() const SwTwips SwRootFrame::GrowFrame( SwTwips nDist, bool bTst, bool ) { if ( !bTst ) - Frame().SSize().Height() += nDist; + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.SSize().Height() += nDist; + } + return nDist; } SwTwips SwRootFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool ) { OSL_ENSURE( nDist >= 0, "nDist < 0." ); - OSL_ENSURE( nDist <= Frame().Height(), "nDist greater than current size." ); + OSL_ENSURE( nDist <= getSwFrame().Height(), "nDist greater than current size." ); if ( !bTst ) - Frame().SSize().Height() -= nDist; + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.SSize().Height() -= nDist; + } + return nDist; } @@ -1424,7 +1461,7 @@ void SwRootFrame::RemoveSuperfluous() { SAL_INFO( "sw.pageframe", "RemoveSuperfluous - DestroyFrm p: " << pPage ); RemovePage( &pPage, SwRemoveResult::Prev ); - nDocPos = pPage ? pPage->Frame().Top() : 0; + nDocPos = pPage ? pPage->getSwFrame().Top() : 0; } } while ( pPage ); @@ -1550,28 +1587,41 @@ void SwRootFrame::AssertPageFlys( SwPageFrame *pPage ) Size SwRootFrame::ChgSize( const Size& aNewSize ) { - Frame().SSize() = aNewSize; + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.SSize() = aNewSize; + } + InvalidatePrt_(); mbFixSize = false; - return Frame().SSize(); + return getSwFrame().SSize(); } void SwRootFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) { if ( !mbValidPos ) - { mbValidPos = true; - maFrame.Pos().setX(DOCUMENTBORDER); - maFrame.Pos().setY(DOCUMENTBORDER); + { + mbValidPos = true; + + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Pos().setX(DOCUMENTBORDER); + aFrm.Pos().setY(DOCUMENTBORDER); } + if ( !mbValidPrtArea ) - { mbValidPrtArea = true; - maPrt.Pos().setX(0); - maPrt.Pos().setY(0); - maPrt.SSize( maFrame.SSize() ); + { + mbValidPrtArea = true; + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Pos().setX(0); + aPrt.Pos().setY(0); + aPrt.SSize( getSwFrame().SSize() ); } + if ( !mbValidSize ) + { // SSize is set by the pages (Cut/Paste). mbValidSize = true; + } } void SwRootFrame::ImplInvalidateBrowseWidth() @@ -1682,7 +1732,7 @@ void SwRootFrame::ImplCalcBrowseWidth() case text::HoriOrientation::INSIDE: case text::HoriOrientation::LEFT: if ( text::RelOrientation::PRINT_AREA == rHori.GetRelationOrient() ) - nWidth += pFrame->Prt().Left(); + nWidth += pFrame->getSwPrint().Left(); break; default: break; @@ -1874,14 +1924,22 @@ static void lcl_MoveAllLowerObjs( SwFrame* pFrame, const Point& rOffset ) static void lcl_MoveAllLowers( SwFrame* pFrame, const Point& rOffset ) { - const SwRect aFrame( pFrame->Frame() ); + const SwRect aFrame( pFrame->getSwFrame() ); // first move the current frame - Point &rPoint = pFrame->Frame().Pos(); - if (rPoint.X() != FAR_AWAY) - rPoint.X() += rOffset.X(); - if (rPoint.Y() != FAR_AWAY) - rPoint.Y() += rOffset.Y(); + { + SwFrameRect::FrameWriteAccess aFrm(*pFrame); + + if (aFrm.Pos().X() != FAR_AWAY) + { + aFrm.Pos().X() += rOffset.X(); + } + + if (aFrm.Pos().Y() != FAR_AWAY) + { + aFrm.Pos().Y() += rOffset.Y(); + } + } // Don't forget accessibility: if( pFrame->IsAccessibleFrame() ) @@ -1959,7 +2017,7 @@ void SwRootFrame::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* p maPageRects.clear(); - const long nBorder = Frame().Pos().getX(); + const long nBorder = getSwFrame().Pos().getX(); const long nVisWidth = mnViewWidth - 2 * nBorder; const long nGapBetweenPages = pViewOpt ? pViewOpt->GetGapBetweenPages() : (pSh ? pSh->GetViewOptions()->GetGapBetweenPages() @@ -2008,15 +2066,15 @@ void SwRootFrame::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* p { const SwFrame& rFormatPage = pPageFrame->GetFormatPage(); - nPageWidth = rFormatPage.Frame().Width() + nSidebarWidth + ((bStartOfRow || 1 == (pPageFrame->GetPhyPageNum()%2)) ? 0 : nGapBetweenPages); - nPageHeight = rFormatPage.Frame().Height() + nGapBetweenPages; + nPageWidth = rFormatPage.getSwFrame().Width() + nSidebarWidth + ((bStartOfRow || 1 == (pPageFrame->GetPhyPageNum()%2)) ? 0 : nGapBetweenPages); + nPageHeight = rFormatPage.getSwFrame().Height() + nGapBetweenPages; } else { if ( !pPageFrame->IsEmptyPage() ) { - nPageWidth = pPageFrame->Frame().Width() + nSidebarWidth + (bStartOfRow ? 0 : nGapBetweenPages); - nPageHeight = pPageFrame->Frame().Height() + nGapBetweenPages; + nPageWidth = pPageFrame->getSwFrame().Width() + nSidebarWidth + (bStartOfRow ? 0 : nGapBetweenPages); + nPageHeight = pPageFrame->getSwFrame().Height() + nGapBetweenPages; } } @@ -2065,7 +2123,7 @@ void SwRootFrame::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* p const sal_uInt16 nMaxNumberOfVirtualPages = mnColumns > 0 ? mnColumns - nNumberOfPagesInRow : USHRT_MAX; SwTwips nRemain = nWidthRemain; SwTwips nVirtualPagesWidth = 0; - SwTwips nLastPageWidth = pLastPageInCurrentRow->Frame().Width() + nSidebarWidth; + SwTwips nLastPageWidth = pLastPageInCurrentRow->getSwFrame().Width() + nSidebarWidth; while ( ( mnColumns > 0 || nRemain > 0 ) && nNumberOfVirtualPages < nMaxNumberOfVirtualPages ) { @@ -2089,7 +2147,7 @@ void SwRootFrame::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* p { // #i88036# nCurrentRowWidth += - pStartOfRow->GetFormatPage().Frame().Width() + nSidebarWidth; + pStartOfRow->GetFormatPage().getSwFrame().Width() + nSidebarWidth; } // center page if possible @@ -2106,7 +2164,7 @@ void SwRootFrame::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* p if ( bFirstRow && mbBookMode ) { // #i88036# - nX += pStartOfRow->GetFormatPage().Frame().Width() + nSidebarWidth; + nX += pStartOfRow->GetFormatPage().getSwFrame().Width() + nSidebarWidth; } SwPageFrame* pEndOfRow = pPageFrame; @@ -2118,8 +2176,8 @@ void SwRootFrame::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* p if ( mbBookMode ) pFormatPage = &pPageToAdjust->GetFormatPage(); - const SwTwips nCurrentPageWidth = pFormatPage->Frame().Width() + (pFormatPage->IsEmptyPage() ? 0 : nSidebarWidth); - const Point aOldPagePos = pPageToAdjust->Frame().Pos(); + const SwTwips nCurrentPageWidth = pFormatPage->getSwFrame().Width() + (pFormatPage->IsEmptyPage() ? 0 : nSidebarWidth); + const Point aOldPagePos = pPageToAdjust->getSwFrame().Pos(); const bool bLeftSidebar = pPageToAdjust->SidebarPosition() == sw::sidebarwindows::SidebarPosition::LEFT; const SwTwips nLeftPageAddOffset = bLeftSidebar ? nSidebarWidth : @@ -2156,7 +2214,7 @@ void SwRootFrame::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* p // border of nGapBetweenPages around the current page: SwRect aPageRectWithBorders( aNewPagePos.getX() - nGapBetweenPages, aNewPagePos.getY(), - pPageToAdjust->Frame().SSize().Width() + nGapBetweenPages + nSidebarWidth, + pPageToAdjust->getSwFrame().SSize().Width() + nGapBetweenPages + nSidebarWidth, nCurrentRowHeight ); static const long nOuterClickDiff = 1000000; @@ -2214,7 +2272,7 @@ void SwRootFrame::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* p } // end while // set size of root frame: - const Size aOldSize( Frame().SSize() ); + const Size aOldSize( getSwFrame().SSize() ); const Size aNewSize( nMaxPageRight - nBorder, nSumRowHeight - nGapBetweenPages ); if ( bPageChanged || aNewSize != aOldSize ) @@ -2234,7 +2292,7 @@ void SwRootFrame::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* p } } - maPagesArea.Pos( Frame().Pos() ); + maPagesArea.Pos( getSwFrame().Pos() ); maPagesArea.SSize( aNewSize ); if ( TWIPS_MAX != nMinPageLeft ) maPagesArea.Left_( nMinPageLeft ); @@ -2291,17 +2349,17 @@ bool SwPageFrame::IsOverHeaderFooterArea( const Point& rPt, FrameControlType &rC { if ( pFrame->IsBodyFrame() ) { - nUpperLimit = pFrame->Frame().Top(); - nLowerLimit = pFrame->Frame().Bottom(); + nUpperLimit = pFrame->getSwFrame().Top(); + nLowerLimit = pFrame->getSwFrame().Bottom(); } else if ( pFrame->IsFootnoteContFrame() ) - nLowerLimit = pFrame->Frame().Bottom(); + nLowerLimit = pFrame->getSwFrame().Bottom(); pFrame = pFrame->GetNext(); } - SwRect aHeaderArea( Frame().TopLeft(), - Size( Frame().Width(), nUpperLimit - Frame().Top() ) ); + SwRect aHeaderArea( getSwFrame().TopLeft(), + Size( getSwFrame().Width(), nUpperLimit - getSwFrame().Top() ) ); SwViewShell* pViewShell = getRootFrame()->GetCurrShell(); const bool bHideWhitespaceMode = pViewShell->GetViewOptions()->IsHideWhitespaceMode(); @@ -2315,8 +2373,8 @@ bool SwPageFrame::IsOverHeaderFooterArea( const Point& rPt, FrameControlType &rC } else { - SwRect aFooterArea( Point( Frame().Left(), nLowerLimit ), - Size( Frame().Width(), Frame().Bottom() - nLowerLimit ) ); + SwRect aFooterArea( Point( getSwFrame().Left(), nLowerLimit ), + Size( getSwFrame().Width(), getSwFrame().Bottom() - nLowerLimit ) ); if ( aFooterArea.IsInside( rPt ) && (!bHideWhitespaceMode || static_cast<const SwFrameFormat*>(GetRegisteredIn())->GetFooter().IsActive()) ) @@ -2346,7 +2404,7 @@ bool SwPageFrame::CheckPageHeightValidForHideWhitespace(SwTwips nDiff) // Content frame doesn't fit the actual size, check if it fits the nominal one. const SwFrameFormat* pPageFormat = static_cast<const SwFrameFormat*>(GetRegisteredIn()); const Size& rPageSize = pPageFormat->GetFrameSize().GetSize(); - long nWhitespace = rPageSize.getHeight() - Frame().Height(); + long nWhitespace = rPageSize.getHeight() - getSwFrame().Height(); if (nWhitespace > -nDiff) { // It does: don't move it and invalidate our page frame so diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 873b2c67880e..dee5bb6f94e7 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -900,8 +900,8 @@ void SwLineRects::PaintLines( OutputDevice *pOut, SwPaintProperties const &prope // Vertical edge, overlapping with the table edge? SwTwips nLLeft = rLRect.Left() - 30, nLRight = rLRect.Right() + 30, - nTLeft = rLRect.GetTab()->Frame().Left() + rLRect.GetTab()->Prt().Left(), - nTRight = rLRect.GetTab()->Frame().Left() + rLRect.GetTab()->Prt().Right(); + nTLeft = rLRect.GetTab()->getSwFrame().Left() + rLRect.GetTab()->getSwPrint().Left(), + nTRight = rLRect.GetTab()->getSwFrame().Left() + rLRect.GetTab()->getSwPrint().Right(); if ( (nTLeft >= nLLeft && nTLeft <= nLRight) || (nTRight>= nLLeft && nTRight<= nLRight) ) bPaint = false; @@ -911,8 +911,8 @@ void SwLineRects::PaintLines( OutputDevice *pOut, SwPaintProperties const &prope // Horizontal edge, overlapping with the table edge? SwTwips nLTop = rLRect.Top() - 30, nLBottom = rLRect.Bottom() + 30, - nTTop = rLRect.GetTab()->Frame().Top() + rLRect.GetTab()->Prt().Top(), - nTBottom = rLRect.GetTab()->Frame().Top() + rLRect.GetTab()->Prt().Bottom(); + nTTop = rLRect.GetTab()->getSwFrame().Top() + rLRect.GetTab()->getSwPrint().Top(), + nTBottom = rLRect.GetTab()->getSwFrame().Top() + rLRect.GetTab()->getSwPrint().Bottom(); if ( (nTTop >= nLTop && nTTop <= nLBottom) || (nTBottom >= nLTop && nTBottom <= nLBottom) ) bPaint = false; @@ -1292,15 +1292,15 @@ static void lcl_CalcBorderRect( SwRect &rRect, const SwFrame *pFrame, // See <lcl_PaintLeftLine> and <lcl_PaintRightLine>. if( pFrame->IsSctFrame() ) { - rRect = pFrame->Prt(); - rRect.Pos() += pFrame->Frame().Pos(); + rRect = pFrame->getSwPrint(); + rRect.Pos() += pFrame->getSwFrame().Pos(); } else if ( pFrame->IsCellFrame() ) - rRect = pFrame->Frame(); + rRect = pFrame->getSwFrame(); else { - rRect = pFrame->Prt(); - rRect.Pos() += pFrame->Frame().Pos(); + rRect = pFrame->getSwPrint(); + rRect.Pos() += pFrame->getSwFrame().Pos(); if ( rAttrs.IsLine() || rAttrs.IsBorderDist() || (bShadow && rAttrs.GetShadow().GetLocation() != SvxShadowLocation::NONE) ) @@ -1431,7 +1431,7 @@ static void lcl_SubtractFlys( const SwFrame *pFrame, const SwPageFrame *pPage, const SwFlyFrame *pFly = static_cast<const SwFlyFrame*>(pAnchoredObj); - if (pSelfFly == pFly || gProp.pSRetoucheFly == pFly || !rRect.IsOver(pFly->Frame())) + if (pSelfFly == pFly || gProp.pSRetoucheFly == pFly || !rRect.IsOver(pFly->getSwFrame())) continue; if (!pFly->GetFormat()->GetPrint().GetValue() && @@ -1565,8 +1565,8 @@ static void lcl_SubtractFlys( const SwFrame *pFrame, const SwPageFrame *pPage, } else { - SwRect aRect( pFly->Prt() ); - aRect += pFly->Frame().Pos(); + SwRect aRect( pFly->getSwPrint() ); + aRect += pFly->getSwFrame().Pos(); rRegion -= aRect; rClipState.subtractRange(lcl_ShrinkFly(aRect)); } @@ -2428,8 +2428,8 @@ void SwTabFramePainter::PaintLines(OutputDevice& rDev, const SwRect& rRect) cons } const SwFrame* pUpper = mrTabFrame.GetUpper(); - SwRect aUpper( pUpper->Prt() ); - aUpper.Pos() += pUpper->Frame().Pos(); + SwRect aUpper( pUpper->getSwPrint() ); + aUpper.Pos() += pUpper->getSwFrame().Pos(); SwRect aUpperAligned( aUpper ); ::SwAlignRect( aUpperAligned, gProp.pSGlobalShell, &rDev ); drawinglayer::primitive2d::Primitive2DContainer aHorizontalSequence; @@ -2754,11 +2754,11 @@ static bool lcl_IsFirstRowInFollowTableWithoutRepeatedHeadlines( void SwTabFramePainter::Insert( const SwFrame& rFrame, const SvxBoxItem& rBoxItem ) { // build 4 line entries for the 4 borders: - SwRect aBorderRect = rFrame.Frame(); + SwRect aBorderRect = rFrame.getSwFrame(); if ( rFrame.IsTabFrame() ) { - aBorderRect = rFrame.Prt(); - aBorderRect.Pos() += rFrame.Frame().Pos(); + aBorderRect = rFrame.getSwPrint(); + aBorderRect.Pos() += rFrame.getSwFrame().Pos(); } bool const bBottomAsTop(lcl_IsFirstRowInFollowTableWithoutRepeatedHeadlines( @@ -3068,7 +3068,7 @@ void SwRootFrame::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, if ( !pPage->IsEmptyPage() ) { SwRect aPaintRect; - SwPageFrame::GetBorderAndShadowBoundRect( pPage->Frame(), pSh, &rRenderContext, aPaintRect, + SwPageFrame::GetBorderAndShadowBoundRect( pPage->getSwFrame(), pSh, &rRenderContext, aPaintRect, bPaintLeftShadow, bPaintRightShadow, bRightSidebar ); if ( aRect.IsOver( aPaintRect ) ) @@ -3090,8 +3090,8 @@ void SwRootFrame::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, SwRectFnSet aRectFnSet(pPage); SwRect aPageRectTemp( aPaintRect ); aRectFnSet.SetLeftAndWidth( aPageRectTemp, - aRectFnSet.GetLeft(pPage->Frame()), - aRectFnSet.GetWidth(pPage->Frame()) ); + aRectFnSet.GetLeft(pPage->getSwFrame()), + aRectFnSet.GetWidth(pPage->getSwFrame()) ); aPageRectTemp.Intersection_( pSh->VisArea() ); vcl::Region aPageRectRegion( aPageRectTemp.SVRect() ); aPageRectRegion.Exclude( aPaintRect.SVRect() ); @@ -3143,7 +3143,7 @@ void SwRootFrame::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, const IDocumentDrawModelAccess& rIDDMA = pSh->getIDocumentDrawModelAccess(); pSh->Imp()->PaintLayer( rIDDMA.GetHellId(), pPrintData, - *pPage, pPage->Frame(), + *pPage, pPage->getSwFrame(), &aPageBackgrdColor, pPage->IsRightToLeft(), &aSwRedirector ); @@ -3168,8 +3168,8 @@ void SwRootFrame::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, if( pSh->GetWin() && pSh->GetDoc()->GetDocShell() && !pSh->GetDoc()->GetDocShell()->IsInPlaceActive() ) { - SwPageFrame::PaintBorderAndShadow( pPage->Frame(), pSh, bPaintLeftShadow, bPaintRightShadow, bRightSidebar ); - SwPageFrame::PaintNotesSidebar( pPage->Frame(), pSh, pPage->GetPhyPageNum(), bRightSidebar); + SwPageFrame::PaintBorderAndShadow( pPage->getSwFrame(), pSh, bPaintLeftShadow, bPaintRightShadow, bRightSidebar ); + SwPageFrame::PaintNotesSidebar( pPage->getSwFrame(), pSh, pPage->GetPhyPageNum(), bRightSidebar); } gProp.pSLines->PaintLines( pSh->GetOut(), gProp ); @@ -3190,7 +3190,7 @@ void SwRootFrame::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, // OD 09.12.2002 #103045# - add 4th parameter for horizontal text direction. pSh->Imp()->PaintLayer( pSh->GetDoc()->getIDocumentDrawModelAccess().GetHeavenId(), pPrintData, - *pPage, pPage->Frame(), + *pPage, pPage->getSwFrame(), &aPageBackgrdColor, pPage->IsRightToLeft(), &aSwRedirector ); @@ -3226,11 +3226,11 @@ void SwRootFrame::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, { // paint empty page SwRect aPaintRect; - SwRect aEmptyPageRect( pPage->Frame() ); + SwRect aEmptyPageRect( pPage->getSwFrame() ); // code from vprint.cxx const SwPageFrame& rFormatPage = pPage->GetFormatPage(); - aEmptyPageRect.SSize() = rFormatPage.Frame().SSize(); + aEmptyPageRect.SSize() = rFormatPage.getSwFrame().SSize(); SwPageFrame::GetBorderAndShadowBoundRect( aEmptyPageRect, pSh, &rRenderContext, aPaintRect, bPaintLeftShadow, bPaintRightShadow, bRightSidebar ); @@ -3425,11 +3425,11 @@ void SwLayoutFrame::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRec if ( aPaintRect.Height() > 0 ) gProp.pSGlobalShell->InvalidateWindows(aPaintRect); aPaintRect.Top( rRect.Bottom() + 1 ); - aPaintRect.Bottom( pFrame->Frame().Bottom() ); + aPaintRect.Bottom( pFrame->getSwFrame().Bottom() ); if ( aPaintRect.Height() > 0 ) gProp.pSGlobalShell->InvalidateWindows(aPaintRect); - aPaintRect.Top( pFrame->Frame().Top() ); - aPaintRect.Bottom( pFrame->Frame().Bottom() ); + aPaintRect.Top( pFrame->getSwFrame().Top() ); + aPaintRect.Bottom( pFrame->getSwFrame().Bottom() ); } else { @@ -3597,8 +3597,8 @@ void SwColumnFrame::PaintBreak( ) const !gProp.pSGlobalShell->IsShowHeaderFooterSeparator( Footer ) && gProp.pSGlobalShell->GetViewOptions()->IsLineBreak() ) { - SwRect aRect( pCnt->Prt() ); - aRect.Pos() += pCnt->Frame().Pos(); + SwRect aRect( pCnt->getSwPrint() ); + aRect.Pos() += pCnt->getSwFrame().Pos(); // Draw the line basegfx::B2DPoint aStart( double( aRect.Left() ), aRect.Top() ); @@ -3679,7 +3679,7 @@ void SwPageFrame::PaintDecorators( ) const const SwLayoutFrame* pBody = FindBodyCont(); if ( pBody ) { - SwRect aBodyRect( pBody->Frame() ); + SwRect aBodyRect( pBody->getSwFrame() ); if ( gProp.pSGlobalShell->GetOut()->GetOutDevType() != OUTDEV_PRINTER && !gProp.pSGlobalShell->GetViewOptions()->IsPDFExport() && @@ -3714,7 +3714,7 @@ void SwPageFrame::PaintDecorators( ) const while ( pFootnoteContFrame ) { if ( pFootnoteContFrame->IsFootnoteContFrame() ) - aBodyRect.AddBottom( pFootnoteContFrame->Frame().Bottom() - aBodyRect.Bottom() ); + aBodyRect.AddBottom( pFootnoteContFrame->getSwFrame().Bottom() - aBodyRect.Bottom() ); pFootnoteContFrame = pFootnoteContFrame->GetNext(); } @@ -3821,7 +3821,7 @@ bool SwFlyFrame::IsPaint( SdrObject *pObj, const SwViewShell *pSh ) //HACK: exception: printing of frames in tables, those can overlap //a page once in a while when dealing with oversized tables (HTML). SwPageFrame *pPage = pFly->FindPageFrame(); - if ( pPage && pPage->Frame().IsOver( pFly->Frame() ) ) + if ( pPage && pPage->getSwFrame().IsOver( pFly->getSwFrame() ) ) { pAnch = pFly->AnchorFrame(); } @@ -3845,7 +3845,7 @@ bool SwFlyFrame::IsPaint( SdrObject *pObj, const SwViewShell *pSh ) //right now. Afterwards they must not be printed if the //page over which they float position wise gets printed. const SwPageFrame *pPage = pAnch->FindPageFrame(); - if ( !pPage->Frame().IsOver( pObj->GetCurrentBoundRect() ) ) + if ( !pPage->getSwFrame().IsOver( pObj->GetCurrentBoundRect() ) ) pAnch = nullptr; } } @@ -3903,7 +3903,7 @@ void SwFlyFrame::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, if (bInGenerateThumbnail) { SwRect aVisRect = pShell->VisArea(); - if (!aVisRect.IsOver(Frame())) + if (!aVisRect.IsOver(getSwFrame())) return; } } @@ -3915,7 +3915,7 @@ void SwFlyFrame::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, BorderLinesGuard blg; // this should not paint borders added from PaintBaBo SwRect aRect( rRect ); - aRect.Intersection_( Frame() ); + aRect.Intersection_( getSwFrame() ); rRenderContext.Push( PushFlags::CLIPREGION ); rRenderContext.SetClipRegion(); @@ -3984,7 +3984,7 @@ void SwFlyFrame::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, } // paint of margin needed. const bool bPaintMarginOnly( !bPaintCompleteBack && - Prt().SSize() != Frame().SSize() ); + getSwPrint().SSize() != getSwFrame().SSize() ); // #i47804# - paint background of parent fly frame // for transparent graphics in layer Hell, if parent fly frame isn't @@ -4007,7 +4007,7 @@ void SwFlyFrame::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, SwBorderAttrAccess aAccess( SwFrame::GetCache(), pParentFlyFrame ); const SwBorderAttrs &rAttrs = *aAccess.Get(); SwRect aPaintRect( aRect ); - aPaintRect.Intersection_( pParentFlyFrame->Frame() ); + aPaintRect.Intersection_( pParentFlyFrame->getSwFrame() ); pParentFlyFrame->PaintBackground( aPaintRect, pPage, rAttrs ); gProp.pSRetoucheFly2 = pOldRet; @@ -4040,7 +4040,7 @@ void SwFlyFrame::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, { //What we actually want to paint is the small stripe between //PrtArea and outer border. - SwRect aTmp( Prt() ); aTmp += Frame().Pos(); + SwRect aTmp( getSwPrint() ); aTmp += getSwFrame().Pos(); aRegion -= aTmp; } if ( bContour ) @@ -4174,8 +4174,8 @@ void SwTabFrame::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, else if ( gProp.pSGlobalShell->GetWin() && !gProp.pSGlobalShell->IsPreview() ) { // OD 10.01.2003 #i6467# - intersect output rectangle with table frame - SwRect aTabRect( Prt() ); - aTabRect.Pos() += Frame().Pos(); + SwRect aTabRect( getSwPrint() ); + aTabRect.Pos() += getSwFrame().Pos(); SwRect aTabOutRect( rRect ); aTabOutRect.Intersection( aTabRect ); SwViewOption::DrawRect( &rRenderContext, aTabOutRect, COL_LIGHTGRAY ); @@ -5272,8 +5272,8 @@ void SwFrame::PaintBorder( const SwRect& rRect, const SwPageFrame *pPage, //be painted. //For the PrtArea the aligned value needs to be used, otherwise it could //happen, that some parts won't be processed. - SwRect aRect( Prt() ); - aRect += Frame().Pos(); + SwRect aRect( getSwPrint() ); + aRect += getSwFrame().Pos(); ::SwAlignRect( aRect, gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut() ); // OD 27.09.2002 #103636# - new local boolean variable in order to // suspend border paint under special cases - see below. @@ -5369,8 +5369,8 @@ void SwFootnoteContFrame::PaintBorder( const SwRect& rRect, const SwPageFrame *p { //If the rectangle is completely inside the PrtArea, no border needs to //be painted. - SwRect aRect( Prt() ); - aRect.Pos() += Frame().Pos(); + SwRect aRect( getSwPrint() ); + aRect.Pos() += getSwFrame().Pos(); if ( !aRect.IsInside( rRect ) ) PaintLine( rRect, pPage ); } @@ -5388,7 +5388,7 @@ void SwFootnoteContFrame::PaintLine( const SwRect& rRect, const SwPageFootnoteInfo &rInf = pPage->GetPageDesc()->GetFootnoteInfo(); SwRectFnSet aRectFnSet(this); - SwTwips nPrtWidth = aRectFnSet.GetWidth(Prt()); + SwTwips nPrtWidth = aRectFnSet.GetWidth(getSwPrint()); Fraction aFract( nPrtWidth, 1 ); const SwTwips nWidth = (long)(aFract *= rInf.GetWidth()); @@ -5407,9 +5407,9 @@ void SwFootnoteContFrame::PaintLine( const SwRect& rRect, } SwTwips nLineWidth = rInf.GetLineWidth(); const SwRect aLineRect = aRectFnSet.IsVert() ? - SwRect( Point(Frame().Left()+Frame().Width()-rInf.GetTopDist()-nLineWidth, + SwRect( Point(getSwFrame().Left()+getSwFrame().Width()-rInf.GetTopDist()-nLineWidth, nX), Size( nLineWidth, nWidth ) ) - : SwRect( Point( nX, Frame().Pos().Y() + rInf.GetTopDist() ), + : SwRect( Point( nX, getSwFrame().Pos().Y() + rInf.GetTopDist() ), Size( nWidth, rInf.GetLineWidth())); if ( aLineRect.HasArea() && rInf.GetLineStyle() != SvxBorderLineStyle::NONE) PaintBorderLine( rRect, aLineRect , pPage, &rInf.GetLineColor(), @@ -5426,8 +5426,8 @@ void SwLayoutFrame::PaintColLines( const SwRect &rRect, const SwFormatCol &rForm SwRectFn fnRect = pCol->IsVertical() ? ( pCol->IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori; - SwRect aLineRect = Prt(); - aLineRect += Frame().Pos(); + SwRect aLineRect = getSwPrint(); + aLineRect += getSwFrame().Pos(); SwTwips nTop = ((aLineRect.*fnRect->fnGetHeight)()*rFormatCol.GetLineHeight()) / 100 - (aLineRect.*fnRect->fnGetHeight)(); @@ -5462,7 +5462,7 @@ void SwLayoutFrame::PaintColLines( const SwRect &rRect, const SwFormatCol &rForm while ( pCol->GetNext() ) { (aLineRect.*fnRect->fnSetPosX) - ( (pCol->Frame().*fnGetX)() - nPenHalf ); + ( (pCol->getSwFrame().*fnGetX)() - nPenHalf ); if ( aRect.IsOver( aLineRect ) ) PaintBorderLine( aRect, aLineRect , pPage, &rFormatCol.GetLineColor(), rFormatCol.GetLineStyle() ); @@ -5481,8 +5481,8 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co const SwLayoutFrame* pBody = FindBodyCont(); if( pBody ) { - SwRect aGrid( pBody->Prt() ); - aGrid += pBody->Frame().Pos(); + SwRect aGrid( pBody->getSwPrint() ); + aGrid += pBody->getSwFrame().Pos(); SwRect aInter( aGrid ); aInter.Intersection( rRect ); @@ -5786,7 +5786,7 @@ void SwPageFrame::PaintMarginArea( const SwRect& _rOutputRect, if ( _pViewShell->GetWin() && !_pViewShell->GetViewOptions()->getBrowseMode() ) { // Simplified paint with DrawingLayer FillStyle - SwRect aPgRect = Frame(); + SwRect aPgRect = getSwFrame(); aPgRect.Intersection_( _rOutputRect ); if(!aPgRect.IsEmpty()) @@ -6207,7 +6207,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin SwRect SwPageFrame::GetBoundRect(OutputDevice const * pOutputDevice) const { const SwViewShell *pSh = getRootFrame()->GetCurrShell(); - SwRect aPageRect( Frame() ); + SwRect aPageRect( getSwFrame() ); SwRect aResult; if(!pSh) { @@ -6360,7 +6360,7 @@ void SwFrame::PaintBackground( const SwRect &rRect, const SwPageFrame *pPage, } } - SwRect aPaintRect( Frame() ); + SwRect aPaintRect( getSwFrame() ); if( IsTextFrame() || IsSctFrame() ) aPaintRect = UnionFrame( true ); @@ -6371,9 +6371,9 @@ void SwFrame::PaintBackground( const SwRect &rRect, const SwPageFrame *pPage, const bool bBrowse = pSh->GetViewOptions()->getBrowseMode(); SwRect aRect; if ( (bPageFrame && bBrowse) || - (IsTextFrame() && Prt().SSize() == Frame().SSize()) ) + (IsTextFrame() && getSwPrint().SSize() == getSwFrame().SSize()) ) { - aRect = Frame(); + aRect = getSwFrame(); ::SwAlignRect( aRect, gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut() ); } else @@ -6384,7 +6384,7 @@ void SwFrame::PaintBackground( const SwRect &rRect, const SwPageFrame *pPage, if ( GetPrev()->GetAttrSet()->GetBackground() == GetAttrSet()->GetBackground() && lcl_compareFillAttributes(GetPrev()->getSdrAllFillAttributesHelper(), getSdrAllFillAttributesHelper())) { - aRect.Top( Frame().Top() ); + aRect.Top( getSwFrame().Top() ); } } } @@ -6557,9 +6557,9 @@ void SwLayoutFrame::RefreshLaySubsidiary( const SwPageFrame *pPage, if( !pLow ) return; SwShortCut aShortCut( *pLow, rRect ); - while( pLow && !aShortCut.Stop( pLow->Frame() ) ) + while( pLow && !aShortCut.Stop( pLow->getSwFrame() ) ) { - if ( pLow->Frame().IsOver( rRect ) && pLow->Frame().HasArea() ) + if ( pLow->getSwFrame().IsOver( rRect ) && pLow->getSwFrame().HasArea() ) { if ( pLow->IsLayoutFrame() ) static_cast<const SwLayoutFrame*>(pLow)->RefreshLaySubsidiary( pPage, rRect); @@ -6574,7 +6574,7 @@ void SwLayoutFrame::RefreshLaySubsidiary( const SwPageFrame *pPage, { const SwFlyFrame *pFly = static_cast<const SwFlyFrame*>(pAnchoredObj); - if ( pFly->IsFlyInContentFrame() && pFly->Frame().IsOver( rRect ) ) + if ( pFly->IsFlyInContentFrame() && pFly->getSwFrame().IsOver( rRect ) ) { if ( !pFly->Lower() || !pFly->Lower()->IsNoTextFrame() || !static_cast<const SwNoTextFrame*>(pFly->Lower())->HasAnimation()) @@ -6807,9 +6807,9 @@ void SwPageFrame::PaintSubsidiaryLines( const SwPageFrame *, pLay = pLay->GetNext(); } - SwRect aArea( pPageBody->Frame() ); + SwRect aArea( pPageBody->getSwFrame() ); if ( pFootnoteCont ) - aArea.AddBottom( pFootnoteCont->Frame().Bottom() - aArea.Bottom() ); + aArea.AddBottom( pFootnoteCont->getSwFrame().Bottom() - aArea.Bottom() ); if ( !gProp.pSGlobalShell->GetViewOptions()->IsViewMetaChars( ) ) ProcessPrimitives( lcl_CreatePageAreaDelimiterPrimitives( aArea ) ); @@ -6833,7 +6833,7 @@ void SwColumnFrame::PaintSubsidiaryLines( const SwPageFrame *, pLay = pLay->GetNext(); } - SwRect aArea( pColBody->Frame() ); + SwRect aArea( pColBody->getSwFrame() ); // #i3662# - enlarge top of column body frame's printing area // in sections to top of section frame. @@ -6841,13 +6841,13 @@ void SwColumnFrame::PaintSubsidiaryLines( const SwPageFrame *, if ( bColInSection ) { if ( IsVertical() ) - aArea.Right( GetUpper()->Frame().Right() ); + aArea.Right( GetUpper()->getSwFrame().Right() ); else - aArea.Top( GetUpper()->Frame().Top() ); + aArea.Top( GetUpper()->getSwFrame().Top() ); } if ( pFootnoteCont ) - aArea.AddBottom( pFootnoteCont->Frame().Bottom() - aArea.Bottom() ); + aArea.AddBottom( pFootnoteCont->getSwFrame().Bottom() - aArea.Bottom() ); ::SwAlignRect( aArea, gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut() ); @@ -6880,8 +6880,8 @@ void SwHeadFootFrame::PaintSubsidiaryLines( const SwPageFrame *, const SwRect & { if ( gProp.pSGlobalShell->IsHeaderFooterEdit() ) { - SwRect aArea( Prt() ); - aArea.Pos() += Frame().Pos(); + SwRect aArea( getSwPrint() ); + aArea.Pos() += getSwFrame().Pos(); if ( !gProp.pSGlobalShell->GetViewOptions()->IsViewMetaChars( ) ) ProcessPrimitives( lcl_CreatePageAreaDelimiterPrimitives( aArea ) ); else @@ -6935,9 +6935,9 @@ void SwLayoutFrame::PaintSubsidiaryLines( const SwPageFrame *pPage, // use frame area for cells // OD 13.02.2003 #i3662# - for section use also frame area const bool bUseFrameArea = bCell || IsSctFrame(); - SwRect aOriginal( bUseFrameArea ? Frame() : Prt() ); + SwRect aOriginal( bUseFrameArea ? getSwFrame() : getSwPrint() ); if ( !bUseFrameArea ) - aOriginal.Pos() += Frame().Pos(); + aOriginal.Pos() += getSwFrame().Pos(); ::SwAlignRect( aOriginal, gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut() ); @@ -7054,8 +7054,8 @@ void SwPageFrame::RefreshExtraData( const SwRect &rRect ) const if ( dynamic_cast< const SwFlyFrame *>( pAnchoredObj ) != nullptr ) { const SwFlyFrame *pFly = static_cast<const SwFlyFrame*>(pAnchoredObj); - if ( pFly->Frame().Top() <= aRect.Bottom() && - pFly->Frame().Bottom() >= aRect.Top() ) + if ( pFly->getSwFrame().Top() <= aRect.Bottom() && + pFly->getSwFrame().Bottom() >= aRect.Top() ) pFly->RefreshExtraData( aRect ); } } @@ -7077,8 +7077,8 @@ void SwLayoutFrame::RefreshExtraData( const SwRect &rRect ) const ( !pCnt->IsInTab() && ((bLineInBody && pCnt->IsInDocBody()) || (bLineInFly && pCnt->IsInFly())) ) ) && - pCnt->Frame().Top() <= rRect.Bottom() && - pCnt->Frame().Bottom() >= rRect.Top() ) + pCnt->getSwFrame().Top() <= rRect.Bottom() && + pCnt->getSwFrame().Bottom() >= rRect.Top() ) { static_cast<const SwTextFrame*>(pCnt)->PaintExtraData( rRect ); } @@ -7089,8 +7089,8 @@ void SwLayoutFrame::RefreshExtraData( const SwRect &rRect ) const { const SwFlyFrame *pFly = static_cast<const SwFlyFrame*>(pAnchoredObj); if ( pFly->IsFlyInContentFrame() && - pFly->Frame().Top() <= rRect.Bottom() && - pFly->Frame().Bottom() >= rRect.Top() ) + pFly->getSwFrame().Top() <= rRect.Bottom() && + pFly->getSwFrame().Bottom() >= rRect.Top() ) pFly->RefreshExtraData( rRect ); } } @@ -7188,7 +7188,7 @@ void SwFrame::Retouch( const SwPageFrame * pPage, const SwRect &rRect ) const OSL_ENSURE( getRootFrame()->GetCurrShell() && gProp.pSGlobalShell->GetWin(), "Retouche on a printer?" ); SwRect aRetouche( GetUpper()->PaintArea() ); - aRetouche.Top( Frame().Top() + Frame().Height() ); + aRetouche.Top( getSwFrame().Top() + getSwFrame().Height() ); aRetouche.Intersection( gProp.pSGlobalShell->VisArea() ); if ( aRetouche.HasArea() ) @@ -7385,11 +7385,11 @@ bool SwFrame::GetBackgroundBrush( rpBrush = &rBack; if ( pFrame->IsPageFrame() && pSh->GetViewOptions()->getBrowseMode() ) { - rOrigRect = pFrame->Frame(); + rOrigRect = pFrame->getSwFrame(); } else { - if ( pFrame->Frame().SSize() != pFrame->Prt().SSize() ) + if ( pFrame->getSwFrame().SSize() != pFrame->getSwPrint().SSize() ) { SwBorderAttrAccess aAccess( SwFrame::GetCache(), pFrame ); const SwBorderAttrs &rAttrs = *aAccess.Get(); @@ -7397,8 +7397,8 @@ bool SwFrame::GetBackgroundBrush( } else { - rOrigRect = pFrame->Prt(); - rOrigRect += pFrame->Frame().Pos(); + rOrigRect = pFrame->getSwPrint(); + rOrigRect += pFrame->getSwFrame().Pos(); } } @@ -7471,7 +7471,7 @@ Graphic SwFlyFrameFormat::MakeGraphic( ImageMap* pMap ) aMet.SetPrefMapMode( aMap ); ::SwCalcPixStatics( pSh->GetOut() ); - aMet.SetPrefSize( pFly->Frame().SSize() ); + aMet.SetPrefSize( pFly->getSwFrame().SSize() ); aMet.Record( pDev.get() ); pDev->SetLineColor(); @@ -7479,7 +7479,7 @@ Graphic SwFlyFrameFormat::MakeGraphic( ImageMap* pMap ) pDev->SetFont( pOld->GetFont() ); //Enlarge the rectangle if needed, so the border is painted too. - SwRect aOut( pFly->Frame() ); + SwRect aOut( pFly->getSwFrame() ); SwBorderAttrAccess aAccess( SwFrame::GetCache(), pFly ); const SwBorderAttrs &rAttrs = *aAccess.Get(); if ( rAttrs.CalcRightLine() ) @@ -7533,13 +7533,13 @@ Graphic SwFlyFrameFormat::MakeGraphic( ImageMap* pMap ) pSh->DLPostPaint2(true); aMet.Stop(); - aMet.Move( -pFly->Frame().Left(), -pFly->Frame().Top() ); + aMet.Move( -pFly->getSwFrame().Left(), -pFly->getSwFrame().Top() ); aRet = Graphic( aMet ); if( bNoteURL ) { OSL_ENSURE( pNoteURL, "MakeGraphic: Good Bye, NoteURL." ); - pNoteURL->FillImageMap( pMap, pFly->Frame().Pos(), aMap ); + pNoteURL->FillImageMap( pMap, pFly->getSwFrame().Pos(), aMap ); delete pNoteURL; pNoteURL = nullptr; } diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index ff091c12327b..79627835e543 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -100,16 +100,23 @@ void SwSectionFrame::Init() { assert(GetUpper() && "SwSectionFrame::Init before insertion?!"); SwRectFnSet aRectFnSet(this); - long nWidth = aRectFnSet.GetWidth(GetUpper()->Prt()); - aRectFnSet.SetWidth( Frame(), nWidth ); - aRectFnSet.SetHeight( Frame(), 0 ); + long nWidth = aRectFnSet.GetWidth(GetUpper()->getSwPrint()); + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.SetWidth( aFrm, nWidth ); + aRectFnSet.SetHeight( aFrm, 0 ); + } // #109700# LRSpace for sections const SvxLRSpaceItem& rLRSpace = GetFormat()->GetLRSpace(); - aRectFnSet.SetLeft( Prt(), rLRSpace.GetLeft() ); - aRectFnSet.SetWidth( Prt(), nWidth - rLRSpace.GetLeft() - - rLRSpace.GetRight() ); - aRectFnSet.SetHeight( Prt(), 0 ); + + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aRectFnSet.SetLeft( aPrt, rLRSpace.GetLeft() ); + aRectFnSet.SetWidth( aPrt, nWidth - rLRSpace.GetLeft() - rLRSpace.GetRight() ); + aRectFnSet.SetHeight( aPrt, 0 ); + } const SwFormatCol &rCol = GetFormat()->GetCol(); if( ( rCol.GetNumCols() > 1 || IsAnyNoteAtEnd() ) && !IsInFootnote() ) @@ -197,7 +204,11 @@ void SwSectionFrame::DelEmpty( bool bRemove ) SetFollow(nullptr); if( pUp ) { - Frame().Height( 0 ); + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Height( 0 ); + } + // If we are destroyed immediately anyway, we don't need // to put us into the list if( bRemove ) @@ -208,7 +219,10 @@ void SwSectionFrame::DelEmpty( bool bRemove ) getRootFrame()->RemoveFromList( this ); } else if( getRootFrame() ) + { getRootFrame()->InsertEmptySct( this ); + } + m_pSection = nullptr; // like this a reanimation is virtually impossible though } } @@ -281,14 +295,18 @@ void SwSectionFrame::Cut_( bool bRemove ) if ( pUp ) { SwRectFnSet aRectFnSet(this); - SwTwips nFrameHeight = aRectFnSet.GetHeight(Frame()); + SwTwips nFrameHeight = aRectFnSet.GetHeight(getSwFrame()); if( nFrameHeight > 0 ) { if( !bRemove ) { - aRectFnSet.SetHeight( Frame(), 0 ); - aRectFnSet.SetHeight( Prt(), 0 ); + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.SetHeight( aFrm, 0 ); + + SwFrameRect::PrintWriteAccess aPrt(*this); + aRectFnSet.SetHeight( aPrt, 0 ); } + pUp->Shrink( nFrameHeight ); } } @@ -382,7 +400,7 @@ void SwSectionFrame::Paste( SwFrame* pParent, SwFrame* pSibling ) pSibling->InvalidatePage( pPage ); } - SwTwips nFrameHeight = aRectFnSet.GetHeight(Frame()); + SwTwips nFrameHeight = aRectFnSet.GetHeight(getSwFrame()); if( nFrameHeight ) pParent->Grow( nFrameHeight ); @@ -725,7 +743,7 @@ void SwSectionFrame::MakeAll(vcl::RenderContext* pRenderContext) aRectFnSet.MakePos( *this, GetUpper(), GetPrev(), false ); } - if (Frame().Height() == 0) + if (getSwFrame().Height() == 0) { // SwLayoutFrame::MakeAll() is not called for to-be-deleted // section frames (which would invalidate the position of the @@ -885,7 +903,7 @@ bool SwSectionFrame::CalcMinDiff( SwTwips& rMinDiff ) const { SwRectFnSet aRectFnSet(this); rMinDiff = aRectFnSet.GetPrtBottom(*GetUpper()); - rMinDiff = aRectFnSet.BottomDist( Frame(), rMinDiff ); + rMinDiff = aRectFnSet.BottomDist( getSwFrame(), rMinDiff ); return true; } return false; @@ -1012,7 +1030,7 @@ void SwSectionFrame::CheckClipping( bool bGrow, bool bMaximize ) if( bGrow && ( !IsInFly() || !GetUpper()->IsColBodyFrame() || !FindFlyFrame()->IsLocked() ) ) { - nDiff = -aRectFnSet.BottomDist( Frame(), nDeadLine ); + nDiff = -aRectFnSet.BottomDist( getSwFrame(), nDeadLine ); if( !bMaximize ) nDiff += Undersize(); if( nDiff > 0 ) @@ -1024,11 +1042,11 @@ void SwSectionFrame::CheckClipping( bool bGrow, bool bMaximize ) nDeadLine += nAdd; } } - nDiff = -aRectFnSet.BottomDist( Frame(), nDeadLine ); + nDiff = -aRectFnSet.BottomDist( getSwFrame(), nDeadLine ); SetUndersized( !bMaximize && nDiff >= 0 ); const bool bCalc = ( IsUndersized() || bMaximize ) && ( nDiff || - aRectFnSet.GetTop(Prt()) > aRectFnSet.GetHeight(Frame()) ); + aRectFnSet.GetTop(getSwPrint()) > aRectFnSet.GetHeight(getSwFrame()) ); // 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; @@ -1051,13 +1069,18 @@ void SwSectionFrame::CheckClipping( bool bGrow, bool bMaximize ) } if ( bCalc || bExtraCalc ) { - nDiff = aRectFnSet.YDiff( nDeadLine, aRectFnSet.GetTop(Frame()) ); + nDiff = aRectFnSet.YDiff( nDeadLine, aRectFnSet.GetTop(getSwFrame()) ); if( nDiff < 0 ) - nDeadLine = aRectFnSet.GetTop(Frame()); - const Size aOldSz( Prt().SSize() ); + nDeadLine = aRectFnSet.GetTop(getSwFrame()); + const Size aOldSz( getSwPrint().SSize() ); long nTop = aRectFnSet.GetTopMargin(*this); - aRectFnSet.SetBottom( Frame(), nDeadLine ); - nDiff = aRectFnSet.GetHeight(Frame()); + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.SetBottom( aFrm, nDeadLine ); + } + + nDiff = aRectFnSet.GetHeight(getSwFrame()); if( nTop > nDiff ) nTop = nDiff; aRectFnSet.SetYMargins( *this, nTop, 0 ); @@ -1066,8 +1089,8 @@ void SwSectionFrame::CheckClipping( bool bGrow, bool bMaximize ) // Determine, if height has changed. // Note: In vertical layout the height equals the width value. bool bHeightChanged = aRectFnSet.IsVert() ? - (aOldSz.Width() != Prt().Width()) : - (aOldSz.Height() != Prt().Height()); + (aOldSz.Width() != getSwPrint().Width()) : + (aOldSz.Height() != getSwPrint().Height()); // Last but not least we have changed the height again, thus the inner // layout (columns) is calculated and the content as well. // OD 18.09.2002 #100522# @@ -1108,10 +1131,14 @@ void SwSectionFrame::SimpleFormat() 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( aRectFnSet.BottomDist( Frame(), nDeadLine ) >= 0 ) + if( aRectFnSet.BottomDist( getSwFrame(), nDeadLine ) >= 0 ) { - aRectFnSet.SetBottom( Frame(), nDeadLine ); - long nHeight = aRectFnSet.GetHeight(Frame()); + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.SetBottom( aFrm, nDeadLine ); + } + + long nHeight = aRectFnSet.GetHeight(getSwFrame()); long nTop = CalcUpperSpace(); if( nTop > nHeight ) nTop = nHeight; @@ -1190,14 +1217,18 @@ class ExtraFormatToPositionObjs // grow section till bottom of printing area of upper frame SwRectFnSet aRectFnSet(mpSectFrame); SwTwips nTopMargin = aRectFnSet.GetTopMargin(*mpSectFrame); - Size aOldSectPrtSize( mpSectFrame->Prt().SSize() ); - SwTwips nDiff = aRectFnSet.BottomDist( mpSectFrame->Frame(), - aRectFnSet.GetPrtBottom(*mpSectFrame->GetUpper()) ); - aRectFnSet.AddBottom( mpSectFrame->Frame(), nDiff ); + Size aOldSectPrtSize( mpSectFrame->getSwPrint().SSize() ); + SwTwips nDiff = aRectFnSet.BottomDist( mpSectFrame->getSwFrame(), aRectFnSet.GetPrtBottom(*mpSectFrame->GetUpper()) ); + + { + SwFrameRect::FrameWriteAccess aFrm(*mpSectFrame); + aRectFnSet.AddBottom( aFrm, nDiff ); + } + aRectFnSet.SetYMargins( *mpSectFrame, nTopMargin, 0 ); // #i59789# // suppress formatting, if printing area of section is too narrow - if ( aRectFnSet.GetHeight(mpSectFrame->Prt()) <= 0 ) + if ( aRectFnSet.GetHeight(mpSectFrame->getSwPrint()) <= 0 ) { return; } @@ -1283,7 +1314,7 @@ void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderA if ( !mbValidSize ) { PROTOCOL_ENTER( this, PROT::Size, DbgAction::NONE, nullptr ) - const long nOldHeight = aRectFnSet.GetHeight(Frame()); + const long nOldHeight = aRectFnSet.GetHeight(getSwFrame()); bool bOldLock = IsColLocked(); ColLock(); @@ -1318,13 +1349,19 @@ void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderA if( GetUpper() ) { - long nWidth = aRectFnSet.GetWidth(GetUpper()->Prt()); - aRectFnSet.SetWidth( maFrame, nWidth ); + const long nWidth = aRectFnSet.GetWidth(GetUpper()->getSwPrint()); + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.SetWidth( aFrm, nWidth ); + } // #109700# LRSpace for sections - const SvxLRSpaceItem& rLRSpace = GetFormat()->GetLRSpace(); - aRectFnSet.SetWidth( maPrt, nWidth - rLRSpace.GetLeft() - - rLRSpace.GetRight() ); + { + const SvxLRSpaceItem& rLRSpace = GetFormat()->GetLRSpace(); + SwFrameRect::PrintWriteAccess aPrt(*this); + aRectFnSet.SetWidth( aPrt, nWidth - rLRSpace.GetLeft() - rLRSpace.GetRight() ); + } // OD 15.10.2002 #103517# - allow grow in online layout // Thus, set <..IsBrowseMode()> as parameter <bGrow> on calling @@ -1349,7 +1386,7 @@ void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderA { // #i61435# // suppress formatting, if upper frame has height <= 0 - if ( aRectFnSet.GetHeight(GetUpper()->Frame()) > 0 ) + if ( aRectFnSet.GetHeight(GetUpper()->getSwFrame()) > 0 ) { FormatWidthCols( *pAttr, nRemaining, MINLAY ); } @@ -1364,7 +1401,7 @@ void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderA break; } bMaximize = ToMaximize( false ); - nRemaining += aRectFnSet.GetHeight(pFrame->Frame()); + nRemaining += aRectFnSet.GetHeight(pFrame->getSwFrame()); } else { @@ -1386,12 +1423,12 @@ void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderA } } - SwTwips nDiff = aRectFnSet.GetHeight(Frame()) - nRemaining; + SwTwips nDiff = aRectFnSet.GetHeight(getSwFrame()) - nRemaining; if( nDiff < 0) { SwTwips nDeadLine = aRectFnSet.GetPrtBottom(*GetUpper()); { - long nBottom = aRectFnSet.GetBottom(Frame()); + long nBottom = aRectFnSet.GetBottom(getSwFrame()); nBottom = aRectFnSet.YInc( nBottom, -nDiff ); long nTmpDiff = aRectFnSet.YDiff( nBottom, nDeadLine ); if( nTmpDiff > 0 ) @@ -1408,11 +1445,17 @@ void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderA } if( nDiff ) { - long nTmp = nRemaining - aRectFnSet.GetHeight(Frame()); + long nTmp = nRemaining - aRectFnSet.GetHeight(getSwFrame()); long nTop = aRectFnSet.GetTopMargin(*this); - aRectFnSet.AddBottom( Frame(), nTmp ); + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.AddBottom( aFrm, nTmp ); + } + aRectFnSet.SetYMargins( *this, nTop, 0 ); InvalidateNextPos(); + if (m_pLower && (!m_pLower->IsColumnFrame() || !m_pLower->GetNext())) { // If a single-column section just created the space that @@ -1451,7 +1494,7 @@ void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderA CheckClipping( true, bMaximize ); if( !bOldLock ) ColUnlock(); - long nDiff = nOldHeight - aRectFnSet.GetHeight(Frame()); + long nDiff = nOldHeight - aRectFnSet.GetHeight(getSwFrame()); if( nDiff > 0 ) { if( !GetNext() ) @@ -1707,7 +1750,7 @@ SwLayoutFrame *SwFrame::GetNextSctLeaf( MakePageType eMakePage ) if( pOldBoss == pNxtContent->FindFootnoteBossFrame( true ) ) { SwSaveFootnoteHeight aHeight( pOldBoss, - pOldBoss->Frame().Top() + pOldBoss->Frame().Height() ); + pOldBoss->getSwFrame().Top() + pOldBoss->getSwFrame().Height() ); pSect->GetUpper()->MoveLowerFootnotes( pNxtContent, pOldBoss, pLayLeaf->FindFootnoteBossFrame( true ), false ); } @@ -1939,7 +1982,7 @@ static SwTwips lcl_DeadLine( const SwFrame* pFrame ) } SwRectFnSet aRectFnSet(pFrame); return pUp ? aRectFnSet.GetPrtBottom(*pUp) : - aRectFnSet.GetBottom(pFrame->Frame()); + aRectFnSet.GetBottom(pFrame->getSwFrame()); } /// checks whether the SectionFrame is still able to grow, as case may be the environment has to be asked @@ -1947,7 +1990,7 @@ bool SwSectionFrame::Growable() const { SwRectFnSet aRectFnSet(this); if( aRectFnSet.YDiff( lcl_DeadLine( this ), - aRectFnSet.GetBottom(Frame()) ) > 0 ) + aRectFnSet.GetBottom(getSwFrame()) ) > 0 ) return true; return ( GetUpper() && const_cast<SwFrame*>(static_cast<SwFrame const *>(GetUpper()))->Grow( LONG_MAX, true ) ); @@ -1958,7 +2001,7 @@ SwTwips SwSectionFrame::Grow_( SwTwips nDist, bool bTst ) if ( !IsColLocked() && !HasFixSize() ) { SwRectFnSet aRectFnSet(this); - long nFrameHeight = aRectFnSet.GetHeight(Frame()); + long nFrameHeight = aRectFnSet.GetHeight(getSwFrame()); if( nFrameHeight > 0 && nDist > (LONG_MAX - nFrameHeight) ) nDist = LONG_MAX - nFrameHeight; @@ -1982,7 +2025,7 @@ SwTwips SwSectionFrame::Grow_( SwTwips nDist, bool bTst ) else { nGrow = lcl_DeadLine( this ); - nGrow = aRectFnSet.YDiff( nGrow, aRectFnSet.GetBottom(Frame()) ); + nGrow = aRectFnSet.YDiff( nGrow, aRectFnSet.GetBottom(getSwFrame()) ); } SwTwips nSpace = nGrow; if( !bInCalcContent && nGrow < nDist && GetUpper() ) @@ -2021,9 +2064,17 @@ SwTwips SwSectionFrame::Grow_( SwTwips nDist, bool bTst ) if( GetUpper() && GetUpper()->IsHeaderFrame() ) GetUpper()->InvalidateSize(); } - aRectFnSet.AddBottom( Frame(), nGrow ); - long nPrtHeight = aRectFnSet.GetHeight(Prt()) + nGrow; - aRectFnSet.SetHeight( Prt(), nPrtHeight ); + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.AddBottom( aFrm, nGrow ); + } + + { + const long nPrtHeight = aRectFnSet.GetHeight(getSwPrint()) + nGrow; + SwFrameRect::PrintWriteAccess aPrt(*this); + aRectFnSet.SetHeight( aPrt, nPrtHeight ); + } if( Lower() && Lower()->IsColumnFrame() && Lower()->GetNext() ) { @@ -2083,7 +2134,7 @@ SwTwips SwSectionFrame::Shrink_( SwTwips nDist, bool bTst ) else { SwRectFnSet aRectFnSet(this); - long nFrameHeight = aRectFnSet.GetHeight(Frame()); + long nFrameHeight = aRectFnSet.GetHeight(getSwFrame()); if ( nDist > nFrameHeight ) nDist = nFrameHeight; @@ -2104,9 +2155,17 @@ SwTwips SwSectionFrame::Shrink_( SwTwips nDist, bool bTst ) SetCompletePaint(); InvalidatePage(); } - aRectFnSet.AddBottom( Frame(), -nDist ); - long nPrtHeight = aRectFnSet.GetHeight(Prt()) - nDist; - aRectFnSet.SetHeight( Prt(), nPrtHeight ); + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.AddBottom( aFrm, -nDist ); + } + + { + const long nPrtHeight = aRectFnSet.GetHeight(getSwPrint()) - nDist; + SwFrameRect::PrintWriteAccess aPrt(*this); + aRectFnSet.SetHeight( aPrt, nPrtHeight ); + } // We do not allow a section frame to shrink the its upper // footer frame. This is because in the calculation of a @@ -2583,7 +2642,7 @@ void SwSectionFrame::InvalidateFootnotePos() SwTwips SwSectionFrame::CalcUndersize() const { SwRectFnSet aRectFnSet(this); - return InnerHeight() - aRectFnSet.GetHeight(Prt()); + return InnerHeight() - aRectFnSet.GetHeight(getSwPrint()); } SwTwips SwSectionFrame::Undersize() @@ -2650,7 +2709,7 @@ void SwRootFrame::DeleteEmptySct_() mpDestroy->erase( mpDestroy->begin() ); OSL_ENSURE( !pSect->IsColLocked() && !pSect->IsJoinLocked(), "DeleteEmptySct: Locked SectionFrame" ); - if( !pSect->Frame().HasArea() && !pSect->ContainsContent() ) + if( !pSect->getSwFrame().HasArea() && !pSect->ContainsContent() ) { SwLayoutFrame* pUp = pSect->GetUpper(); pSect->RemoveFromLayout(); diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index b8b3c1ecf8cf..edcc34354ff8 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -34,29 +34,33 @@ // No inline cause we need the function pointers long SwFrame::GetTopMargin() const - { return Prt().Top(); } + { return getSwPrint().Top(); } long SwFrame::GetBottomMargin() const - { return Frame().Height() -Prt().Height() -Prt().Top(); } + { return getSwFrame().Height() -getSwPrint().Height() -getSwPrint().Top(); } long SwFrame::GetLeftMargin() const - { return Prt().Left(); } + { return getSwPrint().Left(); } long SwFrame::GetRightMargin() const - { return Frame().Width() - Prt().Width() - Prt().Left(); } + { return getSwFrame().Width() - getSwPrint().Width() - getSwPrint().Left(); } long SwFrame::GetPrtLeft() const - { return Frame().Left() + Prt().Left(); } + { return getSwFrame().Left() + getSwPrint().Left(); } long SwFrame::GetPrtBottom() const - { return Frame().Top() + Prt().Height() + Prt().Top(); } + { return getSwFrame().Top() + getSwPrint().Height() + getSwPrint().Top(); } long SwFrame::GetPrtRight() const - { return Frame().Left() + Prt().Width() + Prt().Left(); } + { return getSwFrame().Left() + getSwPrint().Width() + getSwPrint().Left(); } long SwFrame::GetPrtTop() const - { return Frame().Top() + Prt().Top(); } + { return getSwFrame().Top() + getSwPrint().Top(); } bool SwFrame::SetMinLeft( long nDeadline ) { - SwTwips nDiff = nDeadline - Frame().Left(); + SwTwips nDiff = nDeadline - getSwFrame().Left(); if( nDiff > 0 ) { - Frame().Left( nDeadline ); - Prt().Width( Prt().Width() - nDiff ); + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Left( nDeadline ); + + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Width( aPrt.Width() - nDiff ); + return true; } return false; @@ -64,11 +68,15 @@ bool SwFrame::SetMinLeft( long nDeadline ) bool SwFrame::SetMaxBottom( long nDeadline ) { - SwTwips nDiff = Frame().Top() + Frame().Height() - nDeadline; + SwTwips nDiff = getSwFrame().Top() + getSwFrame().Height() - nDeadline; if( nDiff > 0 ) { - Frame().Height( Frame().Height() - nDiff ); - Prt().Height( Prt().Height() - nDiff ); + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Height( aFrm.Height() - nDiff ); + + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Height( aPrt.Height() - nDiff ); + return true; } return false; @@ -76,11 +84,15 @@ bool SwFrame::SetMaxBottom( long nDeadline ) bool SwFrame::SetMinTop( long nDeadline ) { - SwTwips nDiff = nDeadline - Frame().Top(); + SwTwips nDiff = nDeadline - getSwFrame().Top(); if( nDiff > 0 ) { - Frame().Top( nDeadline ); - Prt().Height( Prt().Height() - nDiff ); + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Top( nDeadline ); + + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Height( aPrt.Height() - nDiff ); + return true; } return false; @@ -88,11 +100,15 @@ bool SwFrame::SetMinTop( long nDeadline ) bool SwFrame::SetMaxRight( long nDeadline ) { - SwTwips nDiff = Frame().Left() + Frame().Width() - nDeadline; + SwTwips nDiff = getSwFrame().Left() + getSwFrame().Width() - nDeadline; if( nDiff > 0 ) { - Frame().Width( Frame().Width() - nDiff ); - Prt().Width( Prt().Width() - nDiff ); + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Width( aFrm.Width() - nDiff ); + + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Width( aPrt.Width() - nDiff ); + return true; } return false; @@ -100,92 +116,116 @@ bool SwFrame::SetMaxRight( long nDeadline ) void SwFrame::MakeBelowPos( const SwFrame* pUp, const SwFrame* pPrv, bool bNotify ) { + SwFrameRect::FrameWriteAccess aFrm(*this); + if( pPrv ) { - maFrame.Pos( pPrv->Frame().Pos() ); - maFrame.Pos().Y() += pPrv->Frame().Height(); + aFrm.Pos( pPrv->getSwFrame().Pos() ); + aFrm.Pos().Y() += pPrv->getSwFrame().Height(); } else { - maFrame.Pos( pUp->Frame().Pos() ); - maFrame.Pos() += pUp->Prt().Pos(); + aFrm.Pos( pUp->getSwFrame().Pos() ); + aFrm.Pos() += pUp->getSwPrint().Pos(); } + if( bNotify ) - maFrame.Pos().Y() += 1; + { + aFrm.Pos().Y() += 1; + } } void SwFrame::MakeUpperPos( const SwFrame* pUp, const SwFrame* pPrv, bool bNotify ) { + SwFrameRect::FrameWriteAccess aFrm(*this); + if( pPrv ) { - maFrame.Pos( pPrv->Frame().Pos() ); - maFrame.Pos().Y() -= Frame().Height(); + aFrm.Pos( pPrv->getSwFrame().Pos() ); + aFrm.Pos().Y() -= aFrm.Height(); } else { - maFrame.Pos( pUp->Frame().Pos() ); - maFrame.Pos() += pUp->Prt().Pos(); - maFrame.Pos().Y() += pUp->Prt().Height() - maFrame.Height(); + aFrm.Pos( pUp->getSwFrame().Pos() ); + aFrm.Pos() += pUp->getSwPrint().Pos(); + aFrm.Pos().Y() += pUp->getSwPrint().Height() - aFrm.Height(); } + if( bNotify ) - maFrame.Pos().Y() -= 1; + { + aFrm.Pos().Y() -= 1; + } } void SwFrame::MakeLeftPos( const SwFrame* pUp, const SwFrame* pPrv, bool bNotify ) { + SwFrameRect::FrameWriteAccess aFrm(*this); + if( pPrv ) { - maFrame.Pos( pPrv->Frame().Pos() ); - maFrame.Pos().X() -= Frame().Width(); + aFrm.Pos( pPrv->getSwFrame().Pos() ); + aFrm.Pos().X() -= aFrm.Width(); } else { - maFrame.Pos( pUp->Frame().Pos() ); - maFrame.Pos() += pUp->Prt().Pos(); - maFrame.Pos().X() += pUp->Prt().Width() - maFrame.Width(); + aFrm.Pos( pUp->getSwFrame().Pos() ); + aFrm.Pos() += pUp->getSwPrint().Pos(); + aFrm.Pos().X() += pUp->getSwPrint().Width() - aFrm.Width(); } + if( bNotify ) - maFrame.Pos().X() -= 1; + { + aFrm.Pos().X() -= 1; + } } void SwFrame::MakeRightPos( const SwFrame* pUp, const SwFrame* pPrv, bool bNotify ) { + SwFrameRect::FrameWriteAccess aFrm(*this); + if( pPrv ) { - maFrame.Pos( pPrv->Frame().Pos() ); - maFrame.Pos().X() += pPrv->Frame().Width(); + aFrm.Pos( pPrv->getSwFrame().Pos() ); + aFrm.Pos().X() += pPrv->getSwFrame().Width(); } else { - maFrame.Pos( pUp->Frame().Pos() ); - maFrame.Pos() += pUp->Prt().Pos(); + aFrm.Pos( pUp->getSwFrame().Pos() ); + aFrm.Pos() += pUp->getSwPrint().Pos(); } + if( bNotify ) - maFrame.Pos().X() += 1; + { + aFrm.Pos().X() += 1; + } } void SwFrame::SetTopBottomMargins( long nTop, long nBot ) { - Prt().Top( nTop ); - Prt().Height( Frame().Height() - nTop - nBot ); + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Top( nTop ); + aPrt.Height( getSwFrame().Height() - nTop - nBot ); } void SwFrame::SetBottomTopMargins( long nBot, long nTop ) { - Prt().Top( nTop ); - Prt().Height( Frame().Height() - nTop - nBot ); + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Top( nTop ); + aPrt.Height( getSwFrame().Height() - nTop - nBot ); } void SwFrame::SetLeftRightMargins( long nLeft, long nRight) { - Prt().Left( nLeft ); - Prt().Width( Frame().Width() - nLeft - nRight ); + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Left( nLeft ); + aPrt.Width( getSwFrame().Width() - nLeft - nRight ); } void SwFrame::SetRightLeftMargins( long nRight, long nLeft) { - Prt().Left( nLeft ); - Prt().Width( Frame().Width() - nLeft - nRight ); + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Left( nLeft ); + aPrt.Width( getSwFrame().Width() - nLeft - nRight ); } /// checks the layout direction and invalidates the lower frames recursively, if necessary. @@ -291,10 +331,10 @@ void SwFrame::CheckDirChange() // previous frame according to new option 'Use former object positioning' Point SwFrame::GetFrameAnchorPos( bool bIgnoreFlysAnchoredAtThisFrame ) const { - Point aAnchor = Frame().Pos(); + Point aAnchor = getSwFrame().Pos(); if ( ( IsVertical() && !IsVertLR() ) || IsRightToLeft() ) - aAnchor.X() += Frame().Width(); + aAnchor.X() += getSwFrame().Width(); if ( IsTextFrame() ) { @@ -550,14 +590,14 @@ SwLayoutFrame::~SwLayoutFrame() /** |* The paintarea is the area, in which the content of a frame is allowed -|* to be displayed. This region could be larger than the printarea (Prt()) +|* to be displayed. This region could be larger than the printarea (getSwPrint()) |* of the upper, it includes e.g. often the margin of the page. |*/ const SwRect SwFrame::PaintArea() const { // NEW TABLES // Cell frames may not leave their upper: - SwRect aRect = IsRowFrame() ? GetUpper()->Frame() : Frame(); + SwRect aRect = IsRowFrame() ? GetUpper()->getSwFrame() : getSwFrame(); const bool bVert = IsVertical(); SwRectFn fnRect = bVert ? ( IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori; long nRight = (aRect.*fnRect->fnGetRight)(); @@ -571,17 +611,17 @@ const SwRect SwFrame::PaintArea() const if( pTmp->IsCellFrame() && pTmp->GetUpper() && pTmp->GetUpper()->IsVertical() != pTmp->IsVertical() ) nRowSpan = static_cast<const SwCellFrame*>(pTmp)->GetTabBox()->getRowSpan(); - long nTmpRight = (pTmp->Frame().*fnRect->fnGetRight)(); - long nTmpLeft = (pTmp->Frame().*fnRect->fnGetLeft)(); + long nTmpRight = (pTmp->getSwFrame().*fnRect->fnGetRight)(); + long nTmpLeft = (pTmp->getSwFrame().*fnRect->fnGetLeft)(); if( pTmp->IsRowFrame() && nRowSpan > 1 ) { const SwFrame* pNxt = pTmp; while( --nRowSpan > 0 && pNxt->GetNext() ) pNxt = pNxt->GetNext(); if( pTmp->IsVertical() ) - nTmpLeft = (pNxt->Frame().*fnRect->fnGetLeft)(); + nTmpLeft = (pNxt->getSwFrame().*fnRect->fnGetLeft)(); else - nTmpRight = (pNxt->Frame().*fnRect->fnGetRight)(); + nTmpRight = (pNxt->getSwFrame().*fnRect->fnGetRight)(); } OSL_ENSURE( pTmp, "PaintArea lost in time and space" ); if( pTmp->IsPageFrame() || pTmp->IsFlyFrame() || @@ -644,17 +684,17 @@ const SwRect SwFrame::PaintArea() const } /** -|* The unionframe is the framearea (Frame()) of a frame expanded by the +|* The unionframe is the framearea (getSwFrame()) of a frame expanded by the |* printarea, if there's a negative margin at the left or right side. |*/ const SwRect SwFrame::UnionFrame( bool bBorder ) const { bool bVert = IsVertical(); SwRectFn fnRect = bVert ? ( IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori; - long nLeft = (Frame().*fnRect->fnGetLeft)(); - long nWidth = (Frame().*fnRect->fnGetWidth)(); - long nPrtLeft = (Prt().*fnRect->fnGetLeft)(); - long nPrtWidth = (Prt().*fnRect->fnGetWidth)(); + long nLeft = (getSwFrame().*fnRect->fnGetLeft)(); + long nWidth = (getSwFrame().*fnRect->fnGetWidth)(); + long nPrtLeft = (getSwPrint().*fnRect->fnGetLeft)(); + long nPrtWidth = (getSwPrint().*fnRect->fnGetWidth)(); if( nPrtLeft + nPrtWidth > nWidth ) nWidth = nPrtLeft + nPrtWidth; if( nPrtLeft < 0 ) @@ -691,7 +731,7 @@ const SwRect SwFrame::UnionFrame( bool bBorder ) const nAdd = nTmp; } nWidth = nRight + nAdd - nLeft; - SwRect aRet( Frame() ); + SwRect aRet( getSwFrame() ); (aRet.*fnRect->fnSetPosX)( nLeft ); (aRet.*fnRect->fnSetWidth)( nWidth ); return aRet; diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index c840c62649ea..cdf0ef0b9d01 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -199,7 +199,7 @@ static SwTwips lcl_GetHeightOfRows( const SwFrame* pStart, long nCount ) SwRectFnSet aRectFnSet(pStart); while ( pStart && nCount > 0 ) { - nRet += aRectFnSet.GetHeight(pStart->Frame()); + nRet += aRectFnSet.GetHeight(pStart->getSwFrame()); pStart = pStart->GetNext(); --nCount; } @@ -266,7 +266,7 @@ static void lcl_InvalidateLowerObjs( SwLayoutFrame& _rLayoutFrame, // modification of the anchored object resp. it's attributes // due to the movement SwObjPositioningInProgress aObjPosInProgress( *pAnchoredObj ); - pAnchoredObj->SetObjLeft( _pPageFrame->Frame().Right() ); + pAnchoredObj->SetObjLeft( _pPageFrame->getSwFrame().Right() ); // #115759# - reset character rectangle, // top of line and relative position in order to assure, // that anchored object is correctly positioned. @@ -344,7 +344,7 @@ static void lcl_ShrinkCellsAndAllContent( SwRowFrame& rRow ) { lcl_ShrinkCellsAndAllContent( *pTmpRow ); - if (aRectFnSet.GetHeight(pTmpRow->Frame()) > 0) + if (aRectFnSet.GetHeight(pTmpRow->getSwFrame()) > 0) bAllRowsCollapsed = false; pTmpRow = static_cast<SwRowFrame*>(pTmpRow->GetNext()); @@ -353,21 +353,27 @@ static void lcl_ShrinkCellsAndAllContent( SwRowFrame& rRow ) if (bAllRowsCollapsed) { // All rows of this table have 0 height -> set height of the table itself as well. - aRectFnSet.SetHeight(pTmp->Frame(), 0); - aRectFnSet.SetTop(pTmp->Prt(), 0); - aRectFnSet.SetHeight(pTmp->Prt(), 0); + SwFrameRect::FrameWriteAccess aFrm(*pTmp); + aRectFnSet.SetHeight(aFrm, 0); + + SwFrameRect::PrintWriteAccess aPrt(*pTmp); + aRectFnSet.SetTop(aPrt, 0); + aRectFnSet.SetHeight(aPrt, 0); } else bAllLowersCollapsed = false; } else { - pTmp->Shrink(aRectFnSet.GetHeight(pTmp->Frame())); - aRectFnSet.SetTop(pTmp->Prt(), 0); - aRectFnSet.SetHeight(pTmp->Prt(), 0); + pTmp->Shrink(aRectFnSet.GetHeight(pTmp->getSwFrame())); + SwFrameRect::PrintWriteAccess aPrt(*pTmp); + aRectFnSet.SetTop(aPrt, 0); + aRectFnSet.SetHeight(aPrt, 0); - if (aRectFnSet.GetHeight(pTmp->Frame()) > 0) + if (aRectFnSet.GetHeight(pTmp->getSwFrame()) > 0) + { bAllLowersCollapsed = false; + } } pTmp = pTmp->GetPrev(); @@ -382,9 +388,12 @@ static void lcl_ShrinkCellsAndAllContent( SwRowFrame& rRow ) if (bAllLowersCollapsed) { // All lower frame of this cell have 0 height -> set height of the cell itself as well. - aRectFnSet.SetHeight(pCurrMasterCell->Frame(), 0); - aRectFnSet.SetTop(pCurrMasterCell->Prt(), 0); - aRectFnSet.SetHeight(pCurrMasterCell->Prt(), 0); + SwFrameRect::FrameWriteAccess aFrm(*pCurrMasterCell); + aRectFnSet.SetHeight(aFrm, 0); + + SwFrameRect::PrintWriteAccess aPrt(*pCurrMasterCell); + aRectFnSet.SetTop(aPrt, 0); + aRectFnSet.SetHeight(aPrt, 0); } else bAllCellsCollapsed = false; @@ -395,9 +404,12 @@ static void lcl_ShrinkCellsAndAllContent( SwRowFrame& rRow ) if (bAllCellsCollapsed) { // All cells have 0 height -> set height of row as well. - aRectFnSet.SetHeight(rRow.Frame(), 0); - aRectFnSet.SetTop(rRow.Prt(), 0); - aRectFnSet.SetHeight(rRow.Prt(), 0); + SwFrameRect::FrameWriteAccess aFrm(rRow); + aRectFnSet.SetHeight(aFrm, 0); + + SwFrameRect::PrintWriteAccess aPrt(rRow); + aRectFnSet.SetTop(aPrt, 0); + aRectFnSet.SetHeight(aPrt, 0); } } @@ -520,7 +532,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 = aRectFnSet.GetHeight(pTmpLastLineRow->Frame()); + nMinHeight = aRectFnSet.GetHeight(pTmpLastLineRow->getSwFrame()); else { { @@ -574,8 +586,8 @@ static void lcl_PreprocessRowsInCells( SwTabFrame& rTab, SwRowFrame& rLastLine, lcl_MoveFootnotes( rTab, *rTab.GetFollow(), *pTmpLastLineRow ); pTmpLastLineRow->RemoveFromLayout(); pTmpLastLineRow->InsertBefore( pCurrFollowFlowLineCell, nullptr ); - pTmpLastLineRow->Shrink( aRectFnSet.GetHeight(pTmpLastLineRow->Frame()) ); - pCurrFollowFlowLineCell->Grow( aRectFnSet.GetHeight(pTmpLastLineRow->Frame()) ); + pTmpLastLineRow->Shrink( aRectFnSet.GetHeight(pTmpLastLineRow->getSwFrame()) ); + pCurrFollowFlowLineCell->Grow( aRectFnSet.GetHeight(pTmpLastLineRow->getSwFrame()) ); pTmpLastLineRow = pTmp; } } @@ -629,7 +641,7 @@ static bool lcl_RecalcSplitLine( SwRowFrame& rLastLine, SwRowFrame& rFollowLine, vcl::RenderContext* pRenderContext = rLastLine.getRootFrame()->GetCurrShell()->GetOut(); SwTabFrame& rTab = static_cast<SwTabFrame&>(*rLastLine.GetUpper()); SwRectFnSet aRectFnSet(rTab.GetUpper()); - SwTwips nCurLastLineHeight = aRectFnSet.GetHeight(rLastLine.Frame()); + SwTwips nCurLastLineHeight = aRectFnSet.GetHeight(rLastLine.getSwFrame()); // If there are nested cells in rLastLine, the recalculation of the last // line needs some preprocessing. @@ -706,7 +718,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 = - aRectFnSet.BottomDist(rTab.Frame(), aRectFnSet.GetPrtBottom(*rTab.GetUpper())); + aRectFnSet.BottomDist(rTab.getSwFrame(), aRectFnSet.GetPrtBottom(*rTab.GetUpper())); if ( nDistanceToUpperPrtBottom < 0 || !rTab.DoesObjsFit() ) bRet = false; @@ -781,9 +793,13 @@ static void lcl_AdjustRowSpanCells( SwRowFrame* pRow ) { // calculate height of cell: const long nNewCellHeight = lcl_GetHeightOfRows( pRow, nLayoutRowSpan ); - const long nDiff = nNewCellHeight - aRectFnSet.GetHeight(pCellFrame->Frame()); + const long nDiff = nNewCellHeight - aRectFnSet.GetHeight(pCellFrame->getSwFrame()); + if ( nDiff ) - aRectFnSet.AddBottom(pCellFrame->Frame(), nDiff); + { + SwFrameRect::FrameWriteAccess aFrm(*pCellFrame); + aRectFnSet.AddBottom(aFrm, nDiff); + } } pCellFrame = static_cast<SwCellFrame*>(pCellFrame->GetNext()); @@ -864,7 +880,7 @@ bool SwTabFrame::RemoveFollowFlowLine() while ( pRow && nRowsToMove-- > 1 ) { SwFrame* pNxt = pRow->GetNext(); - nGrow += aRectFnSet.GetHeight(pRow->Frame()); + nGrow += aRectFnSet.GetHeight(pRow->getSwFrame()); // The footnotes have to be moved: lcl_MoveFootnotes( *GetFollow(), *this, static_cast<SwRowFrame&>(*pRow) ); @@ -980,20 +996,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.YDiff(nCutPos, aRectFnSet.GetTop(Frame())); + aRectFnSet.YDiff(nCutPos, aRectFnSet.GetTop(getSwFrame())); nRemainingSpaceForLastRow -= aRectFnSet.GetTopMargin(*this); // Make pRow point to the line that does not fit anymore: while( pRow->GetNext() && - nRemainingSpaceForLastRow >= ( aRectFnSet.GetHeight(pRow->Frame()) + + nRemainingSpaceForLastRow >= ( aRectFnSet.GetHeight(pRow->getSwFrame()) + (IsCollapsingBorders() ? pRow->GetBottomLineSize() : 0 ) ) ) { if( bTryToSplit || !pRow->IsRowSpanLine() || - 0 != aRectFnSet.GetHeight(pRow->Frame()) ) + 0 != aRectFnSet.GetHeight(pRow->getSwFrame()) ) ++nRowCount; - nRemainingSpaceForLastRow -= aRectFnSet.GetHeight(pRow->Frame()); + nRemainingSpaceForLastRow -= aRectFnSet.GetHeight(pRow->getSwFrame()); pRow = static_cast<SwRowFrame*>(pRow->GetNext()); } @@ -1045,7 +1061,7 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK { const SwRowFrame* pLowerRow = static_cast<SwRowFrame*>(pLowerCell->Lower()); if ( !pLowerRow->IsRowSplitAllowed() && - aRectFnSet.GetHeight(pLowerRow->Frame()) > nRemainingSpaceForLastRow ) + aRectFnSet.GetHeight(pLowerRow->getSwFrame()) > nRemainingSpaceForLastRow ) { bKeepNextRow = true; break; @@ -1062,7 +1078,7 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK if ( bKeepNextRow ) { pRow = GetFirstNonHeadlineRow(); - if ( pRow && pRow->IsRowSpanLine() && 0 == aRectFnSet.GetHeight(pRow->Frame()) ) + if ( pRow && pRow->IsRowSpanLine() && 0 == aRectFnSet.GetHeight(pRow->getSwFrame()) ) pRow = static_cast<SwRowFrame*>(pRow->GetNext()); if ( pRow ) { @@ -1139,9 +1155,16 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK pFoll = new SwTabFrame( *this ); // We give the follow table an initial width. - aRectFnSet.AddWidth(pFoll->Frame(), aRectFnSet.GetWidth(Frame())); - aRectFnSet.AddWidth(pFoll->Prt(), aRectFnSet.GetWidth(Prt())); - aRectFnSet.SetLeft(pFoll->Frame(), aRectFnSet.GetLeft(Frame())); + { + SwFrameRect::FrameWriteAccess aFrm(*pFoll); + aRectFnSet.AddWidth(aFrm, aRectFnSet.GetWidth(getSwFrame())); + aRectFnSet.SetLeft(aFrm, aRectFnSet.GetLeft(getSwFrame())); + } + + { + SwFrameRect::PrintWriteAccess aPrt(*pFoll); + aRectFnSet.AddWidth(aPrt, aRectFnSet.GetWidth(getSwPrint())); + } // Insert the new follow table pFoll->InsertBehind( GetUpper(), this ); @@ -1225,7 +1248,7 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK while ( pRow ) { SwFrame* pNxt = pRow->GetNext(); - nShrink += aRectFnSet.GetHeight(pRow->Frame()); + nShrink += aRectFnSet.GetHeight(pRow->getSwFrame()); // The footnotes do not have to be moved, this is done in the // MoveFwd of the follow table!!! pRow->RemoveFromLayout(); @@ -1244,7 +1267,7 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK while ( pRow ) { SwFrame* pNxt = pRow->GetNext(); - nShrink += aRectFnSet.GetHeight(pRow->Frame()); + nShrink += aRectFnSet.GetHeight(pRow->getSwFrame()); // The footnotes have to be moved: lcl_MoveFootnotes( *this, *GetFollow(), *pRow ); @@ -1303,7 +1326,7 @@ bool SwTabFrame::Join() while ( pRow ) { pNxt = pRow->GetNext(); - nHeight += aRectFnSet.GetHeight(pRow->Frame()); + nHeight += aRectFnSet.GetHeight(pRow->getSwFrame()); pRow->RemoveFromLayout(); pRow->InvalidateAll_(); pRow->InsertBehind( this, pPrv ); @@ -1344,7 +1367,7 @@ void SwInvalidatePositions( SwFrame *pFrame, long nBottom ) pFrame = pFrame->GetNext(); } while ( pFrame && ( bAll || - aRectFnSet.YDiff( aRectFnSet.GetTop(pFrame->Frame()), nBottom ) < 0 ) ); + aRectFnSet.YDiff( aRectFnSet.GetTop(pFrame->getSwFrame()), nBottom ) < 0 ) ); } void SwInvalidateAll( SwFrame *pFrame, long nBottom ) @@ -1379,7 +1402,7 @@ void SwInvalidateAll( SwFrame *pFrame, long nBottom ) pFrame = pFrame->GetNext(); } while ( pFrame && ( bAll || - aRectFnSet.YDiff( aRectFnSet.GetTop(pFrame->Frame()), nBottom ) < 0 ) ); + aRectFnSet.YDiff( aRectFnSet.GetTop(pFrame->getSwFrame()), nBottom ) < 0 ) ); } // #i29550# @@ -1489,7 +1512,7 @@ bool SwContentFrame::CalcLowers( SwLayoutFrame* pLay, const SwLayoutFrame* pDont } pCnt->GetUpper()->Calc(pRenderContext); } - if( ! bAll && aRectFnSet.YDiff(aRectFnSet.GetTop(pCnt->Frame()), nBottom) > 0 ) + if( ! bAll && aRectFnSet.YDiff(aRectFnSet.GetTop(pCnt->getSwFrame()), nBottom) > 0 ) break; pCnt = pCnt->GetNextContentFrame(); } @@ -1537,7 +1560,7 @@ static bool lcl_InnerCalcLayout( SwFrame *pFrame, pFrame = pFrame->GetNext(); } while( pFrame && ( bAll || - aRectFnSet.YDiff(aRectFnSet.GetTop(pFrame->Frame()), nBottom) < 0 ) + aRectFnSet.YDiff(aRectFnSet.GetTop(pFrame->getSwFrame()), nBottom) < 0 ) && pFrame->GetUpper() == pOldUp ); return bRet; } @@ -1880,7 +1903,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) } // a new one is moved forwards immediately - if ( !Frame().Top() && IsFollow() ) + if ( !getSwFrame().Top() && IsFollow() ) { SwFrame *pPre = GetPrev(); if ( pPre && pPre->IsTabFrame() && static_cast<SwTabFrame*>(pPre)->GetFollow() == this) @@ -1909,12 +1932,12 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) bSplit = false; } - Point aOldPos( aRectFnSet.GetPos(Frame()) ); + Point aOldPos( aRectFnSet.GetPos(getSwFrame()) ); MakePos(); - if ( aOldPos != aRectFnSet.GetPos(Frame()) ) + if ( aOldPos != aRectFnSet.GetPos(getSwFrame()) ) { - if ( aOldPos.Y() != aRectFnSet.GetTop(Frame()) ) + if ( aOldPos.Y() != aRectFnSet.GetTop(getSwFrame()) ) { SwHTMLTableLayout *pLayout = GetTable()->GetHTMLTableLayout(); if( pLayout ) @@ -1948,20 +1971,20 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) { SwFrame* pFrame = GetFirstNonHeadlineRow(); if ( pFrame ) - n1StLineHeight = aRectFnSet.GetHeight(pFrame->Frame()); + n1StLineHeight = aRectFnSet.GetHeight(pFrame->getSwFrame()); } if ( !mbValidSize || !mbValidPrtArea ) { - const long nOldPrtWidth = aRectFnSet.GetWidth(Prt()); - const long nOldFrameWidth = aRectFnSet.GetWidth(Frame()); - const Point aOldPrtPos = aRectFnSet.GetPos(Prt()); + const long nOldPrtWidth = aRectFnSet.GetWidth(getSwPrint()); + const long nOldFrameWidth = aRectFnSet.GetWidth(getSwFrame()); + const Point aOldPrtPos = aRectFnSet.GetPos(getSwPrint()); Format( getRootFrame()->GetCurrShell()->GetOut(), pAttrs ); SwHTMLTableLayout *pLayout = GetTable()->GetHTMLTableLayout(); if ( pLayout && - (aRectFnSet.GetWidth(Prt()) != nOldPrtWidth || - aRectFnSet.GetWidth(Frame()) != nOldFrameWidth) ) + (aRectFnSet.GetWidth(getSwPrint()) != nOldPrtWidth || + aRectFnSet.GetWidth(getSwFrame()) != nOldFrameWidth) ) { pAccess.reset(); m_bCalcLowers |= pLayout->Resize( @@ -1969,7 +1992,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) pAccess = o3tl::make_unique<SwBorderAttrAccess>(SwFrame::GetCache(), this); pAttrs = pAccess->Get(); } - if ( aOldPrtPos != aRectFnSet.GetPos(Prt()) ) + if ( aOldPrtPos != aRectFnSet.GetPos(getSwPrint()) ) aNotify.SetLowersComplete( false ); } @@ -1985,7 +2008,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) { // Only if the height of the first line got smaller. SwFrame *pFrame = GetFirstNonHeadlineRow(); - if( pFrame && n1StLineHeight >aRectFnSet.GetHeight(pFrame->Frame()) ) + if( pFrame && n1StLineHeight >aRectFnSet.GetHeight(pFrame->getSwFrame()) ) { SwTabFrame *pMaster = FindMaster(); bool bDummy; @@ -2004,9 +2027,9 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) MoveLowerFootnotes( nullptr, pOldBoss, nullptr, true ); if ( bReformat || bKeep ) { - long nOldTop = aRectFnSet.GetTop(Frame()); + long nOldTop = aRectFnSet.GetTop(getSwFrame()); MakePos(); - if( nOldTop != aRectFnSet.GetTop(Frame()) ) + if( nOldTop != aRectFnSet.GetTop(getSwFrame()) ) { SwHTMLTableLayout *pHTMLLayout = GetTable()->GetHTMLTableLayout(); @@ -2054,7 +2077,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 = - aRectFnSet.BottomDist(Frame(), aRectFnSet.GetPrtBottom(*GetUpper())); + aRectFnSet.BottomDist(getSwFrame(), 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(); @@ -2064,7 +2087,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) if ( GetUpper()->Grow( -nDistanceToUpperPrtBottom ) ) { // upper is grown --> recalculate <nDistanceToUpperPrtBottom> - nDistanceToUpperPrtBottom = aRectFnSet.BottomDist(Frame(), aRectFnSet.GetPrtBottom(*GetUpper())); + nDistanceToUpperPrtBottom = aRectFnSet.BottomDist(getSwFrame(), aRectFnSet.GetPrtBottom(*GetUpper())); } } @@ -2085,7 +2108,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) SwTwips nDeadLine = aRectFnSet.GetPrtBottom(*pTmp); if ( bBrowseMode ) nDeadLine += pTmp->Grow( LONG_MAX, true ); - if( aRectFnSet.BottomDist( Frame(), nDeadLine ) > 0 ) + if( aRectFnSet.BottomDist( getSwFrame(), nDeadLine ) > 0 ) { // First, we remove an existing follow flow line. if ( HasFollowFlowLine() ) @@ -2121,7 +2144,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) continue; } - const SwTwips nOld = aRectFnSet.GetHeight(Frame()); + const SwTwips nOld = aRectFnSet.GetHeight(getSwFrame()); long nRowsToMove = lcl_GetMaximumLayoutRowSpan( *pRow ); SwFrame* pRowToMove = pRow; @@ -2154,7 +2177,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) pRowToMove = pNextRow; } - if ( nOld != aRectFnSet.GetHeight(Frame()) ) + if ( nOld != aRectFnSet.GetHeight(getSwFrame()) ) lcl_RecalcTable( *this, static_cast<SwLayoutFrame*>(pRow), aNotify ); continue; @@ -2292,7 +2315,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) // all kinds of unexpected things could happen. if ( !bEmulateTableKeepFwdMoveAllowed || ( IsInSct() && (FindSctFrame())->Lower()->IsColumnFrame() && - 0 == aRectFnSet.GetHeight(GetUpper()->Frame()) + 0 == aRectFnSet.GetHeight(GetUpper()->getSwFrame()) ) ) { bTryToSplit = false; @@ -2318,7 +2341,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( aRectFnSet.BottomDist( Frame(), nDeadLine ) > 0 && !bLastRowHasToMoveToFollow ) + if( aRectFnSet.BottomDist( getSwFrame(), nDeadLine ) > 0 && !bLastRowHasToMoveToFollow ) { continue; } @@ -2355,7 +2378,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) ++nMinNumOfLines; const SwTwips nBreakLine = aRectFnSet.YInc( - aRectFnSet.GetTop(Frame()), + aRectFnSet.GetTop(getSwFrame()), aRectFnSet.GetTopMargin(*this) + lcl_GetHeightOfRows( GetLower(), nMinNumOfLines ) ); @@ -2448,7 +2471,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) const bool bOldJoinLock = GetFollow()->IsJoinLocked(); GetFollow()->LockJoin(); ::lcl_RecalcRow( static_cast<SwRowFrame&>(*GetFollow()->Lower()), - fnRectX.GetBottom(GetFollow()->GetUpper()->Frame()) ); + fnRectX.GetBottom(GetFollow()->GetUpper()->getSwFrame()) ); // #i43913# // #i63632# Do not unlock the // follow if it wasn't locked before. @@ -2551,7 +2574,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 = - aRectFnSet.BottomDist( Frame(), aRectFnSet.GetPrtBottom(*GetUpper())); + aRectFnSet.BottomDist( getSwFrame(), aRectFnSet.GetPrtBottom(*GetUpper())); if ( nDistToUpperPrtBottom >= 0 || bTryToSplit ) { lcl_RecalcTable( *this, nullptr, aNotify ); @@ -2606,10 +2629,10 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper, { SwRectFnSet aRectFnSet(this); const bool bConsiderWrapOnObjPos = rIDSA.get(DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION); - long nPrtPos = aRectFnSet.GetTop(Frame()); + long nPrtPos = aRectFnSet.GetTop(getSwFrame()); nPrtPos = aRectFnSet.YInc( nPrtPos, rUpper ); - SwRect aRect( Frame() ); - long nYDiff = aRectFnSet.YDiff( aRectFnSet.GetTop(Prt()), rUpper ); + SwRect aRect( getSwFrame() ); + long nYDiff = aRectFnSet.YDiff( aRectFnSet.GetTop(getSwPrint()), rUpper ); if( nYDiff > 0 ) aRectFnSet.AddBottom( aRect, -nYDiff ); for ( size_t i = 0; i < pPage->GetSortedObjs()->size(); ++i ) @@ -2696,7 +2719,7 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper, { const long nWidth = aRectFnSet.XDiff( aRectFnSet.GetRight(aFlyRect), - aRectFnSet.GetLeft(pFly->GetAnchorFrame()->Frame()) ); + aRectFnSet.GetLeft(pFly->GetAnchorFrame()->getSwFrame()) ); rLeftOffset = std::max( rLeftOffset, nWidth ); bInvalidatePrtArea = true; } @@ -2705,7 +2728,7 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper, text::HoriOrientation::RIGHT == rHori.GetHoriOrient() ) { const long nWidth = aRectFnSet.XDiff( - aRectFnSet.GetRight(pFly->GetAnchorFrame()->Frame()), + aRectFnSet.GetRight(pFly->GetAnchorFrame()->getSwFrame()), aRectFnSet.GetLeft(aFlyRect) ); rRightOffset = std::max( rRightOffset, nWidth ); bInvalidatePrtArea = true; @@ -2713,7 +2736,7 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper, } } } - rUpper = aRectFnSet.YDiff( nPrtPos, aRectFnSet.GetTop(Frame()) ); + rUpper = aRectFnSet.YDiff( nPrtPos, aRectFnSet.GetTop(getSwFrame()) ); } return bInvalidatePrtArea; @@ -2728,10 +2751,13 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA SwRectFnSet aRectFnSet(this); if ( !mbValidSize ) { - long nDiff = aRectFnSet.GetWidth(GetUpper()->Prt()) - - aRectFnSet.GetWidth(Frame()); + long nDiff = aRectFnSet.GetWidth(GetUpper()->getSwPrint()) - + aRectFnSet.GetWidth(getSwFrame()); if( nDiff ) - aRectFnSet.AddRight( maFrame, nDiff ); + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.AddRight( aFrm, nDiff ); + } } //VarSize is always the height. @@ -2766,8 +2792,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 = aRectFnSet.GetHeight(Prt()); - const SwTwips nMax = aRectFnSet.GetWidth(maFrame); + const SwTwips nOldHeight = aRectFnSet.GetHeight(getSwPrint()); + const SwTwips nMax = aRectFnSet.GetWidth(getSwFrame()); // OD 14.03.2003 #i9040# - adjust variable names. const SwTwips nLeftLine = pAttrs->CalcLeftLine(); @@ -2947,12 +2973,14 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA //The page width can be bigger because objects with //"over-size" are possible (RootFrame::ImplCalcBrowseWidth()) long nWidth = pSh->GetBrowseWidth(); - nWidth -= Prt().Left(); + nWidth -= getSwPrint().Left(); nWidth -= pAttrs->CalcRightLine(); - Prt().Width( std::min( nWidth, Prt().Width() ) ); + + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Width( std::min( nWidth, aPrt.Width() ) ); } - if ( nOldHeight != aRectFnSet.GetHeight(Prt()) ) + if ( nOldHeight != aRectFnSet.GetHeight(getSwPrint()) ) mbValidSize = false; } @@ -2965,13 +2993,13 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA SwFrame *pFrame = m_pLower; while ( pFrame ) { - nRemaining += aRectFnSet.GetHeight(pFrame->Frame()); + nRemaining += aRectFnSet.GetHeight(pFrame->getSwFrame()); pFrame = pFrame->GetNext(); } //And now add the borders nRemaining += nUpper + nLower; - nDiff = aRectFnSet.GetHeight(Frame()) - nRemaining; + nDiff = aRectFnSet.GetHeight(getSwFrame()) - nRemaining; if ( nDiff > 0 ) Shrink( nDiff ); else if ( nDiff < 0 ) @@ -2982,7 +3010,7 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA SwTwips SwTabFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) { SwRectFnSet aRectFnSet(this); - SwTwips nHeight = aRectFnSet.GetHeight(Frame()); + SwTwips nHeight = aRectFnSet.GetHeight(getSwFrame()); if( nHeight > 0 && nDist > ( LONG_MAX - nHeight ) ) nDist = LONG_MAX - nHeight; @@ -2991,15 +3019,15 @@ SwTwips SwTabFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) if ( GetUpper() ) { - SwRect aOldFrame( Frame() ); + SwRect aOldFrame( getSwFrame() ); //The upper only grows as far as needed. nReal provides the distance //which is already available. - SwTwips nReal = aRectFnSet.GetHeight(GetUpper()->Prt()); + SwTwips nReal = aRectFnSet.GetHeight(GetUpper()->getSwPrint()); SwFrame *pFrame = GetUpper()->Lower(); while ( pFrame && GetFollow() != pFrame ) { - nReal -= aRectFnSet.GetHeight(pFrame->Frame()); + nReal -= aRectFnSet.GetHeight(pFrame->getSwFrame()); pFrame = pFrame->GetNext(); } @@ -3016,7 +3044,10 @@ SwTwips SwTabFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) if ( !bTst ) { - aRectFnSet.AddBottom( Frame(), nDist ); + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.AddBottom( aFrm, nDist ); + } SwRootFrame *pRootFrame = getRootFrame(); if( pRootFrame && pRootFrame->IsAnyShellAccessible() && @@ -3170,7 +3201,7 @@ void SwTabFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew, CheckPageDescs( pPage ); if (GetFormat()->GetPageDesc().GetNumOffset()) static_cast<SwRootFrame*>(pPage->GetUpper())->SetVirtPageNum( true ); - SwDocPosUpdate aMsgHint( pPage->Frame().Top() ); + SwDocPosUpdate aMsgHint( pPage->getSwFrame().Top() ); GetFormat()->GetDoc()->getIDocumentFieldsAccess().UpdatePageFields( &aMsgHint ); } } @@ -3337,33 +3368,33 @@ bool SwTabFrame::ShouldBwdMoved( SwLayoutFrame *pNewUpper, bool, bool &rReformat if ( !SwFlowFrame::IsMoveBwdJump() ) { - long nOldWidth = aRectFnSet.GetWidth(GetUpper()->Prt()); + long nOldWidth = aRectFnSet.GetWidth(GetUpper()->getSwPrint()); SwRectFnSet fnRectX(pNewUpper); - long nNewWidth = fnRectX.GetWidth(pNewUpper->Prt()); + long nNewWidth = fnRectX.GetWidth(pNewUpper->getSwPrint()); if( std::abs( nNewWidth - nOldWidth ) < 2 ) { - bMoveAnyway = BwdMoveNecessary( pOldPage, Frame() ) > 1; + bMoveAnyway = BwdMoveNecessary( pOldPage, getSwFrame() ) > 1; if( !bMoveAnyway ) { - SwRect aRect( pNewUpper->Prt() ); - aRect.Pos() += pNewUpper->Frame().Pos(); + SwRect aRect( pNewUpper->getSwPrint() ); + aRect.Pos() += pNewUpper->getSwFrame().Pos(); const SwFrame *pPrevFrame = pNewUpper->Lower(); while ( pPrevFrame && pPrevFrame != this ) { - fnRectX.SetTop( aRect, fnRectX.GetBottom(pPrevFrame->Frame()) ); + fnRectX.SetTop( aRect, fnRectX.GetBottom(pPrevFrame->getSwFrame()) ); pPrevFrame = pPrevFrame->GetNext(); } bMoveAnyway = BwdMoveNecessary( pNewPage, aRect) > 1; // #i54861# Due to changes made in PrepareMake, // the tabfrm may not have a correct position. Therefore - // it is possible that pNewUpper->Prt().Height == 0. In this + // it is possible that pNewUpper->getSwPrint().Height == 0. In this // case the above calculation of nSpace might give wrong // 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 = fnRectX.GetHeight(aRect); - if ( fnRectX.GetHeight(pNewUpper->Prt()) > 0 || nTmpSpace <= 0 ) + if ( fnRectX.GetHeight(pNewUpper->getSwPrint()) > 0 || nTmpSpace <= 0 ) nSpace = nTmpSpace; const SwViewShell *pSh = getRootFrame()->GetCurrShell(); @@ -3497,11 +3528,11 @@ void SwTabFrame::Cut() SwFrame::DestroyFrame(pUp); } } - else if( aRectFnSet.GetHeight(Frame()) ) + else if( aRectFnSet.GetHeight(getSwFrame()) ) { // OD 26.08.2003 #i18103# - *no* 'ColUnlock' of section - // undo changes of fix for #104992# - pUp->Shrink( Frame().Height() ); + pUp->Shrink( getSwFrame().Height() ); } } @@ -3535,10 +3566,10 @@ void SwTabFrame::Paste( SwFrame* pParent, SwFrame* pSibling ) } SwRectFnSet aRectFnSet(this); - if( aRectFnSet.GetHeight(Frame()) ) - pParent->Grow( aRectFnSet.GetHeight(Frame()) ); + if( aRectFnSet.GetHeight(getSwFrame()) ) + pParent->Grow( aRectFnSet.GetHeight(getSwFrame()) ); - if( aRectFnSet.GetWidth(Frame()) != aRectFnSet.GetWidth(pParent->Prt()) ) + if( aRectFnSet.GetWidth(getSwFrame()) != aRectFnSet.GetWidth(pParent->getSwPrint()) ) Prepare( PREP_FIXSIZE_CHG ); if ( GetPrev() ) { @@ -3740,14 +3771,14 @@ long CalcHeightWithFlys( const SwFrame *pFrame ) const SwTwips nFrameDiff = aRectFnSet.YDiff( - aRectFnSet.GetTop(pTmp->Frame()), - aRectFnSet.GetTop(pFrame->Frame()) ); + aRectFnSet.GetTop(pTmp->getSwFrame()), + aRectFnSet.GetTop(pFrame->getSwFrame()) ); nHeight = std::max( nHeight, nDistOfFlyBottomToAnchorTop + nFrameDiff - - aRectFnSet.GetHeight(pFrame->Frame()) ); + aRectFnSet.GetHeight(pFrame->getSwFrame()) ); // #i56115# The first height calculation - // gives wrong results if pFrame->Prt().Y() > 0. We do + // gives wrong results if pFrame->getSwPrint().Y() > 0. We do // a second calculation based on the actual rectangles of // pFrame and pAnchoredObj, and use the maximum of the results. // I do not want to remove the first calculation because @@ -3755,7 +3786,7 @@ long CalcHeightWithFlys( const SwFrame *pFrame ) // might be the better option to calculate nHeight. const SwTwips nDistOfFlyBottomToAnchorTop2 = aRectFnSet.YDiff( aRectFnSet.GetBottom(pAnchoredObj->GetObjRect()), - aRectFnSet.GetBottom(pFrame->Frame()) ); + aRectFnSet.GetBottom(pFrame->getSwFrame()) ); nHeight = std::max( nHeight, nDistOfFlyBottomToAnchorTop2 ); } @@ -3826,7 +3857,7 @@ static SwTwips lcl_CalcMinCellHeight( const SwLayoutFrame *_pCell, } else { - long nLowHeight = aRectFnSet.GetHeight(pLow->Frame()); + long nLowHeight = aRectFnSet.GetHeight(pLow->getSwFrame()); nHeight += nLowHeight; // #i26945# if ( _bConsiderObjs ) @@ -3906,7 +3937,7 @@ static SwTwips lcl_CalcMinRowHeight( const SwRowFrame* _pRow, const SwFrame* pMasterRow = rMaster.GetUpper(); while ( pMasterRow && pMasterRow != _pRow ) { - nTmp -= aRectFnSet.GetHeight(pMasterRow->Frame()); + nTmp -= aRectFnSet.GetHeight(pMasterRow->getSwFrame()); pMasterRow = pMasterRow->GetNext(); } } @@ -4043,7 +4074,7 @@ static SwTwips lcl_calcHeightOfRowBeforeThisFrame(const SwRowFrame& rRow) { // The found row frame belongs to a table frame that precedes // (above) this one in chain. So, include it in the sum - nResult += aRectFnSet.GetHeight(pCurRow->Frame()); + nResult += aRectFnSet.GetHeight(pCurRow->getSwFrame()); } } } @@ -4062,10 +4093,14 @@ void SwRowFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA //RowFrames don't have borders and so on therefore the PrtArea always //matches the Frame. mbValidPrtArea = true; - maPrt.Left( 0 ); - maPrt.Top( 0 ); - maPrt.Width ( maFrame.Width() ); - maPrt.Height( maFrame.Height() ); + + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Left( 0 ); + aPrt.Top( 0 ); + aPrt.Width ( getSwFrame().Width() ); + aPrt.Height( getSwFrame().Height() ); + } // #i29550# // Here we calculate the top-printing area for the lower cell frames @@ -4178,7 +4213,7 @@ void SwRowFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA OSL_ENSURE( rFrameSize.GetSize().Height() > 0, "Has it" ); } #endif - const SwTwips nDiff = aRectFnSet.GetHeight(Frame()) - + const SwTwips nDiff = aRectFnSet.GetHeight(getSwFrame()) - ( HasFixSize() && !IsRowSpanLine() ? pAttrs->GetSize().Height() // #i26945# @@ -4199,10 +4234,10 @@ void SwRowFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA if ( !GetNext() ) { //The last fills the remaining space in the upper. - SwTwips nDiff = aRectFnSet.GetHeight(GetUpper()->Prt()); + SwTwips nDiff = aRectFnSet.GetHeight(GetUpper()->getSwPrint()); SwFrame *pSibling = GetUpper()->Lower(); do - { nDiff -= aRectFnSet.GetHeight(pSibling->Frame()); + { nDiff -= aRectFnSet.GetHeight(pSibling->getSwFrame()); pSibling = pSibling->GetNext(); } while ( pSibling ); if ( nDiff > 0 ) @@ -4239,10 +4274,14 @@ 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 - aRectFnSet.GetHeight(pCellFrame->Frame()); + const long nDiff = nHeight - aRectFnSet.GetHeight(pCellFrame->getSwFrame()); if ( nDiff ) { - aRectFnSet.AddBottom( pCellFrame->Frame(), nDiff ); + { + SwFrameRect::FrameWriteAccess aFrm(*pCellFrame); + aRectFnSet.AddBottom( aFrm, nDiff ); + } + pCellFrame->InvalidatePrt_(); } } @@ -4271,7 +4310,7 @@ void SwRowFrame::AdjustCells( const SwTwips nHeight, const bool bHeight ) // Use new height for the current row: nSumRowHeight += pToAdjustRow == this ? nHeight : - aRectFnSet.GetHeight(pToAdjustRow->Frame()); + aRectFnSet.GetHeight(pToAdjustRow->getSwFrame()); if ( nRowSpan-- == 1 ) break; @@ -4282,11 +4321,12 @@ void SwRowFrame::AdjustCells( const SwTwips nHeight, const bool bHeight ) if ( pToAdjustRow && pToAdjustRow != this ) pToAdjustRow->InvalidateSize_(); - const long nDiff = nSumRowHeight - aRectFnSet.GetHeight(pToAdjust->Frame()); + const long nDiff = nSumRowHeight - aRectFnSet.GetHeight(pToAdjust->getSwFrame()); if ( nDiff ) { - aOldFrame = pToAdjust->Frame(); - aRectFnSet.AddBottom( pToAdjust->Frame(), nDiff ); + aOldFrame = pToAdjust->getSwFrame(); + SwFrameRect::FrameWriteAccess aFrm(*pToAdjust); + aRectFnSet.AddBottom( aFrm, nDiff ); pNotify = pToAdjust; } @@ -4346,13 +4386,16 @@ SwTwips SwRowFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) // There may still be some space left in my direct upper: const SwTwips nAdditionalSpace = - aRectFnSet.BottomDist( Frame(), aRectFnSet.GetPrtBottom(*GetUpper()->GetUpper()) ); + aRectFnSet.BottomDist( getSwFrame(), aRectFnSet.GetPrtBottom(*GetUpper()->GetUpper()) ); if ( bRestrictTableGrowth && nAdditionalSpace > 0 ) { nReal = std::min( nAdditionalSpace, nDist ); nDist -= nReal; if ( !bTst ) - aRectFnSet.AddBottom( Frame(), nReal ); + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.AddBottom( aFrm, nReal ); + } } } @@ -4378,7 +4421,7 @@ SwTwips SwRowFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) if ( !bTst ) { SwRectFnSet fnRectX(this); - AdjustCells( fnRectX.GetHeight(Prt()) + nReal, true ); + AdjustCells( fnRectX.GetHeight(getSwPrint()) + nReal, true ); if ( nReal ) SetCompletePaint(); } @@ -4391,7 +4434,7 @@ SwTwips SwRowFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) SwRectFnSet aRectFnSet(this); if( HasFixSize() ) { - AdjustCells( aRectFnSet.GetHeight(Prt()), true ); + AdjustCells( aRectFnSet.GetHeight(getSwPrint()), true ); return 0L; } @@ -4413,7 +4456,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 < aRectFnSet.GetHeight(Frame()) ) + if( nMinHeight < aRectFnSet.GetHeight(getSwFrame()) ) { // #i26945# OSL_ENSURE( FindTabFrame(), "<SwRowFrame::ShrinkFrame(..)> - no table frame -> crash." ); @@ -4421,8 +4464,8 @@ SwTwips SwRowFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) nMinHeight = lcl_CalcMinRowHeight( this, bConsiderObjs ); } - if ( (aRectFnSet.GetHeight(Frame()) - nRealDist) < nMinHeight ) - nRealDist = aRectFnSet.GetHeight(Frame()) - nMinHeight; + if ( (aRectFnSet.GetHeight(getSwFrame()) - nRealDist) < nMinHeight ) + nRealDist = aRectFnSet.GetHeight(getSwFrame()) - nMinHeight; } if ( nRealDist < 0 ) nRealDist = 0; @@ -4432,11 +4475,14 @@ SwTwips SwRowFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) { if ( !bTst ) { - SwTwips nHeight = aRectFnSet.GetHeight(Frame()); - aRectFnSet.SetHeight( Frame(), nHeight - nReal ); + SwTwips nHeight = aRectFnSet.GetHeight(getSwFrame()); + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.SetHeight( aFrm, nHeight - nReal ); if( IsVertical() && !IsVertLR() && !aRectFnSet.IsRev() ) - Frame().Pos().X() += nReal; + { + aFrm.Pos().X() += nReal; + } } SwLayoutFrame* pFrame = GetUpper(); @@ -4448,11 +4494,14 @@ SwTwips SwRowFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) if ( !bTst ) { nReal -= nTmp; - SwTwips nHeight = aRectFnSet.GetHeight(Frame()); - aRectFnSet.SetHeight( Frame(), nHeight + nReal ); + SwTwips nHeight = aRectFnSet.GetHeight(getSwFrame()); + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.SetHeight( aFrm, nHeight + nReal ); if( IsVertical() && !IsVertLR() && !aRectFnSet.IsRev() ) - Frame().Pos().X() -= nReal; + { + aFrm.Pos().X() -= nReal; + } } nReal = nTmp; } @@ -4478,7 +4527,7 @@ SwTwips SwRowFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) pMasterTab->InvalidatePos(); } } - AdjustCells( aRectFnSet.GetHeight(Prt()) - nReal, true ); + AdjustCells( aRectFnSet.GetHeight(getSwPrint()) - nReal, true ); } return nReal; } @@ -4578,22 +4627,28 @@ static bool lcl_ArrangeLowers( SwLayoutFrame *pLay, long lYStart, bool bInva ) SwRectFnSet aRectFnSet(pLay); while ( pFrame ) { - long nFrameTop = aRectFnSet.GetTop(pFrame->Frame()); + long nFrameTop = aRectFnSet.GetTop(pFrame->getSwFrame()); if( nFrameTop != lYStart ) { bRet = true; const long lDiff = aRectFnSet.YDiff( lYStart, nFrameTop ); const long lDiffX = lYStart - nFrameTop; - aRectFnSet.SubTop( pFrame->Frame(), -lDiff ); - aRectFnSet.AddBottom( pFrame->Frame(), lDiff ); + + { + SwFrameRect::FrameWriteAccess aFrm(*pFrame); + aRectFnSet.SubTop( aFrm, -lDiff ); + aRectFnSet.AddBottom( aFrm, lDiff ); + } + pFrame->SetCompletePaint(); + if ( !pFrame->GetNext() ) pFrame->SetRetouche(); if( bInva ) pFrame->Prepare( PREP_POS_CHGD ); if ( pFrame->IsLayoutFrame() && static_cast<SwLayoutFrame*>(pFrame)->Lower() ) lcl_ArrangeLowers( static_cast<SwLayoutFrame*>(pFrame), - aRectFnSet.GetTop(static_cast<SwLayoutFrame*>(pFrame)->Lower()->Frame()) + aRectFnSet.GetTop(static_cast<SwLayoutFrame*>(pFrame)->Lower()->getSwFrame()) + lDiffX, bInva ); if ( pFrame->GetDrawObjs() ) { @@ -4635,13 +4690,17 @@ static bool lcl_ArrangeLowers( SwLayoutFrame *pLay, long lYStart, bool bInva ) // #i52904# - no direct move of objects, // whose vertical position doesn't depend on anchor frame. const bool bDirectMove = - FAR_AWAY != pFly->Frame().Top() && + FAR_AWAY != pFly->getSwFrame().Top() && bVertPosDepOnAnchor && !pFly->ConsiderObjWrapInfluenceOnObjPos(); if ( bDirectMove ) { - aRectFnSet.SubTop( pFly->Frame(), -lDiff ); - aRectFnSet.AddBottom( pFly->Frame(), lDiff ); + { + SwFrameRect::FrameWriteAccess aFrm(*pFly); + aRectFnSet.SubTop( aFrm, -lDiff ); + aRectFnSet.AddBottom( aFrm, lDiff ); + } + pFly->GetVirtDrawObj()->SetRectsDirty(); // --> OD 2004-08-17 - also notify view of <SdrObject> // instance, which represents the Writer fly frame in @@ -4765,7 +4824,7 @@ 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.YInc( lYStart, - aRectFnSet.GetHeight(pFrame->Frame()) ); + aRectFnSet.GetHeight(pFrame->getSwFrame()) ); // 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. @@ -4773,7 +4832,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 = - aRectFnSet.BottomDist( pFrame->Frame(), aRectFnSet.GetPrtBottom(*pLay) ); + aRectFnSet.BottomDist( pFrame->getSwFrame(), 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 @@ -4852,7 +4911,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 = aRectFnSet.GetWidth(pTab->Prt()); + const long nPrtWidth = aRectFnSet.GetWidth(pTab->getSwPrint()); if ( nWish != nPrtWidth ) { // Avoid rounding problems, at least for the new table model @@ -4883,7 +4942,7 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder SwTwips nSumFrameWidths = 0; while ( pTmpCell != this ) { - nSumFrameWidths += aRectFnSet.GetWidth(pTmpCell->Frame()); + nSumFrameWidths += aRectFnSet.GetWidth(pTmpCell->getSwFrame()); pTmpCell = pTmpCell->GetNext(); } @@ -4903,23 +4962,37 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder else { OSL_ENSURE( pAttrs->GetSize().Width() > 0, "Box without width" ); - nWidth = aRectFnSet.GetWidth(GetUpper()->Prt()); + nWidth = aRectFnSet.GetWidth(GetUpper()->getSwPrint()); SwFrame *pPre = GetUpper()->Lower(); while ( pPre != this ) { - nWidth -= aRectFnSet.GetWidth(pPre->Frame()); + nWidth -= aRectFnSet.GetWidth(pPre->getSwFrame()); pPre = pPre->GetNext(); } } - const long nDiff = nWidth - aRectFnSet.GetWidth(Frame()); - if( IsNeighbourFrame() && IsRightToLeft() ) - aRectFnSet.SubLeft( Frame(), nDiff ); - else - aRectFnSet.AddRight( Frame(), nDiff ); - aRectFnSet.AddRight( Prt(), nDiff ); + + const long nDiff = nWidth - aRectFnSet.GetWidth(getSwFrame()); + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + + if( IsNeighbourFrame() && IsRightToLeft() ) + { + aRectFnSet.SubLeft( aFrm, nDiff ); + } + else + { + aRectFnSet.AddRight( aFrm, nDiff ); + } + } + + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aRectFnSet.AddRight( aPrt, nDiff ); + } //Adjust the height, it's defined through the content and the border. - const long nDiffHeight = nRemaining - aRectFnSet.GetHeight(Frame()); + const long nDiffHeight = nRemaining - aRectFnSet.GetHeight(getSwFrame()); if ( nDiffHeight ) { if ( nDiffHeight > 0 ) @@ -4966,7 +5039,7 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder //No alignment if border with flow overlaps the cell. if ( pPg->GetSortedObjs() ) { - SwRect aRect( Prt() ); aRect += Frame().Pos(); + SwRect aRect( getSwPrint() ); aRect += getSwFrame().Pos(); for (SwAnchoredObject* pAnchoredObj : *pPg->GetSortedObjs()) { SwRect aTmp( pAnchoredObj->GetObjRect() ); @@ -5006,11 +5079,11 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder } } - long nPrtHeight = aRectFnSet.GetHeight(Prt()); + long nPrtHeight = aRectFnSet.GetHeight(getSwPrint()); if( ( bVertDir && ( nRemaining -= lcl_CalcTopAndBottomMargin( *this, *pAttrs ) ) < nPrtHeight ) || - aRectFnSet.GetTop(Lower()->Frame()) != aRectFnSet.GetPrtTop(*this) ) + aRectFnSet.GetTop(Lower()->getSwFrame()) != aRectFnSet.GetPrtTop(*this) ) { - long nDiff = aRectFnSet.GetHeight(Prt()) - nRemaining; + long nDiff = aRectFnSet.GetHeight(getSwPrint()) - nRemaining; if ( nDiff >= 0 ) { long lTopOfst = 0; @@ -5291,12 +5364,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 = aRectFnSet.GetHeight(pPrevCell->Prt()); + SwTwips nReal = aRectFnSet.GetHeight(pPrevCell->getSwPrint()); const SwFrame* pFrame = pPrevCell->Lower(); const SwFrame* pLast = pFrame; while ( pFrame ) { - nReal -= aRectFnSet.GetHeight(pFrame->Frame()); + nReal -= aRectFnSet.GetHeight(pFrame->getSwFrame()); pLast = pFrame; pFrame = pFrame->GetNext(); } @@ -5382,7 +5455,7 @@ SwTwips SwTabFrame::CalcHeightOfFirstContentLine() const if ( bDontSplit ) { // Table is not allowed to split: Take the whole height, that's all - return aRectFnSet.GetHeight(Frame()); + return aRectFnSet.GetHeight(getSwFrame()); } SwTwips nTmpHeight = 0; @@ -5433,7 +5506,7 @@ SwTwips SwTabFrame::CalcHeightOfFirstContentLine() const if ( pFirstRow ) { const bool bSplittable = pFirstRow->IsRowSplitAllowed(); - const SwTwips nFirstLineHeight = aRectFnSet.GetHeight(pFirstRow->Frame()); + const SwTwips nFirstLineHeight = aRectFnSet.GetHeight(pFirstRow->getSwFrame()); if ( !bSplittable ) { diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 8cfbec1f17cf..add551fe8680 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -176,12 +176,12 @@ bool SwPageFrame::GetCursorOfst( SwPosition *pPos, Point &rPoint, Point aPoint( rPoint ); // check, if we have to adjust the point - if ( !Frame().IsInside( aPoint ) ) + if ( !getSwFrame().IsInside( aPoint ) ) { - aPoint.X() = std::max( aPoint.X(), Frame().Left() ); - aPoint.X() = std::min( aPoint.X(), Frame().Right() ); - aPoint.Y() = std::max( aPoint.Y(), Frame().Top() ); - aPoint.Y() = std::min( aPoint.Y(), Frame().Bottom() ); + aPoint.X() = std::max( aPoint.X(), getSwFrame().Left() ); + aPoint.X() = std::min( aPoint.X(), getSwFrame().Right() ); + aPoint.Y() = std::max( aPoint.Y(), getSwFrame().Top() ); + aPoint.Y() = std::min( aPoint.Y(), getSwFrame().Bottom() ); } bool bTextRet = false; @@ -398,9 +398,9 @@ bool SwRootFrame::FillSelection( SwSelectionList& aSelList, const SwRect& rRect) const long nBottom = rRect.Bottom(); while( pPage ) { - if( pPage->Frame().Top() < nBottom ) + if( pPage->getSwFrame().Top() < nBottom ) { - if( pPage->Frame().Bottom() > rRect.Top() ) + if( pPage->getSwFrame().Bottom() > rRect.Top() ) pPage->FillSelection( aSelList, rRect ); pPage = pPage->GetNext(); } @@ -430,8 +430,8 @@ bool SwRootFrame::GetCursorOfst( SwPosition *pPos, Point &rPoint, // #i95626# // special handling for <rPoint> beyond root frames area if ( !pPage && - rPoint.X() > Frame().Right() && - rPoint.Y() > Frame().Bottom() ) + rPoint.X() > getSwFrame().Right() && + rPoint.Y() > getSwFrame().Bottom() ) { pPage = dynamic_cast<const SwPageFrame*>(Lower()); while ( pPage && pPage->GetNext() ) @@ -496,7 +496,7 @@ bool SwCellFrame::GetCursorOfst( SwPosition *pPos, Point &rPoint, while ( pFrame && !bRet ) { pFrame->Calc(pRenderContext); - if ( pFrame->Frame().IsInside( rPoint ) ) + if ( pFrame->getSwFrame().IsInside( rPoint ) ) { bRet = pFrame->GetCursorOfst( pPos, rPoint, pCMS ); if ( pCMS && pCMS->m_bStop ) @@ -539,7 +539,7 @@ bool SwFlyFrame::GetCursorOfst( SwPosition *pPos, Point &rPoint, //However if the Point sits inside a Fly which is completely located inside //the current one, we call GetCursorOfst for it. Calc(pRenderContext); - bool bInside = Frame().IsInside( rPoint ) && Lower(); + bool bInside = getSwFrame().IsInside( rPoint ) && Lower(); bool bRet = false; //If an Frame contains a graphic, but only text was requested, it basically @@ -557,8 +557,8 @@ bool SwFlyFrame::GetCursorOfst( SwPosition *pPos, Point &rPoint, { const SwVirtFlyDrawObj* pObj = static_cast<const SwVirtFlyDrawObj*>(aIter()); const SwFlyFrame* pFly = pObj ? pObj->GetFlyFrame() : nullptr; - if ( pFly && pFly->Frame().IsInside( rPoint ) && - Frame().IsInside( pFly->Frame() ) ) + if ( pFly && pFly->getSwFrame().IsInside( rPoint ) && + getSwFrame().IsInside( pFly->getSwFrame() ) ) { if (g_OszCtrl.ChkOsz(pFly)) break; @@ -578,7 +578,7 @@ bool SwFlyFrame::GetCursorOfst( SwPosition *pPos, Point &rPoint, while ( pFrame && !bRet ) { pFrame->Calc(pRenderContext); - if ( pFrame->Frame().IsInside( rPoint ) ) + if ( pFrame->getSwFrame().IsInside( rPoint ) ) { bRet = pFrame->GetCursorOfst( pPos, rPoint, pCMS ); if ( pCMS && pCMS->m_bStop ) @@ -741,7 +741,7 @@ static bool lcl_UpDown( SwPaM *pPam, const SwContentFrame *pStart, if ( bTab ) { // pStart or pCnt is inside a table. nX will be used for travelling: - SwRect aRect( pStart->Frame() ); + SwRect aRect( pStart->getSwFrame() ); pStart->GetCharRect( aRect, *pPam->GetPoint() ); Point aCenter = aRect.Center(); nX = aRectFnSet.IsVert() ? aCenter.Y() : aCenter.X(); @@ -758,16 +758,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 = aRectFnSet.GetLeft(pCell->Frame()) + - aRectFnSet.GetWidth(pCell->Frame()) / 2; + nX = aRectFnSet.GetLeft(pCell->getSwFrame()) + + aRectFnSet.GetWidth(pCell->getSwFrame()) / 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 += aRectFnSet.GetLeft(pTable->Frame()) - - aRectFnSet.GetLeft(pStTab->Frame()); + nX += aRectFnSet.GetLeft(pTable->getSwFrame()) - + aRectFnSet.GetLeft(pStTab->getSwFrame()); } } @@ -870,7 +870,7 @@ static bool lcl_UpDown( SwPaM *pPam, const SwContentFrame *pStart, if ( pTable && !pTab->GetUpper()->IsInTab() && !pTable->GetUpper()->IsInTab() ) - nX += pTab->Frame().Left() - pTable->Frame().Left(); + nX += pTab->getSwFrame().Left() - pTable->getSwFrame().Left(); pTable = pTab; } const SwLayoutFrame *pCell = pCnt->GetUpper(); @@ -881,7 +881,7 @@ static bool lcl_UpDown( SwPaM *pPam, const SwContentFrame *pStart, Point aInsideCnt; if ( pCell ) { - long nTmpTop = aRectFnSet.GetTop(pCell->Frame()); + long nTmpTop = aRectFnSet.GetTop(pCell->getSwFrame()); if ( aRectFnSet.IsVert() ) { if ( nTmpTop ) @@ -893,7 +893,7 @@ static bool lcl_UpDown( SwPaM *pPam, const SwContentFrame *pStart, aInsideCell = Point( nX, nTmpTop ); } - long nTmpTop = aRectFnSet.GetTop(pCnt->Frame()); + long nTmpTop = aRectFnSet.GetTop(pCnt->getSwFrame()); if ( aRectFnSet.IsVert() ) { if ( nTmpTop ) @@ -904,11 +904,11 @@ static bool lcl_UpDown( SwPaM *pPam, const SwContentFrame *pStart, else aInsideCnt = Point( nX, nTmpTop ); - if ( pCell && pCell->Frame().IsInside( aInsideCell ) ) + if ( pCell && pCell->getSwFrame().IsInside( aInsideCell ) ) { bEnd = true; //Get the right Content out of the cell. - if ( !pCnt->Frame().IsInside( aInsideCnt ) ) + if ( !pCnt->getSwFrame().IsInside( aInsideCnt ) ) { pCnt = pCell->ContainsContent(); if ( fnNxtPrv == lcl_GetPrvCnt ) @@ -916,7 +916,7 @@ static bool lcl_UpDown( SwPaM *pPam, const SwContentFrame *pStart, pCnt = pCnt->GetNextContentFrame(); } } - else if ( pCnt->Frame().IsInside( aInsideCnt ) ) + else if ( pCnt->getSwFrame().IsInside( aInsideCnt ) ) bEnd = true; } } @@ -1022,8 +1022,8 @@ sal_uInt16 SwRootFrame::SetCurrPage( SwCursor* pToSet, sal_uInt16 nPageNum ) if( pSCursor ) { Point &rPt = pSCursor->GetPtPos(); - rPt = pContent->Frame().Pos(); - rPt += pContent->Prt().Pos(); + rPt = pContent->getSwFrame().Pos(); + rPt += pContent->getSwPrint().Pos(); } return pPage->GetPhyPageNum(); } @@ -1147,12 +1147,12 @@ static const SwLayoutFrame* lcl_Inside( const SwContentFrame *pCnt, Point& rPt ) { if( pUp->IsPageBodyFrame() || pUp->IsFooterFrame() || pUp->IsHeaderFrame() ) { - if( rPt.Y() >= pUp->Frame().Top() && rPt.Y() <= pUp->Frame().Bottom() ) + if( rPt.Y() >= pUp->getSwFrame().Top() && rPt.Y() <= pUp->getSwFrame().Bottom() ) return pUp; return nullptr; } if( pUp->IsFootnoteContFrame() ) - return pUp->Frame().IsInside( rPt ) ? pUp : nullptr; + return pUp->getSwFrame().IsInside( rPt ) ? pUp : nullptr; pUp = pUp->GetUpper(); } return nullptr; @@ -1195,7 +1195,7 @@ const SwContentFrame *SwLayoutFrame::GetContentPos( Point& rPoint, ((!bDontLeave || IsAnLower( pContent )) && (pContent->GetPhyPageNum() <= nMaxPage)) ) { - if ( pContent->Frame().Width() && + if ( pContent->getSwFrame().Width() && ( !bBodyOnly || pContent->IsInDocBody() ) ) { //If the Content lies in a protected area (cell, Footnote, section), @@ -1319,34 +1319,34 @@ const SwContentFrame *SwLayoutFrame::GetContentPos( Point& rPoint, } //A small correction at the first/last - Size aActualSize( pActual->Prt().SSize() ); - if ( aActualSize.Height() > pActual->GetUpper()->Prt().Height() ) - aActualSize.Height() = pActual->GetUpper()->Prt().Height(); + Size aActualSize( pActual->getSwPrint().SSize() ); + if ( aActualSize.Height() > pActual->GetUpper()->getSwPrint().Height() ) + aActualSize.Height() = pActual->GetUpper()->getSwPrint().Height(); SwRectFnSet aRectFnSet(pActual); if ( !pActual->GetPrev() && 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() + + aPoint.Y() = pActual->getSwFrame().Top() + pActual->getSwPrint().Top(); + aPoint.X() = pActual->getSwFrame().Left() + ( pActual->IsRightToLeft() || aRectFnSet.IsVert() ? - pActual->Prt().Right() : - pActual->Prt().Left() ); + pActual->getSwPrint().Right() : + pActual->getSwPrint().Left() ); } else if ( !pActual->GetNext() && 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() + + aPoint.Y() = pActual->getSwFrame().Top() + pActual->getSwPrint().Bottom(); + aPoint.X() = pActual->getSwFrame().Left() + ( pActual->IsRightToLeft() || aRectFnSet.IsVert() ? - pActual->Prt().Left() : - pActual->Prt().Right() ); + pActual->getSwPrint().Left() : + pActual->getSwPrint().Right() ); } //Bring the Point in to the PrtArea - const SwRect aRect( pActual->Frame().Pos() + pActual->Prt().Pos(), + const SwRect aRect( pActual->getSwFrame().Pos() + pActual->getSwPrint().Pos(), aActualSize ); if ( aPoint.Y() < aRect.Top() ) aPoint.Y() = aRect.Top(); @@ -1413,7 +1413,7 @@ void SwPageFrame::GetContentPosition( const Point &rPt, SwPosition &rPos ) const nDist = nDiff; pAct = pContent; } - else if ( aContentFrame.Top() > Frame().Bottom() ) + else if ( aContentFrame.Top() > getSwFrame().Bottom() ) //In terms of fields, it's not possible to be closer any more! break; @@ -1423,7 +1423,7 @@ void SwPageFrame::GetContentPosition( const Point &rPt, SwPosition &rPos ) const } //Bring the point into the PrtArea. - const SwRect aRect( pAct->Frame().Pos() + pAct->Prt().Pos(), pAct->Prt().SSize() ); + const SwRect aRect( pAct->getSwFrame().Pos() + pAct->getSwPrint().Pos(), pAct->getSwPrint().SSize() ); if ( aAct.Y() < aRect.Top() ) aAct.Y() = aRect.Top(); else if ( aAct.Y() > aRect.Bottom() ) @@ -1466,7 +1466,7 @@ Point SwRootFrame::GetNextPrevContentPos( const Point& rPoint, bool bNext ) cons //page. const SwLayoutFrame *pPage = static_cast<const SwLayoutFrame*>(Lower()); if( pPage ) - while( pPage->GetNext() && pPage->Frame().Bottom() < rPoint.Y() ) + while( pPage->GetNext() && pPage->getSwFrame().Bottom() < rPoint.Y() ) pPage = static_cast<const SwLayoutFrame*>(pPage->GetNext()); const SwContentFrame *pCnt = pPage ? pPage->ContainsContent() : ContainsContent(); @@ -1481,7 +1481,7 @@ Point SwRootFrame::GetNextPrevContentPos( const Point& rPoint, bool bNext ) cons { // As long as the point lies before the first ContentFrame and there are // still precedent pages I'll go to the next page. - while ( rPoint.Y() < pCnt->Frame().Top() && pPage->GetPrev() ) + while ( rPoint.Y() < pCnt->getSwFrame().Top() && pPage->GetPrev() ) { pPage = static_cast<const SwLayoutFrame*>(pPage->GetPrev()); pCnt = pPage->ContainsContent(); @@ -1498,7 +1498,7 @@ Point SwRootFrame::GetNextPrevContentPos( const Point& rPoint, bool bNext ) cons } //Does the point lie above the first ContentFrame? - if ( rPoint.Y() < pCnt->Frame().Top() && !lcl_IsInRepeatedHeadline( pCnt ) ) + if ( rPoint.Y() < pCnt->getSwFrame().Top() && !lcl_IsInRepeatedHeadline( pCnt ) ) return pCnt->UnionFrame().Pos(); Point aRet(0, 0); @@ -1530,12 +1530,12 @@ Point SwRootFrame::GetNextPrevContentPos( const Point& rPoint, bool bNext ) cons //searched. const SwTabFrame* pTFrame; pNxt->Calc(pRenderContext); - if( pNxt->Frame().Top() > rPoint.Y() && + if( pNxt->getSwFrame().Top() > rPoint.Y() && !lcl_IsInRepeatedHeadline( pCnt, &pTFrame ) && - ( !pTFrame || pNxt->Frame().Left() > rPoint.X() )) + ( !pTFrame || pNxt->getSwFrame().Left() > rPoint.X() )) { if (bNext) - aRet = pNxt->Frame().Pos(); + aRet = pNxt->getSwFrame().Pos(); else aRet = Point( aContentFrame.Right(), aContentFrame.Bottom() ); break; @@ -1564,7 +1564,7 @@ Point SwRootFrame::GetPagePos( sal_uInt16 nPageNum ) const break; pPage = static_cast<const SwPageFrame*>(pPage->GetNext()); } - return pPage->Frame().Pos(); + return pPage->getSwFrame().Pos(); } /** get page frame by phyiscal page number @@ -1771,10 +1771,10 @@ void SwFrame::Calc(vcl::RenderContext* pRenderContext) const Point SwFrame::GetRelPos() const { - Point aRet( maFrame.Pos() ); + Point aRet( getSwFrame().Pos() ); // here we cast since SwLayoutFrame is declared only as forwarded - aRet -= GetUpper()->Prt().Pos(); - aRet -= GetUpper()->Frame().Pos(); + aRet -= GetUpper()->getSwPrint().Pos(); + aRet -= GetUpper()->getSwFrame().Pos(); return aRet; } @@ -1893,7 +1893,7 @@ bool SwRootFrame::MakeTableCursors( SwTableCursor& rTableCursor ) while ( pRow ) { - if ( pRow->Frame().IsOver( rUnion.GetUnion() ) ) + if ( pRow->getSwFrame().IsOver( rUnion.GetUnion() ) ) { const SwLayoutFrame *pCell = pRow->FirstCell(); @@ -1995,7 +1995,7 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor) // #i12836# enhanced pdf SwRegionRects aRegion( !bIgnoreVisArea ? pSh->VisArea() : - Frame() ); + getSwFrame() ); if( !pStartPos->nNode.GetNode().IsContentNode() || !pStartPos->nNode.GetNode().GetContentNode()->getLayoutFrame(this) || ( pStartPos->nNode != pEndPos->nNode && @@ -2387,8 +2387,8 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor) } else { - lLeft = aRectFnSet.GetLeft(pStartFrame->Frame()) + - aRectFnSet.GetLeft(pStartFrame->Prt()); + lLeft = aRectFnSet.GetLeft(pStartFrame->getSwFrame()) + + aRectFnSet.GetLeft(pStartFrame->getSwPrint()); lRight = aRectFnSet.GetRight(aEndFrame); } if( lLeft < aRectFnSet.GetLeft(aStFrame) ) @@ -2556,7 +2556,7 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor) } } if( inSelection ) - Add( aRegion, pFly->Frame() ); + Add( aRegion, pFly->getSwFrame() ); else if ( !pFly->IsAnLower( pStartFrame ) && (rSur.GetSurround() != css::text::WrapTextMode_THROUGH && !rSur.IsContour()) ) @@ -2584,7 +2584,7 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor) } while ( bSub && pTmp ); } if ( bSub ) - Sub( aRegion, pFly->Frame() ); + Sub( aRegion, pFly->getSwFrame() ); } } } diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index 4ed44df2f38b..40ffaa5d0eec 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -53,9 +53,32 @@ using namespace ::com::sun::star; -SwFrame::SwFrame( SwModify *pMod, SwFrame* pSib ) : +SwFrameRect::SwFrameRect() +: maFrameRect(), + maPrintRect() +{ +} + +SwFrameRect::FrameWriteAccess::~FrameWriteAccess() +{ + if(mrTarget.maFrameRect != *this) + { + mrTarget.maFrameRect = *this; + } +} + +SwFrameRect::PrintWriteAccess::~PrintWriteAccess() +{ + if(mrTarget.maPrintRect != *this) + { + mrTarget.maPrintRect = *this; + } +} + +SwFrame::SwFrame( SwModify *pMod, SwFrame* pSib ) +: SwFrameRect(), SwClient( pMod ), - mbInDtor(false), + SfxBroadcaster(), mnFrameId( SwFrame::mnLastFrameId++ ), mpRoot( pSib ? pSib->getRootFrame() : nullptr ), mpUpper(nullptr), @@ -63,21 +86,33 @@ SwFrame::SwFrame( SwModify *pMod, SwFrame* pSib ) : mpPrev(nullptr), mpDrawObjs(nullptr), mnFrameType(SwFrameType::None), + mbInDtor(false), + mbReverse(false), + mbInvalidR2L(true), + mbDerivedR2L(false), + mbRightToLeft(false), + mbInvalidVert(true), + mbDerivedVert(false), + mbVertical(false), + mbVertLR(false), + mbValidPos(false), + mbValidPrtArea(false), + mbValidSize(false), + mbValidLineNum(false), + mbFixSize(false), + mbCompletePaint(true), + mbRetouche(false), + mbInfInvalid(true), mbInfBody( false ), mbInfTab ( false ), mbInfFly ( false ), mbInfFootnote ( false ), - mbInfSct ( false ) - , m_isInDestroy(false) + mbInfSct ( false ), + mbColLocked(false), + m_isInDestroy(false), + mbForbidDelete(false) { OSL_ENSURE( pMod, "No frame format given." ); - mbInvalidR2L = mbInvalidVert = true; - mbDerivedR2L = mbDerivedVert = mbRightToLeft = mbVertical = mbReverse = mbVertLR = false; - - mbValidPos = mbValidPrtArea = mbValidSize = mbValidLineNum = mbRetouche = - mbFixSize = mbColLocked = false; - mbCompletePaint = mbInfInvalid = true; - mbForbidDelete = false; } const IDocumentDrawModelAccess& SwFrame::getIDocumentDrawModelAccess() @@ -444,30 +479,42 @@ void SwFrame::InvalidatePage( const SwPageFrame *pPage ) const Size SwFrame::ChgSize( const Size& aNewSize ) { mbFixSize = true; - const Size aOldSize( Frame().SSize() ); + const Size aOldSize( getSwFrame().SSize() ); if ( aNewSize == aOldSize ) return aOldSize; if ( GetUpper() ) { bool bNeighb = IsNeighbourFrame(); - SwRectFn fnRect = IsVertical() == bNeighb ? - fnRectHori : ( IsVertLR() ? fnRectVertL2R : fnRectVert ); - + SwRectFn fnRect = IsVertical() == bNeighb ? fnRectHori : ( IsVertLR() ? fnRectVertL2R : fnRectVert ); SwRect aNew( Point(0,0), aNewSize ); - (maFrame.*fnRect->fnSetWidth)( (aNew.*fnRect->fnGetWidth)() ); + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + (aFrm.*fnRect->fnSetWidth)( (aNew.*fnRect->fnGetWidth)() ); + } + long nNew = (aNew.*fnRect->fnGetHeight)(); - long nDiff = nNew - (maFrame.*fnRect->fnGetHeight)(); + long nDiff = nNew - (getSwFrame().*fnRect->fnGetHeight)(); + if( nDiff ) { if ( GetUpper()->IsFootnoteBossFrame() && HasFixSize() && SwNeighbourAdjust::GrowShrink != static_cast<SwFootnoteBossFrame*>(GetUpper())->NeighbourhoodAdjustment() ) { - (maFrame.*fnRect->fnSetHeight)( nNew ); + { + SwFrameRect::FrameWriteAccess aFrm(*this); + (aFrm.*fnRect->fnSetHeight)( nNew ); + } + SwTwips nReal = static_cast<SwLayoutFrame*>(this)->AdjustNeighbourhood(nDiff); + if ( nReal != nDiff ) - (maFrame.*fnRect->fnSetHeight)( nNew - nDiff + nReal ); + { + SwFrameRect::FrameWriteAccess aFrm(*this); + (aFrm.*fnRect->fnSetHeight)( nNew - nDiff + nReal ); + } } else { @@ -480,21 +527,27 @@ Size SwFrame::ChgSize( const Size& aNewSize ) else Shrink( -nDiff ); - if ( GetUpper() && (maFrame.*fnRect->fnGetHeight)() != nNew ) + if ( GetUpper() && (getSwFrame().*fnRect->fnGetHeight)() != nNew ) + { GetUpper()->InvalidateSize_(); + } } // Even if grow/shrink did not yet set the desired width, for // example when called by ChgColumns to set the column width, we // set the right width now. - (maFrame.*fnRect->fnSetHeight)( nNew ); + SwFrameRect::FrameWriteAccess aFrm(*this); + (aFrm.*fnRect->fnSetHeight)( nNew ); } } } else - maFrame.SSize( aNewSize ); + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.SSize( aNewSize ); + } - if ( Frame().SSize() != aOldSize ) + if ( getSwFrame().SSize() != aOldSize ) { SwPageFrame *pPage = FindPageFrame(); if ( GetNext() ) @@ -514,7 +567,7 @@ Size SwFrame::ChgSize( const Size& aNewSize ) InvalidatePage( pPage ); } - return maFrame.SSize(); + return getSwFrame().SSize(); } /** Insert SwFrame into existing structure. @@ -754,10 +807,10 @@ void SwContentFrame::Paste( SwFrame* pParent, SwFrame* pSibling) pNxt->Prepare( PREP_FTN, nullptr, false ); } - if ( Frame().Height() ) - pParent->Grow( Frame().Height() ); + if ( getSwFrame().Height() ) + pParent->Grow( getSwFrame().Height() ); - if ( Frame().Width() != pParent->Prt().Width() ) + if ( getSwFrame().Width() != pParent->getSwPrint().Width() ) Prepare( PREP_FIXSIZE_CHG ); if ( GetPrev() ) @@ -767,8 +820,8 @@ void SwContentFrame::Paste( SwFrame* pParent, SwFrame* pSibling) static_cast<SwContentFrame*>(GetPrev())->Prepare( PREP_FOLLOW_FOLLOWS ); else { - if ( GetPrev()->Frame().Height() != - GetPrev()->Prt().Height() + GetPrev()->Prt().Top() ) + if ( GetPrev()->getSwFrame().Height() != + GetPrev()->getSwPrint().Height() + GetPrev()->getSwPrint().Top() ) { // Take the border into account? GetPrev()->InvalidatePrt_(); @@ -991,7 +1044,7 @@ void SwContentFrame::Cut() else { SwRectFnSet aRectFnSet(this); - long nFrameHeight = aRectFnSet.GetHeight(Frame()); + long nFrameHeight = aRectFnSet.GetHeight(getSwFrame()); if( nFrameHeight ) pUp->Shrink( nFrameHeight ); } @@ -1044,7 +1097,7 @@ void SwLayoutFrame::Paste( SwFrame* pParent, SwFrame* pSibling) else fnRect = GetUpper()->IsVertical() ? ( GetUpper()->IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori; - if( (Frame().*fnRect->fnGetWidth)() != (pParent->Prt().*fnRect->fnGetWidth)()) + if( (getSwFrame().*fnRect->fnGetWidth)() != (pParent->getSwPrint().*fnRect->fnGetWidth)()) InvalidateSize_(); InvalidatePos_(); const SwPageFrame *pPage = FindPageFrame(); @@ -1072,14 +1125,14 @@ void SwLayoutFrame::Paste( SwFrame* pParent, SwFrame* pSibling) } } - if( (Frame().*fnRect->fnGetHeight)() ) + if( (getSwFrame().*fnRect->fnGetHeight)() ) { // AdjustNeighbourhood is now also called in columns which are not // placed inside a frame SwNeighbourAdjust nAdjust = GetUpper()->IsFootnoteBossFrame() ? static_cast<SwFootnoteBossFrame*>(GetUpper())->NeighbourhoodAdjustment() : SwNeighbourAdjust::GrowShrink; - SwTwips nGrow = (Frame().*fnRect->fnGetHeight)(); + SwTwips nGrow = (getSwFrame().*fnRect->fnGetHeight)(); if( SwNeighbourAdjust::OnlyAdjust == nAdjust ) AdjustNeighbourhood( nGrow ); else @@ -1101,7 +1154,7 @@ void SwLayoutFrame::Cut() GetNext()->InvalidatePos_(); SwRectFnSet aRectFnSet(this); - SwTwips nShrink = aRectFnSet.GetHeight(Frame()); + SwTwips nShrink = aRectFnSet.GetHeight(getSwFrame()); // Remove first, then shrink upper. SwLayoutFrame *pUp = GetUpper(); @@ -1126,11 +1179,23 @@ void SwLayoutFrame::Cut() nReal = -AdjustNeighbourhood( -nShrink ); if( nReal < nShrink ) { - SwTwips nOldHeight = aRectFnSet.GetHeight(Frame()); - aRectFnSet.SetHeight( Frame(), 0 ); + const SwTwips nOldHeight = aRectFnSet.GetHeight(getSwFrame()); + + // seems as if this needs to be frowarded to the SwFrame already here, + // changing to zero seems temporary anyways + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.SetHeight( aFrm, 0 ); + } + nReal += pUp->Shrink( nShrink - nReal ); - aRectFnSet.SetHeight( Frame(), nOldHeight ); + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.SetHeight( aFrm, nOldHeight ); + } } + if( SwNeighbourAdjust::GrowAdjust == nAdjust && nReal < nShrink ) AdjustNeighbourhood( nReal - nShrink ); } @@ -1162,7 +1227,7 @@ SwTwips SwFrame::Grow( SwTwips nDist, bool bTst, bool bInfo ) { SwRectFnSet aRectFnSet(this); - SwTwips nPrtHeight = aRectFnSet.GetHeight(Prt()); + SwTwips nPrtHeight = aRectFnSet.GetHeight(getSwPrint()); if( nPrtHeight > 0 && nDist > (LONG_MAX - nPrtHeight) ) nDist = LONG_MAX - nPrtHeight; @@ -1186,9 +1251,10 @@ SwTwips SwFrame::Grow( SwTwips nDist, bool bTst, bool bInfo ) const SwTwips nReal = GrowFrame( nDist, bTst, bInfo ); if( !bTst ) { - nPrtHeight = aRectFnSet.GetHeight(Prt()); - aRectFnSet.SetHeight( Prt(), nPrtHeight + - ( IsContentFrame() ? nDist : nReal ) ); + nPrtHeight = aRectFnSet.GetHeight(getSwPrint()); + + SwFrameRect::PrintWriteAccess aPrt(*this); + aRectFnSet.SetHeight( aPrt, nPrtHeight + ( IsContentFrame() ? nDist : nReal ) ); } return nReal; } @@ -1222,14 +1288,14 @@ SwTwips SwFrame::Shrink( SwTwips nDist, bool bTst, bool bInfo ) } SwRectFnSet aRectFnSet(this); - SwTwips nReal = aRectFnSet.GetHeight(Frame()); + SwTwips nReal = aRectFnSet.GetHeight(getSwFrame()); ShrinkFrame( nDist, bTst, bInfo ); - nReal -= aRectFnSet.GetHeight(Frame()); + nReal -= aRectFnSet.GetHeight(getSwFrame()); if( !bTst ) { - const SwTwips nPrtHeight = aRectFnSet.GetHeight(Prt()); - aRectFnSet.SetHeight( Prt(), nPrtHeight - - ( IsContentFrame() ? nDist : nReal ) ); + const SwTwips nPrtHeight = aRectFnSet.GetHeight(getSwPrint()); + SwFrameRect::PrintWriteAccess aPrt(*this); + aRectFnSet.SetHeight( aPrt, nPrtHeight - ( IsContentFrame() ? nDist : nReal ) ); } return nReal; } @@ -1281,9 +1347,9 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst ) SwViewShell *pViewShell = getRootFrame()->GetCurrShell(); SwLayoutFrame *pUp = GetUpper(); long nChg; - const long nUpPrtBottom = pUp->Frame().Height() - - pUp->Prt().Height() - pUp->Prt().Top(); - SwRect aInva( pUp->Frame() ); + const long nUpPrtBottom = pUp->getSwFrame().Height() - + pUp->getSwPrint().Height() - pUp->getSwPrint().Top(); + SwRect aInva( pUp->getSwFrame() ); if ( pViewShell ) { aInva.Pos().X() = pViewShell->VisArea().Left(); @@ -1291,20 +1357,24 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst ) } if ( nDiff > 0 ) { - nChg = BROWSE_HEIGHT - pUp->Frame().Height(); + nChg = BROWSE_HEIGHT - pUp->getSwFrame().Height(); nChg = std::min( nDiff, nChg ); if ( !IsBodyFrame() ) { SetCompletePaint(); - if ( !pViewShell || pViewShell->VisArea().Height() >= pUp->Frame().Height() ) + if ( !pViewShell || pViewShell->VisArea().Height() >= pUp->getSwFrame().Height() ) { //First minimize Body, it will grow again later. SwFrame *pBody = static_cast<SwFootnoteBossFrame*>(pUp)->FindBodyCont(); - const long nTmp = nChg - pBody->Prt().Height(); + const long nTmp = nChg - pBody->getSwPrint().Height(); if ( !bTst ) { - pBody->Frame().Height(std::max( 0L, pBody->Frame().Height() - nChg )); + { + SwFrameRect::FrameWriteAccess aFrm(*pBody); + aFrm.Height(std::max( 0L, aFrm.Height() - nChg )); + } + pBody->InvalidatePrt_(); pBody->InvalidateSize_(); if ( pBody->GetNext() ) @@ -1327,10 +1397,10 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst ) nChg = nDiff; long nInvaAdd = 0; if ( pViewShell && !pUp->GetPrev() && - pUp->Frame().Height() + nDiff < pViewShell->VisArea().Height() ) + pUp->getSwFrame().Height() + nDiff < pViewShell->VisArea().Height() ) { // This means that we have to invalidate adequately. - nChg = pViewShell->VisArea().Height() - pUp->Frame().Height(); + nChg = pViewShell->VisArea().Height() - pUp->getSwFrame().Height(); nInvaAdd = -(nDiff - nChg); } @@ -1357,8 +1427,16 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst ) } if ( !bTst && nChg ) { - pUp->Frame().SSize().Height() += nChg; - pUp->Prt().SSize().Height() += nChg; + { + SwFrameRect::FrameWriteAccess aFrm(*pUp); + aFrm.SSize().Height() += nChg; + } + + { + SwFrameRect::PrintWriteAccess aPrt(*pUp); + aPrt.SSize().Height() += nChg; + } + if ( pViewShell ) pViewShell->Imp()->SetFirstVisPageInvalid(); @@ -1369,7 +1447,7 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst ) SvxBrushItem aBack(pUp->GetFormat()->makeBackgroundBrushItem()); const SvxGraphicPosition ePos = aBack.GetGraphicPos(); if ( ePos != GPOS_NONE && ePos != GPOS_TILED ) - pViewShell->InvalidateWindows( pUp->Frame() ); + pViewShell->InvalidateWindows( pUp->getSwFrame() ); if ( pUp->GetUpper() ) { @@ -1380,18 +1458,27 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst ) //its Lower may be called. The values should not be changed //because the caller takes care of the adjustment of Frame and //Prt. - const long nOldFrameHeight = Frame().Height(); - const long nOldPrtHeight = Prt().Height(); + const long nOldFrameHeight = getSwFrame().Height(); + const long nOldPrtHeight = getSwPrint().Height(); const bool bOldComplete = IsCompletePaint(); + if ( IsBodyFrame() ) - Prt().SSize().Height() = nOldFrameHeight; + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.SSize().Height() = nOldFrameHeight; + } if ( pUp->GetUpper() ) + { static_cast<SwRootFrame*>(pUp->GetUpper())->CheckViewLayout( nullptr, nullptr ); - //static_cast<SwPageFrame*>(pUp)->AdjustRootSize( CHG_CHGPAGE, &aOldRect ); + } + + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.SSize().Height() = nOldFrameHeight; + + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.SSize().Height() = nOldPrtHeight; - Frame().SSize().Height() = nOldFrameHeight; - Prt().SSize().Height() = nOldPrtHeight; mbCompletePaint = bOldComplete; } if ( !IsBodyFrame() ) @@ -1428,14 +1515,14 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst ) { if( !pFootnote->GetAttr()->GetFootnote().IsEndNote() ) { - nMinH += aRectFnSet.GetHeight(pFootnote->Frame()); + nMinH += aRectFnSet.GetHeight(pFootnote->getSwFrame()); bFootnote = true; } pFootnote = static_cast<SwFootnoteFrame*>(pFootnote->GetNext()); } if( bFootnote ) - nMinH += aRectFnSet.GetTop(pCont->Prt()); - nReal = aRectFnSet.GetHeight(pCont->Frame()) - nMinH; + nMinH += aRectFnSet.GetTop(pCont->getSwPrint()); + nReal = aRectFnSet.GetHeight(pCont->getSwFrame()) - nMinH; if( nReal > nDiff ) nReal = nDiff; if( nReal > 0 ) @@ -1461,7 +1548,7 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst ) return 0; //If not one is found, everything else is solved. - nReal = aRectFnSet.GetHeight(pFrame->Frame()); + nReal = aRectFnSet.GetHeight(pFrame->getSwFrame()); if( nReal > nDiff ) nReal = nDiff; if( !bFootnotePage ) @@ -1480,18 +1567,28 @@ 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 = aRectFnSet.GetHeight(pFrame->GetNext()->Frame()); + const SwTwips nAddMax = aRectFnSet.GetHeight(pFrame->GetNext()->getSwFrame()); nAdd = nDiff - nReal; if ( nAdd > nAddMax ) nAdd = nAddMax; if ( !bTst ) { - aRectFnSet.SetHeight(pFrame->GetNext()->Frame(), nAddMax-nAdd); - if( aRectFnSet.IsVert() && !aRectFnSet.IsVertL2R() && !aRectFnSet.IsRev() ) - pFrame->GetNext()->Frame().Pos().X() += nAdd; + { + SwFrameRect::FrameWriteAccess aFrm(*pFrame->GetNext()); + aRectFnSet.SetHeight(aFrm, nAddMax-nAdd); + + if( aRectFnSet.IsVert() && !aRectFnSet.IsVertL2R() && !aRectFnSet.IsRev() ) + { + aFrm.Pos().X() += nAdd; + } + } + pFrame->GetNext()->InvalidatePrt(); + if ( pFrame->GetNext()->GetNext() ) + { pFrame->GetNext()->GetNext()->InvalidatePos_(); + } } } } @@ -1499,14 +1596,24 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst ) if ( !bTst && nReal ) { - SwTwips nTmp = aRectFnSet.GetHeight(pFrame->Frame()); - aRectFnSet.SetHeight( pFrame->Frame(), nTmp - nReal ); - if( aRectFnSet.IsVert() && !aRectFnSet.IsVertL2R() && !aRectFnSet.IsRev() ) - pFrame->Frame().Pos().X() += nReal; + SwTwips nTmp = aRectFnSet.GetHeight(pFrame->getSwFrame()); + + { + SwFrameRect::FrameWriteAccess aFrm(*pFrame); + aRectFnSet.SetHeight( aFrm, nTmp - nReal ); + + if( aRectFnSet.IsVert() && !aRectFnSet.IsVertL2R() && !aRectFnSet.IsRev() ) + { + aFrm.Pos().X() += nReal; + } + } + pFrame->InvalidatePrt(); + if ( pFrame->GetNext() ) pFrame->GetNext()->InvalidatePos_(); - if( nReal < 0 && pFrame->IsInSct() ) + + if( nReal < 0 && pFrame->IsInSct() ) { SwLayoutFrame* pUp = pFrame->GetUpper(); if( pUp && nullptr != ( pUp = pUp->GetUpper() ) && pUp->IsSctFrame() && @@ -1655,9 +1762,9 @@ void SwFrame::ReinitializeFrameSizeAttrFlags() else if ( rFormatSize.GetHeightSizeType() == ATT_FIX_SIZE ) { if( IsVertical() ) - ChgSize( Size( rFormatSize.GetWidth(), Frame().Height())); + ChgSize( Size( rFormatSize.GetWidth(), getSwFrame().Height())); else - ChgSize( Size( Frame().Width(), rFormatSize.GetHeight())); + ChgSize( Size( getSwFrame().Width(), rFormatSize.GetHeight())); } } @@ -1709,7 +1816,7 @@ SwTwips SwContentFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) { SwRectFnSet aRectFnSet(this); - SwTwips nFrameHeight = aRectFnSet.GetHeight(Frame()); + SwTwips nFrameHeight = aRectFnSet.GetHeight(getSwFrame()); if( nFrameHeight > 0 && nDist > (LONG_MAX - nFrameHeight ) ) nDist = LONG_MAX - nFrameHeight; @@ -1723,9 +1830,16 @@ SwTwips SwContentFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) { if ( !bTst ) { - aRectFnSet.SetHeight( Frame(), nFrameHeight + nDist ); - if( IsVertical() && !IsVertLR() && !IsReverse() ) - Frame().Pos().X() -= nDist; + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.SetHeight( aFrm, nFrameHeight + nDist ); + + if( IsVertical() && !IsVertLR() && !IsReverse() ) + { + aFrm.Pos().X() -= nDist; + } + } + if ( GetNext() ) { GetNext()->InvalidatePos(); @@ -1743,20 +1857,29 @@ SwTwips SwContentFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) return 0; } - SwTwips nReal = aRectFnSet.GetHeight(GetUpper()->Prt()); + SwTwips nReal = aRectFnSet.GetHeight(GetUpper()->getSwPrint()); SwFrame *pFrame = GetUpper()->Lower(); while( pFrame && nReal > 0 ) - { nReal -= aRectFnSet.GetHeight(pFrame->Frame()); + { nReal -= aRectFnSet.GetHeight(pFrame->getSwFrame()); pFrame = pFrame->GetNext(); } if ( !bTst ) { //Contents are always resized to the wished value. - long nOld = aRectFnSet.GetHeight(Frame()); - aRectFnSet.SetHeight( Frame(), nOld + nDist ); - if( IsVertical()&& !IsVertLR() && !IsReverse() ) - Frame().Pos().X() -= nDist; + long nOld = aRectFnSet.GetHeight(getSwFrame()); + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + + aRectFnSet.SetHeight( aFrm, nOld + nDist ); + + if( IsVertical()&& !IsVertLR() && !IsReverse() ) + { + aFrm.Pos().X() -= nDist; + } + } + SwTabFrame *pTab = (nOld && IsInTab()) ? FindTabFrame() : nullptr; if (pTab) { @@ -1814,14 +1937,14 @@ SwTwips SwContentFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) { SwRectFnSet aRectFnSet(this); OSL_ENSURE( nDist >= 0, "nDist < 0" ); - OSL_ENSURE( nDist <= aRectFnSet.GetHeight(Frame()), + OSL_ENSURE( nDist <= aRectFnSet.GetHeight(getSwFrame()), "nDist > than current size." ); if ( !bTst ) { SwTwips nRstHeight; if( GetUpper() ) - nRstHeight = aRectFnSet.BottomDist( Frame(), aRectFnSet.GetPrtBottom(*GetUpper()) ); + nRstHeight = aRectFnSet.BottomDist( getSwFrame(), aRectFnSet.GetPrtBottom(*GetUpper()) ); else nRstHeight = 0; if( nRstHeight < 0 ) @@ -1832,17 +1955,27 @@ SwTwips SwContentFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) SwFrame *pNxt = GetNext(); while( pNxt ) { - nNextHeight += aRectFnSet.GetHeight(pNxt->Frame()); + nNextHeight += aRectFnSet.GetHeight(pNxt->getSwFrame()); pNxt = pNxt->GetNext(); } } nRstHeight = nDist + nRstHeight - nNextHeight; } else + { nRstHeight = nDist; - aRectFnSet.SetHeight( Frame(), aRectFnSet.GetHeight(Frame()) - nDist ); - if( IsVertical() && !IsVertLR() ) - Frame().Pos().X() += nDist; + } + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.SetHeight( aFrm, aRectFnSet.GetHeight(aFrm) - nDist ); + + if( IsVertical() && !IsVertLR() ) + { + aFrm.Pos().X() += nDist; + } + } + nDist = nRstHeight; SwTabFrame *pTab = IsInTab() ? FindTabFrame() : nullptr; if (pTab) @@ -1874,7 +2007,7 @@ SwTwips SwContentFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) // #109722# : The fix for #108745# was too strict. bool bInvalidate = true; - const SwRect aRect( Frame() ); + const SwRect aRect( getSwFrame() ); const SwPageFrame* pPage = FindPageFrame(); const SwSortedObjs* pSorted = pPage ? pPage->GetSortedObjs() : nullptr; if( pSorted ) @@ -2015,7 +2148,7 @@ void SwContentFrame::UpdateAttr_( const SfxPoolItem* pOld, const SfxPoolItem* pN CheckPageDescs( pPage ); if ( GetAttrSet()->GetPageDesc().GetNumOffset() ) static_cast<SwRootFrame*>(pPage->GetUpper())->SetVirtPageNum( true ); - SwDocPosUpdate aMsgHint( pPage->Frame().Top() ); + SwDocPosUpdate aMsgHint( pPage->getSwFrame().Top() ); pPage->GetFormat()->GetDoc()->getIDocumentFieldsAccess().UpdatePageFields( &aMsgHint ); } break; @@ -2169,8 +2302,8 @@ SwTwips SwLayoutFrame::InnerHeight() const { SwTwips nTmp = static_cast<const SwLayoutFrame*>(pCnt)->InnerHeight(); if( pCnt->GetValidPrtAreaFlag() ) - nTmp += aRectFnSet.GetHeight(pCnt->Frame()) - - aRectFnSet.GetHeight(pCnt->Prt()); + nTmp += aRectFnSet.GetHeight(pCnt->getSwFrame()) - + aRectFnSet.GetHeight(pCnt->getSwPrint()); if( nRet < nTmp ) nRet = nTmp; pCnt = pCnt->GetNext(); @@ -2180,13 +2313,13 @@ SwTwips SwLayoutFrame::InnerHeight() const { do { - nRet += aRectFnSet.GetHeight(pCnt->Frame()); + nRet += aRectFnSet.GetHeight(pCnt->getSwFrame()); if( pCnt->IsContentFrame() && static_cast<const SwTextFrame*>(pCnt)->IsUndersized() ) nRet += static_cast<const SwTextFrame*>(pCnt)->GetParHeight() - - aRectFnSet.GetHeight(pCnt->Prt()); + aRectFnSet.GetHeight(pCnt->getSwPrint()); if( pCnt->IsLayoutFrame() && !pCnt->IsTabFrame() ) nRet += static_cast<const SwLayoutFrame*>(pCnt)->InnerHeight() - - aRectFnSet.GetHeight(pCnt->Prt()); + aRectFnSet.GetHeight(pCnt->getSwPrint()); pCnt = pCnt->GetNext(); } while( pCnt ); @@ -2205,8 +2338,8 @@ SwTwips SwLayoutFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) return 0; SwRectFnSet aRectFnSet(this); - const SwTwips nFrameHeight = aRectFnSet.GetHeight(Frame()); - const SwTwips nFramePos = Frame().Pos().X(); + const SwTwips nFrameHeight = aRectFnSet.GetHeight(getSwFrame()); + const SwTwips nFramePos = getSwFrame().Pos().X(); if ( nFrameHeight > 0 && nDist > (LONG_MAX - nFrameHeight) ) nDist = LONG_MAX - nFrameHeight; @@ -2216,23 +2349,28 @@ SwTwips SwLayoutFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) { SwFrame *pFrame = GetUpper()->Lower(); while( pFrame ) - { nMin += aRectFnSet.GetHeight(pFrame->Frame()); + { nMin += aRectFnSet.GetHeight(pFrame->getSwFrame()); pFrame = pFrame->GetNext(); } - nMin = aRectFnSet.GetHeight(GetUpper()->Prt()) - nMin; + nMin = aRectFnSet.GetHeight(GetUpper()->getSwPrint()) - nMin; if ( nMin < 0 ) nMin = 0; } - SwRect aOldFrame( Frame() ); + SwRect aOldFrame( getSwFrame() ); bool bMoveAccFrame = false; bool bChgPos = IsVertical() && !IsReverse(); if ( !bTst ) { - aRectFnSet.SetHeight( Frame(), nFrameHeight + nDist ); + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.SetHeight( aFrm, nFrameHeight + nDist ); + if( bChgPos && !IsVertLR() ) - Frame().Pos().X() -= nDist; + { + aFrm.Pos().X() -= nDist; + } + bMoveAccFrame = true; } @@ -2281,10 +2419,10 @@ SwTwips SwLayoutFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) SwTwips nSpace = bTst ? 0 : -nDist; const SwFrame *pFrame = GetUpper()->Lower(); do - { nSpace += aRectFnSet.GetHeight(pFrame->Frame()); + { nSpace += aRectFnSet.GetHeight(pFrame->getSwFrame()); pFrame = pFrame->GetNext(); } while ( pFrame != GetNext() ); - nSpace = aRectFnSet.GetHeight(GetUpper()->Prt()) -nSpace; + nSpace = aRectFnSet.GetHeight(GetUpper()->getSwPrint()) -nSpace; if ( nSpace < 0 ) nSpace = 0; nSpace += nGrow; @@ -2311,9 +2449,14 @@ SwTwips SwLayoutFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) // NEW TABLES ( !IsCellFrame() || static_cast<SwCellFrame*>(this)->GetLayoutRowSpan() > 1 ) ) { - aRectFnSet.SetHeight( Frame(), nFrameHeight + nReal ); + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.SetHeight( aFrm, nFrameHeight + nReal ); + if( bChgPos && !IsVertLR() ) - Frame().Pos().X() = nFramePos - nReal; + { + aFrm.Pos().X() = nFramePos - nReal; + } + bMoveAccFrame = true; } @@ -2383,7 +2526,7 @@ SwTwips SwLayoutFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) OSL_ENSURE( nDist >= 0, "nDist < 0" ); SwRectFnSet aRectFnSet(this); - SwTwips nFrameHeight = aRectFnSet.GetHeight(Frame()); + SwTwips nFrameHeight = aRectFnSet.GetHeight(getSwFrame()); if ( nDist > nFrameHeight ) nDist = nFrameHeight; @@ -2393,29 +2536,34 @@ SwTwips SwLayoutFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) { if( !Lower()->IsNeighbourFrame() ) { const SwFrame *pFrame = Lower(); - const long nTmp = aRectFnSet.GetHeight(Prt()); + const long nTmp = aRectFnSet.GetHeight(getSwPrint()); while( pFrame && nMin < nTmp ) - { nMin += aRectFnSet.GetHeight(pFrame->Frame()); + { nMin += aRectFnSet.GetHeight(pFrame->getSwFrame()); pFrame = pFrame->GetNext(); } } } SwTwips nReal = nDist; - SwTwips nMinDiff = aRectFnSet.GetHeight(Prt()) - nMin; + SwTwips nMinDiff = aRectFnSet.GetHeight(getSwPrint()) - nMin; if( nReal > nMinDiff ) nReal = nMinDiff; if( nReal <= 0 ) return nDist; - SwRect aOldFrame( Frame() ); + SwRect aOldFrame( getSwFrame() ); bool bMoveAccFrame = false; SwTwips nRealDist = nReal; if ( !bTst ) { - aRectFnSet.SetHeight( Frame(), nFrameHeight - nReal ); + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.SetHeight( aFrm, nFrameHeight - nReal ); + if( bChgPos && !IsVertLR() ) - Frame().Pos().X() += nReal; + { + aFrm.Pos().X() += nReal; + } + bMoveAccFrame = true; } @@ -2433,10 +2581,14 @@ SwTwips SwLayoutFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) nReal *= -1; if ( !bTst && IsBodyFrame() && nReal < nRealDist ) { - aRectFnSet.SetHeight( Frame(), aRectFnSet.GetHeight(Frame()) - + nRealDist - nReal ); + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.SetHeight( aFrm, aRectFnSet.GetHeight(aFrm) + nRealDist - nReal ); + if( bChgPos && !IsVertLR() ) - Frame().Pos().X() += nRealDist - nReal; + { + aFrm.Pos().X() += nRealDist - nReal; + } + OSL_ENSURE( !IsAccessibleFrame(), "bMoveAccFrame has to be set!" ); } } @@ -2446,10 +2598,14 @@ SwTwips SwLayoutFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) SwTwips nTmp = GetUpper()->Shrink( nReal, bTst, bInfo ); if ( nTmp != nReal ) { - aRectFnSet.SetHeight( Frame(), aRectFnSet.GetHeight(Frame()) - + nReal - nTmp ); + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.SetHeight( aFrm, aRectFnSet.GetHeight(aFrm) + nReal - nTmp ); + if( bChgPos && !IsVertLR() ) - Frame().Pos().X() += nTmp - nReal; + { + aFrm.Pos().X() += nTmp - nReal; + } + OSL_ENSURE( !IsAccessibleFrame(), "bMoveAccFrame has to be set!" ); nReal = nTmp; } @@ -2563,8 +2719,8 @@ void SwLayoutFrame::ChgLowersProp( const Size& rOldSize ) SwFrame *pLowerFrame = Lower(); // declare and init const booleans <bHeightChgd> and <bWidthChg> - const bool bHeightChgd = rOldSize.Height() != Prt().Height(); - const bool bWidthChgd = rOldSize.Width() != Prt().Width(); + const bool bHeightChgd = rOldSize.Height() != getSwPrint().Height(); + const bool bWidthChgd = rOldSize.Width() != getSwPrint().Width(); SwRectFnSet aRectFnSet(this); @@ -2631,7 +2787,7 @@ 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.IsVert() ? rOldSize.Width() : rOldSize.Height(); - if( nOldHeight < aRectFnSet.GetHeight(Prt()) ) + if( nOldHeight < aRectFnSet.GetHeight(getSwPrint()) ) { // If variable size of body|section frame has grown, only found // last lower and the position of the its next have to be invalidated. @@ -2650,8 +2806,8 @@ void SwLayoutFrame::ChgLowersProp( const Size& rOldSize ) // and the dedicated new last lower. if( aRectFnSet.IsVert() ) { - SwTwips nBot = Frame().Left() + Prt().Left(); - while ( pLowerFrame && pLowerFrame->GetPrev() && pLowerFrame->Frame().Left() < nBot ) + SwTwips nBot = getSwFrame().Left() + getSwPrint().Left(); + while ( pLowerFrame && pLowerFrame->GetPrev() && pLowerFrame->getSwFrame().Left() < nBot ) { pLowerFrame->InvalidateAll_(); pLowerFrame->InvalidatePage( pPage ); @@ -2660,8 +2816,8 @@ void SwLayoutFrame::ChgLowersProp( const Size& rOldSize ) } else { - SwTwips nBot = Frame().Top() + Prt().Bottom(); - while ( pLowerFrame && pLowerFrame->GetPrev() && pLowerFrame->Frame().Top() > nBot ) + SwTwips nBot = getSwFrame().Top() + getSwPrint().Bottom(); + while ( pLowerFrame && pLowerFrame->GetPrev() && pLowerFrame->getSwFrame().Top() > nBot ) { pLowerFrame->InvalidateAll_(); pLowerFrame->InvalidatePage( pPage ); @@ -2756,7 +2912,8 @@ void SwLayoutFrame::ChgLowersProp( const Size& rOldSize ) // In horizontal layout set width of header, footer, // foot note container, foot note, body and no-text // frames to its upper width. - pLowerFrame->Frame().Width( Prt().Width() ); + SwFrameRect::FrameWriteAccess aFrm(*pLowerFrame); + aFrm.Width( getSwPrint().Width() ); } else if( rOldSize.Width() && !pLowerFrame->IsFootnoteFrame() ) { @@ -2771,21 +2928,23 @@ void SwLayoutFrame::ChgLowersProp( const Size& rOldSize ) // Perform <double> calculation of new width, if // one of the coefficients is greater than 50000 SwTwips nNewWidth; - if ( (pLowerFrame->Frame().Width() > 50000) || - (Prt().Width() > 50000) ) + if ( (pLowerFrame->getSwFrame().Width() > 50000) || + (getSwPrint().Width() > 50000) ) { double nNewWidthTmp = - ( double(pLowerFrame->Frame().Width()) - * double(Prt().Width()) ) + ( double(pLowerFrame->getSwFrame().Width()) + * double(getSwPrint().Width()) ) / double(rOldSize.Width()); nNewWidth = SwTwips(nNewWidthTmp); } else { nNewWidth = - (pLowerFrame->Frame().Width() * Prt().Width()) / rOldSize.Width(); + (pLowerFrame->getSwFrame().Width() * getSwPrint().Width()) / rOldSize.Width(); } - pLowerFrame->Frame().Width( nNewWidth ); + + SwFrameRect::FrameWriteAccess aFrm(*pLowerFrame); + aFrm.Width( nNewWidth ); } } if ( bHeightChgd ) @@ -2797,7 +2956,8 @@ void SwLayoutFrame::ChgLowersProp( const Size& rOldSize ) // no-text frames to its upper height. // In horizontal layout set height of column frames // to its upper height. - pLowerFrame->Frame().Height( Prt().Height() ); + SwFrameRect::FrameWriteAccess aFrm(*pLowerFrame); + aFrm.Height( getSwPrint().Height() ); } // OD 01.10.2002 #102211# // add conditions <!pLowerFrame->IsHeaderFrame()> and @@ -2842,18 +3002,20 @@ void SwLayoutFrame::ChgLowersProp( const Size& rOldSize ) if ( IsVertical() || pLowerFrame->IsBodyFrame() ) { SwTwips nNewHeight = - pLowerFrame->Frame().Height() + - ( Prt().Height() - rOldSize.Height() ); + pLowerFrame->getSwFrame().Height() + + ( getSwPrint().Height() - rOldSize.Height() ); if ( nNewHeight < 0) { // OD 01.04.2003 #108446# - adjust assertion condition and text OSL_ENSURE( !( IsPageFrame() && - (pLowerFrame->Frame().Height()>0) && + (pLowerFrame->getSwFrame().Height()>0) && (pLowerFrame->IsValid()) ), "ChgLowersProg - negative height for lower."); nNewHeight = 0; } - pLowerFrame->Frame().Height( nNewHeight ); + + SwFrameRect::FrameWriteAccess aFrm(*pLowerFrame); + aFrm.Height( nNewHeight ); } } } @@ -2863,35 +3025,37 @@ void SwLayoutFrame::ChgLowersProp( const Size& rOldSize ) // OD 24.10.2002 #97265# - <double> calculation // Perform <double> calculation of new height, if // one of the coefficients is greater than 50000 - if ( (pLowerFrame->Frame().Height() > 50000) || - (Prt().Height() > 50000) ) + if ( (pLowerFrame->getSwFrame().Height() > 50000) || + (getSwPrint().Height() > 50000) ) { double nNewHeightTmp = - ( double(pLowerFrame->Frame().Height()) - * double(Prt().Height()) ) + ( double(pLowerFrame->getSwFrame().Height()) + * double(getSwPrint().Height()) ) / double(rOldSize.Height()); nNewHeight = SwTwips(nNewHeightTmp); } else { - nNewHeight = ( pLowerFrame->Frame().Height() - * Prt().Height() ) / rOldSize.Height(); + nNewHeight = ( pLowerFrame->getSwFrame().Height() + * getSwPrint().Height() ) / rOldSize.Height(); } if( !pLowerFrame->GetNext() ) { - SwTwips nSum = Prt().Height(); + SwTwips nSum = getSwPrint().Height(); SwFrame* pTmp = Lower(); while( pTmp->GetNext() ) { if( !pTmp->IsFootnoteContFrame() || !pTmp->IsVertical() ) - nSum -= pTmp->Frame().Height(); + nSum -= pTmp->getSwFrame().Height(); pTmp = pTmp->GetNext(); } if( nSum - nNewHeight == 1 && - nSum == pLowerFrame->Frame().Height() ) + nSum == pLowerFrame->getSwFrame().Height() ) nNewHeight = nSum; } - pLowerFrame->Frame().Height( nNewHeight ); + + SwFrameRect::FrameWriteAccess aFrm(*pLowerFrame); + aFrm.Height( nNewHeight ); } } } @@ -2909,8 +3073,8 @@ void SwLayoutFrame::ChgLowersProp( const Size& rOldSize ) { //If a growth took place and the subordinate elements can retouch //itself (currently Tabs, Sections and Content) we trigger it. - if ( rOldSize.Height() < Prt().SSize().Height() || - rOldSize.Width() < Prt().SSize().Width() ) + if ( rOldSize.Height() < getSwPrint().SSize().Height() || + rOldSize.Width() < getSwPrint().SSize().Width() ) pLowerFrame->SetRetouche(); } pLowerFrame = pLowerFrame->GetNext(); @@ -2995,20 +3159,20 @@ void SwLayoutFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBord SwTwips nRemaining = 0; SwFrame *pFrame = Lower(); while ( pFrame ) - { nRemaining += (pFrame->Frame().*fnRect->fnGetHeight)(); + { nRemaining += (pFrame->getSwFrame().*fnRect->fnGetHeight)(); if( pFrame->IsTextFrame() && static_cast<SwTextFrame*>(pFrame)->IsUndersized() ) // This TextFrame would like to be a bit bigger nRemaining += static_cast<SwTextFrame*>(pFrame)->GetParHeight() - - (pFrame->Prt().*fnRect->fnGetHeight)(); + - (pFrame->getSwPrint().*fnRect->fnGetHeight)(); else if( pFrame->IsSctFrame() && static_cast<SwSectionFrame*>(pFrame)->IsUndersized() ) nRemaining += static_cast<SwSectionFrame*>(pFrame)->Undersize(); pFrame = pFrame->GetNext(); } nRemaining += nBorder; nRemaining = std::max( nRemaining, nMinHeight ); - const SwTwips nDiff = nRemaining-(Frame().*fnRect->fnGetHeight)(); - const long nOldLeft = (Frame().*fnRect->fnGetLeft)(); - const long nOldTop = (Frame().*fnRect->fnGetTop)(); + const SwTwips nDiff = nRemaining-(getSwFrame().*fnRect->fnGetHeight)(); + const long nOldLeft = (getSwFrame().*fnRect->fnGetLeft)(); + const long nOldTop = (getSwFrame().*fnRect->fnGetTop)(); if ( nDiff ) { if ( nDiff > 0 ) @@ -3019,12 +3183,12 @@ void SwLayoutFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBord MakePos(); } //Don't exceed the bottom edge of the Upper. - if ( GetUpper() && (Frame().*fnRect->fnGetHeight)() ) + if ( GetUpper() && (getSwFrame().*fnRect->fnGetHeight)() ) { const SwTwips nLimit = (GetUpper()->*fnRect->fnGetPrtBottom)(); if( (this->*fnRect->fnSetLimit)( nLimit ) && - nOldLeft == (Frame().*fnRect->fnGetLeft)() && - nOldTop == (Frame().*fnRect->fnGetTop)() ) + nOldLeft == (getSwFrame().*fnRect->fnGetLeft)() && + nOldTop == (getSwFrame().*fnRect->fnGetTop)() ) mbValidSize = mbValidPrtArea = true; } } while ( !mbValidSize ); @@ -3032,8 +3196,8 @@ void SwLayoutFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBord else if (GetType() & FRM_HEADFOOT) { do - { if ( Frame().Height() != pAttrs->GetSize().Height() ) - ChgSize( Size( Frame().Width(), pAttrs->GetSize().Height())); + { if ( getSwFrame().Height() != pAttrs->GetSize().Height() ) + ChgSize( Size( getSwFrame().Width(), pAttrs->GetSize().Height())); mbValidSize = true; MakePos(); } while ( !mbValidSize ); @@ -3073,8 +3237,8 @@ static void InvaPercentFlys( SwFrame *pFrame, SwTwips nDiff ) // not allow the text to go through... // then a notifycation could cause an endless loop, e.g. // 100% height and no text wrap inside a cell of a table. - if( pFly->Frame().Height()*10 > - ( nDiff + pRel->Prt().Height() )*9 && + if( pFly->getSwFrame().Height()*10 > + ( nDiff + pRel->getSwPrint().Height() )*9 && pFly->GetFormat()->GetSurround().GetSurround() != css::text::WrapTextMode_THROUGH ) bNotify = false; @@ -3129,11 +3293,11 @@ long SwLayoutFrame::CalcRel( const SwFormatFrameSize &rSz ) const if( pRel->IsPageBodyFrame() && pSh && bBrowseMode && pSh->VisArea().Width() ) { nRel = pSh->GetBrowseWidth(); - long nDiff = nRel - pRel->Prt().Width(); + long nDiff = nRel - pRel->getSwPrint().Width(); if ( nDiff > 0 ) nRel -= nDiff; } - nRel = std::min( nRel, pRel->Prt().Width() ); + nRel = std::min( nRel, pRel->getSwPrint().Width() ); nRet = nRel * nPercent / 100; } return nRet; @@ -3257,8 +3421,8 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs, SwRectFnSet aRectFnSet(this); if( IsSctFrame() ) { - nMaximum = aRectFnSet.GetHeight(Frame()) - nBorder + - aRectFnSet.BottomDist(Frame(), aRectFnSet.GetPrtBottom(*GetUpper())); + nMaximum = aRectFnSet.GetHeight(getSwFrame()) - nBorder + + aRectFnSet.BottomDist(getSwFrame(), aRectFnSet.GetPrtBottom(*GetUpper())); nMaximum += GetUpper()->Grow( LONG_MAX, true ); if( nMaximum < nMinimum ) { @@ -3274,13 +3438,16 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs, GetBalancedColumns().GetValue(); SwFrame* pAny = ContainsAny(); if( bNoBalance || - ( !aRectFnSet.GetHeight(Frame()) && pAny ) ) + ( !aRectFnSet.GetHeight(getSwFrame()) && pAny ) ) { long nTop = aRectFnSet.GetTopMargin(*this); // #i23129# - correction // to the calculated maximum height. - aRectFnSet.AddBottom( Frame(), nMaximum - - aRectFnSet.GetHeight(Frame()) ); + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.AddBottom( aFrm, nMaximum - aRectFnSet.GetHeight(getSwFrame()) ); + } + if( nTop > nMaximum ) nTop = nMaximum; aRectFnSet.SetYMargins( *this, nTop, 0 ); @@ -3365,8 +3532,8 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs, while( pCol ) { SwLayoutFrame* pLay = static_cast<SwLayoutFrame*>(pCol->Lower()); - SwTwips nInnerHeight = aRectFnSet.GetHeight(pLay->Frame()) - - aRectFnSet.GetHeight(pLay->Prt()); + SwTwips nInnerHeight = aRectFnSet.GetHeight(pLay->getSwFrame()) - + aRectFnSet.GetHeight(pLay->getSwPrint()); if( pLay->Lower() ) { bFoundLower = true; @@ -3381,10 +3548,10 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs, pLay = static_cast<SwLayoutFrame*>(pLay->GetNext()); OSL_ENSURE( pLay->IsFootnoteContFrame(),"FootnoteContainer expected" ); nInnerHeight += pLay->InnerHeight(); - nInnerHeight += aRectFnSet.GetHeight(pLay->Frame()) - - aRectFnSet.GetHeight(pLay->Prt()); + nInnerHeight += aRectFnSet.GetHeight(pLay->getSwFrame()) - + aRectFnSet.GetHeight(pLay->getSwPrint()); } - nInnerHeight -= aRectFnSet.GetHeight(pCol->Prt()); + nInnerHeight -= aRectFnSet.GetHeight(pCol->getSwPrint()); if( nInnerHeight > nDiff ) { nDiff = nInnerHeight; @@ -3410,7 +3577,7 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs, if ( nDiff || ::lcl_IsFlyHeightClipped( this ) || ( IsSctFrame() && static_cast<SwSectionFrame*>(this)->CalcMinDiff( nMinDiff ) ) ) { - long nPrtHeight = aRectFnSet.GetHeight(Prt()); + long nPrtHeight = aRectFnSet.GetHeight(getSwPrint()); // The minimum must not be smaller than our PrtHeight as // long as something juts over. if( nMinimum < nPrtHeight ) @@ -3432,7 +3599,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 = aRectFnSet.GetHeight(Frame()); + long nFrameHeight = aRectFnSet.GetHeight(getSwFrame()); if ( nFrameHeight > nMinHeight || nPrtHeight >= nMinDiff ) nDiff = std::max( nDiff, nMinDiff ); else if( nDiff < nMinDiff ) @@ -3446,7 +3613,7 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs, } else if( nMaximum > nMinimum ) // We fit, do we still have some margin? { - long nPrtHeight = aRectFnSet.GetHeight(Prt()); + long nPrtHeight = aRectFnSet.GetHeight(getSwPrint()); if ( nMaximum < nPrtHeight ) nDiff = nMaximum - nPrtHeight; // We grew over a working // height and shrink back to it, but will this ever @@ -3481,11 +3648,15 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs, } if( nDiff ) // now we shrink or grow... { - Size aOldSz( Prt().SSize() ); + Size aOldSz( getSwPrint().SSize() ); long nTop = aRectFnSet.GetTopMargin(*this); - nDiff = aRectFnSet.GetHeight(Prt()) + nDiff + nBorder - - aRectFnSet.GetHeight(Frame()); - aRectFnSet.AddBottom( Frame(), nDiff ); + nDiff = aRectFnSet.GetHeight(getSwPrint()) + nDiff + nBorder - aRectFnSet.GetHeight(getSwFrame()); + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.AddBottom( aFrm, nDiff ); + } + // #i68520# SwFlyFrame *pFlyFrame = dynamic_cast<SwFlyFrame*>(this); if (pFlyFrame) @@ -3709,7 +3880,7 @@ void SwRootFrame::InvalidateAllContent( SwInvalidateFlags nInv ) { SwViewShell *pSh = getRootFrame()->GetCurrShell(); if( pSh ) - pSh->InvalidateWindows( Frame() ); + pSh->InvalidateWindows( getSwFrame() ); } } diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx index a865228d5b4f..6c9635d717e8 100644 --- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx @@ -158,7 +158,7 @@ SwTwips SwAnchoredObjectPosition::GetTopForObjPos( const SwFrame& _rFrame, const SwRectFn& _fnRect, const bool _bVert ) const { - SwTwips nTopOfFrameForObjPos = (_rFrame.Frame().*_fnRect->fnGetTop)(); + SwTwips nTopOfFrameForObjPos = (_rFrame.getSwFrame().*_fnRect->fnGetTop)(); if ( _rFrame.IsTextFrame() ) { @@ -213,14 +213,14 @@ void SwAnchoredObjectPosition::GetVertAlignmentValues( case text::RelOrientation::FRAME: { // #i11860# - consider upper space of previous frame - nHeight = aRectFnSet.GetHeight(_rVertOrientFrame.Frame()) - + nHeight = aRectFnSet.GetHeight(_rVertOrientFrame.getSwFrame()) - nVertOrientUpperSpaceForPrevFrameAndPageGrid; nOffset = 0; } break; case text::RelOrientation::PRINT_AREA: { - nHeight = aRectFnSet.GetHeight(_rVertOrientFrame.Prt()); + nHeight = aRectFnSet.GetHeight(_rVertOrientFrame.getSwPrint()); // #i11860# - consider upper space of previous frame nOffset = aRectFnSet.GetTopMargin(_rVertOrientFrame) - nVertOrientUpperSpaceForPrevFrameAndPageGrid; @@ -234,12 +234,12 @@ void SwAnchoredObjectPosition::GetVertAlignmentValues( { if( pPrtFrame->IsHeaderFrame() ) { - nHeight -= pPrtFrame->Frame().Height(); - nOffset += pPrtFrame->Frame().Height(); + nHeight -= pPrtFrame->getSwFrame().Height(); + nOffset += pPrtFrame->getSwFrame().Height(); } else if( pPrtFrame->IsFooterFrame() ) { - nHeight -= pPrtFrame->Frame().Height(); + nHeight -= pPrtFrame->getSwFrame().Height(); } pPrtFrame = pPrtFrame->GetNext(); } @@ -248,18 +248,18 @@ void SwAnchoredObjectPosition::GetVertAlignmentValues( break; case text::RelOrientation::PAGE_FRAME: { - nHeight = aRectFnSet.GetHeight(_rPageAlignLayFrame.Frame()); + nHeight = aRectFnSet.GetHeight(_rPageAlignLayFrame.getSwFrame()); nOffset = aRectFnSet.YDiff( - aRectFnSet.GetTop(_rPageAlignLayFrame.Frame()), + aRectFnSet.GetTop(_rPageAlignLayFrame.getSwFrame()), nVertOrientTop ); } break; case text::RelOrientation::PAGE_PRINT_AREA: { - nHeight = aRectFnSet.GetHeight(_rPageAlignLayFrame.Prt()); + nHeight = aRectFnSet.GetHeight(_rPageAlignLayFrame.getSwPrint()); nOffset = aRectFnSet.GetTopMargin(_rPageAlignLayFrame) + aRectFnSet.YDiff( - aRectFnSet.GetTop(_rPageAlignLayFrame.Frame()), + aRectFnSet.GetTop(_rPageAlignLayFrame.getSwFrame()), nVertOrientTop ); // if aligned to page in horizontal layout, consider header and // footer frame height appropriately. @@ -271,12 +271,12 @@ void SwAnchoredObjectPosition::GetVertAlignmentValues( { if( pPrtFrame->IsHeaderFrame() ) { - nHeight -= pPrtFrame->Frame().Height(); - nOffset += pPrtFrame->Frame().Height(); + nHeight -= pPrtFrame->getSwFrame().Height(); + nOffset += pPrtFrame->getSwFrame().Height(); } else if( pPrtFrame->IsFooterFrame() ) { - nHeight -= pPrtFrame->Frame().Height(); + nHeight -= pPrtFrame->getSwFrame().Height(); } pPrtFrame = pPrtFrame->GetNext(); } @@ -426,11 +426,11 @@ SwTwips SwAnchoredObjectPosition::ImplAdjustVertRelPos( const SwTwips nTopOfAnch ( !bFollowTextFlow || !GetAnchoredObj().GetAnchorFrame()->IsInTab() ) ) { - aPgAlignArea = rPageAlignLayFrame.FindPageFrame()->Frame(); + aPgAlignArea = rPageAlignLayFrame.FindPageFrame()->getSwFrame(); } else { - aPgAlignArea = rPageAlignLayFrame.Frame(); + aPgAlignArea = rPageAlignLayFrame.getSwFrame(); } } @@ -530,34 +530,34 @@ SwTwips SwAnchoredObjectPosition::ImplAdjustHoriRelPos( if( bVert ) { - if ( rAnchorFrame.Frame().Top() + nAdjustedRelPosX + aObjSize.Height() > - _rPageAlignLayFrame.Frame().Bottom() ) + if ( rAnchorFrame.getSwFrame().Top() + nAdjustedRelPosX + aObjSize.Height() > + _rPageAlignLayFrame.getSwFrame().Bottom() ) { - nAdjustedRelPosX = _rPageAlignLayFrame.Frame().Bottom() - - rAnchorFrame.Frame().Top() - + nAdjustedRelPosX = _rPageAlignLayFrame.getSwFrame().Bottom() - + rAnchorFrame.getSwFrame().Top() - aObjSize.Height(); } - if ( rAnchorFrame.Frame().Top() + nAdjustedRelPosX < - _rPageAlignLayFrame.Frame().Top() ) + if ( rAnchorFrame.getSwFrame().Top() + nAdjustedRelPosX < + _rPageAlignLayFrame.getSwFrame().Top() ) { - nAdjustedRelPosX = _rPageAlignLayFrame.Frame().Top() - - rAnchorFrame.Frame().Top(); + nAdjustedRelPosX = _rPageAlignLayFrame.getSwFrame().Top() - + rAnchorFrame.getSwFrame().Top(); } } else { - if ( rAnchorFrame.Frame().Left() + nAdjustedRelPosX + aObjSize.Width() > - _rPageAlignLayFrame.Frame().Right() ) + if ( rAnchorFrame.getSwFrame().Left() + nAdjustedRelPosX + aObjSize.Width() > + _rPageAlignLayFrame.getSwFrame().Right() ) { - nAdjustedRelPosX = _rPageAlignLayFrame.Frame().Right() - - rAnchorFrame.Frame().Left() - + nAdjustedRelPosX = _rPageAlignLayFrame.getSwFrame().Right() - + rAnchorFrame.getSwFrame().Left() - aObjSize.Width(); } - if ( rAnchorFrame.Frame().Left() + nAdjustedRelPosX < - _rPageAlignLayFrame.Frame().Left() ) + if ( rAnchorFrame.getSwFrame().Left() + nAdjustedRelPosX < + _rPageAlignLayFrame.getSwFrame().Left() ) { - nAdjustedRelPosX = _rPageAlignLayFrame.Frame().Left() - - rAnchorFrame.Frame().Left(); + nAdjustedRelPosX = _rPageAlignLayFrame.getSwFrame().Left() - + rAnchorFrame.getSwFrame().Left(); } } @@ -580,7 +580,7 @@ void SwAnchoredObjectPosition::GetHoriAlignmentValues( const SwFrame& _rHoriOri { case text::RelOrientation::PRINT_AREA: { - nWidth = aRectFnSet.GetWidth(_rHoriOrientFrame.Prt()); + nWidth = aRectFnSet.GetWidth(_rHoriOrientFrame.getSwPrint()); nOffset = aRectFnSet.GetLeftMargin(_rHoriOrientFrame); if ( _rHoriOrientFrame.IsTextFrame() ) { @@ -597,12 +597,12 @@ void SwAnchoredObjectPosition::GetHoriAlignmentValues( const SwFrame& _rHoriOri { if( pPrtFrame->IsHeaderFrame() ) { - nWidth -= pPrtFrame->Frame().Height(); - nOffset += pPrtFrame->Frame().Height(); + nWidth -= pPrtFrame->getSwFrame().Height(); + nOffset += pPrtFrame->getSwFrame().Height(); } else if( pPrtFrame->IsFooterFrame() ) { - nWidth -= pPrtFrame->Frame().Height(); + nWidth -= pPrtFrame->getSwFrame().Height(); } pPrtFrame = pPrtFrame->GetNext(); } @@ -614,8 +614,8 @@ void SwAnchoredObjectPosition::GetHoriAlignmentValues( const SwFrame& _rHoriOri // align at left border of page frame/fly frame/cell frame nWidth = aRectFnSet.GetLeftMargin(_rPageAlignLayFrame); nOffset = aRectFnSet.XDiff( - aRectFnSet.GetLeft(_rPageAlignLayFrame.Frame()), - aRectFnSet.GetLeft(_rHoriOrientFrame.Frame()) ); + aRectFnSet.GetLeft(_rPageAlignLayFrame.getSwFrame()), + aRectFnSet.GetLeft(_rHoriOrientFrame.getSwFrame()) ); _obAlignedRelToPage = true; } break; @@ -625,7 +625,7 @@ void SwAnchoredObjectPosition::GetHoriAlignmentValues( const SwFrame& _rHoriOri nWidth = aRectFnSet.GetRightMargin(_rPageAlignLayFrame); nOffset = aRectFnSet.XDiff( aRectFnSet.GetPrtRight(_rPageAlignLayFrame), - aRectFnSet.GetLeft(_rHoriOrientFrame.Frame()) ); + aRectFnSet.GetLeft(_rHoriOrientFrame.getSwFrame()) ); _obAlignedRelToPage = true; } break; @@ -641,7 +641,7 @@ void SwAnchoredObjectPosition::GetHoriAlignmentValues( const SwFrame& _rHoriOri // align at right border of anchor frame // Unify and simplify nWidth = aRectFnSet.GetRightMargin(_rHoriOrientFrame); - nOffset = aRectFnSet.GetRight(_rHoriOrientFrame.Prt()); + nOffset = aRectFnSet.GetRight(_rHoriOrientFrame.getSwPrint()); } break; case text::RelOrientation::CHAR: @@ -653,17 +653,17 @@ void SwAnchoredObjectPosition::GetHoriAlignmentValues( const SwFrame& _rHoriOri nWidth = 0; nOffset = aRectFnSet.XDiff( aRectFnSet.GetLeft(*ToCharRect()), - aRectFnSet.GetLeft(ToCharOrientFrame()->Frame()) ); + aRectFnSet.GetLeft(ToCharOrientFrame()->getSwFrame()) ); break; } SAL_FALLTHROUGH; } case text::RelOrientation::PAGE_PRINT_AREA: { - nWidth = aRectFnSet.GetWidth(_rPageAlignLayFrame.Prt()); + nWidth = aRectFnSet.GetWidth(_rPageAlignLayFrame.getSwPrint()); nOffset = aRectFnSet.XDiff( aRectFnSet.GetPrtLeft(_rPageAlignLayFrame), - aRectFnSet.GetLeft(_rHoriOrientFrame.Frame()) ); + aRectFnSet.GetLeft(_rHoriOrientFrame.getSwFrame()) ); if ( _rHoriOrientFrame.IsPageFrame() && aRectFnSet.IsVert() ) { // for to-page anchored objects, consider header/footer frame @@ -674,12 +674,12 @@ void SwAnchoredObjectPosition::GetHoriAlignmentValues( const SwFrame& _rHoriOri { if( pPrtFrame->IsHeaderFrame() ) { - nWidth -= pPrtFrame->Frame().Height(); - nOffset += pPrtFrame->Frame().Height(); + nWidth -= pPrtFrame->getSwFrame().Height(); + nOffset += pPrtFrame->getSwFrame().Height(); } else if( pPrtFrame->IsFooterFrame() ) { - nWidth -= pPrtFrame->Frame().Height(); + nWidth -= pPrtFrame->getSwFrame().Height(); } pPrtFrame = pPrtFrame->GetNext(); } @@ -689,16 +689,16 @@ void SwAnchoredObjectPosition::GetHoriAlignmentValues( const SwFrame& _rHoriOri } case text::RelOrientation::PAGE_FRAME: { - nWidth = aRectFnSet.GetWidth(_rPageAlignLayFrame.Frame()); + nWidth = aRectFnSet.GetWidth(_rPageAlignLayFrame.getSwFrame()); nOffset = aRectFnSet.XDiff( - aRectFnSet.GetLeft(_rPageAlignLayFrame.Frame()), - aRectFnSet.GetLeft(_rHoriOrientFrame.Frame()) ); + aRectFnSet.GetLeft(_rPageAlignLayFrame.getSwFrame()), + aRectFnSet.GetLeft(_rHoriOrientFrame.getSwFrame()) ); _obAlignedRelToPage = true; break; } default: { - nWidth = aRectFnSet.GetWidth(_rHoriOrientFrame.Frame()); + nWidth = aRectFnSet.GetWidth(_rHoriOrientFrame.getSwFrame()); bool bWrapThrough = _bObjWrapThrough; // If the frame format is a TextBox of a draw shape, then use the @@ -846,8 +846,8 @@ SwTwips SwAnchoredObjectPosition::CalcRelPosX( // the frame, the object is oriented at. if ( &rAnchorFrame != &_rHoriOrientFrame ) { - SwTwips nLeftOrient = aRectFnSet.GetLeft(_rHoriOrientFrame.Frame()); - SwTwips nLeftAnchor = aRectFnSet.GetLeft(rAnchorFrame.Frame()); + SwTwips nLeftOrient = aRectFnSet.GetLeft(_rHoriOrientFrame.getSwFrame()); + SwTwips nLeftAnchor = aRectFnSet.GetLeft(rAnchorFrame.getSwFrame()); nRelPosX += aRectFnSet.XDiff( nLeftOrient, nLeftAnchor ); } @@ -913,7 +913,7 @@ SwTwips SwAnchoredObjectPosition::AdjustHoriRelPosForDrawAside( SwTwips nAdjustedRelPosX = _nProposedRelPosX; // determine proposed object bound rectangle - Point aTmpPos = aRectFnSet.GetPos(rAnchorTextFrame.Frame()); + Point aTmpPos = aRectFnSet.GetPos(rAnchorTextFrame.getSwFrame()); if( aRectFnSet.IsVert() ) { aTmpPos.X() -= _nRelPosY + aObjBoundRect.Width(); @@ -940,19 +940,19 @@ SwTwips SwAnchoredObjectPosition::AdjustHoriRelPosForDrawAside( if( aRectFnSet.IsVert() ) { const SvxULSpaceItem& rOtherUL = pFly->GetFormat()->GetULSpace(); - const SwTwips nOtherTop = pFly->Frame().Top() - rOtherUL.GetUpper(); - const SwTwips nOtherBot = pFly->Frame().Bottom() + rOtherUL.GetLower(); + const SwTwips nOtherTop = pFly->getSwFrame().Top() - rOtherUL.GetUpper(); + const SwTwips nOtherBot = pFly->getSwFrame().Bottom() + rOtherUL.GetLower(); if ( nOtherTop <= aTmpObjRect.Bottom() + _rULSpacing.GetLower() && nOtherBot >= aTmpObjRect.Top() - _rULSpacing.GetUpper() ) { if ( _eHoriOrient == text::HoriOrientation::LEFT ) { SwTwips nTmp = nOtherBot + 1 + _rULSpacing.GetUpper() - - rAnchorTextFrame.Frame().Top(); + rAnchorTextFrame.getSwFrame().Top(); if ( nTmp > nAdjustedRelPosX && - rAnchorTextFrame.Frame().Top() + nTmp + + rAnchorTextFrame.getSwFrame().Top() + nTmp + aObjBoundRect.Height() + _rULSpacing.GetLower() - <= pObjPage->Frame().Height() + pObjPage->Frame().Top() ) + <= pObjPage->getSwFrame().Height() + pObjPage->getSwFrame().Top() ) { nAdjustedRelPosX = nTmp; } @@ -961,34 +961,34 @@ SwTwips SwAnchoredObjectPosition::AdjustHoriRelPosForDrawAside( { SwTwips nTmp = nOtherTop - 1 - _rULSpacing.GetLower() - aObjBoundRect.Height() - - rAnchorTextFrame.Frame().Top(); + rAnchorTextFrame.getSwFrame().Top(); if ( nTmp < nAdjustedRelPosX && - rAnchorTextFrame.Frame().Top() + nTmp - _rULSpacing.GetUpper() - >= pObjPage->Frame().Top() ) + rAnchorTextFrame.getSwFrame().Top() + nTmp - _rULSpacing.GetUpper() + >= pObjPage->getSwFrame().Top() ) { nAdjustedRelPosX = nTmp; } } - aTmpObjRect.Pos().Y() = rAnchorTextFrame.Frame().Top() + + aTmpObjRect.Pos().Y() = rAnchorTextFrame.getSwFrame().Top() + nAdjustedRelPosX; } } else { const SvxLRSpaceItem& rOtherLR = pFly->GetFormat()->GetLRSpace(); - const SwTwips nOtherLeft = pFly->Frame().Left() - rOtherLR.GetLeft(); - const SwTwips nOtherRight = pFly->Frame().Right() + rOtherLR.GetRight(); + const SwTwips nOtherLeft = pFly->getSwFrame().Left() - rOtherLR.GetLeft(); + const SwTwips nOtherRight = pFly->getSwFrame().Right() + rOtherLR.GetRight(); if( nOtherLeft <= aTmpObjRect.Right() + _rLRSpacing.GetRight() && nOtherRight >= aTmpObjRect.Left() - _rLRSpacing.GetLeft() ) { if ( _eHoriOrient == text::HoriOrientation::LEFT ) { SwTwips nTmp = nOtherRight + 1 + _rLRSpacing.GetLeft() - - rAnchorTextFrame.Frame().Left(); + rAnchorTextFrame.getSwFrame().Left(); if ( nTmp > nAdjustedRelPosX && - rAnchorTextFrame.Frame().Left() + nTmp + + rAnchorTextFrame.getSwFrame().Left() + nTmp + aObjBoundRect.Width() + _rLRSpacing.GetRight() - <= pObjPage->Frame().Width() + pObjPage->Frame().Left() ) + <= pObjPage->getSwFrame().Width() + pObjPage->getSwFrame().Left() ) { nAdjustedRelPosX = nTmp; } @@ -997,15 +997,15 @@ SwTwips SwAnchoredObjectPosition::AdjustHoriRelPosForDrawAside( { SwTwips nTmp = nOtherLeft - 1 - _rLRSpacing.GetRight() - aObjBoundRect.Width() - - rAnchorTextFrame.Frame().Left(); + rAnchorTextFrame.getSwFrame().Left(); if ( nTmp < nAdjustedRelPosX && - rAnchorTextFrame.Frame().Left() + nTmp - _rLRSpacing.GetLeft() - >= pObjPage->Frame().Left() ) + rAnchorTextFrame.getSwFrame().Left() + nTmp - _rLRSpacing.GetLeft() + >= pObjPage->getSwFrame().Left() ) { nAdjustedRelPosX = nTmp; } } - aTmpObjRect.Pos().X() = rAnchorTextFrame.Frame().Left() + + aTmpObjRect.Pos().X() = rAnchorTextFrame.getSwFrame().Left() + nAdjustedRelPosX; } } // end of <if (bVert)> @@ -1035,8 +1035,8 @@ bool SwAnchoredObjectPosition::DrawAsideFly( const SwFlyFrame* _pFly, SwRectFnSet aRectFnSet(&GetAnchorFrame()); if ( _pFly->IsFlyAtContentFrame() && - aRectFnSet.BottomDist( _pFly->Frame(), aRectFnSet.GetTop(_rObjRect) ) < 0 && - aRectFnSet.BottomDist( _rObjRect, aRectFnSet.GetTop(_pFly->Frame()) ) < 0 && + aRectFnSet.BottomDist( _pFly->getSwFrame(), aRectFnSet.GetTop(_rObjRect) ) < 0 && + aRectFnSet.BottomDist( _rObjRect, aRectFnSet.GetTop(_pFly->getSwFrame()) ) < 0 && ::FindContext( _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 2a97fdb0e1f7..df2fc6bd9ba9 100644 --- a/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx @@ -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 != aRectFnSet.GetWidth(pFlyInContentFrame->Frame()) ) + if( nObjWidth != aRectFnSet.GetWidth(pFlyInContentFrame->getSwFrame()) ) { // 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( aRectFnSet.GetHeight(rFlyInContentFrame.Frame()), + OSL_ENSURE( aRectFnSet.GetHeight(rFlyInContentFrame.getSwFrame()), "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 15a57491ad3f..e3c51c2c4f92 100644 --- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx @@ -529,12 +529,12 @@ void SwToContentAnchoredObjectPosition::CalcPosition() else if ( aVert.GetRelationOrient() == text::RelOrientation::PAGE_FRAME ) { nVertOffsetToFrameAnchorPos += aRectFnSet.YDiff( - aRectFnSet.GetTop(rPageAlignLayFrame.Frame()), + aRectFnSet.GetTop(rPageAlignLayFrame.getSwFrame()), nTopOfOrient ); } else if ( aVert.GetRelationOrient() == text::RelOrientation::PAGE_PRINT_AREA ) { - SwRect aPgPrtRect( rPageAlignLayFrame.Frame() ); + SwRect aPgPrtRect( rPageAlignLayFrame.getSwFrame() ); if ( rPageAlignLayFrame.IsPageFrame() ) { aPgPrtRect = @@ -661,7 +661,7 @@ void SwToContentAnchoredObjectPosition::CalcPosition() pUpperOfOrientFrame = pTmp; bMoveable = rAnchorTextFrame.IsMoveable( pUpperOfOrientFrame ); aRectFnSet.Refresh(pUpperOfOrientFrame); - nAvail = aRectFnSet.GetHeight(pUpperOfOrientFrame->Prt()); + nAvail = aRectFnSet.GetHeight(pUpperOfOrientFrame->getSwPrint()); } else { @@ -904,7 +904,7 @@ void SwToContentAnchoredObjectPosition::CalcPosition() SwRectFnSet fnRectX(pNextLay); if ( !bInSct || ( pUpperOfOrientFrame->FindSctFrame()->IsAnFollow( pNextLay->FindSctFrame() ) && - fnRectX.GetHeight(pNextLay->Prt()) ) ) + fnRectX.GetHeight(pNextLay->getSwPrint()) ) ) { SwTwips nTmpRelPosY = aRectFnSet.YDiff( aRectFnSet.GetPrtTop(*pNextLay), @@ -1052,12 +1052,12 @@ void SwToContentAnchoredObjectPosition::CalcPosition() { GetAnchoredObj().SetObjLeft( nTopOfAnch + aRelPos.X() ); } - GetAnchoredObj().SetObjTop( rAnchorTextFrame.Frame().Top() + + GetAnchoredObj().SetObjTop( rAnchorTextFrame.getSwFrame().Top() + aRelPos.Y() ); } else { - GetAnchoredObj().SetObjLeft( rAnchorTextFrame.Frame().Left() + + GetAnchoredObj().SetObjLeft( rAnchorTextFrame.getSwFrame().Left() + aRelPos.X() ); GetAnchoredObj().SetObjTop( nTopOfAnch + aRelPos.Y() ); } diff --git a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx index f0b5d6e2a297..a4b53f1668fd 100644 --- a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx @@ -125,8 +125,8 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition() if ( !bFlyAtFly && GetAnchorFrame().IsPageFrame() && pSh && pSh->GetViewOptions()->getBrowseMode() ) { - const long nAnchorBottom = GetAnchorFrame().Frame().Bottom(); - const long nBottom = GetAnchorFrame().Frame().Top() + + const long nAnchorBottom = GetAnchorFrame().getSwFrame().Bottom(); + const long nBottom = GetAnchorFrame().getSwFrame().Top() + aRelPos.Y() + aObjBoundRect.Height(); if ( nAnchorBottom < nBottom ) { diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx index e0131579c99c..a36e584583cf 100644 --- a/sw/source/core/ole/ndole.cxx +++ b/sw/source/core/ole/ndole.cxx @@ -890,7 +890,7 @@ const uno::Reference < embed::XEmbeddedObject > SwOLEObj::GetOleRef() SwFrame *pFrame = m_pOLENode->getLayoutFrame(nullptr); if ( pFrame ) { - Size aSz( pFrame->Frame().SSize() ); + Size aSz( pFrame->getSwFrame().SSize() ); const MapMode aSrc ( MapUnit::MapTwip ); const MapMode aDest( MapUnit::Map100thMM ); aSz = OutputDevice::LogicToLogic( aSz, aSrc, aDest ); diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 14767b6e6f13..69f7429715ff 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -1578,8 +1578,8 @@ SwTwips SwTableLine::GetTableLineHeight( bool& bLayoutAvailable ) const { const SwTabFrame* pTab = pLast->FindTabFrame(); bLayoutAvailable = ( pTab && pTab->IsVertical() ) ? - ( 0 < pTab->Frame().Height() ) : - ( 0 < pTab->Frame().Width() ); + ( 0 < pTab->getSwFrame().Height() ) : + ( 0 < pTab->getSwFrame().Width() ); // The first one defines the chain, if a chain is defined, only members of the chain // will be added. @@ -1587,9 +1587,9 @@ SwTwips SwTableLine::GetTableLineHeight( bool& bLayoutAvailable ) const { pChain = pTab; // defines my chain (even it is already) if( pTab->IsVertical() ) - nRet += pLast->Frame().Width(); + nRet += pLast->getSwFrame().Width(); else - nRet += pLast->Frame().Height(); + nRet += pLast->getSwFrame().Height(); // Optimization, if there are no master/follows in my chain, nothing more to add if( !pTab->HasFollow() && !pTab->IsFollow() ) break; @@ -2707,7 +2707,7 @@ SwRect SwTableCellInfo::getRect() const SwRect aRet; if (getCellFrame() != nullptr) - aRet = getCellFrame()->Frame(); + aRet = getCellFrame()->getSwFrame(); return aRet; } diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 152738ca1a47..39e4f668a537 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -660,13 +660,13 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType ) if ( bWidth ) { - nVal = aRectFnSet.GetWidth(pFrame->Frame()); + nVal = aRectFnSet.GetWidth(pFrame->getSwFrame()); mpPDFExtOutDevData->SetStructureAttributeNumerical( vcl::PDFWriter::Width, nVal ); } if ( bHeight ) { - nVal = aRectFnSet.GetHeight(pFrame->Frame()); + nVal = aRectFnSet.GetHeight(pFrame->getSwFrame()); mpPDFExtOutDevData->SetStructureAttributeNumerical( vcl::PDFWriter::Height, nVal ); } @@ -678,7 +678,7 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType ) !static_cast<const SwTabFrame*>(pFrame)->IsFollow() && !static_cast<const SwTabFrame*>(pFrame)->HasFollow() ) ) { - mpPDFExtOutDevData->SetStructureBoundingBox(pFrame->Frame().SVRect()); + mpPDFExtOutDevData->SetStructureBoundingBox(pFrame->getSwFrame().SVRect()); } } @@ -699,8 +699,8 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType ) const TableColumnsMapEntry& rCols = SwEnhancedPDFExportHelper::GetTableColumnsMap()[ pTable ]; - const long nLeft = fnRectX.GetLeft(pThisCell->Frame()); - const long nRight = fnRectX.GetRight(pThisCell->Frame()); + const long nLeft = fnRectX.GetLeft(pThisCell->getSwFrame()); + const long nRight = fnRectX.GetRight(pThisCell->getSwFrame()); 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 = aRectFnSet.GetLeft(pCellFrame->Frame()); + const long nLeft = aRectFnSet.GetLeft(pCellFrame->getSwFrame()); rCols.insert( nLeft ); while ( pCellFrame ) { - const long nRight = aRectFnSet.GetRight(pCellFrame->Frame()); + const long nRight = aRectFnSet.GetRight(pCellFrame->getSwFrame()); rCols.insert( nRight ); pCellFrame = pCellFrame->GetNext(); } @@ -1518,7 +1518,7 @@ tools::Rectangle SwEnhancedPDFExportHelper::SwRectToPDFRect(const SwPageFrame* p double fScale = 0.75; aRectSize.Width() = (aRectSize.Width() * fScale); aRectSize.Height() = (aRectSize.Height() * fScale); - long nOrigHeight = pCurrPage->Frame().Height(); + long nOrigHeight = pCurrPage->getSwFrame().Height(); long nNewHeight = nOrigHeight*fScale; long nShiftY = (nOrigHeight-nNewHeight)/2; aRect.Left() = (aRect.Left() * fScale); @@ -2258,7 +2258,7 @@ void SwEnhancedPDFExportHelper::MakeHeaderFooterLinks( vcl::PDFExtOutDevData& rP // Add offset to current page: const SwPageFrame* pPageFrame = pTmpFrame->FindPageFrame(); SwRect aHFLinkRect( rLinkRect ); - aHFLinkRect.Pos() = pPageFrame->Frame().Pos() + aOffset; + aHFLinkRect.Pos() = pPageFrame->getSwFrame().Pos() + aOffset; // #i97135# the gcc_x64 optimizer gets aHFLinkRect != rLinkRect wrong // fool it by comparing the position only (the width and height are the diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx index 955f8bae081f..3cd353c835e6 100644 --- a/sw/source/core/text/frmcrsr.cxx +++ b/sw/source/core/text/frmcrsr.cxx @@ -129,8 +129,8 @@ bool sw_ChangeOffset( SwTextFrame* pFrame, sal_Int32 nNew ) pFrame->SetOfst( nNew ); pFrame->SetPara( nullptr ); pFrame->GetFormatted(); - if( pFrame->Frame().HasArea() ) - pFrame->getRootFrame()->GetCurrShell()->InvalidateWindows( pFrame->Frame() ); + if( pFrame->getSwFrame().HasArea() ) + pFrame->getRootFrame()->GetCurrShell()->InvalidateWindows( pFrame->getSwFrame() ); return true; } } @@ -194,7 +194,7 @@ bool SwTextFrame::GetCharRect( SwRect& rOrig, const SwPosition &rPos, pFrame->GetFormatted(); const SwFrame* pTmpFrame = static_cast<SwFrame*>(pFrame->GetUpper()); - if (pTmpFrame->Frame().Top() == FAR_AWAY && !bAllowFarAway) + if (pTmpFrame->getSwFrame().Top() == FAR_AWAY && !bAllowFarAway) return false; SwRectFnSet aRectFnSet(pFrame); @@ -208,9 +208,9 @@ bool SwTextFrame::GetCharRect( SwRect& rOrig, const SwPosition &rPos, bool bRet = false; - if ( pFrame->IsEmpty() || ! aRectFnSet.GetHeight(pFrame->Prt()) ) + if ( pFrame->IsEmpty() || ! aRectFnSet.GetHeight(pFrame->getSwPrint()) ) { - Point aPnt1 = pFrame->Frame().Pos() + pFrame->Prt().Pos(); + Point aPnt1 = pFrame->getSwFrame().Pos() + pFrame->getSwPrint().Pos(); SwTextNode* pTextNd = const_cast<SwTextFrame*>(this)->GetTextNode(); short nFirstOffset; pTextNd->GetFirstLineOfsWithNum( nFirstOffset ); @@ -222,7 +222,7 @@ bool SwTextFrame::GetCharRect( SwRect& rOrig, const SwPosition &rPos, aPnt1.Y() += nFirstOffset; if ( aPnt1.X() < nMaxY && !aRectFnSet.IsVertL2R() ) aPnt1.X() = nMaxY; - aPnt2.X() = aPnt1.X() + pFrame->Prt().Width(); + aPnt2.X() = aPnt1.X() + pFrame->getSwPrint().Width(); aPnt2.Y() = aPnt1.Y(); if( aPnt2.X() < nMaxY ) aPnt2.X() = nMaxY; @@ -235,7 +235,7 @@ bool SwTextFrame::GetCharRect( SwRect& rOrig, const SwPosition &rPos, if( aPnt1.Y() > nMaxY ) aPnt1.Y() = nMaxY; aPnt2.X() = aPnt1.X(); - aPnt2.Y() = aPnt1.Y() + pFrame->Prt().Height(); + aPnt2.Y() = aPnt1.Y() + pFrame->getSwPrint().Height(); if( aPnt2.Y() > nMaxY ) aPnt2.Y() = nMaxY; } @@ -334,8 +334,8 @@ bool SwTextFrame::GetCharRect( SwRect& rOrig, const SwPosition &rPos, SwPageFrame *pPage = pFrame->FindPageFrame(); OSL_ENSURE( pPage, "Text escaped from page?" ); const SwTwips nOrigTop = aRectFnSet.GetTop(rOrig); - const SwTwips nPageTop = aRectFnSet.GetTop(pPage->Frame()); - const SwTwips nPageBott = aRectFnSet.GetBottom(pPage->Frame()); + const SwTwips nPageTop = aRectFnSet.GetTop(pPage->getSwFrame()); + const SwTwips nPageBott = aRectFnSet.GetBottom(pPage->getSwFrame()); // We have the following situation: if the frame is in an invalid // sectionframe, it's possible that the frame is outside the page. @@ -381,16 +381,16 @@ bool SwTextFrame::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const } else nMaxY = std::min( aRectFnSet.GetPrtBottom(*pFrame), nUpperMaxY ); - if ( pFrame->IsEmpty() || ! aRectFnSet.GetHeight(pFrame->Prt()) ) + if ( pFrame->IsEmpty() || ! aRectFnSet.GetHeight(pFrame->getSwPrint()) ) { - Point aPnt1 = pFrame->Frame().Pos() + pFrame->Prt().Pos(); + Point aPnt1 = pFrame->getSwFrame().Pos() + pFrame->getSwPrint().Pos(); Point aPnt2; if ( aRectFnSet.IsVert() ) { if ( aPnt1.X() < nMaxY && !aRectFnSet.IsVertL2R() ) aPnt1.X() = nMaxY; - aPnt2.X() = aPnt1.X() + pFrame->Prt().Width(); + aPnt2.X() = aPnt1.X() + pFrame->getSwPrint().Width(); aPnt2.Y() = aPnt1.Y(); if( aPnt2.X() < nMaxY ) aPnt2.X() = nMaxY; @@ -400,7 +400,7 @@ bool SwTextFrame::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const if( aPnt1.Y() > nMaxY ) aPnt1.Y() = nMaxY; aPnt2.X() = aPnt1.X(); - aPnt2.Y() = aPnt1.Y() + pFrame->Prt().Height(); + aPnt2.Y() = aPnt1.Y() + pFrame->getSwPrint().Height(); if( aPnt2.Y() > nMaxY ) aPnt2.Y() = nMaxY; } @@ -461,7 +461,7 @@ bool SwTextFrame::GetTopOfLine( SwTwips& _onTopOfLine, else { SwRectFnSet aRectFnSet(this); - if ( IsEmpty() || !aRectFnSet.GetHeight(Prt()) ) + if ( IsEmpty() || !aRectFnSet.GetHeight(getSwPrint()) ) { // consider upper space amount considered // for previous frame and the page grid. @@ -565,7 +565,7 @@ bool SwTextFrame::GetCursorOfst_(SwPosition* pPos, const Point& rPoint, SwitchRTLtoLTR( const_cast<Point&>(rPoint) ); SwFillData *pFillData = ( pCMS && pCMS->m_pFill ) ? - new SwFillData( pCMS, pPos, Frame(), rPoint ) : nullptr; + new SwFillData( pCMS, pPos, getSwFrame(), rPoint ) : nullptr; if ( IsEmpty() ) { @@ -574,7 +574,7 @@ bool SwTextFrame::GetCursorOfst_(SwPosition* pPos, const Point& rPoint, pPos->nContent.Assign( pTextNd, 0 ); if( pCMS && pCMS->m_bFieldInfo ) { - SwTwips nDiff = rPoint.X() - Frame().Left() - Prt().Left(); + SwTwips nDiff = rPoint.X() - getSwFrame().Left() - getSwPrint().Left(); if( nDiff > 50 || nDiff < 0 ) pCMS->m_bPosCorr = true; } @@ -585,7 +585,7 @@ bool SwTextFrame::GetCursorOfst_(SwPosition* pPos, const Point& rPoint, SwTextCursor aLine( const_cast<SwTextFrame*>(this), &aInf ); // See comment in AdjustFrame() - SwTwips nMaxY = Frame().Top() + Prt().Top() + Prt().Height(); + SwTwips nMaxY = getSwFrame().Top() + getSwPrint().Top() + getSwPrint().Height(); aLine.TwipsToLine( rPoint.Y() ); while( aLine.Y() + aLine.GetLineHeight() > nMaxY ) { @@ -616,7 +616,7 @@ bool SwTextFrame::GetCursorOfst_(SwPosition* pPos, const Point& rPoint, if( pFillData ) { if (pTextNd->GetText().getLength() > nOffset || - rPoint.Y() < Frame().Top() ) + rPoint.Y() < getSwFrame().Top() ) pFillData->bInner = true; pFillData->bFirstLine = aLine.GetLineNr() < 2; if (pTextNd->GetText().getLength()) @@ -628,7 +628,7 @@ bool SwTextFrame::GetCursorOfst_(SwPosition* pPos, const Point& rPoint, } } bool bChgFillData = false; - if( pFillData && FindPageFrame()->Frame().IsInside( aOldPoint ) ) + if( pFillData && FindPageFrame()->getSwFrame().IsInside( aOldPoint ) ) { FillCursorPos( *pFillData ); bChgFillData = true; @@ -881,7 +881,7 @@ bool SwTextFrame::UnitUp_( SwPaM *pPam, const SwTwips nOffset, } if ( !pPrevPrev ) return pTmpPrev->SwContentFrame::UnitUp( pPam, nOffset, bSetInReadOnly ); - aCharBox.Pos().Y() = pPrevPrev->Frame().Bottom() - 1; + aCharBox.Pos().Y() = pPrevPrev->getSwFrame().Bottom() - 1; return pPrevPrev->GetKeyCursorOfst( pPam->GetPoint(), aCharBox.Pos() ); } } @@ -1258,7 +1258,7 @@ bool SwTextFrame::UnitDown_(SwPaM *pPam, const SwTwips nOffset, // We take a shortcut for follows if( pTmpFollow ) { - aCharBox.Pos().Y() = pTmpFollow->Frame().Top() + 1; + aCharBox.Pos().Y() = pTmpFollow->getSwFrame().Top() + 1; return static_cast<const SwTextFrame*>(pTmpFollow)->GetKeyCursorOfst( pPam->GetPoint(), aCharBox.Pos() ); } @@ -1304,7 +1304,7 @@ void SwTextFrame::FillCursorPos( SwFillData& rFill ) const const SwFrame* pFrame = static_cast<const SwLayoutFrame*>(pTmp->Lower())->Lower(); sal_uInt16 nNextCol = 0; // In which column do we end up in? - while( rFill.X() > pTmp->Frame().Right() && pTmp->GetNext() ) + while( rFill.X() > pTmp->getSwFrame().Right() && pTmp->GetNext() ) { pTmp = static_cast<const SwColumnFrame*>(pTmp->GetNext()); if( static_cast<const SwLayoutFrame*>(pTmp->Lower())->Lower() ) // ColumnFrames now with BodyFrame @@ -1326,7 +1326,7 @@ void SwTextFrame::FillCursorPos( SwFillData& rFill ) const } else { - while( pFrame->GetNext() && pFrame->Frame().Bottom() < rFill.Y() ) + while( pFrame->GetNext() && pFrame->getSwFrame().Bottom() < rFill.Y() ) pFrame = pFrame->GetNext(); } // No filling, if the last frame in the targeted column does @@ -1344,11 +1344,11 @@ void SwTextFrame::FillCursorPos( SwFillData& rFill ) const } if( nNextCol ) { - rFill.aFrame = pTmp->Prt(); - rFill.aFrame += pTmp->Frame().Pos(); + rFill.aFrame = pTmp->getSwPrint(); + rFill.aFrame += pTmp->getSwFrame().Pos(); } else - rFill.aFrame = pFrame->Frame(); + rFill.aFrame = pFrame->getSwFrame(); static_cast<const SwTextFrame*>(pFrame)->FillCursorPos( rFill ); } return; @@ -1357,7 +1357,7 @@ void SwTextFrame::FillCursorPos( SwFillData& rFill ) const SwFont *pFnt; SwTextFormatColl* pColl = GetTextNode()->GetTextColl(); SwTwips nFirst = GetTextNode()->GetSwAttrSet().GetULSpace().GetLower(); - SwTwips nDiff = rFill.Y() - Frame().Bottom(); + SwTwips nDiff = rFill.Y() - getSwFrame().Bottom(); if( nDiff < nFirst ) nDiff = -1; else diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index 4553b8593128..79921b43c4df 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -70,9 +70,9 @@ sal_uInt16 FormatLevel::nLevel = 0; void ValidateText( SwFrame *pFrame ) // Friend of frame { if ( ( ! pFrame->IsVertical() && - pFrame->Frame().Width() == pFrame->GetUpper()->Prt().Width() ) || + pFrame->getSwFrame().Width() == pFrame->GetUpper()->getSwPrint().Width() ) || ( pFrame->IsVertical() && - pFrame->Frame().Height() == pFrame->GetUpper()->Prt().Height() ) ) + pFrame->getSwFrame().Height() == pFrame->GetUpper()->getSwPrint().Height() ) ) pFrame->mbValidSize = true; } @@ -193,16 +193,16 @@ bool SwTextFrame::CalcFollow( const sal_Int32 nTextOfst ) if( !pMyFollow->GetOfst() || pMyFollow->GetOfst() != nTextOfst || bFollowField || pMyFollow->IsFieldFollow() || - ( pMyFollow->IsVertical() && !pMyFollow->Prt().Width() ) || - ( ! pMyFollow->IsVertical() && !pMyFollow->Prt().Height() ) ) + ( pMyFollow->IsVertical() && !pMyFollow->getSwPrint().Width() ) || + ( ! pMyFollow->IsVertical() && !pMyFollow->getSwPrint().Height() ) ) { #if OSL_DEBUG_LEVEL > 0 const SwFrame *pOldUp = GetUpper(); #endif SwRectFnSet aRectFnSet(this); - SwTwips nOldBottom = aRectFnSet.GetBottom(GetUpper()->Frame()); - SwTwips nMyPos = aRectFnSet.GetTop(Frame()); + SwTwips nOldBottom = aRectFnSet.GetBottom(GetUpper()->getSwFrame()); + SwTwips nMyPos = aRectFnSet.GetTop(getSwFrame()); const SwPageFrame *pPage = nullptr; bool bOldInvaContent = true; @@ -246,8 +246,8 @@ bool SwTextFrame::CalcFollow( const sal_Int32 nTextOfst ) { if( pSct->GetFollow() ) pSct->SimpleFormat(); - else if( ( pSct->IsVertical() && !pSct->Frame().Width() ) || - ( ! pSct->IsVertical() && !pSct->Frame().Height() ) ) + else if( ( pSct->IsVertical() && !pSct->getSwFrame().Width() ) || + ( ! pSct->IsVertical() && !pSct->getSwFrame().Height() ) ) break; } // i#11760 - Intrinsic format of follow is controlled. @@ -280,7 +280,7 @@ bool SwTextFrame::CalcFollow( const sal_Int32 nTextOfst ) } pMyFollow->Calc(pRenderContext); - // The Follow can tell from its Frame().Height() that something went wrong + // The Follow can tell from its getSwFrame().Height() that something went wrong OSL_ENSURE( !pMyFollow->GetPrev(), "SwTextFrame::CalcFollow: cheesy follow" ); if( pMyFollow->GetPrev() ) { @@ -328,11 +328,11 @@ bool SwTextFrame::CalcFollow( const sal_Int32 nTextOfst ) #endif const long nRemaining = - - aRectFnSet.BottomDist( GetUpper()->Frame(), nOldBottom ); + - aRectFnSet.BottomDist( GetUpper()->getSwFrame(), nOldBottom ); if ( nRemaining > 0 && !GetUpper()->IsSctFrame() && nRemaining != ( aRectFnSet.IsVert() ? - nMyPos - Frame().Right() : - Frame().Top() - nMyPos ) ) + nMyPos - getSwFrame().Right() : + getSwFrame().Top() - nMyPos ) ) { return true; } @@ -368,17 +368,26 @@ void SwTextFrame::AdjustFrame( const SwTwips nChgHght, bool bHasToFit ) SwTwips nReal = Grow( nChgHght, true ); if( nReal < nChgHght ) { - SwTwips nBot = aRectFnSet.YInc( aRectFnSet.GetBottom(Frame()), + SwTwips nBot = aRectFnSet.YInc( aRectFnSet.GetBottom(getSwFrame()), nChgHght - nReal ); SwFrame* pCont = FindFootnoteFrame()->GetUpper(); - if( aRectFnSet.BottomDist( pCont->Frame(), nBot ) > 0 ) + if( aRectFnSet.BottomDist( pCont->getSwFrame(), nBot ) > 0 ) { - aRectFnSet.AddBottom( Frame(), nChgHght ); + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.AddBottom( aFrm, nChgHght ); + + SwFrameRect::PrintWriteAccess aPrt(*this); + if( aRectFnSet.IsVert() ) - Prt().SSize().Width() += nChgHght; + { + aPrt.SSize().Width() += nChgHght; + } else - Prt().SSize().Height() += nChgHght; + { + aPrt.SSize().Height() += nChgHght; + } + return; } } @@ -401,9 +410,9 @@ void SwTextFrame::AdjustFrame( const SwTwips nChgHght, bool bHasToFit ) pPre = pPre->GetNext(); } while ( pPre && pPre != this ); } - const Point aOldPos( Frame().Pos() ); + const Point aOldPos( getSwFrame().Pos() ); MakePos(); - if ( aOldPos != Frame().Pos() ) + if ( aOldPos != getSwFrame().Pos() ) { // i#28701 - No format is performed for the floating screen objects. InvalidateObjs(); @@ -422,19 +431,19 @@ void SwTextFrame::AdjustFrame( const SwTwips nChgHght, bool bHasToFit ) OSL_ENSURE( ! IsSwapped(),"Swapped frame while calculating nRstHeight" ); if ( IsVertLR() ) - nRstHeight = GetUpper()->Frame().Left() - + GetUpper()->Prt().Left() - + GetUpper()->Prt().Width() - - Frame().Left(); + nRstHeight = GetUpper()->getSwFrame().Left() + + GetUpper()->getSwPrint().Left() + + GetUpper()->getSwPrint().Width() + - getSwFrame().Left(); else - nRstHeight = Frame().Left() + Frame().Width() - - ( GetUpper()->Frame().Left() + GetUpper()->Prt().Left() ); + nRstHeight = getSwFrame().Left() + getSwFrame().Width() - + ( GetUpper()->getSwFrame().Left() + GetUpper()->getSwPrint().Left() ); } else - nRstHeight = GetUpper()->Frame().Top() - + GetUpper()->Prt().Top() - + GetUpper()->Prt().Height() - - Frame().Top(); + nRstHeight = GetUpper()->getSwFrame().Top() + + GetUpper()->getSwPrint().Top() + + GetUpper()->getSwPrint().Height() + - getSwFrame().Top(); // We can get a bit of space in table cells, because there could be some // left through a vertical alignment to the top. @@ -443,7 +452,7 @@ void SwTextFrame::AdjustFrame( const SwTwips nChgHght, bool bHasToFit ) ( GetUpper()->Lower() == this || GetUpper()->Lower()->IsValid() ) ) { - long nAdd = aRectFnSet.YDiff( aRectFnSet.GetTop(GetUpper()->Lower()->Frame()), + long nAdd = aRectFnSet.YDiff( aRectFnSet.GetTop(GetUpper()->Lower()->getSwFrame()), aRectFnSet.GetPrtTop(*GetUpper()) ); OSL_ENSURE( nAdd >= 0, "Ey" ); nRstHeight += nAdd; @@ -453,8 +462,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 = aRectFnSet.GetHeight(Frame()); - SwTwips nPrtHeight = aRectFnSet.GetHeight(Prt()); + SwTwips nFrameHeight = aRectFnSet.GetHeight(getSwFrame()); + SwTwips nPrtHeight = aRectFnSet.GetHeight(getSwPrint()); if( nRstHeight < nFrameHeight ) { @@ -784,7 +793,7 @@ bool SwTextFrame::CalcPreps() // -> we let our Frame become too big SwTwips nChgHeight = GetParHeight(); - if( nChgHeight >= aRectFnSet.GetHeight(Prt()) ) + if( nChgHeight >= aRectFnSet.GetHeight(getSwPrint()) ) { if( bPrepMustFit ) { @@ -793,26 +802,43 @@ bool SwTextFrame::CalcPreps() } else if ( aRectFnSet.IsVert() ) { - Frame().Width( Frame().Width() + Frame().Left() ); - Prt().Width( Prt().Width() + Frame().Left() ); - Frame().Left( 0 ); + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Width( aFrm.Width() + aFrm.Left() ); + aFrm.Left( 0 ); + } + + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Width( aPrt.Width() + getSwFrame().Left() ); + } + SetWidow( true ); } else { - SwTwips nTmp = TWIPS_MAX/2 - (Frame().Top()+10000); - SwTwips nDiff = nTmp - Frame().Height(); - Frame().Height( nTmp ); - Prt().Height( Prt().Height() + nDiff ); + SwTwips nTmp = TWIPS_MAX/2 - (getSwFrame().Top()+10000); + SwTwips nDiff = nTmp - getSwFrame().Height(); + + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Height( nTmp ); + } + + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Height( aPrt.Height() + nDiff ); + } + SetWidow( true ); } } else { - OSL_ENSURE( nChgHeight < aRectFnSet.GetHeight(Prt()), + OSL_ENSURE( nChgHeight < aRectFnSet.GetHeight(getSwPrint()), "+SwTextFrame::CalcPrep: want to shrink" ); - nChgHeight = aRectFnSet.GetHeight(Prt()) - nChgHeight; + nChgHeight = aRectFnSet.GetHeight(getSwPrint()) - nChgHeight; GetFollow()->SetJustWidow( true ); GetFollow()->Prepare(); @@ -821,12 +847,12 @@ bool SwTextFrame::CalcPreps() if ( aRectFnSet.IsVert() ) { - SwRect aRepaint( Frame().Pos() + Prt().Pos(), Prt().SSize() ); + SwRect aRepaint( getSwFrame().Pos() + getSwPrint().Pos(), getSwPrint().SSize() ); SwitchVerticalToHorizontal( aRepaint ); rRepaint.Chg( aRepaint.Pos(), aRepaint.SSize() ); } else - rRepaint.Chg( Frame().Pos() + Prt().Pos(), Prt().SSize() ); + rRepaint.Chg( getSwFrame().Pos() + getSwPrint().Pos(), getSwPrint().SSize() ); if( 0 >= rRepaint.Width() ) rRepaint.Width(1); @@ -907,20 +933,30 @@ bool SwTextFrame::CalcPreps() if( bPrepMustFit ) { const SwTwips nMust = aRectFnSet.GetPrtBottom(*GetUpper()); - const SwTwips nIs = aRectFnSet.GetBottom(Frame()); + const SwTwips nIs = aRectFnSet.GetBottom(getSwFrame()); if( aRectFnSet.IsVert() && nIs < nMust ) { Shrink( nMust - nIs ); - if( Prt().Width() < 0 ) - Prt().Width( 0 ); + + if( getSwPrint().Width() < 0 ) + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Width( 0 ); + } + SetUndersized( true ); } else if ( ! aRectFnSet.IsVert() && nIs > nMust ) { Shrink( nIs - nMust ); - if( Prt().Height() < 0 ) - Prt().Height( 0 ); + + if( getSwPrint().Height() < 0 ) + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Height( 0 ); + } + SetUndersized( true ); } } @@ -988,8 +1024,8 @@ void SwTextFrame::FormatAdjust( SwTextFormatter &rLine, const SwFrame *pBodyFrame = FindBodyFrame(); const long nBodyHeight = pBodyFrame ? ( IsVertical() ? - pBodyFrame->Frame().Width() : - pBodyFrame->Frame().Height() ) : 0; + pBodyFrame->getSwFrame().Width() : + pBodyFrame->getSwFrame().Height() ) : 0; // If the current values have been calculated, show that they // are valid now @@ -1071,16 +1107,16 @@ void SwTextFrame::FormatAdjust( SwTextFormatter &rLine, // fill up in order to avoid oscillation. if( bDummy && pBodyFrame && nBodyHeight < ( IsVertical() ? - pBodyFrame->Frame().Width() : - pBodyFrame->Frame().Height() ) ) + pBodyFrame->getSwFrame().Width() : + pBodyFrame->getSwFrame().Height() ) ) rLine.MakeDummyLine(); } // In AdjustFrame() we set ourselves via Grow/Shrink // In AdjustFollow() we set our FollowFrame - const SwTwips nDocPrtTop = Frame().Top() + Prt().Top(); - const SwTwips nOldHeight = Prt().SSize().Height(); + const SwTwips nDocPrtTop = getSwFrame().Top() + getSwPrint().Top(); + const SwTwips nOldHeight = getSwPrint().SSize().Height(); SwTwips nChg = rLine.CalcBottomLine() - nDocPrtTop - nOldHeight; //#i84870# - no shrink of text frame, if it only contains one as-character anchored object. @@ -1130,7 +1166,7 @@ bool SwTextFrame::FormatLine( SwTextFormatter &rLine, const bool bPrev ) const sal_Int32 nNewStart = rLine.FormatLine( rLine.GetStart() ); - OSL_ENSURE( Frame().Pos().Y() + Prt().Pos().Y() == rLine.GetFirstPos(), + OSL_ENSURE( getSwFrame().Pos().Y() + getSwPrint().Pos().Y() == rLine.GetFirstPos(), "SwTextFrame::FormatLine: frame leaves orbit." ); OSL_ENSURE( rLine.GetCurr()->Height(), "SwTextFrame::FormatLine: line height is zero" ); @@ -1327,7 +1363,7 @@ void SwTextFrame::Format_( SwTextFormatter &rLine, SwTextFormatInfo &rInf, rRepaint.SetOfst( 0 ); rRepaint.SetRightOfst( 0 ); - rRepaint.Chg( Frame().Pos() + Prt().Pos(), Prt().SSize() ); + rRepaint.Chg( getSwFrame().Pos() + getSwPrint().Pos(), getSwPrint().SSize() ); if( pPara->IsMargin() ) rRepaint.Width( rRepaint.Width() + pPara->GetHangingMargin() ); rRepaint.Top( rLine.Y() ); @@ -1699,30 +1735,42 @@ 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( aRectFnSet.GetWidth(Prt()) <= 0 ) + if( aRectFnSet.GetWidth(getSwPrint()) <= 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 = aRectFnSet.GetHeight(Frame()); + long nFrameHeight = aRectFnSet.GetHeight(getSwFrame()); + if( aAccess.GetPara()->IsPrepMustFit() ) { const SwTwips nLimit = aRectFnSet.GetPrtBottom(*GetUpper()); - const SwTwips nDiff = - aRectFnSet.BottomDist( Frame(), nLimit ); + const SwTwips nDiff = - aRectFnSet.BottomDist( getSwFrame(), nLimit ); if( nDiff > 0 ) Shrink( nDiff ); } else if( 240 < nFrameHeight ) + { Shrink( nFrameHeight - 240 ); + } else if( 240 > nFrameHeight ) + { Grow( 240 - nFrameHeight ); - nFrameHeight = aRectFnSet.GetHeight(Frame()); + } + + nFrameHeight = aRectFnSet.GetHeight(getSwFrame()); + const long nTop = aRectFnSet.GetTopMargin(*this); - long nTop = aRectFnSet.GetTopMargin(*this); if( nTop > nFrameHeight ) + { aRectFnSet.SetYMargins( *this, nFrameHeight, 0 ); - else if( aRectFnSet.GetHeight(Prt()) < 0 ) - aRectFnSet.SetHeight( Prt(), 0 ); + } + else if( aRectFnSet.GetHeight(getSwPrint()) < 0 ) + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aRectFnSet.SetHeight( aPrt, 0 ); + } + return; } @@ -1743,7 +1791,7 @@ void SwTextFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderAttr // Attention: Format() could be triggered by GetFormatted() if( IsHiddenNow() ) { - long nPrtHeight = aRectFnSet.GetHeight(Prt()); + long nPrtHeight = aRectFnSet.GetHeight(getSwPrint()); if( nPrtHeight ) { HideHidden(); @@ -1788,10 +1836,16 @@ void SwTextFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderAttr if( pMaster ) pMaster->Prepare( PREP_FOLLOW_FOLLOWS ); SwTwips nMaxY = aRectFnSet.GetPrtBottom(*GetUpper()); - if( aRectFnSet.OverStep( Frame(), nMaxY ) ) + + if( aRectFnSet.OverStep( getSwFrame(), nMaxY ) ) + { aRectFnSet.SetLimit( *this, nMaxY ); - else if( aRectFnSet.BottomDist( Frame(), nMaxY ) < 0 ) - aRectFnSet.AddBottom( Frame(), -aRectFnSet.GetHeight(Frame()) ); + } + else if( aRectFnSet.BottomDist( getSwFrame(), nMaxY ) < 0 ) + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aRectFnSet.AddBottom( aFrm, -aRectFnSet.GetHeight(aFrm) ); + } } else { @@ -1805,7 +1859,7 @@ void SwTextFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderAttr if( pFootnoteBoss ) { const SwFootnoteContFrame* pCont = pFootnoteBoss->FindFootnoteCont(); - nFootnoteHeight = pCont ? aRectFnSet.GetHeight(pCont->Frame()) : 0; + nFootnoteHeight = pCont ? aRectFnSet.GetHeight(pCont->getSwFrame()) : 0; } do { @@ -1813,7 +1867,7 @@ void SwTextFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderAttr if( pFootnoteBoss && nFootnoteHeight ) { const SwFootnoteContFrame* pCont = pFootnoteBoss->FindFootnoteCont(); - SwTwips nNewHeight = pCont ? aRectFnSet.GetHeight(pCont->Frame()) : 0; + SwTwips nNewHeight = pCont ? aRectFnSet.GetHeight(pCont->getSwFrame()) : 0; // If we lost some footnotes, we may have more space // for our main text, so we have to format again ... if( nNewHeight < nFootnoteHeight ) @@ -1874,7 +1928,7 @@ bool SwTextFrame::FormatQuick( bool bForceQuickFormat ) // We're very picky: if( HasPara() || IsWidow() || IsLocked() || !GetValidSizeFlag() || - ( ( IsVertical() ? Prt().Width() : Prt().Height() ) && IsHiddenNow() ) ) + ( ( IsVertical() ? getSwPrint().Width() : getSwPrint().Height() ) && IsHiddenNow() ) ) return false; SwTextLineAccess aAccess( this ); @@ -1917,10 +1971,10 @@ bool SwTextFrame::FormatQuick( bool bForceQuickFormat ) } while( aLine.Next() ); // Last exit: the heights need to match - Point aTopLeft( Frame().Pos() ); - aTopLeft += Prt().Pos(); + Point aTopLeft( getSwFrame().Pos() ); + aTopLeft += getSwPrint().Pos(); const SwTwips nNewHeight = aLine.Y() + aLine.GetLineHeight(); - const SwTwips nOldHeight = aTopLeft.Y() + Prt().Height(); + const SwTwips nOldHeight = aTopLeft.Y() + getSwPrint().Height(); if( !bForceQuickFormat && nNewHeight != nOldHeight && !IsUndersized() ) { @@ -1937,7 +1991,7 @@ bool SwTextFrame::FormatQuick( bool bForceQuickFormat ) // Set repaint pPara->GetRepaint().Pos( aTopLeft ); - pPara->GetRepaint().SSize( Prt().SSize() ); + pPara->GetRepaint().SSize( getSwPrint().SSize() ); // Delete reformat pPara->GetReformat() = SwCharRange(); diff --git a/sw/source/core/text/frminf.cxx b/sw/source/core/text/frminf.cxx index 50f35188d845..0204c16e5227 100644 --- a/sw/source/core/text/frminf.cxx +++ b/sw/source/core/text/frminf.cxx @@ -76,7 +76,7 @@ bool SwTextFrameInfo::IsFilled( const sal_uInt8 nPercent ) const if( !pLay ) return false; - long nWidth = pFrame->Prt().Width(); + long nWidth = pFrame->getSwPrint().Width(); nWidth *= nPercent; nWidth /= 100; return sal_uInt16(nWidth) <= pLay->Width(); @@ -101,7 +101,7 @@ SwTwips SwTextFrameInfo::GetLineStart() const { SwTextSizeInfo aInf( const_cast<SwTextFrame*>(pFrame) ); SwTextCursor aLine( const_cast<SwTextFrame*>(pFrame), &aInf ); - return GetLineStart( aLine ) - pFrame->Frame().Left() - pFrame->Prt().Left(); + return GetLineStart( aLine ) - pFrame->getSwFrame().Left() - pFrame->getSwPrint().Left(); } // Calculates the character's position and returns the middle position @@ -126,7 +126,7 @@ SwTwips SwTextFrameInfo::GetCharPos( sal_Int32 nChar, bool bCenter ) const nStt = aLine.GetLineStart(); if( !bCenter ) - return nStt - aRectFnSet.GetLeft(pFrame->Frame()); + return nStt - aRectFnSet.GetLeft(pFrame->getSwFrame()); if( aLine.GetCharRect( &aRect, nChar+1 ) ) { @@ -138,7 +138,7 @@ SwTwips SwTextFrameInfo::GetCharPos( sal_Int32 nChar, bool bCenter ) const else nNext = aLine.GetLineStart(); - return (( nNext + nStt ) / 2 ) - aRectFnSet.GetLeft(pFrame->Frame()); + return (( nNext + nStt ) / 2 ) - aRectFnSet.GetLeft(pFrame->getSwFrame()); } SwPaM *AddPam( SwPaM *pPam, const SwTextFrame* pTextFrame, @@ -302,7 +302,7 @@ sal_Int32 SwTextFrameInfo::GetBigIndent( sal_Int32& rFndPos, SwRect aRect; return aLine.GetCharRect( &aRect, rFndPos ) - ? static_cast<sal_Int32>(aRect.Left() - pFrame->Frame().Left() - pFrame->Prt().Left()) + ? static_cast<sal_Int32>(aRect.Left() - pFrame->getSwFrame().Left() - pFrame->getSwPrint().Left()) : 0; } diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx index 33ff0463fc16..aa06be049e78 100644 --- a/sw/source/core/text/frmpaint.cxx +++ b/sw/source/core/text/frmpaint.cxx @@ -108,7 +108,7 @@ SwExtraPainter::SwExtraPainter( const SwTextFrame *pFrame, SwViewShell *pVwSh, { if( pFrame->IsUndersized() ) { - SwTwips nBottom = pFrame->Frame().Bottom(); + SwTwips nBottom = pFrame->getSwFrame().Bottom(); if( aRect.Bottom() > nBottom ) aRect.Bottom( nBottom ); } @@ -125,7 +125,7 @@ SwExtraPainter::SwExtraPainter( const SwTextFrame *pFrame, SwViewShell *pVwSh, outside of the paint rect */ nDivider = !rLineInf.GetDivider().isEmpty() ? rLineInf.GetDividerCountBy() : 0; - nX = pFrame->Frame().Left(); + nX = pFrame->getSwFrame().Left(); SwCharFormat* pFormat = rLineInf.GetCharFormat( const_cast<IDocumentStylePoolAccess&>(pFrame->GetNode()->getIDocumentStylePoolAccess()) ); OSL_ENSURE( pFormat, "PaintExtraData without CharFormat" ); pFnt.reset( new SwFont( &pFormat->GetAttrSet(), pFrame->GetTextNode()->getIDocumentSettingAccess() ) ); @@ -159,7 +159,7 @@ SwExtraPainter::SwExtraPainter( const SwTextFrame *pFrame, SwViewShell *pVwSh, else { bGoLeft = false; - nX += pFrame->Frame().Width() + rLineInf.GetPosFromLeft(); + nX += pFrame->getSwFrame().Width() + rLineInf.GetPosFromLeft(); if( nX > aRect.Right() ) bLineNum = false; } @@ -178,8 +178,8 @@ SwExtraPainter::SwExtraPainter( const SwTextFrame *pFrame, SwViewShell *pVwSh, const SwFrame* pTmpFrame = pFrame->FindTabFrame(); if( !pTmpFrame ) pTmpFrame = pFrame; - nRedX = text::HoriOrientation::LEFT == eHor ? pTmpFrame->Frame().Left() - REDLINE_DISTANCE : - pTmpFrame->Frame().Right() + REDLINE_DISTANCE; + nRedX = text::HoriOrientation::LEFT == eHor ? pTmpFrame->getSwFrame().Left() - REDLINE_DISTANCE : + pTmpFrame->getSwFrame().Right() + REDLINE_DISTANCE; } } @@ -283,7 +283,7 @@ void SwExtraPainter::PaintRedline( SwTwips nY, long nMax ) void SwTextFrame::PaintExtraData( const SwRect &rRect ) const { - if( Frame().Top() > rRect.Bottom() || Frame().Bottom() < rRect.Top() ) + if( getSwFrame().Top() > rRect.Bottom() || getSwFrame().Bottom() < rRect.Top() ) return; const SwTextNode& rTextNode = *GetTextNode(); @@ -298,7 +298,7 @@ void SwTextFrame::PaintExtraData( const SwRect &rRect ) const bool bRedLine = eHor != text::HoriOrientation::NONE; if ( bLineNum || bRedLine ) { - if( IsLocked() || IsHiddenNow() || !Prt().Height() ) + if( IsLocked() || IsHiddenNow() || !getSwPrint().Height() ) return; SwViewShell *pSh = getRootFrame()->GetCurrShell(); @@ -392,11 +392,11 @@ void SwTextFrame::PaintExtraData( const SwRect &rRect ) const if( bLineNum && rLineInf.IsCountBlankLines() && ( aExtra.HasNumber() || aExtra.HasDivider() ) ) { - aExtra.PaintExtra( Frame().Top()+Prt().Top(), aExtra.GetFont() - ->GetAscent( pSh, *pSh->GetOut() ), Prt().Height(), bRedLine ); + aExtra.PaintExtra( getSwFrame().Top()+getSwPrint().Top(), aExtra.GetFont() + ->GetAscent( pSh, *pSh->GetOut() ), getSwPrint().Height(), bRedLine ); } else if( bRedLine ) - aExtra.PaintRedline( Frame().Top()+Prt().Top(), Prt().Height() ); + aExtra.PaintRedline( getSwFrame().Top()+getSwPrint().Top(), getSwPrint().Height() ); } const_cast<SwRect&>(rRect) = rOldRect; @@ -408,9 +408,9 @@ SwRect SwTextFrame::Paint() // finger layout OSL_ENSURE( GetValidPosFlag(), "+SwTextFrame::Paint: no Calc()" ); - SwRect aRet( Prt() ); + SwRect aRet( getSwPrint() ); if ( IsEmpty() || !HasPara() ) - aRet += Frame().Pos(); + aRet += getSwFrame().Pos(); else { // We return the right paint rect. Use the calculated PaintOfst as the @@ -419,7 +419,7 @@ SwRect SwTextFrame::Paint() long l; if ( IsVertLR() ) // mba: the following line was added, but we don't need it for the existing directions; kept for IsVertLR(), but should be checked - rRepaint.Chg( ( GetUpper()->Frame() ).Pos() + ( GetUpper()->Prt() ).Pos(), ( GetUpper()->Prt() ).SSize() ); + rRepaint.Chg( ( GetUpper()->getSwFrame() ).Pos() + ( GetUpper()->getSwPrint() ).Pos(), ( GetUpper()->getSwPrint() ).SSize() ); if( rRepaint.GetOfst() ) rRepaint.Left( rRepaint.GetOfst() ); @@ -434,9 +434,9 @@ SwRect SwTextFrame::Paint() // then extend the rectangle to include the page margin as well, // otherwise some font will be clipped. SwLayoutFrame* pBodyFrame = GetUpper(); - if (pBodyFrame->IsBodyFrame() && aRet.Left() == (pBodyFrame->Frame().Left() + pBodyFrame->Prt().Left())) + if (pBodyFrame->IsBodyFrame() && aRet.Left() == (pBodyFrame->getSwFrame().Left() + pBodyFrame->getSwPrint().Left())) if (SwLayoutFrame* pPageFrame = pBodyFrame->GetUpper()) - aRet.Left(pPageFrame->Frame().Left()); + aRet.Left(pPageFrame->getSwFrame().Left()); if ( IsRightToLeft() ) SwitchLTRtoRTL( aRet ); @@ -488,7 +488,7 @@ bool SwTextFrame::PaintEmpty( const SwRect &rRect, bool bCheck ) const } } - if( pSh->GetViewOptions()->IsParagraph() && Prt().Height() ) + if( pSh->GetViewOptions()->IsParagraph() && getSwPrint().Height() ) { if( RTL_TEXTENCODING_SYMBOL == pFnt->GetCharSet( SwFontScript::Latin ) && pFnt->GetName( SwFontScript::Latin ) != numfunc::GetDefBulletFontname() ) @@ -505,7 +505,7 @@ bool SwTextFrame::PaintEmpty( const SwRect &rRect, bool bCheck ) const pFnt->Invalidate(); pFnt->ChgPhysFnt( pSh, *pSh->GetOut() ); - Point aPos = Frame().Pos() + Prt().Pos(); + Point aPos = getSwFrame().Pos() + getSwPrint().Pos(); const SvxLRSpaceItem &rSpace = GetTextNode()->GetSwAttrSet().GetLRSpace(); @@ -583,7 +583,7 @@ void SwTextFrame::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, if( !IsEmpty() || !PaintEmpty( rRect, true ) ) { - if( IsLocked() || IsHiddenNow() || ! Prt().HasArea() ) + if( IsLocked() || IsHiddenNow() || ! getSwFrame().HasArea() ) return; // It can happen that the IdleCollector withdrew my cached information diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx index cdcf139617ea..92501c71c457 100644 --- a/sw/source/core/text/itrcrsr.cxx +++ b/sw/source/core/text/itrcrsr.cxx @@ -187,8 +187,8 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrame *pNewFrame, SwTextSizeInfo *p if ( m_pFrame->IsRightToLeft() ) { // this calculation is identical this the calculation for L2R layout - see below - nLeft = m_pFrame->Frame().Left() + - m_pFrame->Prt().Left() + + nLeft = m_pFrame->getSwFrame().Left() + + m_pFrame->getSwPrint().Left() + nLMWithNum - pNode->GetLeftMarginWithNum() - // #i95907# @@ -206,8 +206,8 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrame *pNewFrame, SwTextSizeInfo *p !pNode->getIDocumentSettingAccess()->get(DocumentSettingId::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) ) { // this calculation is identical this the calculation for R2L layout - see above - nLeft = m_pFrame->Frame().Left() + - m_pFrame->Prt().Left() + + nLeft = m_pFrame->getSwFrame().Left() + + m_pFrame->getSwPrint().Left() + nLMWithNum - pNode->GetLeftMarginWithNum() - // #i95907# @@ -218,13 +218,13 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrame *pNewFrame, SwTextSizeInfo *p } else { - nLeft = m_pFrame->Frame().Left() + + nLeft = m_pFrame->getSwFrame().Left() + std::max( long( rSpace.GetTextLeft() + nLMWithNum ), - m_pFrame->Prt().Left() ); + m_pFrame->getSwPrint().Left() ); } } - nRight = m_pFrame->Frame().Left() + m_pFrame->Prt().Left() + m_pFrame->Prt().Width(); + nRight = m_pFrame->getSwFrame().Left() + m_pFrame->getSwPrint().Left() + m_pFrame->getSwPrint().Width(); if( nLeft >= nRight && // #i53066# Omit adjustment of nLeft for numbered @@ -233,7 +233,7 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrame *pNewFrame, SwTextSizeInfo *p !m_pFrame->IsInTab() || !nLMWithNum ) ) { - nLeft = m_pFrame->Prt().Left() + m_pFrame->Frame().Left(); + nLeft = m_pFrame->getSwPrint().Left() + m_pFrame->getSwFrame().Left(); if( nLeft >= nRight ) // e.g. with large paragraph indentations in slim table columns nRight = nLeft + 1; // einen goennen wir uns immer } @@ -311,9 +311,9 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrame *pNewFrame, SwTextSizeInfo *p } else { - nFirst = m_pFrame->Frame().Left() + + nFirst = m_pFrame->getSwFrame().Left() + std::max( rSpace.GetTextLeft() + nLMWithNum+ nFirstLineOfs, - m_pFrame->Prt().Left() ); + m_pFrame->getSwPrint().Left() ); } // Note: <SwTextFrame::GetAdditionalFirstLineOffset()> returns a negative @@ -1232,13 +1232,13 @@ bool SwTextCursor::GetCharRect( SwRect* pOrig, const sal_Int32 nOfst, pCMS->m_aRealHeight.Y() = nMax - nTmp; } } - long nOut = pOrig->Right() - GetTextFrame()->Frame().Right(); + long nOut = pOrig->Right() - GetTextFrame()->getSwFrame().Right(); if( nOut > 0 ) { - if( GetTextFrame()->Frame().Width() < GetTextFrame()->Prt().Left() - + GetTextFrame()->Prt().Width() ) - nOut += GetTextFrame()->Frame().Width() - GetTextFrame()->Prt().Left() - - GetTextFrame()->Prt().Width(); + if( GetTextFrame()->getSwFrame().Width() < GetTextFrame()->getSwPrint().Left() + + GetTextFrame()->getSwPrint().Width() ) + nOut += GetTextFrame()->getSwFrame().Width() - GetTextFrame()->getSwPrint().Left() + - GetTextFrame()->getSwPrint().Width(); if( nOut > 0 ) pOrig->Pos().X() -= nOut + 10; } @@ -1702,7 +1702,7 @@ sal_Int32 SwTextCursor::GetCursorOfst( SwPosition *pPos, const Point &rPoint, if ( m_pFrame->IsVertical() ) m_pFrame->SwitchHorizontalToVertical( aTmpPoint ); - if( bChgNodeInner && pTmp->Frame().IsInside( aTmpPoint ) && + if( bChgNodeInner && pTmp->getSwFrame().IsInside( aTmpPoint ) && !( pTmp->IsProtected() ) ) { pFlyPor->GetFlyCursorOfst(aTmpPoint, *pPos, pCMS); @@ -1752,7 +1752,7 @@ sal_Int32 SwTextCursor::GetCursorOfst( SwPosition *pPos, const Point &rPoint, bool SwTextFrame::FillSelection( SwSelectionList& rSelList, const SwRect& rRect ) const { bool bRet = false; - // PaintArea() instead Frame() for negative indents + // PaintArea() instead getSwFrame() for negative indents SwRect aTmpFrame( PaintArea() ); if( !rRect.IsOver( aTmpFrame ) ) return false; diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 6b1a631d5240..1b48eb142957 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -141,9 +141,9 @@ sal_uInt16 SwTextFormatter::GetFrameRstHeight() const // GetFrameRstHeight() is being called with Footnote. // Wrong: const SwFrame *pUpper = pFrame->GetUpper(); const SwFrame *pPage = static_cast<const SwFrame*>(m_pFrame->FindPageFrame()); - const SwTwips nHeight = pPage->Frame().Top() - + pPage->Prt().Top() - + pPage->Prt().Height() - Y(); + const SwTwips nHeight = pPage->getSwFrame().Top() + + pPage->getSwPrint().Top() + + pPage->getSwPrint().Height() - Y(); if( 0 > nHeight ) return m_pCurr->Height(); else @@ -1864,8 +1864,8 @@ void SwTextFormatter::FeedInf( SwTextFormatInfo &rInf ) const nTmpFirst > USHRT_MAX ) { SwRectFnSet aRectFnSet(rInf.GetTextFrame()); - nTmpLeft = aRectFnSet.GetLeft(rInf.GetTextFrame()->Frame()); - nTmpRight = aRectFnSet.GetRight(rInf.GetTextFrame()->Frame()); + nTmpLeft = aRectFnSet.GetLeft(rInf.GetTextFrame()->getSwFrame()); + nTmpRight = aRectFnSet.GetRight(rInf.GetTextFrame()->getSwFrame()); nTmpFirst = nTmpLeft; } @@ -1915,8 +1915,8 @@ SwTwips SwTextFormatter::CalcBottomLine() const SwTwips nMin = GetInfo().GetTextFly().GetMinBottom(); if( nMin && ++nMin > nRet ) { - SwTwips nDist = m_pFrame->Frame().Height() - m_pFrame->Prt().Height() - - m_pFrame->Prt().Top(); + SwTwips nDist = m_pFrame->getSwFrame().Height() - m_pFrame->getSwPrint().Height() + - m_pFrame->getSwPrint().Top(); if( nRet + nDist < nMin ) { const bool bRepaint = HasTruncLines() && @@ -2329,16 +2329,16 @@ void SwTextFormatter::CalcFlyWidth( SwTextFormatInfo &rInf ) bool bForced = false; if( aInter.Left() <= nLeftMin ) { - SwTwips nFrameLeft = GetTextFrame()->Frame().Left(); - if( GetTextFrame()->Prt().Left() < 0 ) - nFrameLeft += GetTextFrame()->Prt().Left(); + SwTwips nFrameLeft = GetTextFrame()->getSwFrame().Left(); + if( GetTextFrame()->getSwPrint().Left() < 0 ) + nFrameLeft += GetTextFrame()->getSwPrint().Left(); if( aInter.Left() < nFrameLeft ) aInter.Left( nFrameLeft ); long nAddMar = 0; if ( m_pFrame->IsRightToLeft() ) { - nAddMar = m_pFrame->Frame().Right() - Right(); + nAddMar = m_pFrame->getSwFrame().Right() - Right(); if ( nAddMar < 0 ) nAddMar = 0; } diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx index 7b28458dfde3..6cdcae233d15 100644 --- a/sw/source/core/text/itrpaint.cxx +++ b/sw/source/core/text/itrpaint.cxx @@ -448,7 +448,7 @@ void SwTextPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip, { const bool bNextUndersized = ( GetTextFrame()->GetNext() && - 0 == GetTextFrame()->GetNext()->Prt().Height() && + 0 == GetTextFrame()->GetNext()->getSwPrint().Height() && GetTextFrame()->GetNext()->IsTextFrame() && static_cast<SwTextFrame*>(GetTextFrame()->GetNext())->IsUndersized() ) ; @@ -461,7 +461,7 @@ void SwTextPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip, GetInfo().DrawRedArrow( *pArrow ); // GetInfo().Y() must be current baseline - SwTwips nDiff = GetInfo().Y() + nTmpHeight - nTmpAscent - GetTextFrame()->Frame().Bottom(); + SwTwips nDiff = GetInfo().Y() + nTmpHeight - nTmpAscent - GetTextFrame()->getSwFrame().Bottom(); if( ( nDiff > 0 && ( GetEnd() < GetInfo().GetText().getLength() || ( nDiff > nTmpHeight/2 && GetPrevLine() ) ) ) || diff --git a/sw/source/core/text/itrtxt.cxx b/sw/source/core/text/itrtxt.cxx index a7bf12dc0c62..4e508bd438a4 100644 --- a/sw/source/core/text/itrtxt.cxx +++ b/sw/source/core/text/itrtxt.cxx @@ -44,7 +44,7 @@ void SwTextIter::CtorInitTextIter( SwTextFrame *pNewFrame, SwTextInfo *pNewInf ) m_pFrame = pNewFrame; m_pInf = pNewInf; m_aLineInf.CtorInitLineInfo( pNode->GetSwAttrSet(), *pNode ); - m_nFrameStart = m_pFrame->Frame().Pos().Y() + m_pFrame->Prt().Pos().Y(); + m_nFrameStart = m_pFrame->getSwFrame().Pos().Y() + m_pFrame->getSwPrint().Pos().Y(); SwTextIter::Init(); // Order is important: only execute FillRegister if GetValue!=0 diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx index 8a4779ab5b15..bc16953ddca9 100644 --- a/sw/source/core/text/porfly.cxx +++ b/sw/source/core/text/porfly.cxx @@ -216,10 +216,10 @@ void sw::FlyContentPortion::Paint(const SwTextPaintInfo& rInf) const rInf.GetTextFrame()->SwitchHorizontalToVertical(aRepaintRect); if((m_pFly->IsCompletePaint() || - m_pFly->Frame().IsOver(aRepaintRect)) && + m_pFly->getSwFrame().IsOver(aRepaintRect)) && SwFlyFrame::IsPaint(m_pFly->GetVirtDrawObj(), m_pFly->getRootFrame()->GetCurrShell())) { - SwRect aRect(m_pFly->Frame()); + SwRect aRect(m_pFly->getSwFrame()); if(!m_pFly->IsCompletePaint()) aRect.Intersection_(aRepaintRect); @@ -358,12 +358,12 @@ void SwFlyCntPortion::SetBase( const SwTextFrame& rFrame, const Point &rBase, SwFormatHoriOrient aHori(pTextBox->GetHoriOrient()); aHori.SetHoriOrient(css::text::HoriOrientation::NONE); - sal_Int32 nLeft = aTextRectangle.getX() - rFrame.Frame().Left(); + sal_Int32 nLeft = aTextRectangle.getX() - rFrame.getSwFrame().Left(); aHori.SetPos(nLeft); SwFormatVertOrient aVert(pTextBox->GetVertOrient()); aVert.SetVertOrient(css::text::VertOrientation::NONE); - sal_Int32 nTop = aTextRectangle.getY() - rFrame.Frame().Top() - nFlyAsc; + sal_Int32 nTop = aTextRectangle.getY() - rFrame.getSwFrame().Top() - nFlyAsc; aVert.SetPos(nTop); pTextBox->LockModify(); diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx index 5134593156f3..8f5ea538393f 100644 --- a/sw/source/core/text/pormulti.cxx +++ b/sw/source/core/text/pormulti.cxx @@ -1695,8 +1695,8 @@ bool SwTextFormatter::BuildMultiPortion( SwTextFormatInfo &rInf, nMaxWidth = pUpperFrame ? ( rInf.GetTextFrame()->IsVertical() ? - pUpperFrame->Prt().Width() : - pUpperFrame->Prt().Height() ) : + pUpperFrame->getSwPrint().Width() : + pUpperFrame->getSwPrint().Height() ) : USHRT_MAX; } else diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index 3aaac8495ac0..8350073d613c 100644 --- a/sw/source/core/text/porrst.cxx +++ b/sw/source/core/text/porrst.cxx @@ -188,11 +188,11 @@ SwArrowPortion::SwArrowPortion( const SwLinePortion &rPortion ) : SwArrowPortion::SwArrowPortion( const SwTextPaintInfo &rInf ) : bLeft( false ) { - Height( (sal_uInt16)(rInf.GetTextFrame()->Prt().Height()) ); - aPos.X() = rInf.GetTextFrame()->Frame().Left() + - rInf.GetTextFrame()->Prt().Right(); - aPos.Y() = rInf.GetTextFrame()->Frame().Top() + - rInf.GetTextFrame()->Prt().Bottom(); + Height( (sal_uInt16)(rInf.GetTextFrame()->getSwPrint().Height()) ); + aPos.X() = rInf.GetTextFrame()->getSwFrame().Left() + + rInf.GetTextFrame()->getSwPrint().Right(); + aPos.Y() = rInf.GetTextFrame()->getSwFrame().Top() + + rInf.GetTextFrame()->getSwPrint().Bottom(); SetWhichPor( POR_ARROW ); } @@ -264,8 +264,8 @@ SwTwips SwTextFrame::EmptyHeight() const SwTwips nRet; if( !pOut ) nRet = IsVertical() ? - Prt().SSize().Width() + 1 : - Prt().SSize().Height() + 1; + getSwPrint().SSize().Width() + 1 : + getSwPrint().SSize().Height() + 1; else { pFnt->SetFntChg( true ); @@ -301,7 +301,7 @@ bool SwTextFrame::FormatEmpty() SwTextFly aTextFly( this ); SwRect aRect; - bool bFirstFlyCheck = 0 != Prt().Height(); + bool bFirstFlyCheck = 0 != getSwPrint().Height(); if ( !bCollapse && bFirstFlyCheck && aTextFly.IsOn() && aTextFly.IsAnyObj( aRect ) ) return false; @@ -317,7 +317,7 @@ bool SwTextFrame::FormatEmpty() } SwRectFnSet aRectFnSet(this); - const SwTwips nChg = nHeight - aRectFnSet.GetHeight(Prt()); + const SwTwips nChg = nHeight - aRectFnSet.GetHeight(getSwPrint()); if( !nChg ) SetUndersized( false ); diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx index c8e58a1aa0c5..711273eedf0b 100644 --- a/sw/source/core/text/txtdrop.cxx +++ b/sw/source/core/text/txtdrop.cxx @@ -52,8 +52,8 @@ static bool lcl_IsDropFlyInter( const SwTextFormatInfo &rInf, const SwTextFly& rTextFly = rInf.GetTextFly(); if( rTextFly.IsOn() ) { - SwRect aRect( rInf.GetTextFrame()->Frame().Pos(), Size( nWidth, nHeight) ); - aRect.Pos() += rInf.GetTextFrame()->Prt().Pos(); + SwRect aRect( rInf.GetTextFrame()->getSwFrame().Pos(), Size( nWidth, nHeight) ); + aRect.Pos() += rInf.GetTextFrame()->getSwPrint().Pos(); aRect.Pos().X() += rInf.X(); aRect.Pos().Y() = rInf.Y(); aRect = rTextFly.GetFrame( aRect ); diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index 76bd7d393555..90d27fd7ea8d 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -227,7 +227,7 @@ const SwRect SwContourCache::ContourRect( const SwFormat* pFormat, tools::PolyPolygon aPoly; if( !static_cast<const SwVirtFlyDrawObj*>(pObj)->GetFlyFrame()->GetContour( aPoly ) ) aPoly = tools::PolyPolygon( static_cast<const SwVirtFlyDrawObj*>(pObj)-> - GetFlyFrame()->Frame().SVRect() ); + GetFlyFrame()->getSwFrame().SVRect() ); aPolyPolygon.clear(); aPolyPolygon.append(aPoly.getB2DPolyPolygon()); } @@ -403,8 +403,8 @@ bool SwTextFly::IsAnyFrame() const SwSwapIfSwapped swap(const_cast<SwTextFrame *>(pCurrFrame)); OSL_ENSURE( bOn, "IsAnyFrame: Why?" ); - SwRect aRect( pCurrFrame->Frame().Pos() + pCurrFrame->Prt().Pos(), - pCurrFrame->Prt().SSize() ); + SwRect aRect( pCurrFrame->getSwFrame().Pos() + pCurrFrame->getSwPrint().Pos(), + pCurrFrame->getSwPrint().SSize() ); return ForEach( aRect, nullptr, false ); } @@ -415,8 +415,8 @@ bool SwTextFly::IsAnyObj( const SwRect &rRect ) const SwRect aRect( rRect ); if ( aRect.IsEmpty() ) - aRect = SwRect( pCurrFrame->Frame().Pos() + pCurrFrame->Prt().Pos(), - pCurrFrame->Prt().SSize() ); + aRect = SwRect( pCurrFrame->getSwFrame().Pos() + pCurrFrame->getSwPrint().Pos(), + pCurrFrame->getSwPrint().SSize() ); const SwSortedObjs *pSorted = pPage->GetSortedObjs(); if( pSorted ) // bOn actually makes sure that we have objects on the side, @@ -501,7 +501,7 @@ bool SwTextFly::DrawTextOpaque( SwDrawTextInfo &rInf ) { // #i68520# const SwFlyFrame& rFly = dynamic_cast<const SwFlyFrame&>(*pTmpAnchoredObj); - if( aRegion.GetOrigin().IsOver( rFly.Frame() ) ) + if( aRegion.GetOrigin().IsOver( rFly.getSwFrame() ) ) { const SwFrameFormat *pFormat = rFly.GetFormat(); const SwFormatSurround &rSur = pFormat->GetSurround(); @@ -530,7 +530,7 @@ bool SwTextFly::DrawTextOpaque( SwDrawTextInfo &rInf ) (!pNoText->IsTransparent() && !rSur.IsContour()) ) { bOpaque = true; - aRegion -= rFly.Frame(); + aRegion -= rFly.getSwFrame(); } } } @@ -858,12 +858,12 @@ SwAnchoredObjList* SwTextFly::InitAnchoredObjList() SwRect aRect; if ( pIDSA->get(DocumentSettingId::USE_FORMER_TEXT_WRAPPING) ) { - aRect = pCurrFrame->Prt(); - aRect += pCurrFrame->Frame().Pos(); + aRect = pCurrFrame->getSwPrint(); + aRect += pCurrFrame->getSwFrame().Pos(); } else { - aRect = pCurrFrame->Frame(); + aRect = pCurrFrame->getSwFrame(); } // Make ourselves a little smaller than we are, // so that 1-Twip-overlappings are ignored (#49532) @@ -901,7 +901,7 @@ SwAnchoredObjList* SwTextFly::InitAnchoredObjList() aRectFnSet.GetBottom(aBound) ) > 0 || nLeft > aRectFnSet.GetRight(aBound) || aRectFnSet.GetHeight(aBound) > - 2 * aRectFnSet.GetHeight(pPage->Frame()) ) + 2 * aRectFnSet.GetHeight(pPage->getSwFrame()) ) { continue; } @@ -969,7 +969,7 @@ SwTwips SwTextFly::CalcMinBottom() const const size_t nCount = pDrawObj ? pDrawObj->size() : 0; if( nCount ) { - SwTwips nEndOfFrame = pCurrFrame->Frame().Bottom(); + SwTwips nEndOfFrame = pCurrFrame->getSwFrame().Bottom(); for( size_t i = 0; i < nCount; ++i ) { SwAnchoredObject* pAnchoredObj = (*pDrawObj)[ i ]; @@ -986,8 +986,8 @@ SwTwips SwTextFly::CalcMinBottom() const } } } - SwTwips nMax = pCurrFrame->GetUpper()->Frame().Top() + - pCurrFrame->GetUpper()->Prt().Bottom(); + SwTwips nMax = pCurrFrame->GetUpper()->getSwFrame().Top() + + pCurrFrame->GetUpper()->getSwPrint().Bottom(); if( nRet > nMax ) nRet = nMax; } @@ -1107,7 +1107,7 @@ void SwTextFly::CalcRightMargin( SwRect &rFly, // and protrudes into the same line. // Flys with run-through are invisible for those below, i.e., they // are ignored for computing the margins of other Flys. - // 3301: pNext->Frame().IsOver( rLine ) is necessary + // 3301: pNext->getSwFrame().IsOver( rLine ) is necessary // #i68520# css::text::WrapTextMode eSurroundForTextWrap; @@ -1198,7 +1198,7 @@ void SwTextFly::CalcLeftMargin( SwRect &rFly, // and protrudes into the same line. // Flys with run-through are invisible for those below, i.e., they // are ignored for computing the margins of other Flys. - // 3301: pNext->Frame().IsOver( rLine ) is necessary + // 3301: pNext->getSwFrame().IsOver( rLine ) is necessary // #i68520# SwAnchoredObjList::size_type nMyPos = nFlyPos; diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index b485e30c0d7f..296e006c5fd1 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -82,33 +82,50 @@ /// Switches width and height of the text frame void SwTextFrame::SwapWidthAndHeight() { - if ( ! mbIsSwapped ) { - const long nPrtOfstX = Prt().Pos().X(); - Prt().Pos().X() = Prt().Pos().Y(); - if( IsVertLR() ) - Prt().Pos().Y() = nPrtOfstX; + SwFrameRect::PrintWriteAccess aPrt(*this); + + if ( ! mbIsSwapped ) + { + const long nPrtOfstX = aPrt.Pos().X(); + aPrt.Pos().X() = aPrt.Pos().Y(); + + if( IsVertLR() ) + { + aPrt.Pos().Y() = nPrtOfstX; + } + else + { + aPrt.Pos().Y() = getSwFrame().Width() - ( nPrtOfstX + aPrt.Width() ); + } + } else - Prt().Pos().Y() = Frame().Width() - ( nPrtOfstX + Prt().Width() ); + { + const long nPrtOfstY = aPrt.Pos().Y(); + aPrt.Pos().Y() = aPrt.Pos().X(); + if( IsVertLR() ) + { + aPrt.Pos().X() = nPrtOfstY; + } + else + { + aPrt.Pos().X() = getSwFrame().Height() - ( nPrtOfstY + aPrt.Height() ); + } + } + + const long nPrtWidth = aPrt.Width(); + aPrt.Width( aPrt.Height() ); + aPrt.Height( nPrtWidth ); } - else + { - const long nPrtOfstY = Prt().Pos().Y(); - Prt().Pos().Y() = Prt().Pos().X(); - if( IsVertLR() ) - Prt().Pos().X() = nPrtOfstY; - else - Prt().Pos().X() = Frame().Height() - ( nPrtOfstY + Prt().Height() ); + const long nFrameWidth = getSwFrame().Width(); + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Width( aFrm.Height() ); + aFrm.Height( nFrameWidth ); } - const long nFrameWidth = Frame().Width(); - Frame().Width( Frame().Height() ); - Frame().Height( nFrameWidth ); - const long nPrtWidth = Prt().Width(); - Prt().Width( Prt().Height() ); - Prt().Height( nPrtWidth ); - mbIsSwapped = ! mbIsSwapped; } @@ -122,30 +139,30 @@ void SwTextFrame::SwitchHorizontalToVertical( SwRect& rRect ) const long nOfstX, nOfstY; if ( IsVertLR() ) { - nOfstX = rRect.Left() - Frame().Left(); - nOfstY = rRect.Top() - Frame().Top(); + nOfstX = rRect.Left() - getSwFrame().Left(); + nOfstY = rRect.Top() - getSwFrame().Top(); } else { - nOfstX = rRect.Left() - Frame().Left(); - nOfstY = rRect.Top() + rRect.Height() - Frame().Top(); + nOfstX = rRect.Left() - getSwFrame().Left(); + nOfstY = rRect.Top() + rRect.Height() - getSwFrame().Top(); } const long nWidth = rRect.Width(); const long nHeight = rRect.Height(); if ( IsVertLR() ) - rRect.Left(Frame().Left() + nOfstY); + rRect.Left(getSwFrame().Left() + nOfstY); else { if ( mbIsSwapped ) - rRect.Left( Frame().Left() + Frame().Height() - nOfstY ); + rRect.Left( getSwFrame().Left() + getSwFrame().Height() - nOfstY ); else // frame is rotated - rRect.Left( Frame().Left() + Frame().Width() - nOfstY ); + rRect.Left( getSwFrame().Left() + getSwFrame().Width() - nOfstY ); } - rRect.Top( Frame().Top() + nOfstX ); + rRect.Top( getSwFrame().Top() + nOfstX ); rRect.Width( nHeight ); rRect.Height( nWidth ); } @@ -157,20 +174,20 @@ void SwTextFrame::SwitchHorizontalToVertical( SwRect& rRect ) const void SwTextFrame::SwitchHorizontalToVertical( Point& rPoint ) const { // calc offset inside frame - const long nOfstX = rPoint.X() - Frame().Left(); - const long nOfstY = rPoint.Y() - Frame().Top(); + const long nOfstX = rPoint.X() - getSwFrame().Left(); + const long nOfstY = rPoint.Y() - getSwFrame().Top(); if ( IsVertLR() ) - rPoint.X() = Frame().Left() + nOfstY; + rPoint.X() = getSwFrame().Left() + nOfstY; else { if ( mbIsSwapped ) - rPoint.X() = Frame().Left() + Frame().Height() - nOfstY; + rPoint.X() = getSwFrame().Left() + getSwFrame().Height() - nOfstY; else // calc rotated coords - rPoint.X() = Frame().Left() + Frame().Width() - nOfstY; + rPoint.X() = getSwFrame().Left() + getSwFrame().Width() - nOfstY; } - rPoint.Y() = Frame().Top() + nOfstX; + rPoint.Y() = getSwFrame().Top() + nOfstX; } /** @@ -194,22 +211,22 @@ void SwTextFrame::SwitchVerticalToHorizontal( SwRect& rRect ) const // calc offset inside frame if ( IsVertLR() ) - nOfstX = rRect.Left() - Frame().Left(); + nOfstX = rRect.Left() - getSwFrame().Left(); else { if ( mbIsSwapped ) - nOfstX = Frame().Left() + Frame().Height() - ( rRect.Left() + rRect.Width() ); + nOfstX = getSwFrame().Left() + getSwFrame().Height() - ( rRect.Left() + rRect.Width() ); else - nOfstX = Frame().Left() + Frame().Width() - ( rRect.Left() + rRect.Width() ); + nOfstX = getSwFrame().Left() + getSwFrame().Width() - ( rRect.Left() + rRect.Width() ); } - const long nOfstY = rRect.Top() - Frame().Top(); + const long nOfstY = rRect.Top() - getSwFrame().Top(); const long nWidth = rRect.Height(); const long nHeight = rRect.Width(); // calc rotated coords - rRect.Left( Frame().Left() + nOfstY ); - rRect.Top( Frame().Top() + nOfstX ); + rRect.Left( getSwFrame().Left() + nOfstY ); + rRect.Top( getSwFrame().Top() + nOfstX ); rRect.Width( nWidth ); rRect.Height( nHeight ); } @@ -224,20 +241,20 @@ void SwTextFrame::SwitchVerticalToHorizontal( Point& rPoint ) const // calc offset inside frame if ( IsVertLR() ) - nOfstX = rPoint.X() - Frame().Left(); + nOfstX = rPoint.X() - getSwFrame().Left(); else { if ( mbIsSwapped ) - nOfstX = Frame().Left() + Frame().Height() - rPoint.X(); + nOfstX = getSwFrame().Left() + getSwFrame().Height() - rPoint.X(); else - nOfstX = Frame().Left() + Frame().Width() - rPoint.X(); + nOfstX = getSwFrame().Left() + getSwFrame().Width() - rPoint.X(); } - const long nOfstY = rPoint.Y() - Frame().Top(); + const long nOfstY = rPoint.Y() - getSwFrame().Top(); // calc rotated coords - rPoint.X() = Frame().Left() + nOfstY; - rPoint.Y() = Frame().Top() + nOfstX; + rPoint.X() = getSwFrame().Left() + nOfstY; + rPoint.Y() = getSwFrame().Top() + nOfstX; } /** @@ -274,8 +291,8 @@ void SwTextFrame::SwitchLTRtoRTL( SwRect& rRect ) const SwSwapIfNotSwapped swap(const_cast<SwTextFrame *>(this)); long nWidth = rRect.Width(); - rRect.Left( 2 * ( Frame().Left() + Prt().Left() ) + - Prt().Width() - rRect.Right() - 1 ); + rRect.Left( 2 * ( getSwFrame().Left() + getSwPrint().Left() ) + + getSwPrint().Width() - rRect.Right() - 1 ); rRect.Width( nWidth ); } @@ -284,7 +301,7 @@ void SwTextFrame::SwitchLTRtoRTL( Point& rPoint ) const { SwSwapIfNotSwapped swap(const_cast<SwTextFrame *>(this)); - rPoint.X() = 2 * ( Frame().Left() + Prt().Left() ) + Prt().Width() - rPoint.X() - 1; + rPoint.X() = 2 * ( getSwFrame().Left() + getSwPrint().Left() ) + getSwPrint().Width() - rPoint.X() - 1; } SwLayoutModeModifier::SwLayoutModeModifier( const OutputDevice& rOutp ) : @@ -433,7 +450,7 @@ bool SwTextFrame::IsHiddenNow() const { SwFrameSwapper aSwapper( this, true ); - if( !Frame().Width() && IsValid() && GetUpper()->IsValid() ) // invalid when stack overflows (StackHack)! + if( !getSwFrame().Width() && IsValid() && GetUpper()->IsValid() ) // invalid when stack overflows (StackHack)! { // OSL_FAIL( "SwTextFrame::IsHiddenNow: thin frame" ); return true; @@ -544,7 +561,7 @@ bool sw_HideObj( const SwTextFrame& _rFrame, bRet = false; // set needed data structure values for object positioning SwRectFnSet aRectFnSet(&_rFrame); - SwRect aLastCharRect( _rFrame.Frame() ); + SwRect aLastCharRect( _rFrame.getSwFrame() ); aRectFnSet.SetWidth( aLastCharRect, 1 ); _pAnchoredObj->maLastCharRect = aLastCharRect; _pAnchoredObj->mnLastTopOfLine = aRectFnSet.GetTop(aLastCharRect); @@ -765,7 +782,7 @@ void SwTextFrame::CalcLineSpace() return; } - Size aNewSize( Prt().SSize() ); + Size aNewSize( getSwPrint().SSize() ); SwTextFormatInfo aInf( getRootFrame()->GetCurrShell()->GetOut(), this ); SwTextFormatter aLine( this, &aInf ); @@ -778,15 +795,15 @@ void SwTextFrame::CalcLineSpace() aLine.Top(); aLine.RecalcRealHeight(); - aNewSize.Height() = (aLine.Y() - Frame().Top()) + aLine.GetLineHeight(); + aNewSize.Height() = (aLine.Y() - getSwFrame().Top()) + aLine.GetLineHeight(); - SwTwips nDelta = aNewSize.Height() - Prt().Height(); + SwTwips nDelta = aNewSize.Height() - getSwPrint().Height(); // Underflow with free-flying frames if( aInf.GetTextFly().IsOn() ) { - SwRect aTmpFrame( Frame() ); + SwRect aTmpFrame( getSwFrame() ); if( nDelta < 0 ) - aTmpFrame.Height( Prt().Height() ); + aTmpFrame.Height( getSwPrint().Height() ); else aTmpFrame.Height( aNewSize.Height() ); if( aInf.GetTextFly().Relax( aTmpFrame ) ) @@ -1309,7 +1326,7 @@ void SwTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) if( pOld && pNew ) { const SwDocPosUpdate *pDocPos = static_cast<const SwDocPosUpdate*>(pOld); - if( pDocPos->nDocPos <= maFrame.Top() ) + if( pDocPos->nDocPos <= getSwFrame().Top() ) { const SwFormatField *pField = static_cast<const SwFormatField *>(pNew); InvalidateRange( @@ -1463,7 +1480,7 @@ bool SwTextFrame::Prepare( const PrepareHint ePrep, const void* pVoid, SwFrameSwapper aSwapper( this, false ); #if OSL_DEBUG_LEVEL > 1 - const SwTwips nDbgY = Frame().Top(); + const SwTwips nDbgY = getSwFrame().Top(); (void)nDbgY; #endif @@ -1484,9 +1501,9 @@ bool SwTextFrame::Prepare( const PrepareHint ePrep, const void* pVoid, // so that we format and bUndersized is set (if needed) if( IsInFly() || IsInSct() ) { - SwTwips nTmpBottom = GetUpper()->Frame().Top() + - GetUpper()->Prt().Bottom(); - if( nTmpBottom < Frame().Bottom() ) + SwTwips nTmpBottom = GetUpper()->getSwFrame().Top() + + GetUpper()->getSwPrint().Bottom(); + if( nTmpBottom < getSwFrame().Bottom() ) break; } // Are there any free-flying frames on this page? @@ -1532,25 +1549,36 @@ bool SwTextFrame::Prepare( const PrepareHint ePrep, const void* pVoid, switch( ePrep ) { - case PREP_MOVEFTN : Frame().Height(0); - Prt().Height(0); - InvalidatePrt_(); - InvalidateSize_(); - SAL_FALLTHROUGH; - case PREP_ADJUST_FRM : pPara->SetPrepAdjust(); - if( IsFootnoteNumFrame() != pPara->IsFootnoteNum() || - IsUndersized() ) - { - InvalidateRange( SwCharRange( 0, 1 ), 1); - if( GetOfst() && !IsFollow() ) - SetOfst_( 0 ); - } - break; - case PREP_MUST_FIT : pPara->SetPrepMustFit(true); - SAL_FALLTHROUGH; - case PREP_WIDOWS_ORPHANS : pPara->SetPrepAdjust(); - break; + case PREP_MOVEFTN : + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Height(0); + } + + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Height(0); + } + InvalidatePrt_(); + InvalidateSize_(); + SAL_FALLTHROUGH; + case PREP_ADJUST_FRM : + pPara->SetPrepAdjust(); + if( IsFootnoteNumFrame() != pPara->IsFootnoteNum() || + IsUndersized() ) + { + InvalidateRange( SwCharRange( 0, 1 ), 1); + if( GetOfst() && !IsFollow() ) + SetOfst_( 0 ); + } + break; + case PREP_MUST_FIT : + pPara->SetPrepMustFit(true); + SAL_FALLTHROUGH; + case PREP_WIDOWS_ORPHANS : + pPara->SetPrepAdjust(); + break; case PREP_WIDOWS : // MustFit is stronger than anything else if( pPara->IsPrepMustFit() ) @@ -1670,9 +1698,9 @@ bool SwTextFrame::Prepare( const PrepareHint ePrep, const void* pVoid, { if( IsInFly() ) { - SwTwips nTmpBottom = GetUpper()->Frame().Top() + - GetUpper()->Prt().Bottom(); - if( nTmpBottom < Frame().Bottom() ) + SwTwips nTmpBottom = GetUpper()->getSwFrame().Top() + + GetUpper()->getSwPrint().Bottom(); + if( nTmpBottom < getSwFrame().Bottom() ) bFormat = true; } if( !bFormat ) @@ -1856,39 +1884,50 @@ public: SwTestFormat::SwTestFormat( SwTextFrame* pTextFrame, const SwFrame* pPre, SwTwips nMaxHeight ) : pFrame( pTextFrame ) { - aOldFrame = pFrame->Frame(); - aOldPrt = pFrame->Prt(); + aOldFrame = pFrame->getSwFrame(); + aOldPrt = pFrame->getSwPrint(); SwRectFnSet aRectFnSet(pFrame); SwTwips nLower = aRectFnSet.GetBottomMargin(*pFrame); - pFrame->Frame() = pFrame->GetUpper()->Prt(); - pFrame->Frame() += pFrame->GetUpper()->Frame().Pos(); + { + // indeed, here the GetUpper()->getSwPrint() gets copied and manipulated + SwFrameRect::FrameWriteAccess aFrm(*pFrame); + aFrm.setSwRect(pFrame->GetUpper()->getSwPrint()); + aFrm += pFrame->GetUpper()->getSwFrame().Pos(); + aRectFnSet.SetHeight( aFrm, nMaxHeight ); - aRectFnSet.SetHeight( pFrame->Frame(), nMaxHeight ); - if( pFrame->GetPrev() ) - aRectFnSet.SetPosY( pFrame->Frame(), - aRectFnSet.GetBottom(pFrame->GetPrev()->Frame()) - - ( aRectFnSet.IsVert() ? nMaxHeight + 1 : 0 ) ); + if( pFrame->GetPrev() ) + { + aRectFnSet.SetPosY( + aFrm, + aRectFnSet.GetBottom(pFrame->GetPrev()->getSwFrame()) - ( aRectFnSet.IsVert() ? nMaxHeight + 1 : 0 ) ); + } + } SwBorderAttrAccess aAccess( SwFrame::GetCache(), pFrame ); const SwBorderAttrs &rAttrs = *aAccess.Get(); - aRectFnSet.SetPosX( pFrame->Prt(), rAttrs.CalcLeft( pFrame ) ); + + { + SwFrameRect::PrintWriteAccess aPrt(*pFrame); + aRectFnSet.SetPosX(aPrt, rAttrs.CalcLeft( pFrame ) ); + } if( pPre ) { SwTwips nUpper = pFrame->CalcUpperSpace( &rAttrs, pPre ); - aRectFnSet.SetPosY( pFrame->Prt(), nUpper ); - } - 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 ) ) ); + SwFrameRect::PrintWriteAccess aPrt(*pFrame); + aRectFnSet.SetPosY(aPrt, nUpper ); + } + + { + SwFrameRect::PrintWriteAccess aPrt(*pFrame); + aRectFnSet.SetHeight( aPrt, std::max( 0L , aRectFnSet.GetHeight(pFrame->getSwFrame()) - aRectFnSet.GetTop(aPrt) - nLower ) ); + aRectFnSet.SetWidth( aPrt, aRectFnSet.GetWidth(pFrame->getSwFrame()) - ( rAttrs.CalcLeft( pFrame ) + rAttrs.CalcRight( pFrame ) ) ); + } + pOldPara = pFrame->HasPara() ? pFrame->GetPara() : nullptr; pFrame->SetPara( new SwParaPortion(), false ); - OSL_ENSURE( ! pFrame->IsSwapped(), "A frame is swapped before Format_" ); if ( pFrame->IsVertical() ) @@ -1907,8 +1946,16 @@ SwTestFormat::SwTestFormat( SwTextFrame* pTextFrame, const SwFrame* pPre, SwTwip SwTestFormat::~SwTestFormat() { - pFrame->Frame() = aOldFrame; - pFrame->Prt() = aOldPrt; + { + SwFrameRect::FrameWriteAccess aFrm(*pFrame); + aFrm.setSwRect(aOldFrame); + } + + { + SwFrameRect::PrintWriteAccess aPrt(*pFrame); + aPrt.setSwRect(aOldPrt); + } + pFrame->SetPara( pOldPara ); } @@ -1916,7 +1963,7 @@ bool SwTextFrame::TestFormat( const SwFrame* pPrv, SwTwips &rMaxHeight, bool &bS { PROTOCOL_ENTER( this, PROT::TestFormat, DbgAction::NONE, nullptr ) - if( IsLocked() && GetUpper()->Prt().Width() <= 0 ) + if( IsLocked() && GetUpper()->getSwPrint().Width() <= 0 ) return false; SwTestFormat aSave( this, pPrv, rMaxHeight ); @@ -1956,7 +2003,7 @@ bool SwTextFrame::WouldFit( SwTwips &rMaxHeight, bool &bSplit, bool bTst ) if ( IsEmpty() && !bTst ) { bSplit = false; - SwTwips nHeight = aRectFnSet.IsVert() ? Prt().SSize().Width() : Prt().SSize().Height(); + SwTwips nHeight = aRectFnSet.IsVert() ? getSwPrint().SSize().Width() : getSwPrint().SSize().Height(); if( rMaxHeight < nHeight ) return false; else @@ -1969,15 +2016,15 @@ 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() || ( !aRectFnSet.GetHeight(Frame()) && IsHiddenNow() ) ) + if( !HasPara() || ( !aRectFnSet.GetHeight(getSwFrame()) && 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.IsVert() ? - ( 0 == Frame().Left() ) : - ( LONG_MAX - 20000 < Frame().Bottom() ) ) ) + ( 0 == getSwFrame().Left() ) : + ( LONG_MAX - 20000 < getSwFrame().Bottom() ) ) ) { SetWidow(false); if ( GetFollow() ) @@ -1986,17 +2033,17 @@ 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.IsVert() && LONG_MAX - 20000 >= Frame().Bottom() ) || - ( aRectFnSet.IsVert() && 0 < Frame().Left() ) ) && + if( ( ( ! aRectFnSet.IsVert() && LONG_MAX - 20000 >= getSwFrame().Bottom() ) || + ( aRectFnSet.IsVert() && 0 < getSwFrame().Left() ) ) && ( GetFollow()->IsVertical() ? - !GetFollow()->Frame().Width() : - !GetFollow()->Frame().Height() ) ) + !GetFollow()->getSwFrame().Width() : + !GetFollow()->getSwFrame().Height() ) ) { SwTextFrame* pFoll = GetFollow()->GetFollow(); while( pFoll && ( pFoll->IsVertical() ? - !pFoll->Frame().Width() : - !pFoll->Frame().Height() ) ) + !pFoll->getSwFrame().Width() : + !pFoll->getSwFrame().Height() ) ) pFoll = pFoll->GetFollow(); if( pFoll ) return false; @@ -2041,7 +2088,7 @@ sal_uInt16 SwTextFrame::GetParHeight() const if( !HasPara() ) { // For non-empty paragraphs this is a special case // For UnderSized we can simply just ask 1 Twip more - sal_uInt16 nRet = (sal_uInt16)Prt().SSize().Height(); + sal_uInt16 nRet = (sal_uInt16)getSwPrint().SSize().Height(); if( IsUndersized() ) { if( IsEmpty() || GetText().isEmpty() ) @@ -2104,26 +2151,36 @@ SwTwips SwTextFrame::CalcFitToContent() // If we are currently locked, we better return with a // fairly reasonable value: if ( IsLocked() ) - return Prt().Width(); + return getSwPrint().Width(); SwParaPortion* pOldPara = GetPara(); SwParaPortion *pDummy = new SwParaPortion(); SetPara( pDummy, false ); const SwPageFrame* pPage = FindPageFrame(); - const Point aOldFramePos = Frame().Pos(); - const SwTwips nOldFrameWidth = Frame().Width(); - const SwTwips nOldPrtWidth = Prt().Width(); + const Point aOldFramePos = getSwFrame().Pos(); + const SwTwips nOldFrameWidth = getSwFrame().Width(); + const SwTwips nOldPrtWidth = getSwPrint().Width(); const SwTwips nPageWidth = GetUpper()->IsVertical() ? - pPage->Prt().Height() : - pPage->Prt().Width(); + pPage->getSwPrint().Height() : + pPage->getSwPrint().Width(); - Frame().Width( nPageWidth ); - Prt().Width( nPageWidth ); + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Width( nPageWidth ); + } + + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Width( nPageWidth ); + } // i#25422 objects anchored as character in RTL if ( IsRightToLeft() ) - Frame().Pos().X() += nOldFrameWidth - nPageWidth; + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Pos().X() += nOldFrameWidth - nPageWidth; + } TextFrameLockGuard aLock( this ); @@ -2133,15 +2190,23 @@ SwTwips SwTextFrame::CalcFitToContent() SwHookOut aHook( aInf ); // i#54031 - assure mininum of MINLAY twips. - const SwTwips nMax = std::max( (SwTwips)MINLAY, - aLine.CalcFitToContent_() + 1 ); + const SwTwips nMax = std::max( (SwTwips)MINLAY, aLine.CalcFitToContent_() + 1 ); - Frame().Width( nOldFrameWidth ); - Prt().Width( nOldPrtWidth ); + { + SwFrameRect::FrameWriteAccess aFrm(*this); + aFrm.Width( nOldFrameWidth ); - // i#25422 objects anchored as character in RTL - if ( IsRightToLeft() ) - Frame().Pos() = aOldFramePos; + // i#25422 objects anchored as character in RTL + if ( IsRightToLeft() ) + { + aFrm.Pos() = aOldFramePos; + } + } + + { + SwFrameRect::PrintWriteAccess aPrt(*this); + aPrt.Width( nOldPrtWidth ); + } SetPara( pOldPara ); @@ -2423,7 +2488,7 @@ sal_uInt16 SwTextFrame::FirstLineHeight() const if ( !HasPara() ) { if( IsEmpty() && IsValid() ) - return IsVertical() ? (sal_uInt16)Prt().Width() : (sal_uInt16)Prt().Height(); + return IsVertical() ? (sal_uInt16)getSwPrint().Width() : (sal_uInt16)getSwPrint().Height(); return USHRT_MAX; } const SwParaPortion *pPara = GetPara(); @@ -2501,7 +2566,7 @@ void SwTextFrame::ChgThisLines() { SwRepaint& rRepaint = GetPara()->GetRepaint(); rRepaint.Bottom( std::max( rRepaint.Bottom(), - Frame().Top()+Prt().Bottom())); + getSwFrame().Top()+getSwPrint().Bottom())); } } else // Paragraphs which are not counted should not manipulate the AllLines. @@ -2606,8 +2671,8 @@ static SwTwips lcl_CalcFlyBasePos( const SwTextFrame& rFrame, SwRect aFlyRect, { SwRectFnSet aRectFnSet(&rFrame); SwTwips nRet = rFrame.IsRightToLeft() ? - aRectFnSet.GetRight(rFrame.Frame()) : - aRectFnSet.GetLeft(rFrame.Frame()); + aRectFnSet.GetRight(rFrame.getSwFrame()) : + aRectFnSet.GetLeft(rFrame.getSwFrame()); do { @@ -2658,7 +2723,7 @@ void SwTextFrame::CalcBaseOfstForFly() SwRectFnSet aRectFnSet(this); - SwRect aFlyRect( Frame().Pos() + Prt().Pos(), Prt().SSize() ); + SwRect aFlyRect( getSwFrame().Pos() + getSwPrint().Pos(), getSwPrint().SSize() ); // Get first 'real' line and adjust position and height of line rectangle. // Correct behaviour if no 'real' line exists @@ -2693,8 +2758,8 @@ void SwTextFrame::CalcBaseOfstForFly() // make values relative to frame start position SwTwips nLeft = IsRightToLeft() ? - aRectFnSet.GetRight(Frame()) : - aRectFnSet.GetLeft(Frame()); + aRectFnSet.GetRight(getSwFrame()) : + aRectFnSet.GetLeft(getSwFrame()); mnFlyAnchorOfst = nRet1 - nLeft; mnFlyAnchorOfstNoWrap = nRet2 - nLeft; diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx index 6511307b0e92..c1d00e5cf102 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.YDiff( aRectFnSet.GetTop(pCont->Frame()), - aRectFnSet.GetBottom(Frame()) ) > 0 ) + if ( pCont && aRectFnSet.YDiff( aRectFnSet.GetTop(pCont->getSwFrame()), + aRectFnSet.GetBottom(getSwFrame()) ) > 0 ) { - pBoss->RearrangeFootnotes( aRectFnSet.GetBottom(Frame()), false, + pBoss->RearrangeFootnotes( aRectFnSet.GetBottom(getSwFrame()), false, pFootnote->GetAttr() ); ValidateBodyFrame(); ValidateFrame(); @@ -197,9 +197,9 @@ static SwTwips lcl_GetFootnoteLower( const SwTextFrame* pFrame, SwTwips nLower ) SwTwips nMin = 0; if ( bDontSplit ) - nMin = aRectFnSet.GetBottom(pTabFrame->Frame()); + nMin = aRectFnSet.GetBottom(pTabFrame->getSwFrame()); else if ( !static_cast<const SwRowFrame*>(pRow)->IsRowSplitAllowed() ) - nMin = aRectFnSet.GetBottom(pRow->Frame()); + nMin = aRectFnSet.GetBottom(pRow->getSwFrame()); if ( nMin && aRectFnSet.YDiff( nMin, nLower ) > 0 ) nRet = nMin; @@ -266,7 +266,7 @@ SwTwips SwTextFrame::GetFootnoteLine( const SwTextFootnote *pFootnote ) const // the frame is currently locked. We return the previous value. return pThis->mnFootnoteLine > 0 ? pThis->mnFootnoteLine : - IsVertical() ? Frame().Left() : Frame().Bottom(); + IsVertical() ? getSwFrame().Left() : getSwFrame().Bottom(); } SwTwips nRet; @@ -317,7 +317,7 @@ SwTwips SwTextFrame::GetFootnoteFrameHeight_() const // Height within the Container which we're allowed to consume anyways SwRectFnSet aRectFnSet(pCont); SwTwips nTmp = aRectFnSet.YDiff( aRectFnSet.GetPrtBottom(*pCont), - aRectFnSet.GetTop(Frame()) ); + aRectFnSet.GetTop(getSwFrame()) ); #if OSL_DEBUG_LEVEL > 0 if( nTmp < 0 ) @@ -336,7 +336,7 @@ SwTwips SwTextFrame::GetFootnoteFrameHeight_() const } #endif - if ( aRectFnSet.YDiff( aRectFnSet.GetTop(pCont->Frame()), nHeight) > 0 ) + if ( aRectFnSet.YDiff( aRectFnSet.GetTop(pCont->getSwFrame()), 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.YDiff( aRectFnSet.GetTop(pCont->Frame()), nHeight); + nTmp += aRectFnSet.YDiff( aRectFnSet.GetTop(pCont->getSwFrame()), 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.YDiff( aRectFnSet.GetTop(pCont->Frame()), + long nDiff = aRectFnSet.YDiff( aRectFnSet.GetTop(pCont->getSwFrame()), nDeadLine ); if( nDiff >= 0 ) @@ -702,14 +702,14 @@ 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 = aRectFnSet.GetHeight(pCont->Frame()); + SwTwips nHeight = aRectFnSet.GetHeight(pCont->getSwFrame()); pBoss->RearrangeFootnotes( nDeadLine, false, pFootnote ); ValidateBodyFrame(); ValidateFrame(); SwViewShell *pSh = getRootFrame()->GetCurrShell(); - if ( pSh && nHeight == aRectFnSet.GetHeight(pCont->Frame()) ) + if ( pSh && nHeight == aRectFnSet.GetHeight(pCont->getSwFrame()) ) // So that we don't miss anything - pSh->InvalidateWindows( pCont->Frame() ); + pSh->InvalidateWindows( pCont->getSwFrame() ); } mbInFootnoteConnect = false; return; @@ -894,7 +894,7 @@ SwFootnotePortion *SwTextFormatter::NewFootnotePortion( SwTextFormatInfo &rInf, SwRectFnSet aRectFnSet(pFootnoteCont); const long nDiff = aRectFnSet.YDiff( - aRectFnSet.GetTop(pFootnoteCont->Frame()), + aRectFnSet.GetTop(pFootnoteCont->getSwFrame()), nTmpBot ); if( pScrFrame && nDiff < 0 ) diff --git a/sw/source/core/text/txtio.cxx b/sw/source/core/text/txtio.cxx index faa74738c6e9..94560f74ee27 100644 --- a/sw/source/core/text/txtio.cxx +++ b/sw/source/core/text/txtio.cxx @@ -316,9 +316,9 @@ SvStream &SwFlyCntPortion::operator<<( SvStream &rOs ) const //$ ostream CONSTCHAR( pText2, " {FRM:" ); rOs.WriteCharPtr(pText2); rOs.WriteCharPtr(" {FRM:"); - WriteSwRect(rOs, GetFlyFrame()->Frame()).WriteCharPtr(pClose); + WriteSwRect(rOs, GetFlyFrame()->getSwFrame()).WriteCharPtr(pClose); rOs.WriteCharPtr(" {PRT:"); - WriteSwRect(rOs, GetFlyFrame()->Prt()).WriteCharPtr(pClose); + WriteSwRect(rOs, GetFlyFrame()->getSwPrint()).WriteCharPtr(pClose); rOs.WriteCharPtr(pClose); } rOs.WriteCharPtr(pClose); diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx index 471ba1fedb59..e2dd2a7c4a0d 100644 --- a/sw/source/core/text/txttab.cxx +++ b/sw/source/core/text/txttab.cxx @@ -78,9 +78,9 @@ SwTabPortion *SwTextFormatter::NewTabPortion( SwTextFormatInfo &rInf, bool bAuto const bool bTabsRelativeToIndent = m_pFrame->GetTextNode()->getIDocumentSettingAccess()->get(DocumentSettingId::TABS_RELATIVE_TO_INDENT); const SwTwips nTabLeft = bRTL - ? m_pFrame->Frame().Right() - + ? m_pFrame->getSwFrame().Right() - ( bTabsRelativeToIndent ? GetTabLeft() : 0 ) - : m_pFrame->Frame().Left() + + : m_pFrame->getSwFrame().Left() + ( bTabsRelativeToIndent ? GetTabLeft() : 0 ); // The absolute position, where we started the line formatting @@ -112,7 +112,7 @@ SwTabPortion *SwTextFormatter::NewTabPortion( SwTextFormatInfo &rInf, bool bAuto if ( m_pFrame->IsVertical() ) { - Point aRightTop( nMyRight, m_pFrame->Frame().Top() ); + Point aRightTop( nMyRight, m_pFrame->getSwFrame().Top() ); m_pFrame->SwitchHorizontalToVertical( aRightTop ); nMyRight = aRightTop.Y(); } @@ -195,11 +195,11 @@ SwTabPortion *SwTextFormatter::NewTabPortion( SwTextFormatInfo &rInf, bool bAuto { Point aPoint( Left(), 0 ); m_pFrame->SwitchLTRtoRTL( aPoint ); - nLeftMarginTabPos = m_pFrame->Frame().Right() - aPoint.X(); + nLeftMarginTabPos = m_pFrame->getSwFrame().Right() - aPoint.X(); } else { - nLeftMarginTabPos = Left() - m_pFrame->Frame().Left(); + nLeftMarginTabPos = Left() - m_pFrame->getSwFrame().Left(); } } if( m_pCurr->HasForcedLeftMargin() ) @@ -393,7 +393,7 @@ bool SwTabPortion::PreFormat( SwTextFormatInfo &rInf ) bool bAtParaEnd = rInf.GetIdx() + GetLen() == rInf.GetText().getLength(); if ( bFull && bTabCompat && ( ( bTabOverflow && ( rInf.IsTabOverflow() || !bAutoTabStop ) ) || bAtParaEnd ) && - GetTabPos() >= rInf.GetTextFrame()->Frame().Width() ) + GetTabPos() >= rInf.GetTextFrame()->getSwFrame().Width() ) { bFull = false; if ( bTabOverflow && !bAutoTabStop ) diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx index 56f6b7bafc65..ce718735c6cd 100644 --- a/sw/source/core/text/widorp.cxx +++ b/sw/source/core/text/widorp.cxx @@ -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 += aRectFnSet.GetHeight(m_pFrame->Prt()) - - aRectFnSet.GetHeight(m_pFrame->Frame()); + m_nRstHeight += aRectFnSet.GetHeight(m_pFrame->getSwPrint()) - + aRectFnSet.GetHeight(m_pFrame->getSwFrame()); if( m_nRstHeight < 0 ) m_nRstHeight = 0; } @@ -382,10 +382,10 @@ bool WidowsAndOrphans::FindWidows( SwTextFrame *pFrame, SwTextMargin &rLine ) if ( aRectFnSet.IsVert() ) { nTmpY = pFrame->SwitchHorizontalToVertical( nTmpY ); - nOldHeight = -aRectFnSet.GetHeight(pFrame->Prt()); + nOldHeight = -aRectFnSet.GetHeight(pFrame->getSwPrint()); } else - nOldHeight = aRectFnSet.GetHeight(pFrame->Prt()); + nOldHeight = aRectFnSet.GetHeight(pFrame->getSwPrint()); const SwTwips nChg = aRectFnSet.YDiff( nTmpY, nDocPrtTop + nOldHeight ); @@ -404,7 +404,7 @@ bool WidowsAndOrphans::FindWidows( SwTextFrame *pFrame, SwTextMargin &rLine ) // multiple lines (e.g. via frames). if( !pMaster->IsLocked() && pMaster->GetUpper() ) { - const SwTwips nTmpRstHeight = aRectFnSet.BottomDist( pMaster->Frame(), + const SwTwips nTmpRstHeight = aRectFnSet.BottomDist( pMaster->getSwFrame(), aRectFnSet.GetPrtBottom(*pMaster->GetUpper()) ); if ( nTmpRstHeight >= SwTwips(rLine.GetInfo().GetParaPortion()->Height() ) ) @@ -427,7 +427,7 @@ bool WidowsAndOrphans::FindWidows( SwTextFrame *pFrame, SwTextMargin &rLine ) if( 0 > nChg && !pMaster->IsLocked() && pMaster->GetUpper() ) { - SwTwips nTmpRstHeight = aRectFnSet.BottomDist( pMaster->Frame(), + SwTwips nTmpRstHeight = aRectFnSet.BottomDist( pMaster->getSwFrame(), aRectFnSet.GetPrtBottom(*pMaster->GetUpper()) ); if( nTmpRstHeight >= SwTwips(rLine.GetInfo().GetParaPortion()->Height() ) ) { diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx index 0bf58ac02fba..84f87d621bbd 100644 --- a/sw/source/core/text/xmldump.cxx +++ b/sw/source/core/text/xmldump.cxx @@ -354,10 +354,10 @@ void SwFrame::dumpInfosAsXml( xmlTextWriterPtr writer ) const { // output the Frame xmlTextWriterStartElement( writer, BAD_CAST( "bounds" ) ); - xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "left" ), "%ld", Frame().Left() ); - xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "top" ), "%ld", Frame().Top() ); - xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "width" ), "%ld", Frame().Width() ); - xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "height" ), "%ld", Frame().Height() ); + xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "left" ), "%ld", getSwFrame().Left() ); + xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "top" ), "%ld", getSwFrame().Top() ); + xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "width" ), "%ld", getSwFrame().Width() ); + xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "height" ), "%ld", getSwFrame().Height() ); xmlTextWriterWriteAttribute(writer, BAD_CAST("mbFixSize"), BAD_CAST(OString::boolean(HasFixSize()).getStr())); xmlTextWriterWriteAttribute(writer, BAD_CAST("mbValidPos"), BAD_CAST(OString::boolean(GetValidPosFlag()).getStr())); xmlTextWriterWriteAttribute(writer, BAD_CAST("mbValidSize"), BAD_CAST(OString::boolean(GetValidSizeFlag()).getStr())); @@ -366,10 +366,10 @@ void SwFrame::dumpInfosAsXml( xmlTextWriterPtr writer ) const // output the Prt xmlTextWriterStartElement( writer, BAD_CAST( "prtBounds" ) ); - xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "left" ), "%ld", Prt().Left() ); - xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "top" ), "%ld", Prt().Top() ); - xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "width" ), "%ld", Prt().Width() ); - xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "height" ), "%ld", Prt().Height() ); + xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "left" ), "%ld", getSwPrint().Left() ); + xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "top" ), "%ld", getSwPrint().Top() ); + xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "width" ), "%ld", getSwPrint().Width() ); + xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "height" ), "%ld", getSwPrint().Height() ); xmlTextWriterEndElement( writer ); } diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index b663f5d836b1..a73201a56b1c 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -2242,7 +2242,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) if ( pTmpFrame ) { OSL_ENSURE( pTmpFrame->IsValid(), "frame not valid" ); - const SwRect &rRect = pTmpFrame->Frame(); + const SwRect &rRect = pTmpFrame->getSwFrame(); Size aMM100Size = OutputDevice::LogicToLogic( Size( rRect.Width(), rRect.Height() ), MapMode( MapUnit::MapTwip ), MapMode( MapUnit::Map100thMM )); diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx index e02246ec403d..13deda336df7 100644 --- a/sw/source/core/view/pagepreviewlayout.cxx +++ b/sw/source/core/view/pagepreviewlayout.cxx @@ -133,7 +133,7 @@ void SwPagePreviewLayout::CalcPreviewLayoutSizes() ++mnPages; pPage->Calc(pRenderContext); - const Size& rPageSize = pPage->Frame().SSize(); + const Size& rPageSize = pPage->getSwFrame().SSize(); if ( rPageSize.Width() > maMaxPageSize.Width() ) maMaxPageSize.Width() = rPageSize.Width(); if ( rPageSize.Height() > maMaxPageSize.Height() ) @@ -659,12 +659,12 @@ bool SwPagePreviewLayout::CalcPreviewDataForPage( const SwPageFrame& _rPage, if ( _rPage.IsEmptyPage() ) { if ( _rPage.GetPhyPageNum() % 2 == 0 ) - _opPreviewPage->aPageSize = _rPage.GetPrev()->Frame().SSize(); + _opPreviewPage->aPageSize = _rPage.GetPrev()->getSwFrame().SSize(); else - _opPreviewPage->aPageSize = _rPage.GetNext()->Frame().SSize(); + _opPreviewPage->aPageSize = _rPage.GetNext()->getSwFrame().SSize(); } else - _opPreviewPage->aPageSize = _rPage.Frame().SSize(); + _opPreviewPage->aPageSize = _rPage.getSwFrame().SSize(); // position of page in preview window Point aPreviewWinOffset( _rPreviewOffset ); if ( _opPreviewPage->aPageSize.Width() < maMaxPageSize.Width() ) @@ -680,7 +680,7 @@ bool SwPagePreviewLayout::CalcPreviewDataForPage( const SwPageFrame& _rPage, } else { - _opPreviewPage->aLogicPos = _rPage.Frame().Pos(); + _opPreviewPage->aLogicPos = _rPage.getSwFrame().Pos(); _opPreviewPage->aMapOffset = _opPreviewPage->aPreviewWinPos - _opPreviewPage->aLogicPos; } diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx index 2fca28b7a5fb..e1dfaa412065 100644 --- a/sw/source/core/view/vdraw.cxx +++ b/sw/source/core/view/vdraw.cxx @@ -142,7 +142,7 @@ void SwViewShellImp::PaintLayer( const SdrLayerID _nLayerID, rSdrView.setHideDraw( !pPrintData->IsPrintDraw() ); } basegfx::B2IRectangle const pageFrame( - vcl::unotools::b2IRectangleFromRectangle(rPageFrame.Frame().SVRect())); + vcl::unotools::b2IRectangleFromRectangle(rPageFrame.getSwFrame().SVRect())); GetPageView()->DrawLayer(_nLayerID, pOutDev, pRedirector, aPaintRect.SVRect(), &pageFrame); pOutDev->Pop(); @@ -180,7 +180,7 @@ bool SwViewShellImp::IsDragPossible( const Point &rPoint ) aRect.Union( aTmp ); } else - aRect = GetShell()->GetLayout()->Frame(); + aRect = GetShell()->GetLayout()->getSwFrame(); aRect.Top( aRect.Top() - FUZZY_EDGE ); aRect.Bottom( aRect.Bottom() + FUZZY_EDGE ); diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx index 5faefb389bc4..e43a60866869 100644 --- a/sw/source/core/view/viewimp.cxx +++ b/sw/source/core/view/viewimp.cxx @@ -53,8 +53,8 @@ void SwViewShellImp::Init( const SwViewOption *pNewOpt ) if ( !pRoot->GetDrawPage() ) pRoot->SetDrawPage( rIDDMA.GetDrawModel()->GetPage( 0 ) ); - if ( pRoot->GetDrawPage()->GetSize() != pRoot->Frame().SSize() ) - pRoot->GetDrawPage()->SetSize( pRoot->Frame().SSize() ); + if ( pRoot->GetDrawPage()->GetSize() != pRoot->getSwFrame().SSize() ) + pRoot->GetDrawPage()->SetSize( pRoot->getSwFrame().SSize() ); m_pSdrPageView = m_pDrawView->ShowSdrPage( pRoot->GetDrawPage()); // Notify drawing page view about invisible layers @@ -73,8 +73,8 @@ void SwViewShellImp::Init( const SwViewOption *pNewOpt ) Fraction aSnGrWdtY(rSz.Height(), pNewOpt->GetDivisionY() + 1); m_pDrawView->SetSnapGridWidth( aSnGrWdtX, aSnGrWdtY ); - if ( pRoot->Frame().HasArea() ) - m_pDrawView->SetWorkArea( pRoot->Frame().SVRect() ); + if ( pRoot->getSwFrame().HasArea() ) + m_pDrawView->SetWorkArea( pRoot->getSwFrame().SVRect() ); if ( GetShell()->IsPreview() ) m_pDrawView->SetAnimationEnabled( false ); @@ -136,7 +136,7 @@ bool SwViewShellImp::AddPaintRect( const SwRect &rRect ) { // In case of normal rendering, this makes sure only visible rectangles are painted. // Otherwise get the rectangle of the full document, so all paint rectangles are invalidated. - const SwRect& rArea = comphelper::LibreOfficeKit::isActive() ? m_pShell->GetLayout()->Frame() : m_pShell->VisArea(); + const SwRect& rArea = comphelper::LibreOfficeKit::isActive() ? m_pShell->GetLayout()->getSwFrame() : m_pShell->VisArea(); m_pRegion = new SwRegionRects( rArea ); } (*m_pRegion) -= rRect; @@ -168,7 +168,7 @@ bool SwViewShellImp::IsUpdateExpFields() void SwViewShellImp::SetFirstVisPage(OutputDevice const * pRenderContext) { - if ( m_pShell->mbDocSizeChgd && m_pShell->VisArea().Top() > m_pShell->GetLayout()->Frame().Height() ) + if ( m_pShell->mbDocSizeChgd && m_pShell->VisArea().Top() > m_pShell->GetLayout()->getSwFrame().Height() ) { //We are in an action and because of erase actions the VisArea is //after the first visible page. diff --git a/sw/source/core/view/viewpg.cxx b/sw/source/core/view/viewpg.cxx index 8178fbfb32c8..963aa1010dcb 100644 --- a/sw/source/core/view/viewpg.cxx +++ b/sw/source/core/view/viewpg.cxx @@ -123,13 +123,13 @@ void SwViewShell::PrintProspect( if ( pStPage->IsEmptyPage() ) { if ( pStPage->GetPhyPageNum() % 2 == 0 ) - aSttPageSize = pStPage->GetPrev()->Frame().SSize(); + aSttPageSize = pStPage->GetPrev()->getSwFrame().SSize(); else - aSttPageSize = pStPage->GetNext()->Frame().SSize(); + aSttPageSize = pStPage->GetNext()->getSwFrame().SSize(); } else { - aSttPageSize = pStPage->Frame().SSize(); + aSttPageSize = pStPage->getSwFrame().SSize(); } } Size aNxtPageSize; @@ -138,13 +138,13 @@ void SwViewShell::PrintProspect( if ( pNxtPage->IsEmptyPage() ) { if ( pNxtPage->GetPhyPageNum() % 2 == 0 ) - aNxtPageSize = pNxtPage->GetPrev()->Frame().SSize(); + aNxtPageSize = pNxtPage->GetPrev()->getSwFrame().SSize(); else - aNxtPageSize = pNxtPage->GetNext()->Frame().SSize(); + aNxtPageSize = pNxtPage->GetNext()->getSwFrame().SSize(); } else { - aNxtPageSize = pNxtPage->Frame().SSize(); + aNxtPageSize = pNxtPage->getSwFrame().SSize(); } } @@ -197,13 +197,13 @@ void SwViewShell::PrintProspect( if( pStPage ) { aShell.Imp()->SetFirstVisPageInvalid(); - aShell.maVisArea = pStPage->Frame(); + aShell.maVisArea = pStPage->getSwFrame(); Point aPos( aSttPt ); aPos -= aShell.maVisArea.Pos(); aMapMode.SetOrigin( aPos ); pPrinter->SetMapMode( aMapMode ); - pStPage->GetUpper()->Paint( *pOutDev, pStPage->Frame() ); + pStPage->GetUpper()->Paint( *pOutDev, pStPage->getSwFrame() ); } pStPage = pNxtPage; diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index a2f256d67234..2bf360a58445 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -561,7 +561,7 @@ const SwRect& SwViewShell::VisArea() const { // when using the tiled rendering, consider the entire document as our // visible area - return comphelper::LibreOfficeKit::isActive()? GetLayout()->Frame(): maVisArea; + return comphelper::LibreOfficeKit::isActive()? GetLayout()->getSwFrame(): maVisArea; } void SwViewShell::MakeVisible( const SwRect &rRect ) @@ -576,11 +576,11 @@ void SwViewShell::MakeVisible( const SwRect &rRect ) int nLoopCnt = 3; long nOldH; do{ - nOldH = pRoot->Frame().Height(); + nOldH = pRoot->getSwFrame().Height(); StartAction(); ScrollMDI( this, rRect, USHRT_MAX, USHRT_MAX ); EndAction(); - } while( nOldH != pRoot->Frame().Height() && nLoopCnt-- ); + } while( nOldH != pRoot->getSwFrame().Height() && nLoopCnt-- ); } #if OSL_DEBUG_LEVEL > 0 else @@ -1094,7 +1094,7 @@ void SwViewShell::VisPortChgd( const SwRect &rRect) // (PaintDesktop). Also limit the left and right side of // the scroll range to the pages. const SwPageFrame *pPage = static_cast<SwPageFrame*>(GetLayout()->Lower()); - if ( pPage->Frame().Top() > pOldPage->Frame().Top() ) + if ( pPage->getSwFrame().Top() > pOldPage->getSwFrame().Top() ) pPage = static_cast<const SwPageFrame*>(pOldPage); SwRect aBoth( VisArea() ); aBoth.Union( aPrevArea ); @@ -1104,7 +1104,7 @@ void SwViewShell::VisPortChgd( const SwRect &rRect) const bool bBookMode = GetViewOptions()->IsViewLayoutBookMode(); - while ( pPage && pPage->Frame().Top() <= nBottom ) + while ( pPage && pPage->getSwFrame().Top() <= nBottom ) { SwRect aPageRect( pPage->GetBoundRect(GetWin()) ); if ( bBookMode ) @@ -1462,12 +1462,12 @@ void SwViewShell::PaintDesktop(vcl::RenderContext& rRenderContext, const SwRect //as these are not painted at VisPortChgd. bool bBorderOnly = false; const SwRootFrame *pRoot = GetLayout(); - if ( rRect.Top() > pRoot->Frame().Bottom() ) + if ( rRect.Top() > pRoot->getSwFrame().Bottom() ) { const SwFrame *pPg = pRoot->Lower(); while ( pPg && pPg->GetNext() ) pPg = pPg->GetNext(); - if ( !pPg || !pPg->Frame().IsOver( VisArea() ) ) + if ( !pPg || !pPg->getSwFrame().IsOver( VisArea() ) ) bBorderOnly = true; } @@ -1487,10 +1487,10 @@ void SwViewShell::PaintDesktop(vcl::RenderContext& rRenderContext, const SwRect SwRect aLeft( rRect ), aRight( rRect ); while ( pPage ) { - long nTmp = pPage->Frame().Left(); + long nTmp = pPage->getSwFrame().Left(); if ( nTmp < aLeft.Right() ) aLeft.Right( nTmp ); - nTmp = pPage->Frame().Right(); + nTmp = pPage->getSwFrame().Right(); if ( nTmp > aRight.Left() ) { aRight.Left( nTmp + nSidebarWidth ); @@ -1508,13 +1508,13 @@ void SwViewShell::PaintDesktop(vcl::RenderContext& rRenderContext, const SwRect const SwFrame *pPage = Imp()->GetFirstVisPage(&rRenderContext); const SwTwips nBottom = rRect.Bottom(); while ( pPage && !aRegion.empty() && - (pPage->Frame().Top() <= nBottom) ) + (pPage->getSwFrame().Top() <= nBottom) ) { - SwRect aPageRect( pPage->Frame() ); + SwRect aPageRect( pPage->getSwFrame() ); if ( bBookMode ) { const SwPageFrame& rFormatPage = static_cast<const SwPageFrame*>(pPage)->GetFormatPage(); - aPageRect.SSize() = rFormatPage.Frame().SSize(); + aPageRect.SSize() = rFormatPage.getSwFrame().SSize(); } const bool bSidebarRight = @@ -1593,8 +1593,8 @@ bool SwViewShell::CheckInvalidForPaint( const SwRect &rRect ) const SwTwips nBottom = VisArea().Bottom(); const SwTwips nRight = VisArea().Right(); bool bRet = false; - while ( !bRet && pPage && !((pPage->Frame().Top() > nBottom) || - (pPage->Frame().Left() > nRight))) + while ( !bRet && pPage && !((pPage->getSwFrame().Top() > nBottom) || + (pPage->getSwFrame().Left() > nRight))) { if ( pPage->IsInvalid() || pPage->IsInvalidFly() ) bRet = true; @@ -1995,7 +1995,7 @@ void SwViewShell::InvalidateLayout( bool bSizeChanged ) // That leads to problems with Invalidate, e.g. when setting up an new View // the content is inserted and formatted (regardless of empty VisArea). // Therefore the pages must be roused for formatting. - if( !GetLayout()->Frame().Height() ) + if( !GetLayout()->getSwFrame().Height() ) { SwFrame* pPage = GetLayout()->Lower(); while( pPage ) @@ -2072,7 +2072,7 @@ Size SwViewShell::GetDocSize() const Size aSz; const SwRootFrame* pRoot = GetLayout(); if( pRoot ) - aSz = pRoot->Frame().SSize(); + aSz = pRoot->getSwFrame().SSize(); return aSz; } @@ -2488,7 +2488,7 @@ const Size SwViewShell::GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) if( !bSkipEmptyPages && pPage->IsEmptyPage() && pPage->GetNext() ) pPage = static_cast<const SwPageFrame*>( pPage->GetNext() ); - aSize = pPage->Frame().SSize(); + aSize = pPage->getSwFrame().SSize(); } return aSize; } @@ -2502,14 +2502,14 @@ sal_Int32 SwViewShell::GetPageNumAndSetOffsetForPDF( OutputDevice& rOut, const S // #i40059# Position out of bounds: SwRect aRect( rRect ); - aRect.Pos().X() = std::max( aRect.Left(), GetLayout()->Frame().Left() ); + aRect.Pos().X() = std::max( aRect.Left(), GetLayout()->getSwFrame().Left() ); const SwPageFrame* pPage = GetLayout()->GetPageAtPos( aRect.Center() ); if ( pPage ) { OSL_ENSURE( pPage, "GetPageNumAndSetOffsetForPDF: No page found" ); - Point aOffset( pPage->Frame().Pos() ); + Point aOffset( pPage->getSwFrame().Pos() ); aOffset.X() = -aOffset.X(); aOffset.Y() = -aOffset.Y(); diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx index f8f889ce98b2..dd086ddfddde 100644 --- a/sw/source/core/view/vprint.cxx +++ b/sw/source/core/view/vprint.cxx @@ -303,7 +303,7 @@ void SwViewShell::CalcPagesForPrint( sal_uInt16 nMax ) { pPage->Calc(GetOut()); SwRect aOldVis( VisArea() ); - maVisArea = pPage->Frame(); + maVisArea = pPage->getSwFrame(); Imp()->SetFirstVisPageInvalid(); aAction.Reset(); aAction.SetPaint( false ); @@ -524,13 +524,13 @@ bool SwViewShell::PrintOrPDFExport( //!! applying view options and formatting the document should now only be done in getRendererCount! - ::SetSwVisArea( pViewSh2, pStPage->Frame() ); + ::SetSwVisArea( pViewSh2, pStPage->getSwFrame() ); pShell->InitPrt(pOutDev); - ::SetSwVisArea( pViewSh2, pStPage->Frame() ); + ::SetSwVisArea( pViewSh2, pStPage->getSwFrame() ); - pStPage->GetUpper()->Paint( *pOutDev, pStPage->Frame(), &rPrintData ); + pStPage->GetUpper()->Paint( *pOutDev, pStPage->getSwFrame(), &rPrintData ); SwPaintQueue::Repaint(); @@ -553,7 +553,7 @@ bool SwViewShell::PrintOrPDFExport( //Now scale the recorded page down so the notes //will fit in the final page double fScale = 0.75; - long nOrigHeight = pStPage->Frame().Height(); + long nOrigHeight = pStPage->getSwFrame().Height(); long nNewHeight = nOrigHeight*fScale; long nShiftY = (nOrigHeight-nNewHeight)/2; pMetaFile->Scale( fScale, fScale ); diff --git a/sw/source/uibase/docvw/FrameControlsManager.cxx b/sw/source/uibase/docvw/FrameControlsManager.cxx index 3ffb9a96f532..074dba955823 100644 --- a/sw/source/uibase/docvw/FrameControlsManager.cxx +++ b/sw/source/uibase/docvw/FrameControlsManager.cxx @@ -126,7 +126,7 @@ void SwFrameControlsManager::SetHeaderFooterControl( const SwPageFrame* pPageFra pControl.swap( pNewControl ); } - tools::Rectangle aPageRect = m_pEditWin->LogicToPixel( pPageFrame->Frame().SVRect() ); + tools::Rectangle aPageRect = m_pEditWin->LogicToPixel( pPageFrame->getSwFrame().SVRect() ); SwHeaderFooterWin* pWin = dynamic_cast<SwHeaderFooterWin *>(pControl->GetWindow()); assert( pWin != nullptr) ; diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx index 7fa904801c19..93e6932f9a4c 100644 --- a/sw/source/uibase/docvw/PageBreakWin.cxx +++ b/sw/source/uibase/docvw/PageBreakWin.cxx @@ -336,16 +336,16 @@ void SwPageBreakWin::UpdatePosition( const Point* pEvtPt ) { pPrevPage = pPrevPage->GetPrev(); } - while ( pPrevPage && ( ( pPrevPage->Frame().Top( ) == pPageFrame->Frame().Top( ) ) + while ( pPrevPage && ( ( pPrevPage->getSwFrame().Top( ) == pPageFrame->getSwFrame().Top( ) ) || static_cast< const SwPageFrame* >( pPrevPage )->IsEmptyPage( ) ) ); ::tools::Rectangle aBoundRect = GetEditWin()->LogicToPixel( pPageFrame->GetBoundRect(GetEditWin()).SVRect() ); - ::tools::Rectangle aFrameRect = GetEditWin()->LogicToPixel( pPageFrame->Frame().SVRect() ); + ::tools::Rectangle aFrameRect = GetEditWin()->LogicToPixel( pPageFrame->getSwFrame().SVRect() ); long nYLineOffset = ( aBoundRect.Top() + aFrameRect.Top() ) / 2; if ( pPrevPage ) { - ::tools::Rectangle aPrevFrameRect = GetEditWin()->LogicToPixel( pPrevPage->Frame().SVRect() ); + ::tools::Rectangle aPrevFrameRect = GetEditWin()->LogicToPixel( pPrevPage->getSwFrame().SVRect() ); nYLineOffset = ( aPrevFrameRect.Bottom() + aFrameRect.Top() ) / 2; } diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index cdff7acc2018..538e608853cf 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -230,7 +230,7 @@ static SwPrintUIOptions * lcl_GetPrintUIOptions( const SwPageFrame *pPage = dynamic_cast<const SwPageFrame*>(pFrame->Lower()); while (pPage && nMax-- > 0) { - if (pPage->Frame().Height() == 0) + if (pPage->getSwFrame().Height() == 0) nCurrentPage--; pPage = static_cast<const SwPageFrame*>(pPage->GetNext()); } |