Abiword文檔對(duì)象初始化
新建或開(kāi)發(fā)文檔
- PD_Document類的實(shí)例化
如果是新建文檔,調(diào)用PD_Document::newDocument函數(shù)創(chuàng)建新文檔,或則調(diào)用PD_Document::readFromFile打開(kāi)一個(gè)文檔。
- pt_PieceTable類的實(shí)例化,通過(guò)該類初始化文檔的物理存儲(chǔ)架構(gòu)。也就是PieceTable數(shù)據(jù)結(jié)構(gòu)的實(shí)現(xiàn)
- pf_Frag_Strux_Section類,該類實(shí)例化后放入pf_Fragments中。
- pf_Frag_Strux_Block 類,同樣放入pf_Fragments中。
- pf_Frag 類,實(shí)例化pf_Frag::PFT_EndOfDoc的對(duì)象,表示文檔結(jié)尾的片段。
- AP_Frame::_showDocument方法
- 調(diào)用_createViewGraphics函數(shù)創(chuàng)建:GR_Graphics對(duì)象,F(xiàn)L_DocLayout類的實(shí)例化
??? FL_DocLayout is a formatted representation of a specific PD_Document,?
??? formatted for a specific GR_Graphics context.?
- FV_View類的實(shí)例化,?調(diào)用AP_Frame::_replaceView函數(shù)
- FL_DocLayout::fillLayouts函數(shù)中,實(shí)例化 fl_DocListener 類
- PD_Document::addListener方法將 fl_DocListener 對(duì)象添加到文檔中
- pt_PieceTable::addListener, 循環(huán)pf_Fragments(鏈表數(shù)據(jù)結(jié)構(gòu))對(duì)象 ,初始化對(duì)應(yīng)的布局類。
- fl_DocSectionLayout 類,該類對(duì)應(yīng)pf_Frag_Strux_Section類,并且存儲(chǔ)這個(gè)類對(duì)象的指針
該類實(shí)例化后,被添加到FL_DocLayout中。
- each FL_DocLayout contains a list of fl_SectionLayout objects
- each fl_SectionLayout are composed of fl_BlockLayout objects
- fl_BlockLayout類,該類對(duì)應(yīng)pf_Frag_Strux_Block ,并且存儲(chǔ)這個(gè)類對(duì)象的指針
Where each fl_BlockLayout corresponds to a logical element in
?the PD_Document (i.e., usually a paragraph of text).
在fl_BlockLayout::_insertEndOfParagraphRun函數(shù)中,初始化FL_DocLayout的物理結(jié)構(gòu)。
- ?fp_EndOfParagraphRun類的實(shí)例化。
- fp_Line?類的實(shí)例化。
- FL_DocLayout::addNewPage函數(shù)初始化fp_Page類
- fp_Column 類實(shí)例化
- 調(diào)用fp_VerticalContainer::insertContainer函數(shù)把fp_Line?添加到fp_Column 類中。
- 把fp_EndOfParagraphRun對(duì)象添加到fp_Line?中
編輯文檔
- ?FV_View::_charInsert函數(shù)
-
FV_View::insertParaBreakIfNeededAtPos
??????? Insrts a block and returns true if the point is at the end of a?
??????? section or document and the previous strux is not a block??????if(!isParaBreakNeededAtPos(pos))
???? {
???????? return false;
?????}
???? m_pDoc->insertStrux(pos,PTX_Block);//如果需要就插入Block
???? return true; - ?PD_Document::insertSpan
???????? pt_PieceTable::_insertFmtMarkFragWithNotify, 實(shí)例化pf_Frag_FmtMark類、fp_FmtMarkRun類
???????? pt_PieceTable::insertSpan函數(shù),實(shí)例化pf_Frag_Text
???????? 通過(guò)構(gòu)建PX_ChangeRecord類,調(diào)用PD_Document::notifyListeners函數(shù),通過(guò)fl_DocListener::change方法通知fmt層數(shù)據(jù)發(fā)生變化。
???????? 通過(guò)fl_SectionLayout,fl_BlockLayout::_doInsertTextSpan的方法,實(shí)例化fp_TextRun
?
- 增加新行時(shí),實(shí)例化pf_Frag_Strux_Block、fl_BlockLayout、fp_EndOfParagraphRun、fp_Line
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

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