LibreOffice Module sw (master)  1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SwLayHelper Class Reference

Helps during the InsertCnt_ function to create new pages. More...

#include <layhelp.hxx>

Collaboration diagram for SwLayHelper:
[legend]

Public Member Functions

 SwLayHelper (SwDoc *pD, SwFrame *&rpF, SwFrame *&rpP, SwPageFrame *&rpPg, SwLayoutFrame *&rpL, std::unique_ptr< SwActualSection > &rpA, sal_uLong nNodeIndex, bool bCache)
 helper class, which utilizes the layout cache information to distribute the document content to the right pages. More...
 
 ~SwLayHelper ()
 
sal_uLong CalcPageCount ()
 Does NOT really calculate the page count, it returns the page count value from the layout cache, if available, otherwise it estimates the page count. More...
 
bool CheckInsert (sal_uLong nNodeIndex)
 entry point for the InsertCnt_-function. More...
 
bool CheckInsertPage ()
 inserts a page and return true, if More...
 
void CheckFlyCache (SwPageFrame *pPage)
 Look for fresh text frames at this (new) page and set them to the right position, if they are in the fly cache. More...
 

Private Member Functions

void CheckFlyCache_ (SwPageFrame *pPage)
 If a new page is inserted, the last page is analysed. More...
 

Private Attributes

SwFrame *& mrpFrame
 
SwFrame *& mrpPrv
 
SwPageFrame *& mrpPage
 
SwLayoutFrame *& mrpLay
 
std::unique_ptr< SwActualSection > & mrpActualSection
 
bool mbBreakAfter
 
SwDocmpDoc
 
SwLayCacheImplmpImpl
 
sal_uLong mnMaxParaPerPage
 
sal_uLong mnParagraphCnt
 
sal_uLong mnStartOfContent
 
size_t mnIndex
 the index in the page break array More...
 
size_t mnFlyIdx
 the index in the fly cache array More...
 
bool mbFirst: 1
 

Detailed Description

Helps during the InsertCnt_ function to create new pages.

If there's a layout cache available, this information is used.

Definition at line 102 of file layhelp.hxx.

Constructor & Destructor Documentation

SwLayHelper::SwLayHelper ( SwDoc pD,
SwFrame *&  rpF,
SwFrame *&  rpP,
SwPageFrame *&  rpPg,
SwLayoutFrame *&  rpL,
std::unique_ptr< SwActualSection > &  rpA,
sal_uLong  nNodeIndex,
bool  bCache 
)

helper class, which utilizes the layout cache information to distribute the document content to the right pages.

It's used by the InsertCnt_(..)-function. If there's no layout cache, the distribution to the pages is more a guess, but a guess with statistical background.

Definition at line 519 of file laycache.cxx.

References SwNodes::GetEndOfContent(), SwNode::GetIndex(), SwDoc::GetLayoutCache(), SwDoc::GetNodes(), SwLayoutCache::LockImpl(), mnIndex, mnMaxParaPerPage, mnStartOfContent, mpDoc, mpImpl, SwNode::StartOfSectionNode(), SwLayoutCache::UnlockImpl(), and USHRT_MAX.

SwLayHelper::~SwLayHelper ( )

Definition at line 559 of file laycache.cxx.

References SwDoc::GetLayoutCache(), mpDoc, mpImpl, and SwLayoutCache::UnlockImpl().

Member Function Documentation

sal_uLong SwLayHelper::CalcPageCount ( )
void SwLayHelper::CheckFlyCache ( SwPageFrame pPage)
inline

Look for fresh text frames at this (new) page and set them to the right position, if they are in the fly cache.

Definition at line 131 of file layhelp.hxx.

References CheckFlyCache_().

void SwLayHelper::CheckFlyCache_ ( SwPageFrame pPage)
private

If a new page is inserted, the last page is analysed.

If there are text frames with default position, the fly cache is checked, if these frames are stored in the cache.

Definition at line 968 of file laycache.cxx.

