bool fl_FrameLayout::bl_doclistener_insertEndFrame(fl_ContainerLayout*, const PX_ChangeRecord_Strux * pcrx, PL_StruxDocHandle sdh, PL_ListenerId lid, void (* pfnBindHandles)(PL_StruxDocHandle sdhNew, PL_ListenerId lid, PL_StruxFmtHandle sfhNew)) { // The endFrame strux actually needs a format handle to to this Frame layout. // so we bind to this layout. PL_StruxFmtHandle sfhNew = static_cast<PL_StruxFmtHandle>(this); pfnBindHandles(sdh,lid,sfhNew); // // increment the insertion point in the view. // FV_View* pView = m_pLayout->getView(); if (pView && (pView->isActive() || pView->isPreview())) { pView->setPoint(pcrx->getPosition() + fl_BLOCK_STRUX_OFFSET); } else if(pView && pView->getPoint() > pcrx->getPosition()) { pView->setPoint(pView->getPoint() + fl_BLOCK_STRUX_OFFSET); } if(pView) pView->updateCarets(pcrx->getPosition(),1); m_bHasEndFrame = true; return true; }
/*! * Implements the "insertStrux" method of the document listener class. * It takes the supplied change record and makes an XML-like representation * of it. Eventually these can either be stored in a file or sent over the * internet to a remote AbiWord where it can be translated back. */ bool ABI_Collab_Export::insertStrux(fl_ContainerLayout* sfh, const PX_ChangeRecord * pcr, pf_Frag_Strux* sdh, PL_ListenerId lid, void (* pfnBindHandles)(pf_Frag_Strux* sdhNew, PL_ListenerId lid, fl_ContainerLayout* sfhNew)) { if(pfnBindHandles) { // Ugly hack for MSVC and GCC comlilant warnings #ifdef __GNUC__ #warning not sure #else #pragma message("WARNING: not sure") #endif fl_ContainerLayout* sfhNew = sfh; // WAS static_cast<fl_ContainerLayout*>(this); pfnBindHandles(sdh,lid,sfhNew); } ChangeRecordSessionPacket* newPacket = _buildPacket( pcr ); UT_return_val_if_fail(newPacket, true); // unhandled change record type _handleNewPacket( newPacket, pcr ); return true; }
bool fl_EmbedLayout::bl_doclistener_insertEndEmbed(fl_ContainerLayout*, const PX_ChangeRecord_Strux * pcrx, pf_Frag_Strux* sdh, PL_ListenerId lid, void (* pfnBindHandles)(pf_Frag_Strux* sdhNew, PL_ListenerId lid, fl_ContainerLayout* sfhNew)) { // The endFootnote strux actually needs a format handle to to this Footnote layout. // so we bind to this layout. fl_ContainerLayout* sfhNew = this; pfnBindHandles(sdh,lid,sfhNew); // // increment the insertion point in the view. // FV_View* pView = m_pLayout->getView(); if (pView && (pView->isActive() || pView->isPreview())) { pView->setPoint(pcrx->getPosition() + fl_BLOCK_STRUX_OFFSET); } else if(pView && pView->getPoint() > pcrx->getPosition()) { pView->setPoint(pView->getPoint() + fl_BLOCK_STRUX_OFFSET); } m_bHasEndFootnote = true; fl_BlockLayout * pBL = static_cast<fl_BlockLayout *>(getFirstLayout()); pBL->updateEnclosingBlockIfNeeded(); return true; }
/*! * This code actually inserts a block AFTER the frame in the docsectionlayout * Code copied from tablelayout */ bool fl_FrameLayout::insertBlockAfter(fl_ContainerLayout* /*pLBlock*/, const PX_ChangeRecord_Strux * pcrx, PL_StruxDocHandle sdh, PL_ListenerId lid, void (* pfnBindHandles)(PL_StruxDocHandle sdhNew, PL_ListenerId lid, PL_StruxFmtHandle sfhNew)) { UT_ASSERT(pcrx->getType()==PX_ChangeRecord::PXT_InsertStrux); UT_ASSERT(pcrx->getStruxType()==PTX_Block); fl_ContainerLayout * pNewCL = NULL; fl_ContainerLayout * pMyCL = myContainingLayout(); pNewCL = pMyCL->insert(sdh,this,pcrx->getIndexAP(), FL_CONTAINER_BLOCK); fl_BlockLayout * pBlock = static_cast<fl_BlockLayout *>(pNewCL); // // Set the sectionlayout of this frame to that of the block since it is that scope // pBlock->setSectionLayout(static_cast<fl_SectionLayout *>(myContainingLayout())); pNewCL->setContainingLayout(myContainingLayout()); // Must call the bind function to complete the exchange of handles // with the document (piece table) *** before *** anything tries // to call down into the document (like all of the view // listeners). PL_StruxFmtHandle sfhNew = static_cast<PL_StruxFmtHandle>(pNewCL); pfnBindHandles(sdh,lid,sfhNew); // // increment the insertion point in the view. // FV_View* pView = m_pLayout->getView(); if (pView && (pView->isActive() || pView->isPreview())) { pView->setPoint(pcrx->getPosition() + fl_BLOCK_STRUX_OFFSET); } else if(pView && pView->getPoint() > pcrx->getPosition()) { pView->setPoint(pView->getPoint() + fl_BLOCK_STRUX_OFFSET); } if(pView) pView->updateCarets(pcrx->getPosition(),1); return true; }
/*! * Implements the "insertStrux" method of the document listener class. * It takes the supplied change record and makes an XML-like representation * of it. Eventually these can either be stored in a file or sent over the * internet to a remote AbiWord where it can be translated back. */ bool ABI_Collab_Export::insertStrux(PL_StruxFmtHandle /*sfh*/, const PX_ChangeRecord * pcr, PL_StruxDocHandle sdh, PL_ListenerId lid, void (* pfnBindHandles)(PL_StruxDocHandle sdhNew, PL_ListenerId lid, PL_StruxFmtHandle sfhNew)) { if(pfnBindHandles) { PL_StruxFmtHandle sfhNew = static_cast<PL_StruxFmtHandle>(this); pfnBindHandles(sdh,lid,sfhNew); } ChangeRecordSessionPacket* newPacket = _buildPacket( pcr ); UT_return_val_if_fail(newPacket, true); // unhandled change record type _handleNewPacket( newPacket, pcr ); return true; }