#include <fb_LineBreaker.h>
Public Member Functions | |
fb_LineBreaker () | |
virtual | ~fb_LineBreaker (void) |
UT_sint32 | breakParagraph (fl_BlockLayout *, fp_Line *pLineToStartAt, fp_Page *pPage) |
Protected Member Functions | |
void | _breakTheLineAtLastRunToKeep (fp_Line *pLine, fl_BlockLayout *pBlock, fp_Page *pPage) |
UT_sint32 | _moveBackToFirstNonBlankData (fp_Run *pCurrentRun, fp_Run **pOffendingRun) |
bool | _splitAtOrBeforeThisRun (fp_Run *pCurrentRun, UT_sint32 iTrailSpace) |
bool | _splitAtNextNonBlank (fp_Run *pCurrentRun) |
void | _splitRunAt (fp_Run *pCurrentRun, fp_RunSplitInfo &splitInfo) |
Private Attributes | |
fp_Run * | m_pFirstRunToKeep |
fp_Run * | m_pLastRunToKeep |
UT_sint32 | m_iMaxLineWidth |
UT_sint32 | m_iWorkingLineWidth |
fb_LineBreaker::fb_LineBreaker | ( | ) |
References xxx_UT_DEBUGMSG.
fb_LineBreaker::~fb_LineBreaker | ( | void | ) | [virtual] |
References xxx_UT_DEBUGMSG.
void fb_LineBreaker::_breakTheLineAtLastRunToKeep | ( | fp_Line * | pLine, | |
fl_BlockLayout * | pBlock, | |||
fp_Page * | pPage | |||
) | [protected] |
References fp_Line::addRun(), fp_Line::assertLineListIntegrity(), fp_Run::getBlockOffset(), fp_ContainerObject::getContainerType(), fp_Line::getHeight(), fl_ContainerLayout::getLastContainer(), fp_Line::getLastRun(), fp_Run::getLength(), fp_Run::getLine(), fp_Line::getMaxWidth(), fl_BlockLayout::getNewContainer(), fp_Container::getNext(), fp_Run::getNextRun(), fl_BlockLayout::getNextWrappedLine(), fp_Line::getNumRunsInLine(), fp_Run::getPrevRun(), fp_Run::getType(), fp_Run::getWidth(), fp_Line::getX(), fp_Line::insertRun(), m_iMaxLineWidth, m_pFirstRunToKeep, m_pLastRunToKeep, fp_Line::recalcHeight(), fp_Line::removeRun(), fl_ContainerLayout::setLastContainer(), fp_Run::setLine(), UT_ASSERT, UT_return_if_fail, and xxx_UT_DEBUGMSG.
Referenced by breakParagraph().
UT_sint32 fb_LineBreaker::_moveBackToFirstNonBlankData | ( | fp_Run * | pCurrentRun, | |
fp_Run ** | pOffendingRun | |||
) | [protected] |
References fp_Run::doesContainNonBlankData(), fp_Run::findTrailingSpaceDistance(), fp_Run::getPrevRun(), fp_Run::getWidth(), and xxx_UT_DEBUGMSG.
Referenced by breakParagraph().
bool fb_LineBreaker::_splitAtNextNonBlank | ( | fp_Run * | pCurrentRun | ) | [protected] |
References _splitRunAt(), fp_Run::findFirstNonBlankSplitPoint(), fp_Run::getPrevRun(), fp_RunSplitInfo::iLeftWidth, fp_RunSplitInfo::iOffset, m_pLastRunToKeep, and xxx_UT_DEBUGMSG.
Referenced by breakParagraph().
bool fb_LineBreaker::_splitAtOrBeforeThisRun | ( | fp_Run * | pCurrentRun, | |
UT_sint32 | iTrailSpace | |||
) | [protected] |
References _splitRunAt(), fp_Run::canBreakAfter(), fp_Run::findMaxLeftFitSplitPoint(), fp_Run::getPrevRun(), fp_Run::getType(), fp_Run::getWidth(), fp_RunSplitInfo::iLeftWidth, m_iMaxLineWidth, m_iWorkingLineWidth, m_pFirstRunToKeep, m_pLastRunToKeep, UT_ASSERT, and xxx_UT_DEBUGMSG.
Referenced by breakParagraph().
void fb_LineBreaker::_splitRunAt | ( | fp_Run * | pCurrentRun, | |
fp_RunSplitInfo & | splitInfo | |||
) | [protected] |
References fp_Run::getType(), fp_RunSplitInfo::iOffset, m_pLastRunToKeep, and UT_ASSERT.
Referenced by _splitAtNextNonBlank(), and _splitAtOrBeforeThisRun().
UT_sint32 fb_LineBreaker::breakParagraph | ( | fl_BlockLayout * | pBlock, | |
fp_Line * | pLineToStartAt, | |||
fp_Page * | pPage | |||
) |
Break paragraph of text into lines
pBlock | Paragraph (block) of text |
LineBreaker shouldn't break a line until it finds a non-blank item past the end of the line. All trailing spaces should remain on the end of the line.
References _breakTheLineAtLastRunToKeep(), _moveBackToFirstNonBlankData(), fl_BlockLayout::_removeLine(), _splitAtNextNonBlank(), _splitAtOrBeforeThisRun(), fp_Line::addRun(), fp_Line::assertLineListIntegrity(), fp_Line::calculateWidthOfRun(), fp_Line::clearScreen(), fp_Line::coalesceRuns(), fp_Line::countRuns(), fp_Run::doesContainNonBlankData(), FPRUN_BOOKMARK, FPRUN_DIRECTIONMARKER, FPRUN_DUMMY, FPRUN_EMBED, FPRUN_ENDOFPARAGRAPH, FPRUN_FIELD, FPRUN_FIELDENDRUN, FPRUN_FIELDSTARTRUN, FPRUN_FMTMARK, FPRUN_FORCEDCOLUMNBREAK, FPRUN_FORCEDLINEBREAK, FPRUN_FORCEDPAGEBREAK, FPRUN_HYPERLINK, FPRUN_IMAGE, FPRUN_MATH, FPRUN_TAB, FPRUN_TEXT, fl_BlockLayout::getAlignment(), fp_Line::getAvailableWidth(), fp_Line::getFilledWidth(), fl_ContainerLayout::getFirstContainer(), fp_Line::getFirstRun(), fp_Line::getLastRun(), fp_Line::getLeftThick(), fp_Run::getLine(), fp_Container::getNext(), fp_Run::getNextRun(), fp_Run::getPrevRun(), fp_Run::getType(), fb_Alignment::getType(), fp_Run::getWidth(), fp_Line::getWorkingDirectionAndTabstops(), fp_Line::layout(), m_iMaxLineWidth, m_iWorkingLineWidth, m_pFirstRunToKeep, m_pLastRunToKeep, fp_Line::removeRun(), fp_Line::resetJustification(), UT_ASSERT, UT_ASSERT_HARMLESS, UT_SHOULD_NOT_HAPPEN, and xxx_UT_DEBUGMSG.
Referenced by fl_BlockLayout::format(), and fl_BlockLayout::formatWrappedFromHere().
UT_sint32 fb_LineBreaker::m_iMaxLineWidth [private] |
Referenced by _breakTheLineAtLastRunToKeep(), _splitAtOrBeforeThisRun(), and breakParagraph().
UT_sint32 fb_LineBreaker::m_iWorkingLineWidth [private] |
Referenced by _splitAtOrBeforeThisRun(), and breakParagraph().
fp_Run* fb_LineBreaker::m_pFirstRunToKeep [private] |
Referenced by _breakTheLineAtLastRunToKeep(), _splitAtOrBeforeThisRun(), and breakParagraph().
fp_Run* fb_LineBreaker::m_pLastRunToKeep [private] |
Referenced by _breakTheLineAtLastRunToKeep(), _splitAtNextNonBlank(), _splitAtOrBeforeThisRun(), _splitRunAt(), and breakParagraph().