Logo Search packages:      
Sourcecode: libpodofo version File versions  Download package

bool PoDoFo::PdfTable::CheckForNewPage ( double *  pdY,
double *  pdCurY,
double  dRowHeight,
PdfPainter pPainter 
) [protected]

Checks if there is enough space on the current page for one row! If necessary a new page is created.

If GetAutoPageBreak is false, this method does nothing.

Parameters:
pdYtop of the table
pdCurYpointer to the current y position on the page. Might be reset to a new y position.
dRowHeightheight of the next row.
pPainterpainter used for drawing
Returns:
true if a new page was created, otherwise false

Definition at line 394 of file PdfTable.cpp.

References PoDoFo::PdfRect::GetBottom(), PoDoFo::PdfPainter::Restore(), PoDoFo::PdfPainter::Save(), and PoDoFo::PdfPainter::SetPage().

Referenced by Draw().

{
    if( !m_bAutoPageBreak )
        return false;

    if( (*pdY - *pdCurY) - dRowHeight < m_curClipRect.GetBottom() )
    {
        pPainter->Restore();

        PdfPage* pPage = (*m_fpCallback)( m_curClipRect, m_pCustomData );
        pPainter->SetPage( pPage );
        pPainter->Save();

        *pdY    = m_curClipRect.GetBottom() + m_curClipRect.GetHeight();
        *pdCurY = 0.0;

        return true;
    }

    return false;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index