/*! * This method creates a new footnote with its properties initially set * from the Attributes/properties of this Layout */ void fl_FrameLayout::_createFrameContainer(void) { lookupProperties(); fp_FrameContainer * pFrameContainer = new fp_FrameContainer(static_cast<fl_SectionLayout *>(this)); setFirstContainer(pFrameContainer); setLastContainer(pFrameContainer); pFrameContainer->setWidth(m_iWidth); pFrameContainer->setHeight(m_iHeight); // Now do Frame image const PP_AttrProp* pSectionAP = NULL; // This is a real NO-NO: must *always* call getAP() // m_pLayout->getDocument()->getAttrProp(m_apIndex, &pSectionAP); getAP(pSectionAP); const gchar * pszDataID = NULL; pSectionAP->getAttribute(PT_STRUX_IMAGE_DATAID, (const gchar *&)pszDataID); DELETEP(m_pGraphicImage); DELETEP(m_pImageImage); // // Set the image size from the full width // setImageWidth(pFrameContainer->getFullWidth()); setImageHeight(pFrameContainer->getFullHeight()); if(pszDataID && *pszDataID) { UT_DEBUGMSG(("!!!Found image of file %s \n",pszDataID)); m_pGraphicImage = FG_Graphic::createFromStrux(this); } setContainerProperties(); }
bool fl_FrameLayout::doclistener_changeStrux(const PX_ChangeRecord_StruxChange * pcrxc) { UT_ASSERT(pcrxc->getType()==PX_ChangeRecord::PXT_ChangeStrux); fp_FrameContainer * pFrameC = static_cast<fp_FrameContainer *>(getFirstContainer()); UT_GenericVector<fl_ContainerLayout *> AllLayouts; AllLayouts.clear(); fp_Page * pPage = NULL; UT_sint32 i = 0; if(pFrameC) { pPage = pFrameC->getPage(); UT_return_val_if_fail(pPage, false); pPage->getAllLayouts(AllLayouts); for(i=0; i< AllLayouts.getItemCount();i++) { fl_ContainerLayout * pCL = AllLayouts.getNthItem(i); pCL->collapse(); } } setAttrPropIndex(pcrxc->getIndexAP()); collapse(); lookupProperties(); format(); for(i=0; i< AllLayouts.getItemCount();i++) { fl_ContainerLayout * pCL = AllLayouts.getNthItem(i); pCL->format(); xxx_UT_DEBUGMSG(("Format block %x \n",pBL)); pCL->markAllRunsDirty(); } getDocSectionLayout()->markAllRunsDirty(); return true; }
fp_AnnotationRun::fp_AnnotationRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 /*iLen*/ ) : fp_HyperlinkRun(pBL,iOffsetFirst,1),m_iPID(0),m_sValue(""),m_iRealWidth(0) { UT_ASSERT(pBL); _setLength(1); _setDirty(false); _setWidth(0); _setRecalcWidth(true); UT_ASSERT((pBL)); _setDirection(UT_BIDI_WS); const PP_AttrProp * pAP = NULL; getSpanAP(pAP); const gchar * pTarget; const gchar * pName; bool bFound = false; UT_uint32 k = 0; while(pAP->getNthAttribute(k++, pName, pTarget)) { bFound = (0 == g_ascii_strncasecmp(pName,"Annotation",10)); if(bFound) break; } // we have got to keep a local copy, since the pointer we get // is to a potentially volatile location if(bFound) { DELETEPV(m_pTarget); UT_uint32 iTargetLen = strlen(pTarget); m_pTarget = new gchar [iTargetLen + 1]; strncpy(m_pTarget, pTarget, iTargetLen + 1); m_bIsStart = true; //if this is a start of the Annotation, we set m_pHyperlink to this, //so that when a run gets inserted after this one, its m_pHyperlink is //set correctly _setHyperlink(this); m_iPID = atoi(m_pTarget); } else { m_bIsStart = false; m_pTarget = NULL; _setHyperlink(NULL); m_iPID =0; } lookupProperties(); }
/*! * This method creates a new footnote with its properties initially set * from the Attributes/properties of this Layout */ void fl_EndnoteLayout::_createEndnoteContainer(void) { lookupProperties(); fp_EndnoteContainer * pEndnoteContainer = new fp_EndnoteContainer(static_cast<fl_SectionLayout *>(this)); setFirstContainer(pEndnoteContainer); setLastContainer(pEndnoteContainer); fl_DocSectionLayout * pDSL = m_pLayout->getDocSecForEndnote(pEndnoteContainer); UT_sint32 iWidth = m_pLayout->getLastPage()->getWidth(); iWidth = iWidth - pDSL->getLeftMargin() - pDSL->getRightMargin(); pEndnoteContainer->setWidth(iWidth); m_bNeedsReformat = true; m_bNeedsFormat = true; }
fp_EmbedRun::fp_EmbedRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst,PT_AttrPropIndex indexAP,pf_Frag_Object* oh) : fp_Run(pBL, iOffsetFirst,1, FPRUN_EMBED ), m_iPointHeight(0), m_pSpanAP(NULL), m_iGraphicTick(0), m_pszDataID(NULL), m_sEmbedML(""), m_pEmbedManager(NULL), m_iEmbedUID(-1), m_iIndexAP(indexAP), m_pDocLayout(NULL), m_bNeedsSnapshot(true), m_OH(oh) { m_pDocLayout = getBlock()->getDocLayout(); lookupProperties(getGraphics()); }
/*! * This method creates a new footnote with its properties initially set * from the Attributes/properties of this Layout */ void fl_AnnotationLayout::_createAnnotationContainer(void) { lookupProperties(); fp_AnnotationContainer * pAnnotationContainer = new fp_AnnotationContainer(static_cast<fl_SectionLayout *>(this)); setFirstContainer(pAnnotationContainer); setLastContainer(pAnnotationContainer); fl_ContainerLayout * pCL = myContainingLayout(); while(pCL!= NULL && pCL->getContainerType() != FL_CONTAINER_DOCSECTION) { pCL = pCL->myContainingLayout(); } fl_DocSectionLayout * pDSL = static_cast<fl_DocSectionLayout *>(pCL); UT_return_if_fail(pDSL != NULL); fp_Container * pCon = pCL->getLastContainer(); UT_return_if_fail(pCon); UT_sint32 iWidth = pCon->getPage()->getWidth(); iWidth = iWidth - pDSL->getLeftMargin() - pDSL->getRightMargin(); pAnnotationContainer->setWidth(iWidth); }