void fp_EndnoteContainer::layout(void) { _setMaxContainerHeight(0); UT_sint32 iY = 0, iPrevY = 0; iY= 0; UT_uint32 iCountContainers = countCons(); fp_Container *pContainer, *pPrevContainer = NULL; for (UT_uint32 i=0; i < iCountContainers; i++) { pContainer = static_cast<fp_Container*>(getNthCon(i)); // // This is to speedup redraws. // if(pContainer->getHeight() > _getMaxContainerHeight()) _setMaxContainerHeight(pContainer->getHeight()); if(pContainer->getY() != iY) { pContainer->clearScreen(); } pContainer->setY(iY); UT_sint32 iContainerHeight = pContainer->getHeight(); UT_sint32 iContainerMarginAfter = pContainer->getMarginAfter(); if (pPrevContainer) { pPrevContainer->setAssignedScreenHeight(iY - iPrevY); } iPrevY = iY; iY += iContainerHeight; iY += iContainerMarginAfter; pPrevContainer = pContainer; } // Correct height position of the last line if (pPrevContainer) { pPrevContainer->setAssignedScreenHeight(iY - iPrevY + 1); } UT_sint32 iNewHeight = iY; if (getHeight() == iNewHeight) { return; } setHeight(iNewHeight); fl_EndnoteLayout * pEL = static_cast<fl_EndnoteLayout *>(getSectionLayout()); FL_DocLayout * pDL = pEL->getDocLayout(); fl_DocSectionLayout * pDSL = pDL->getDocSecForEndnote(this); fp_Page * pPage = getPage(); pDSL->setNeedsSectionBreak(true,pPage); }
void fp_TOCContainer::layout(void) { _setMaxContainerHeight(0); UT_sint32 iY = 0, iPrevY = 0; iY= 0; UT_uint32 iCountContainers = countCons(); fp_Container *pContainer, *pPrevContainer = NULL; for (UT_uint32 i=0; i < iCountContainers; i++) { pContainer = static_cast<fp_Container*>(getNthCon(i)); // // This is to speedup redraws. // if(pContainer->getHeight() > _getMaxContainerHeight()) _setMaxContainerHeight(pContainer->getHeight()); if(pContainer->getY() != iY) { pContainer->clearScreen(); } pContainer->setY(iY); UT_sint32 iContainerHeight = pContainer->getHeight(); UT_sint32 iContainerMarginAfter = pContainer->getMarginAfter(); iY += iContainerHeight; iY += iContainerMarginAfter; //iY += 0.5; if (pPrevContainer) { pPrevContainer->setAssignedScreenHeight(iY - iPrevY); } pPrevContainer = pContainer; iPrevY = iY; } // Correct height position of the last line if (pPrevContainer) { pPrevContainer->setAssignedScreenHeight(iY - iPrevY + 1); } if (fp_VerticalContainer::getHeight() == iY) { return; } UT_DEBUGMSG(("Height in TOCContainer set to %d Old Height %d \n",iY,getHeight())); setHeight(iY); deleteBrokenTOCs(true); }
void fp_AnnotationContainer::layout(void) { _setMaxContainerHeight(0); UT_sint32 iY = 0, iPrevY = 0; iY= 0; fl_DocSectionLayout * pDSL = getDocSectionLayout(); UT_sint32 iMaxFootHeight = 0; iMaxFootHeight = pDSL->getActualColumnHeight(); iMaxFootHeight -= getGraphics()->tlu(20)*3; UT_uint32 iCountContainers = countCons(); fp_Container *pContainer, *pPrevContainer = NULL; for (UT_uint32 i=0; i < iCountContainers; i++) { pContainer = static_cast<fp_Container*>(getNthCon(i)); // // This is to speedup redraws. // if(pContainer->getHeight() > _getMaxContainerHeight()) _setMaxContainerHeight(pContainer->getHeight()); if(pContainer->getY() != iY) { pContainer->clearScreen(); } pContainer->setY(iY); UT_sint32 iContainerHeight = pContainer->getHeight(); UT_sint32 iContainerMarginAfter = pContainer->getMarginAfter(); iY += iContainerHeight; iY += iContainerMarginAfter; //iY += 0.5; if(iY > iMaxFootHeight) { iY = iMaxFootHeight; } else { if (pPrevContainer) { pPrevContainer->setAssignedScreenHeight(iY - iPrevY); } } pPrevContainer = pContainer; iPrevY = iY; } // Correct height position of the last line if (pPrevContainer) { pPrevContainer->setAssignedScreenHeight(iY - iPrevY + 1); } if (getHeight() == iY) { return; } setHeight(iY); // UT_ASSERT(pPage); fp_Page * pPage = getPage(); if(pPage) { pPage->annotationHeightChanged(); } }
void fp_FrameContainer::layout(void) { _setMaxContainerHeight(0); UT_sint32 iY = 0, iPrevY = 0; iY= 0; UT_uint32 iCountContainers = countCons(); fp_Container *pContainer, *pPrevContainer = NULL; for (UT_uint32 i=0; i < iCountContainers; i++) { pContainer = static_cast<fp_Container*>(getNthCon(i)); // // This is to speedup redraws. // if(pContainer->getHeight() > _getMaxContainerHeight()) _setMaxContainerHeight(pContainer->getHeight()); if(pContainer->getY() != iY) { pContainer->clearScreen(); } if(iY > getHeight()) { pContainer->setY(-1000000); } else { pContainer->setY(iY); } UT_sint32 iContainerHeight = pContainer->getHeight(); UT_sint32 iContainerMarginAfter = pContainer->getMarginAfter(); if(pContainer->getContainerType() == FP_CONTAINER_TABLE) { fp_TableContainer * pTab = static_cast<fp_TableContainer *>(pContainer); iContainerHeight = pTab->getHeight(); if(!pTab->isThisBroken() && (pTab->getFirstBrokenTable() == NULL)) { /*fp_Container * pBroke = static_cast<fp_Container *> */(pTab->VBreakAt(0)); } } iY += iContainerHeight; iY += iContainerMarginAfter; //iY += 0.5; if (pPrevContainer) { pPrevContainer->setAssignedScreenHeight(iY - iPrevY); } pPrevContainer = pContainer; iPrevY = iY; } // Correct height position of the last line if (pPrevContainer) { if(iY > getHeight()) { pPrevContainer->setAssignedScreenHeight(-1000000); } else { pPrevContainer->setAssignedScreenHeight(iY - iPrevY + 1); } } fl_FrameLayout * pFL = static_cast<fl_FrameLayout *>(getSectionLayout()); if(pFL->expandHeight() && (iY > pFL->minHeight())) { setHeight(iY+m_iYpad*2); } }