本文整理汇总了C++中PD_Document::getUID方法的典型用法代码示例。如果您正苦于以下问题:C++ PD_Document::getUID方法的具体用法?C++ PD_Document::getUID怎么用?C++ PD_Document::getUID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PD_Document
的用法示例。
在下文中一共展示了PD_Document::getUID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//
// AbiMathView_FileInsert
// -------------------
// This is the function that we actually call to insert the MathML.
//
bool
AbiMathView_FileInsert(AV_View* /*v*/, EV_EditMethodCallData* /*d*/)
{
// Get the current view that the user is in.
XAP_Frame *pFrame = XAP_App::getApp()->getLastFocussedFrame();
FV_View* pView = static_cast<FV_View*>(pFrame->getCurrentView());
PD_Document * pDoc = static_cast<PD_Document *>(pFrame->getCurrentDoc());
char* pNewFile = NULL;
bool bOK = s_AskForMathMLPathname(pFrame,&pNewFile);
if (!bOK || !pNewFile)
{
UT_DEBUGMSG(("ARRG! bOK = %d pNewFile = %s \n",bOK,pNewFile));
return false;
}
UT_UTF8String sNewFile = pNewFile;
// we own storage for pNewFile and must free it.
FREEP(pNewFile);
UT_DEBUGMSG(("fileInsertMathML: loading [%s]\n",sNewFile.utf8_str()));
IE_Imp_MathML * pImpMathML = new IE_Imp_MathML(pDoc, pMathManager->EntityTable());
UT_Error errorCode = pImpMathML->importFile(sNewFile.utf8_str());
if (errorCode != UT_OK)
{
s_CouldNotLoadFileMessage(pFrame, sNewFile.utf8_str(), errorCode);
DELETEP(pImpMathML);
return false;
}
/* Create the data item */
UT_uint32 uid = pDoc->getUID(UT_UniqueId::Image);
UT_UTF8String sUID;
UT_UTF8String_sprintf(sUID,"%d",uid);
pDoc->createDataItem(sUID.utf8_str(), false, pImpMathML->getByteBuf(),
"application/mathml+xml", NULL);
/* Insert the MathML Object */
PT_DocPosition pos = pView->getPoint();
pView->cmdInsertMathML(sUID.utf8_str(),pos);
DELETEP(pImpMathML);
return true;
}