References FAR_AWAY, SwLayCacheImpl::GetFlyCache(), SwLayCacheImpl::GetFlyCount(), SwFrameAreaDefinition::getFrameArea(), SwPageFrame::GetPhyPageNum(), SwPageFrame::GetSortedObjs(), GetUserCall(), SwRect::Height(), SwLayCacheImpl::IsUseFlyCache(), SwRect::Left(), mnFlyIdx, mpImpl, SwFlyCache::nPageNum, nPgNum, SwRect::Pos(), SwRect::Top(), and SwRect::Width().

Referenced by CheckFlyCache(), and CheckInsert().

bool SwLayHelper::CheckInsert ( sal_uLong  nNodeIndex)
bool SwLayHelper::CheckInsertPage ( )

inserts a page and return true, if

  • the break after flag is set
  • the actual content wants a break before
  • the maximum count of paragraph/rows is reached

The break after flag is set, if the actual content wants a break after.

Definition at line 634 of file laycache.cxx.

References SwFlowFrame::CastFlowFrame(), SwFootnoteBossFrame::FindBodyCont(), SvxFormatBreakItem::GetBreak(), SwFrame::GetBreakItem(), SwPageDesc::GetFollow(), SwFrame::GetNext(), SwFormatPageDesc::GetNumOffset(), SwFormatPageDesc::GetPageDesc(), SwPageFrame::GetPageDesc(), SwFrame::GetPageDescItem(), SwFrame::GetUpper(), InsertNewPage(), SwFrame::IsFlowFrame(), SwFlowFrame::IsFollow(), SwLayoutFrame::Lower(), mbBreakAfter, mnMaxParaPerPage, mnParagraphCnt, mrpFrame, mrpLay, mrpPage, and SwFrame::OnRightPage().

Referenced by CheckInsert().

Member Data Documentation

bool SwLayHelper::mbBreakAfter
private

Definition at line 109 of file layhelp.hxx.

Referenced by CheckInsert(), and CheckInsertPage().

bool SwLayHelper::mbFirst
private

Definition at line 117 of file layhelp.hxx.

Referenced by CheckInsert().

size_t SwLayHelper::mnFlyIdx
private

the index in the fly cache array

Definition at line 116 of file layhelp.hxx.

Referenced by CheckFlyCache_().

size_t SwLayHelper::mnIndex
private

the index in the page break array

Definition at line 115 of file layhelp.hxx.

Referenced by CheckInsert(), and SwLayHelper().

sal_uLong SwLayHelper::mnMaxParaPerPage
private

Definition at line 112 of file layhelp.hxx.

Referenced by CalcPageCount(), CheckInsert(), CheckInsertPage(), and SwLayHelper().

sal_uLong SwLayHelper::mnParagraphCnt
private

Definition at line 113 of file layhelp.hxx.

Referenced by CheckInsert(), and CheckInsertPage().

sal_uLong SwLayHelper::mnStartOfContent
private

Definition at line 114 of file layhelp.hxx.

Referenced by CheckInsert(), and SwLayHelper().

SwDoc* SwLayHelper::mpDoc
private

Definition at line 110 of file layhelp.hxx.

Referenced by CalcPageCount(), SwLayHelper(), and ~SwLayHelper().

SwLayCacheImpl* SwLayHelper::mpImpl
private

Definition at line 111 of file layhelp.hxx.

Referenced by CheckFlyCache_(), CheckInsert(), SwLayHelper(), and ~SwLayHelper().

std::unique_ptr<SwActualSection>& SwLayHelper::mrpActualSection
private

Definition at line 108 of file layhelp.hxx.

Referenced by CheckInsert().

SwFrame* & SwLayHelper::mrpFrame
private

Definition at line 104 of file layhelp.hxx.

Referenced by CheckInsert(), and CheckInsertPage().

SwLayoutFrame* & SwLayHelper::mrpLay
private

Definition at line 107 of file layhelp.hxx.

Referenced by CalcPageCount(), CheckInsert(), and CheckInsertPage().

SwPageFrame* & SwLayHelper::mrpPage
private

Definition at line 106 of file layhelp.hxx.

Referenced by CheckInsert(), and CheckInsertPage().

SwFrame* & SwLayHelper::mrpPrv
private

Definition at line 105 of file layhelp.hxx.

Referenced by CheckInsert().


The documentation for this class was generated from the following files: