源碼版本:2.4.6
打開文件文件操作:
響應函數:UT_Error AP_Frame::loadDocument(const char * szFilename, int ieft, bool createNew)
加載操作:loadDocument::errorCode = ?_loadDocument(szFilename, static_cast<IEFileType>(ieft), createNew);
?
打開word文件代碼段
UT_Error PD_Document::readFromFile(const char * szFilename, int ieft,
const char * impProps)
?
?
UT_Error PD_Document::readFromFile( const char * szFilename, int ieft, const char * impProps) { if (!szFilename || !* szFilename) { UT_DEBUGMSG(( " PD_Document::readFromFile -- invalid filename\n " )); return UT_INVALIDFILENAME; } if ( ! UT_isRegularFile(szFilename) ) { UT_DEBUGMSG (( " PD_Document::readFromFile -- file (%s) is not plain file\n " ,szFilename)); return UT_INVALIDFILENAME; } if (! UT_fileSize(szFilename)) { UT_DEBUGMSG(( " PD_Document::readFromFile -- file (%s) is empty\n " ,szFilename)); return UT_IE_BOGUSDOCUMENT; } m_pPieceTable = new pt_PieceTable( this ); if (! m_pPieceTable) { UT_DEBUGMSG(( " PD_Document::readFromFile -- could not construct piece table\n " )); return UT_NOPIECETABLE; } m_pPieceTable -> setPieceTableState(PTS_Loading); { UT_String template_list[ 6 ]; buildTemplateList (template_list, " normal.awt " ); bool success = false ; for (UT_uint32 i = 0 ; i < 6 && !success; i++ ) success = (importStyles(template_list[i].c_str(), ieft, true ) == UT_OK); // don't worry if this fails } IE_Imp * pie = NULL; UT_Error errorCode; errorCode = IE_Imp::constructImporter( this , szFilename, static_cast<IEFileType>(ieft), &pie, & m_lastOpenedType); if (errorCode) { UT_DEBUGMSG(( " PD_Document::readFromFile -- could not construct importer\n " )); return errorCode; } if (impProps && strlen(impProps)) pie -> setProps (impProps); _syncFileTypes( false ); // set standard document properties and attributes, such as dtd, lang, // dom-dir, etc., which the importer can then overwite // this also initializes m_indexAP m_indexAP = 0xffffffff ; setAttrProp(NULL); errorCode = pie-> importFile(szFilename); delete pie; repairDoc(); // 意味著之前已經讀取并且分析了文檔結構了
?
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
