summaryrefslogtreecommitdiff
path: root/sw/source/core/view
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2017-10-30 21:30:32 +0100
committerArmin Le Grand <Armin.Le.Grand@cib.de>2017-10-31 10:41:43 +0100
commitf55a9b77b8bfe6fc5e0fbceb0c89aed66660e107 (patch)
tree4ab09c0b426c702fccbded3eb58848d2e0622015 /sw/source/core/view
parent420452e56c2f18b85e6a59dbba80c06d96e28abd (diff)
RotateFlyFrame2: Unified FrameAreaDefinition
Isolated all Frame AreaDefinition and it's layout flags to SwFrameAreaDefinition class which is now base for SwFrame. Adapted calls to get/set and WriteAccess hekper classes accordingly. This allows much deeper understanding what Writer is doing when layouting it's frames and needed when reaction on such changes is necessary Change-Id: I96220a1d140e69c76cc63023aae26e4ed17f3504
Diffstat (limited to 'sw/source/core/view')
-rw-r--r--sw/source/core/view/pagepreviewlayout.cxx10
-rw-r--r--sw/source/core/view/vdraw.cxx6
-rw-r--r--sw/source/core/view/viewimp.cxx12
-rw-r--r--sw/source/core/view/viewpg.cxx16
-rw-r--r--sw/source/core/view/viewsh.cxx38
-rw-r--r--sw/source/core/view/vprint.cxx10
6 files changed, 46 insertions, 46 deletions
diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx
index 13deda336df7..e7de84de66b9 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->getSwFrame().SSize();
+ const Size& rPageSize = pPage->getFrameArea().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()->getSwFrame().SSize();
+ _opPreviewPage->aPageSize = _rPage.GetPrev()->getFrameArea().SSize();
else
- _opPreviewPage->aPageSize = _rPage.GetNext()->getSwFrame().SSize();
+ _opPreviewPage->aPageSize = _rPage.GetNext()->getFrameArea().SSize();
}
else
- _opPreviewPage->aPageSize = _rPage.getSwFrame().SSize();
+ _opPreviewPage->aPageSize = _rPage.getFrameArea().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.getSwFrame().Pos();
+ _opPreviewPage->aLogicPos = _rPage.getFrameArea().Pos();
_opPreviewPage->aMapOffset = _opPreviewPage->aPreviewWinPos - _opPreviewPage->aLogicPos;
}
diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx
index e1dfaa412065..ac30002f3639 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.getSwFrame().SVRect()));
+ vcl::unotools::b2IRectangleFromRectangle(rPageFrame.getFrameArea().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()->getSwFrame();
+ aRect = GetShell()->GetLayout()->getFrameArea();
aRect.Top( aRect.Top() - FUZZY_EDGE );
aRect.Bottom( aRect.Bottom() + FUZZY_EDGE );
@@ -227,7 +227,7 @@ void SwViewShellImp::NotifySizeChg( const Size &rNewSz )
continue;
const SwFrame *pAnchor = static_cast<const SwDrawContact*>(pCont)->GetAnchorFrame();
- if ( !pAnchor || pAnchor->IsInFly() || !pAnchor->IsValid() ||
+ if ( !pAnchor || pAnchor->IsInFly() || !pAnchor->isFrameAreaDefinitionValid() ||
!pAnchor->GetUpper() || !pAnchor->FindPageFrame() ||
(RndStdIds::FLY_AS_CHAR == pCont->GetFormat()->GetAnchor().GetAnchorId()) )
{
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index e43a60866869..40887178d8bd 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->getSwFrame().SSize() )
- pRoot->GetDrawPage()->SetSize( pRoot->getSwFrame().SSize() );
+ if ( pRoot->GetDrawPage()->GetSize() != pRoot->getFrameArea().SSize() )
+ pRoot->GetDrawPage()->SetSize( pRoot->getFrameArea().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->getSwFrame().HasArea() )
- m_pDrawView->SetWorkArea( pRoot->getSwFrame().SVRect() );
+ if ( pRoot->getFrameArea().HasArea() )
+ m_pDrawView->SetWorkArea( pRoot->getFrameArea().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()->getSwFrame() : m_pShell->VisArea();
+ const SwRect& rArea = comphelper::LibreOfficeKit::isActive() ? m_pShell->GetLayout()->getFrameArea() : 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()->getSwFrame().Height() )
+ if ( m_pShell->mbDocSizeChgd && m_pShell->VisArea().Top() > m_pShell->GetLayout()->getFrameArea().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 963aa1010dcb..21c2767b4190 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()->getSwFrame().SSize();
+ aSttPageSize = pStPage->GetPrev()->getFrameArea().SSize();
else
- aSttPageSize = pStPage->GetNext()->getSwFrame().SSize();
+ aSttPageSize = pStPage->GetNext()->getFrameArea().SSize();
}
else
{
- aSttPageSize = pStPage->getSwFrame().SSize();
+ aSttPageSize = pStPage->getFrameArea().SSize();
}
}
Size aNxtPageSize;
@@ -138,13 +138,13 @@ void SwViewShell::PrintProspect(
if ( pNxtPage->IsEmptyPage() )
{
if ( pNxtPage->GetPhyPageNum() % 2 == 0 )
- aNxtPageSize = pNxtPage->GetPrev()->getSwFrame().SSize();
+ aNxtPageSize = pNxtPage->GetPrev()->getFrameArea().SSize();
else
- aNxtPageSize = pNxtPage->GetNext()->getSwFrame().SSize();
+ aNxtPageSize = pNxtPage->GetNext()->getFrameArea().SSize();
}
else
{
- aNxtPageSize = pNxtPage->getSwFrame().SSize();
+ aNxtPageSize = pNxtPage->getFrameArea().SSize();
}
}
@@ -197,13 +197,13 @@ void SwViewShell::PrintProspect(
if( pStPage )
{
aShell.Imp()->SetFirstVisPageInvalid();
- aShell.maVisArea = pStPage->getSwFrame();
+ aShell.maVisArea = pStPage->getFrameArea();
Point aPos( aSttPt );
aPos -= aShell.maVisArea.Pos();
aMapMode.SetOrigin( aPos );
pPrinter->SetMapMode( aMapMode );
- pStPage->GetUpper()->Paint( *pOutDev, pStPage->getSwFrame() );
+ pStPage->GetUpper()->Paint( *pOutDev, pStPage->getFrameArea() );
}
pStPage = pNxtPage;
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 2bf360a58445..bda9c9856542 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()->getSwFrame(): maVisArea;
+ return comphelper::LibreOfficeKit::isActive()? GetLayout()->getFrameArea(): 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->getSwFrame().Height();
+ nOldH = pRoot->getFrameArea().Height();
StartAction();
ScrollMDI( this, rRect, USHRT_MAX, USHRT_MAX );
EndAction();
- } while( nOldH != pRoot->getSwFrame().Height() && nLoopCnt-- );
+ } while( nOldH != pRoot->getFrameArea().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->getSwFrame().Top() > pOldPage->getSwFrame().Top() )
+ if ( pPage->getFrameArea().Top() > pOldPage->getFrameArea().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->getSwFrame().Top() <= nBottom )
+ while ( pPage && pPage->getFrameArea().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->getSwFrame().Bottom() )
+ if ( rRect.Top() > pRoot->getFrameArea().Bottom() )
{
const SwFrame *pPg = pRoot->Lower();
while ( pPg && pPg->GetNext() )
pPg = pPg->GetNext();
- if ( !pPg || !pPg->getSwFrame().IsOver( VisArea() ) )
+ if ( !pPg || !pPg->getFrameArea().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->getSwFrame().Left();
+ long nTmp = pPage->getFrameArea().Left();
if ( nTmp < aLeft.Right() )
aLeft.Right( nTmp );
- nTmp = pPage->getSwFrame().Right();
+ nTmp = pPage->getFrameArea().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->getSwFrame().Top() <= nBottom) )
+ (pPage->getFrameArea().Top() <= nBottom) )
{
- SwRect aPageRect( pPage->getSwFrame() );
+ SwRect aPageRect( pPage->getFrameArea() );
if ( bBookMode )
{
const SwPageFrame& rFormatPage = static_cast<const SwPageFrame*>(pPage)->GetFormatPage();
- aPageRect.SSize() = rFormatPage.getSwFrame().SSize();
+ aPageRect.SSize() = rFormatPage.getFrameArea().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->getSwFrame().Top() > nBottom) ||
- (pPage->getSwFrame().Left() > nRight)))
+ while ( !bRet && pPage && !((pPage->getFrameArea().Top() > nBottom) ||
+ (pPage->getFrameArea().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()->getSwFrame().Height() )
+ if( !GetLayout()->getFrameArea().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->getSwFrame().SSize();
+ aSz = pRoot->getFrameArea().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->getSwFrame().SSize();
+ aSize = pPage->getFrameArea().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()->getSwFrame().Left() );
+ aRect.Pos().X() = std::max( aRect.Left(), GetLayout()->getFrameArea().Left() );
const SwPageFrame* pPage = GetLayout()->GetPageAtPos( aRect.Center() );
if ( pPage )
{
OSL_ENSURE( pPage, "GetPageNumAndSetOffsetForPDF: No page found" );
- Point aOffset( pPage->getSwFrame().Pos() );
+ Point aOffset( pPage->getFrameArea().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 dd086ddfddde..f88e26532356 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->getSwFrame();
+ maVisArea = pPage->getFrameArea();
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->getSwFrame() );
+ ::SetSwVisArea( pViewSh2, pStPage->getFrameArea() );
pShell->InitPrt(pOutDev);
- ::SetSwVisArea( pViewSh2, pStPage->getSwFrame() );
+ ::SetSwVisArea( pViewSh2, pStPage->getFrameArea() );
- pStPage->GetUpper()->Paint( *pOutDev, pStPage->getSwFrame(), &rPrintData );
+ pStPage->GetUpper()->Paint( *pOutDev, pStPage->getFrameArea(), &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->getSwFrame().Height();
+ long nOrigHeight = pStPage->getFrameArea().Height();
long nNewHeight = nOrigHeight*fScale;
long nShiftY = (nOrigHeight-nNewHeight)/2;
pMetaFile->Scale( fScale, fScale );