#include <ie_imp_MsWord_97.h>
IE_Imp_MsWord_97::IE_Imp_MsWord_97 | ( | PD_Document * | pDocument | ) |
References UT_GenericVector< T >::clear(), m_iListIdIncrement, and m_vecTextboxPos.
IE_Imp_MsWord_97::~IE_Imp_MsWord_97 | ( | ) |
References DELETEPV, m_iBookmarksCount, m_pBookmarks, m_pEndnotes, m_pFootnotes, m_pHeaders, m_pTextboxes, m_vecEmObjects, m_vecTextboxPos, m_vLists, bookmark::name, and UT_VECTOR_PURGEALL.
void IE_Imp_MsWord_97::_appendChar | ( | UT_UCSChar | ch | ) | [private] |
References m_bInTable, m_bIsLower, m_pTextRun, and UT_UCS4_tolower().
Referenced by _handleFieldEnd().
bool IE_Imp_MsWord_97::_appendFmt | ( | const PP_PropertyVector & | attributes | ) | [private] |
References PD_Document::appendFmt(), and IE_Imp::getDoc().
Referenced by _beginChar(), _flush(), _insertEndnote(), _insertFootnote(), and _insertHeaderSection().
bool IE_Imp_MsWord_97::_appendObject | ( | PTObjectType | pto, | |
const PP_PropertyVector & | attributes | |||
) | [private] |
References _appendObjectHdrFtr(), _appendStrux(), _shouldUseInsert(), PD_Document::appendObject(), IE_Imp::getDoc(), PD_Document::insertObjectBeforeFrag(), m_bInHeaders, m_bInPara, m_bInTextboxes, m_pNotesEndSection, m_pTextboxEndSection, and PTX_Block.
Referenced by _beginPara(), _flush(), _handleCommandField(), _handleFieldEnd(), _handleImage(), _handleNotesText(), _insertBookmark(), _insertEndnote(), and _insertFootnote().
bool IE_Imp_MsWord_97::_appendObjectHdrFtr | ( | PTObjectType | pto, | |
const PP_PropertyVector & | attributes | |||
) | [private] |
References PD_Document::appendObject(), PD_Document::appendStrux(), d, header::d, header::_d::frag, IE_Imp::getDoc(), UT_GenericVector< T >::getItemCount(), PD_Document::insertObjectBeforeFrag(), PD_Document::insertStruxBeforeFrag(), m_bInHeaders, m_bInPara, m_iCurrentHeader, m_iHeadersCount, m_pHeaders, PTX_Block, and UT_return_val_if_fail.
Referenced by _appendObject().
bool IE_Imp_MsWord_97::_appendSpan | ( | const UT_UCSChar * | p, | |
UT_uint32 | length | |||
) | [private] |
References _appendSpanHdrFtr(), _shouldUseInsert(), PD_Document::appendSpan(), IE_Imp::getDoc(), PD_Document::insertSpanBeforeFrag(), m_bInHeaders, m_bInTextboxes, m_pNotesEndSection, and m_pTextboxEndSection.
Referenced by _beginPara(), _beginSect(), _flush(), _insertEndnote(), and _insertFootnote().
bool IE_Imp_MsWord_97::_appendSpanHdrFtr | ( | const UT_UCSChar * | p, | |
UT_uint32 | length | |||
) | [private] |
References PD_Document::appendSpan(), PD_Document::appendStrux(), d, header::d, header::_d::frag, IE_Imp::getDoc(), UT_GenericVector< T >::getItemCount(), PD_Document::insertSpanBeforeFrag(), PD_Document::insertStruxBeforeFrag(), m_bInHeaders, m_bInPara, m_iCurrentHeader, m_iHeadersCount, m_pHeaders, PTX_Block, and UT_return_val_if_fail.
Referenced by _appendSpan().
bool IE_Imp_MsWord_97::_appendStrux | ( | PTStruxType | pts, | |
const PP_PropertyVector & | attributes | |||
) | [private] |
References _appendStruxHdrFtr(), _flush(), _shouldUseInsert(), PD_Document::appendStrux(), IE_Imp::getDoc(), PD_Document::getLastFrag(), pf_Frag::getPrev(), pf_Frag_Strux::getStruxType(), pf_Frag::getType(), PD_Document::insertStruxBeforeFrag(), m_bInHeaders, m_bInTextboxes, m_pNotesEndSection, m_pTextboxEndSection, PTX_Block, PTX_EndFrame, PTX_SectionFrame, UT_DEBUGMSG, and xxx_UT_DEBUGMSG.
Referenced by _appendObject(), _beginChar(), _beginPara(), _beginSect(), _cell_close(), _cell_open(), _endSect(), _ensureInBlock(), _flush(), _handleCommandField(), _handleFieldEnd(), _handleNotesText(), _insertEndnote(), _insertFootnote(), _insertTOC(), _table_close(), and _table_open().
bool IE_Imp_MsWord_97::_appendStruxHdrFtr | ( | PTStruxType | pts, | |
const PP_PropertyVector & | attributes | |||
) | [private] |
The append*HdrFtr() methods below are needed because in AW headers cannot be shared among sections; in contrast in Word one header can be used by a chain of sections. We get around it by duplicating that one header for each section that uses it. Since we cannot wind back throught the data stream we have to duplicate each shared header as we go using the info stored in the current header's d struct.
References PD_Document::appendStrux(), d, header::d, header::_d::frag, IE_Imp::getDoc(), UT_GenericVector< T >::getItemCount(), PD_Document::insertStruxBeforeFrag(), m_bInHeaders, m_bInPara, m_bInSect, m_iCurrentHeader, m_iHeadersCount, m_pHeaders, PTX_Block, UT_ASSERT, UT_DEBUGMSG, UT_return_val_if_fail, and xxx_UT_DEBUGMSG.
Referenced by _appendStrux().
int IE_Imp_MsWord_97::_beginChar | ( | wvParseStruct * | ps, | |
UT_uint32 | tag, | |||
void * | props, | |||
int | dirty | |||
) | [private] |
References _appendFmt(), _appendStrux(), _flush(), _generateCharProps(), _ignorePosition(), AD_Document::addRevision(), UT_String::c_str(), UT_String::clear(), FREEP, gchar, IE_Imp::getDoc(), header::len, m_bBidiMode, m_bEncounteredRevision, m_bInENotes, m_bInFNotes, m_bInHeaders, m_bInPara, m_bInSect, m_bLTRCharContext, m_bLTRParaContext, m_bSymbolFont, m_charProps, m_charRevs, m_charStyle, m_iAnnotationsEnd, m_iAnnotationsStart, m_iCurrentHeader, m_iEndnotesCount, m_iEndnotesEnd, m_iEndnotesStart, m_iFootnotesCount, m_iFootnotesEnd, m_iFootnotesStart, m_iHeadersCount, m_iHeadersEnd, m_iHeadersStart, m_iMacrosEnd, m_iMacrosStart, m_iNextENote, m_iNextFNote, m_iTextEnd, m_iTextStart, m_pEndnotes, m_pFootnotes, m_pHeaders, header::pos, PP_std_copyProps(), PTX_Block, PTX_Section, s_convert_to_utf8(), s_translateStyleId(), UT_UCS4String::size(), UT_UCS4String::ucs4_str(), UT_ASSERT_NOT_REACHED, UT_DEBUGMSG, and xxx_UT_DEBUGMSG.
Referenced by _eleProc().
int IE_Imp_MsWord_97::_beginComment | ( | wvParseStruct * | ps, | |
UT_uint32 | tag, | |||
void * | props, | |||
int | dirty | |||
) | [private] |
References UT_DEBUGMSG.
Referenced by _eleProc().
int IE_Imp_MsWord_97::_beginPara | ( | wvParseStruct * | ps, | |
UT_uint32 | tag, | |||
void * | props, | |||
int | dirty | |||
) | [private] |
References _appendObject(), _appendSpan(), _appendStrux(), _cell_close(), _cell_open(), _flush(), _generateCharProps(), _generateParaProps(), _handleHeadersText(), _handleTextboxesText(), _ignorePosition(), _row_close(), _row_open(), _table_close(), _table_open(), UT_GenericVector< T >::addItem(), PD_Document::appendFmt(), PD_Document::appendList(), UT_String::c_str(), UT_String::clear(), UT_GenericVector< T >::clear(), FREEP, gchar, IE_Imp::getDoc(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), PD_Document::getUID(), header::len, ListIdLevelPair::level, UT_UniqueId::List, ListIdLevelPair::listId, m_bBidiMode, m_bCellOpen, m_bInENotes, m_bInFNotes, m_bInHeaders, m_bInPara, m_bInSect, m_bInTable, m_bLTRParaContext, m_charProps, m_charStyle, m_iAnnotationsEnd, m_iAnnotationsStart, m_iCellsRemaining, m_iCurrentHeader, m_iEndnotesCount, m_iEndnotesEnd, m_iEndnotesStart, m_iFootnotesCount, m_iFootnotesEnd, m_iFootnotesStart, m_iHeadersCount, m_iHeadersEnd, m_iHeadersStart, m_iListIdIncrement, m_iMacrosEnd, m_iMacrosStart, m_iMSWordListId, m_iNextENote, m_iNextFNote, m_iRowsRemaining, m_iTextboxesEnd, m_iTextboxesStart, m_iTextEnd, m_iTextStart, m_paraProps, m_paraStyle, m_pEndnotes, m_pFootnotes, m_pHeaders, m_vecColumnPositions, m_vecColumnSpansForCurrentRow, m_vListIdMap, m_vLists, header::pos, PTO_Field, PTX_Block, PTX_Section, s_convert_to_utf8(), s_fieldFontForListStyle(), s_mapDocToAbiListDelim(), s_mapDocToAbiListId(), s_mapDocToAbiListStyle(), s_stripDangerousChars(), s_translateStyleId(), UT_String::size(), UT_ASSERT_HARMLESS, UT_ASSERT_NOT_REACHED, UT_DEBUGMSG, UT_std_string_sprintf(), UT_UID_INVALID, UT_VECTOR_PURGEALL, UT_UTF8String::utf8_str(), and xxx_UT_DEBUGMSG.
Referenced by _eleProc().
int IE_Imp_MsWord_97::_beginSect | ( | wvParseStruct * | ps, | |
UT_uint32 | tag, | |||
void * | props, | |||
int | dirty | |||
) | [private] |
References _appendSpan(), _appendStrux(), _flush(), UT_String::c_str(), DIM_IN, gchar, fp_PageSize::getDims(), IE_Imp::getDoc(), fp_PageSize::Height(), HF_FooterEven, HF_FooterFirst, HF_FooterOdd, HF_HeaderEven, HF_HeaderFirst, HF_HeaderOdd, HF_Unsupported, m_bInPara, m_bInSect, m_bSetPageSize, m_dim, PD_Document::m_docPageSize, m_iCurrentSectId, m_iHeadersCount, m_nSections, m_pHeaders, PP_std_copyProps(), PTX_Block, PTX_Section, s_mapPageIdToString(), fp_PageSize::Set(), fp_PageSize::setLandscape(), fp_PageSize::setPortrait(), fp_PageSize::setScale(), header::type, type, UT_ASSERT_HARMLESS, UT_convertInchesToDimensionString(), UT_DEBUGMSG, UT_NOT_REACHED, UT_return_val_if_fail, UT_String_sprintf(), fp_PageSize::Width(), X_CheckError, and xxx_UT_DEBUGMSG.
Referenced by _eleProc().
bool IE_Imp_MsWord_97::_build_ColumnWidths | ( | UT_NumberVector & | colWidths | ) | [private] |
This method parses the vector of MsColSpans held by m_vecColumnWidths and fills the vector colWidths with the widths of the individual columns.
We do this because MSWord provides the widths of column spans, and in some cases you can get a table with no row fully partitioned into individual cells.
References _isVectorFull(), UT_GenericVector< T >::addItem(), findMatchSpan(), UT_GenericVector< T >::getNthItem(), MsColSpan::iLeft, MsColSpan::iRight, m_vecColumnWidths, setNumberVector(), UT_GenericVector< T >::size(), UT_ASSERT_HARMLESS, MsColSpan::width, and xxx_UT_DEBUGMSG.
Referenced by _table_close().
void IE_Imp_MsWord_97::_cell_close | ( | ) | [private] |
References _appendStrux(), m_bCellOpen, m_bInPara, PTX_EndCell, and xxx_UT_DEBUGMSG.
Referenced by _beginPara(), and _table_close().
void IE_Imp_MsWord_97::_cell_open | ( | const wvParseStruct * | ps, | |
const PAP * | apap | |||
) | [private] |
References _appendStrux(), UT_GenericVector< T >::addItem(), brc_to_pixel(), UT_String::c_str(), gchar, UT_GenericVector< T >::getNthItem(), MsColSpan::iLeft, MsColSpan::iRight, m_bCellOpen, m_bInPara, m_bRowOpen, m_iCurrentCell, m_iCurrentRow, m_iLeft, m_iLeftCellPos, m_iRight, m_vecColumnSpansForCurrentRow, m_vecColumnWidths, PP_std_copyProps(), PTX_SectionCell, sConvertLineStyle(), sMapIcoToColor(), UT_return_if_fail, UT_String_sprintf(), MsColSpan::width, and xxx_UT_DEBUGMSG.
Referenced by _beginPara().
int IE_Imp_MsWord_97::_charProc | ( | wvParseStruct * | ps, | |
UT_uint16 | eachchar, | |||
UT_Byte | chartype, | |||
UT_uint16 | lid | |||
) |
Referenced by charProc().
int IE_Imp_MsWord_97::_docProc | ( | wvParseStruct * | ps, | |
UT_uint32 | tag | |||
) |
References _flush(), _handleBookmarks(), _handleHeaders(), _handleNotes(), _handleStyleSheet(), _handleTextBoxes(), IE_Imp::getDoc(), IE_Imp::getLoadStylesOnly(), m_bBidiMode, m_bEvenOddHeaders, m_iAnnotationsEnd, m_iAnnotationsStart, m_iEndnotesEnd, m_iEndnotesStart, m_iFootnotesEnd, m_iFootnotesStart, m_iHeadersEnd, m_iHeadersStart, m_iMacrosEnd, m_iMacrosStart, m_iTextboxesEnd, m_iTextboxesStart, m_iTextEnd, m_iTextStart, PD_MAX_REVISION, PD_Document::purgeFmtMarks(), PD_Document::setMarkRevisions(), AD_Document::setShowRevisionId(), AD_Document::setShowRevisions(), and UT_DEBUGMSG.
Referenced by docProc().
int IE_Imp_MsWord_97::_eleProc | ( | wvParseStruct * | ps, | |
UT_uint32 | tag, | |||
void * | props, | |||
int | dirty | |||
) |
References _beginChar(), _beginComment(), _beginPara(), _beginSect(), _endChar(), _endComment(), _endPara(), _endSect(), m_iTextboxesEnd, UT_ASSERT_NOT_REACHED, and UT_DEBUGMSG.
Referenced by eleProc().
int IE_Imp_MsWord_97::_endChar | ( | wvParseStruct * | ps, | |
UT_uint32 | tag, | |||
void * | props, | |||
int | dirty | |||
) | [private] |
Referenced by _eleProc().
int IE_Imp_MsWord_97::_endComment | ( | wvParseStruct * | ps, | |
UT_uint32 | tag, | |||
void * | props, | |||
int | dirty | |||
) | [private] |
References UT_DEBUGMSG.
Referenced by _eleProc().
int IE_Imp_MsWord_97::_endPara | ( | wvParseStruct * | ps, | |
UT_uint32 | tag, | |||
void * | props, | |||
int | dirty | |||
) | [private] |
References _flush(), m_bInPara, m_bLineBreakPending, and xxx_UT_DEBUGMSG.
Referenced by _eleProc().
int IE_Imp_MsWord_97::_endSect | ( | wvParseStruct * | ps, | |
UT_uint32 | tag, | |||
void * | props, | |||
int | dirty | |||
) | [private] |
References _appendStrux(), m_bInPara, m_bInSect, m_bInTextboxes, m_bLineBreakPending, m_bPageBreakPending, m_pTextRun, PTX_Block, and UT_UCS4String::size().
Referenced by _eleProc(), _handleHeadersText(), _handleNotesText(), and _handleTextboxesText().
bool IE_Imp_MsWord_97::_ensureInBlock | ( | ) | [private] |
References _appendStrux(), IE_Imp::getDoc(), PD_Document::getLastFrag(), pf_Frag::getPrev(), pf_Frag_Strux::getStruxType(), pf_Frag::getType(), m_bInPara, and PTX_Block.
Referenced by _handleImage().
int IE_Imp_MsWord_97::_fieldProc | ( | wvParseStruct * | ps, | |
UT_uint16 | eachchar, | |||
UT_Byte | chartype, | |||
UT_uint16 | lid | |||
) | [private] |
bool IE_Imp_MsWord_97::_findNextENoteSection | ( | ) | [private] |
References PD_Document::findFragOfType(), IE_Imp::getDoc(), pf_Frag::getNext(), m_iNextENote, m_pNotesEndSection, pf_Frag::PFT_Strux, PTX_EndEndnote, UT_DEBUGMSG, and UT_return_val_if_fail.
Referenced by _handleNotesText().
bool IE_Imp_MsWord_97::_findNextFNoteSection | ( | ) | [private] |
References PD_Document::findFragOfType(), IE_Imp::getDoc(), pf_Frag::getNext(), m_iNextFNote, m_pNotesEndSection, pf_Frag::PFT_Strux, PTX_EndFootnote, UT_return_val_if_fail, and xxx_UT_DEBUGMSG.
Referenced by _handleNotesText().
bool IE_Imp_MsWord_97::_findNextTextboxSection | ( | ) | [private] |
void IE_Imp_MsWord_97::_flush | ( | void | ) | [private] |
References _appendFmt(), _appendObject(), _appendSpan(), _appendStrux(), UT_String::c_str(), UT_UCS4String::clear(), UT_GenericVector< T >::clear(), gchar, IE_Imp::getDoc(), UT_GenericVector< T >::getItemCount(), PD_Document::getLastFrag(), UT_GenericVector< T >::getNthItem(), pf_Frag_Strux::getStruxType(), pf_Frag::getType(), m_bBidiMode, m_bInPara, m_bInSect, m_bLTRCharContext, m_charProps, m_charRevs, m_nSections, m_pTextRun, m_vecEmObjects, emObject::objType, emObject::props1, emObject::props2, PTO_Bookmark, PTX_Block, PTX_Section, UT_String::size(), UT_UCS4String::size(), UT_UCS4String::ucs4_str(), UT_ASSERT_HARMLESS, UT_BIDI_IS_NEUTRAL, UT_BIDI_LTR, UT_BIDI_RTL, UT_BIDI_UNSET, UT_bidiGetCharType(), UT_DEBUGMSG, and UT_SHOULD_NOT_HAPPEN.
Referenced by _appendStrux(), _beginChar(), _beginPara(), _beginSect(), _docProc(), _endPara(), _handleCommandField(), _handleFieldEnd(), _insertBookmark(), _insertEndnote(), and _insertFootnote().
void IE_Imp_MsWord_97::_generateCharProps | ( | UT_String & | s, | |
const CHP * | achp, | |||
wvParseStruct * | ps | |||
) | [private] |
References UT_String::c_str(), FREEP, XAP_EncodingManager::get_instance(), IE_Imp::getDoc(), AD_Document::getEncodingName(), XAP_EncodingManager::getNativeUnicodeEncodingName(), m_bIsLower, AD_Document::setEncodingName(), sMapIcoToColor(), UT_ASSERT_HARMLESS, UT_String_sprintf(), wvLIDToCodePageConverter(), wvLIDToLangConverter(), and xxx_UT_DEBUGMSG.
Referenced by _beginChar(), _beginPara(), and _handleStyleSheet().
void IE_Imp_MsWord_97::_generateParaProps | ( | UT_String & | s, | |
const PAP * | apap, | |||
wvParseStruct * | ps | |||
) | [private] |
References m_dim, UT_String::size(), sMapIcoToColor(), UT_convertInchesToDimensionString(), UT_convertToDimensionlessString(), and UT_String_sprintf().
Referenced by _beginPara(), and _handleStyleSheet().
gchar * IE_Imp_MsWord_97::_getBookmarkName | ( | const wvParseStruct * | ps, | |
UT_uint32 | pos | |||
) | [private] |
References UT_UTF8String::appendUCS2(), UT_UTF8String::byteLength(), UT_UTF8String::clear(), gchar, UT_UCS2_strlen(), and UT_UTF8String::utf8_str().
Referenced by _handleBookmarks().
int IE_Imp_MsWord_97::_handleBookmarks | ( | const wvParseStruct * | ps | ) | [private] |
References _getBookmarkName(), m_iBookmarksCount, m_pBookmarks, bookmark::name, bookmark::pos, s_cmp_bookmarks_qsort(), bookmark::start, UT_DEBUGMSG, and UT_return_val_if_fail.
Referenced by _docProc().
bool IE_Imp_MsWord_97::_handleCommandField | ( | char * | command | ) | [private] |
References _appendObject(), _appendStrux(), _flush(), _isTOCsupported(), F_DATE, F_DateTimePicture, F_EDITTIME, F_FILENAME, F_HYPERLINK, F_NUMCHARS, F_NUMPAGES, F_NUMWORDS, F_PAGE, F_PAGEREF, F_TIME, F_TOC, F_TOC_FROM_RANGE, m_bInLink, m_bInPara, m_bInTOC, m_bTOCsupported, m_stackField, PTO_Field, PTO_Hyperlink, PTX_Block, s_mapNameToField(), UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_return_val_if_fail, UT_SHOULD_NOT_HAPPEN, UT_Stack::viewTop(), and xxx_UT_DEBUGMSG.
bool IE_Imp_MsWord_97::_handleFieldEnd | ( | char * | command, | |
UT_uint32 | iPos | |||
) | [private] |
References _appendChar(), _appendObject(), _appendStrux(), _flush(), _insertTOC(), UT_UTF8String::appendUCS2(), F_HYPERLINK, F_MERGEFIELD, F_TOC, F_TOC_FROM_RANGE, m_bInLink, m_bInPara, m_bInTOC, m_bTOCsupported, m_stackField, PTO_Field, PTO_Hyperlink, PTX_Block, s_mapNameToField(), UT_DEBUGMSG, UT_return_val_if_fail, UT_UTF8String::utf8_str(), and UT_Stack::viewTop().
void IE_Imp_MsWord_97::_handleHeaders | ( | const wvParseStruct * | ps | ) | [private] |
References UT_GenericVector< T >::addItem(), header::d, DELETEPV, IE_Imp::getDoc(), PD_Document::getUID(), header::_d::hdr, UT_UniqueId::HeaderFtr, HF_FooterFirst, HF_HeaderFirst, HF_Unsupported, header::len, m_bEvenOddHeaders, m_iHeadersCount, m_iHeadersStart, m_pHeaders, header::pid, header::pos, type, header::type, UT_DEBUGMSG, and UT_return_if_fail.
Referenced by _docProc().
bool IE_Imp_MsWord_97::_handleHeadersText | ( | UT_uint32 | iDocPosition, | |
bool | bDoBlockIns | |||
) | [private] |
This function makes sure that the insert is happening at the correct place if we are in the header segment.
UT_uint32 iDocPosition: character position in the Word document stream
References _endSect(), _insertHeaderSection(), HF_Unsupported, m_bInENotes, m_bInFNotes, m_bInHeaders, m_bInSect, m_iCurrentHeader, m_iHeadersCount, m_iHeadersEnd, m_iHeadersStart, m_iPrevHeaderPosition, m_pHeaders, type, UT_DEBUGMSG, and xxx_UT_DEBUGMSG.
Referenced by _beginPara().
UT_Error IE_Imp_MsWord_97::_handleImage | ( | Blip * | b, | |
long | width, | |||
long | height, | |||
long | cropt, | |||
long | cropb, | |||
long | cropl, | |||
long | cropr | |||
) | [private] |
References _appendObject(), _ensureInBlock(), DELETEPV, abicollab::service::error(), IE_Imp::getDoc(), UT_UniqueId::Image, IE_ImpGraphic::loadGraphic(), MSWord_RasterImage, MSWord_VectorImage, PTO_Image, s_determineIEGFT(), s_determineImageType(), size, UT_DEBUGMSG, UT_ERROR, UT_OK, and UT_std_string_sprintf().
void IE_Imp_MsWord_97::_handleMetaData | ( | wvParseStruct * | ps | ) | [private] |
References IE_Imp::getDoc(), and print_summary_stream().
Referenced by _loadFile().
void IE_Imp_MsWord_97::_handleNotes | ( | const wvParseStruct * | ps | ) | [private] |
References DELETEPV, UT_UniqueId::Endnote, UT_UniqueId::Footnote, IE_Imp::getDoc(), PD_Document::getUID(), m_iEndnotesCount, m_iEndnotesStart, m_iFootnotesCount, m_iFootnotesStart, m_pEndnotes, m_pFootnotes, footnote::pid, footnote::ref_pos, PD_Document::setProperties(), footnote::txt_len, footnote::txt_pos, footnote::type, UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_NOT_REACHED, UT_return_if_fail, and UT_std_string_sprintf().
Referenced by _docProc().
bool IE_Imp_MsWord_97::_handleNotesText | ( | UT_uint32 | iDocPosition | ) | [private] |
This function makes sure that the insert is happening at the correct place if we are in a segment which belongs to one of the set of notes (foonotes & endnote, in future also annotations).
UT_uint32 iDocPosition: character position in the Word document stream
References _appendObject(), _appendStrux(), _endSect(), _findNextENoteSection(), _findNextFNoteSection(), UT_String::c_str(), m_bInENotes, m_bInFNotes, m_bInHeaders, m_bInPara, m_bInSect, m_charProps, m_charStyle, m_iEndnotesCount, m_iEndnotesEnd, m_iEndnotesStart, m_iFootnotesCount, m_iFootnotesEnd, m_iFootnotesStart, m_iNextENote, m_iNextFNote, m_paraProps, m_paraStyle, m_pEndnotes, m_pFootnotes, PTO_Field, PTX_Block, type, UT_DEBUGMSG, UT_std_string_sprintf(), and xxx_UT_DEBUGMSG.
This method imports an image that can be later used as an embedded object. The Blip pointer p contains the MS Word data we use to create the image "width" and "height" are the width and height of the object in inches. The routine returns the name of the data-item it creates is in the UT_UTF8String sImageName
References UT_String::c_str(), DELETEPV, abicollab::service::error(), IE_Imp::getDoc(), IEGFT_Unknown, UT_UniqueId::Image, IE_ImpGraphic::loadGraphic(), MSWord_RasterImage, MSWord_VectorImage, s_determineImageType(), size, UT_DEBUGMSG, UT_ERROR, UT_OK, and UT_String_sprintf().
void IE_Imp_MsWord_97::_handleStyleSheet | ( | const wvParseStruct * | ps | ) | [private] |
References _generateCharProps(), _generateParaProps(), PD_Style::addAttributes(), PD_Document::appendStyle(), UT_String::c_str(), UT_String::clear(), FREEP, gchar, PD_Style::getBasedOn(), IE_Imp::getDoc(), PD_Style::getFollowedBy(), PP_std_copyProps(), PT_MAX_ATTRIBUTES, s_convert_to_utf8(), s_translateStyleId(), UT_String::size(), UT_DEBUGMSG, UT_return_if_fail, and xxx_UT_DEBUGMSG.
Referenced by _docProc().
void IE_Imp_MsWord_97::_handleTextBoxes | ( | const wvParseStruct * | ps | ) | [private] |
References DELETEPV, m_iTextboxCount, m_iTextboxesStart, m_pTextboxes, textbox::ref_pos, textbox::txt_len, textbox::txt_pos, UT_DEBUGMSG, and UT_return_if_fail.
Referenced by _docProc().
bool IE_Imp_MsWord_97::_handleTextboxesText | ( | UT_uint32 | iDocPosition | ) | [private] |
This function makes sure that the insert is happening at the correct place if we are in a segment which belongs to one of the set of Textboxes
UT_uint32 iDocPosition: character position in the Word document stream
References _endSect(), _findNextTextboxSection(), m_bInFNotes, m_bInHeaders, m_bInSect, m_bInTextboxes, m_iNextTextbox, m_iTextboxCount, m_iTextboxesEnd, m_iTextboxesStart, m_pTextboxes, UT_DEBUGMSG, and xxx_UT_DEBUGMSG.
Referenced by _beginPara().
bool IE_Imp_MsWord_97::_ignorePosition | ( | UT_uint32 | pos | ) | [private] |
References HF_Unsupported, m_bInHeaders, m_bInTOC, m_bTOCsupported, m_iCurrentHeader, m_iHeadersCount, m_pHeaders, and type.
Referenced by _beginChar(), and _beginPara().
bool IE_Imp_MsWord_97::_insertBookmark | ( | bookmark * | bm | ) | [private] |
References _appendObject(), _flush(), UT_GenericVector< T >::addItem(), PD_Document::appendStrux(), abicollab::service::error(), IE_Imp::getDoc(), PD_Document::getLastFrag(), pf_Frag::getPrev(), pf_Frag_Strux::getStruxType(), pf_Frag::getType(), m_bCellOpen, m_bInTable, m_vecEmObjects, bookmark::name, emObject::objType, emObject::props1, emObject::props2, PTO_Bookmark, PTX_Block, bookmark::start, and UT_DEBUGMSG.
Referenced by _insertBookmarkIfAppropriate().
bool IE_Imp_MsWord_97::_insertBookmarkIfAppropriate | ( | UT_uint32 | iPos | ) | [private] |
bool IE_Imp_MsWord_97::_insertEndnote | ( | const footnote * | f, | |
UT_UCS4Char | c | |||
) | [private] |
References _appendFmt(), _appendObject(), _appendSpan(), _appendStrux(), _flush(), UT_String::c_str(), m_charProps, m_charStyle, footnote::pid, PTO_Field, PTX_EndEndnote, PTX_SectionEndnote, footnote::ref_pos, footnote::type, UT_return_val_if_fail, UT_std_string_sprintf(), and xxx_UT_DEBUGMSG.
Referenced by _insertNoteIfAppropriate().
bool IE_Imp_MsWord_97::_insertFootnote | ( | const footnote * | f, | |
UT_UCS4Char | c | |||
) | [private] |
References _appendFmt(), _appendObject(), _appendSpan(), _appendStrux(), _flush(), UT_String::c_str(), UT_String::empty(), m_charProps, m_charStyle, footnote::pid, PTO_Field, PTX_EndFootnote, PTX_SectionFootnote, footnote::ref_pos, footnote::type, UT_return_val_if_fail, UT_std_string_sprintf(), and xxx_UT_DEBUGMSG.
Referenced by _insertNoteIfAppropriate().
bool IE_Imp_MsWord_97::_insertHeaderSection | ( | bool | bDoBlockIns | ) | [private] |
A helper function that inserts the header/ftr section
References _appendFmt(), UT_GenericVector< T >::addItem(), PD_Document::appendFmt(), PD_Document::appendStrux(), UT_String::c_str(), d, header::d, header::_d::frag, IE_Imp::getDoc(), UT_GenericVector< T >::getItemCount(), PD_Document::getLastFrag(), pf_Frag::getType(), header::_d::hdr, HF_FooterEven, HF_FooterFirst, HF_FooterOdd, HF_HeaderEven, HF_HeaderFirst, HF_HeaderOdd, HF_Unsupported, m_bInHeaders, m_bInPara, m_bInSect, m_charProps, m_charStyle, m_iCurrentHeader, m_iLastAppendedHeader, m_paraProps, m_paraStyle, m_pHeaders, header::pid, PTX_Block, PTX_SectionHdrFtr, UT_String::size(), header::type, type, UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_NOT_REACHED, UT_return_val_if_fail, and UT_std_string_sprintf().
Referenced by _handleHeadersText().
bool IE_Imp_MsWord_97::_insertNoteIfAppropriate | ( | UT_uint32 | iDocPosition, | |
UT_UCS4Char | c | |||
) | [private] |
Determines whether footnote is to be inserted at present document position, and if so takes care of inserting the reference marker, note section and anchor marker.
returns true if a note was successfully inserted, false otherwise; if the return value is true, the caller should ignore the present character
we will take advantage of the notes being in document order, so we can just remember the last note we inserted, rather than having to search through the list
References _insertEndnote(), _insertFootnote(), m_bInENotes, m_bInFNotes, m_iEndnotesCount, m_iFootnotesCount, m_iNextENote, m_iNextFNote, m_pEndnotes, and m_pFootnotes.
bool IE_Imp_MsWord_97::_insertTOC | ( | field * | f | ) | [private] |
returns true if the TOC has been handled, false if the TOC type is unsupported
References _appendStrux(), UT_UTF8String::assign(), field::command, command, F_TOC, F_TOC_FROM_RANGE, FREEP, gchar, m_bInPara, PP_std_copyProps(), PTX_Block, PTX_EndTOC, PTX_SectionTOC, field::type, UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_MIN, UT_return_val_if_fail, UT_UTF8String_sprintf(), and UT_UTF8String::utf8_str().
Referenced by _handleFieldEnd().
bool IE_Imp_MsWord_97::_isTOCsupported | ( | field * | f | ) | [private] |
Word has several different toc tables (TOC, TOA, indexes); at the moment we only support TOC and even than only if it is based on heading styles
References field::command, command, F_TOC, F_TOC_FROM_RANGE, FREEP, field::type, UT_DEBUGMSG, and UT_return_val_if_fail.
Referenced by _handleCommandField().
bool IE_Imp_MsWord_97::_isVectorFull | ( | UT_NumberVector & | vec | ) | [private] |
Returns false if any element in the vector is non-zero
References UT_GenericVector< T >::size(), and xxx_UT_DEBUGMSG.
Referenced by _build_ColumnWidths().
UT_Error IE_Imp_MsWord_97::_loadFile | ( | GsfInput * | input | ) | [protected, virtual] |
Implements IE_Imp.
References _handleMetaData(), charProc(), docProc(), eleProc(), ErrCleanupAndExit, IE_Imp::getDoc(), IE_Imp::getLoadStylesOnly(), GetPassword, m_nSections, PD_Document::setAttrProp(), UT_UTF8String::size(), specCharProc(), UT_IE_BOGUSDOCUMENT, UT_IE_PROTECTED, and UT_UTF8String::utf8_str().
void IE_Imp_MsWord_97::_row_close | ( | ) | [private] |
References m_bRowOpen, and xxx_UT_DEBUGMSG.
Referenced by _beginPara(), and _table_close().
void IE_Imp_MsWord_97::_row_open | ( | const wvParseStruct * | ps | ) | [private] |
References m_bRowOpen, m_iCurrentCell, m_iCurrentRow, m_iLeft, m_iRight, and xxx_UT_DEBUGMSG.
Referenced by _beginPara().
bool IE_Imp_MsWord_97::_shouldUseInsert | ( | ) | const [private] |
References m_bInENotes, m_bInFNotes, m_bInHeaders, and m_bInTextboxes.
Referenced by _appendObject(), _appendSpan(), and _appendStrux().
int IE_Imp_MsWord_97::_specCharProc | ( | wvParseStruct * | ps, | |
UT_uint16 | eachchar, | |||
CHP * | achp | |||
) |
Referenced by specCharProc().
void IE_Imp_MsWord_97::_table_close | ( | const wvParseStruct * | ps, | |
const PAP * | apap | |||
) | [private] |
References _appendStrux(), _build_ColumnWidths(), _cell_close(), _row_close(), UT_String::c_str(), PD_Document::changeStruxAttsNoUpdate(), UT_GenericVector< T >::clear(), PD_Document::getBounds(), IE_Imp::getDoc(), PD_Document::getLastStruxOfType(), UT_GenericVector< T >::getNthItem(), m_bInPara, m_dim, m_iLeftCellPos, m_vecColumnWidths, PTX_EndTable, PTX_SectionTable, UT_GenericVector< T >::size(), UT_convertInchesToDimensionString(), UT_DEBUGMSG, UT_String_sprintf(), and UT_VECTOR_PURGEALL.
Referenced by _beginPara().
void IE_Imp_MsWord_97::_table_open | ( | ) | [private] |
References _appendStrux(), UT_GenericVector< T >::clear(), m_bCellOpen, m_bInPara, m_bRowOpen, m_iCurrentCell, m_iCurrentRow, m_vecColumnWidths, PTX_SectionTable, and UT_DEBUGMSG.
Referenced by _beginPara().
Returns true if a span in the m_vecColumnWidths span matches the left, right values given
References UT_GenericVector< T >::getNthItem(), MsColSpan::iLeft, MsColSpan::iRight, m_vecColumnWidths, and UT_GenericVector< T >::size().
Referenced by _build_ColumnWidths().
void IE_Imp_MsWord_97::setNumberVector | ( | UT_NumberVector & | vec, | |
UT_sint32 | i, | |||
UT_sint32 | val | |||
) | [private] |
Exand a vector with zeros to make room for a new value
References UT_GenericVector< T >::addItem(), and UT_GenericVector< T >::size().
Referenced by _build_ColumnWidths().
virtual bool IE_Imp_MsWord_97::supportsLoadStylesOnly | ( | ) | [inline, virtual] |
Reimplemented from IE_Imp.
bool IE_Imp_MsWord_97::m_bBidiMode [private] |
Referenced by _beginChar(), _beginPara(), _docProc(), and _flush().
bool IE_Imp_MsWord_97::m_bCellOpen [private] |
Referenced by _beginPara(), _cell_close(), _cell_open(), _insertBookmark(), and _table_open().
bool IE_Imp_MsWord_97::m_bEncounteredRevision [private] |
Referenced by _beginChar().
bool IE_Imp_MsWord_97::m_bEvenOddHeaders [private] |
Referenced by _docProc(), and _handleHeaders().
bool IE_Imp_MsWord_97::m_bInENotes [private] |
Referenced by _beginChar(), _beginPara(), _handleHeadersText(), _handleNotesText(), _insertNoteIfAppropriate(), and _shouldUseInsert().
bool IE_Imp_MsWord_97::m_bInFNotes [private] |
bool IE_Imp_MsWord_97::m_bInHeaders [private] |
bool IE_Imp_MsWord_97::m_bInLink [private] |
Referenced by _handleCommandField(), and _handleFieldEnd().
bool IE_Imp_MsWord_97::m_bInPara [private] |
Referenced by _appendObject(), _appendObjectHdrFtr(), _appendSpanHdrFtr(), _appendStruxHdrFtr(), _beginChar(), _beginPara(), _beginSect(), _cell_close(), _cell_open(), _endPara(), _endSect(), _ensureInBlock(), _flush(), _handleCommandField(), _handleFieldEnd(), _handleNotesText(), _insertHeaderSection(), _insertTOC(), _table_close(), and _table_open().
bool IE_Imp_MsWord_97::m_bInSect [private] |
bool IE_Imp_MsWord_97::m_bInTable [private] |
Referenced by _appendChar(), _beginPara(), and _insertBookmark().
bool IE_Imp_MsWord_97::m_bInTextboxes [private] |
Referenced by _appendObject(), _appendSpan(), _appendStrux(), _endSect(), _handleTextboxesText(), and _shouldUseInsert().
UT_sint32 IE_Imp_MsWord_97::m_bInTOC [private] |
Referenced by _handleCommandField(), _handleFieldEnd(), and _ignorePosition().
bool IE_Imp_MsWord_97::m_bIsLower [private] |
Referenced by _appendChar(), and _generateCharProps().
bool IE_Imp_MsWord_97::m_bLineBreakPending [private] |
Referenced by _endPara(), and _endSect().
bool IE_Imp_MsWord_97::m_bLTRCharContext [private] |
Referenced by _beginChar(), and _flush().
bool IE_Imp_MsWord_97::m_bLTRParaContext [private] |
Referenced by _beginChar(), and _beginPara().
bool IE_Imp_MsWord_97::m_bPageBreakPending [private] |
Referenced by _endSect().
bool IE_Imp_MsWord_97::m_bRowOpen [private] |
Referenced by _cell_open(), _row_close(), _row_open(), and _table_open().
bool IE_Imp_MsWord_97::m_bSetPageSize [private] |
Referenced by _beginSect().
bool IE_Imp_MsWord_97::m_bSymbolFont [private] |
Referenced by _beginChar().
bool IE_Imp_MsWord_97::m_bTOCsupported [private] |
Referenced by _handleCommandField(), _handleFieldEnd(), and _ignorePosition().
UT_String IE_Imp_MsWord_97::m_charProps [private] |
Referenced by _beginChar(), _beginPara(), _flush(), _handleNotesText(), _insertEndnote(), _insertFootnote(), and _insertHeaderSection().
UT_String IE_Imp_MsWord_97::m_charRevs [private] |
Referenced by _beginChar(), and _flush().
UT_String IE_Imp_MsWord_97::m_charStyle [private] |
Referenced by _beginChar(), _beginPara(), _handleNotesText(), _insertEndnote(), _insertFootnote(), and _insertHeaderSection().
UT_Dimension IE_Imp_MsWord_97::m_dim [private] |
Referenced by _beginSect(), _generateParaProps(), and _table_close().
UT_uint32 IE_Imp_MsWord_97::m_iAnnotationsEnd [private] |
Referenced by _beginChar(), _beginPara(), and _docProc().
Referenced by _beginChar(), _beginPara(), and _docProc().
UT_uint32 IE_Imp_MsWord_97::m_iBookmarksCount [private] |
Referenced by _handleBookmarks(), _insertBookmarkIfAppropriate(), and ~IE_Imp_MsWord_97().
int IE_Imp_MsWord_97::m_iCellsRemaining [private] |
Referenced by _beginPara().
int IE_Imp_MsWord_97::m_iCurrentCell [private] |
Referenced by _cell_open(), _row_open(), and _table_open().
UT_uint32 IE_Imp_MsWord_97::m_iCurrentHeader [private] |
int IE_Imp_MsWord_97::m_iCurrentRow [private] |
Referenced by _cell_open(), _row_open(), and _table_open().
UT_uint32 IE_Imp_MsWord_97::m_iCurrentSectId [private] |
Referenced by _beginSect().
UT_uint32 IE_Imp_MsWord_97::m_iEndnotesCount [private] |
Referenced by _beginChar(), _beginPara(), _handleNotes(), _handleNotesText(), and _insertNoteIfAppropriate().
UT_uint32 IE_Imp_MsWord_97::m_iEndnotesEnd [private] |
Referenced by _beginChar(), _beginPara(), _docProc(), and _handleNotesText().
UT_uint32 IE_Imp_MsWord_97::m_iEndnotesStart [private] |
Referenced by _beginChar(), _beginPara(), _docProc(), _handleNotes(), and _handleNotesText().
UT_uint32 IE_Imp_MsWord_97::m_iFootnotesCount [private] |
Referenced by _beginChar(), _beginPara(), _handleNotes(), _handleNotesText(), and _insertNoteIfAppropriate().
UT_uint32 IE_Imp_MsWord_97::m_iFootnotesEnd [private] |
Referenced by _beginChar(), _beginPara(), _docProc(), and _handleNotesText().
UT_uint32 IE_Imp_MsWord_97::m_iFootnotesStart [private] |
Referenced by _beginChar(), _beginPara(), _docProc(), _handleNotes(), and _handleNotesText().
UT_uint32 IE_Imp_MsWord_97::m_iHeadersCount [private] |
UT_uint32 IE_Imp_MsWord_97::m_iHeadersEnd [private] |
Referenced by _beginChar(), _beginPara(), _docProc(), and _handleHeadersText().
UT_uint32 IE_Imp_MsWord_97::m_iHeadersStart [private] |
Referenced by _beginChar(), _beginPara(), _docProc(), _handleHeaders(), and _handleHeadersText().
Referenced by _insertHeaderSection().
UT_sint32 IE_Imp_MsWord_97::m_iLeft [private] |
Referenced by _cell_open(), and _row_open().
UT_sint32 IE_Imp_MsWord_97::m_iLeftCellPos [private] |
Referenced by _cell_open(), and _table_close().
UT_uint32 IE_Imp_MsWord_97::m_iListIdIncrement[9] [private] |
Referenced by _beginPara(), and IE_Imp_MsWord_97().
UT_uint32 IE_Imp_MsWord_97::m_iMacrosEnd [private] |
Referenced by _beginChar(), _beginPara(), and _docProc().
UT_uint32 IE_Imp_MsWord_97::m_iMacrosStart [private] |
Referenced by _beginChar(), _beginPara(), and _docProc().
UT_uint32 IE_Imp_MsWord_97::m_iMSWordListId [private] |
Referenced by _beginPara().
UT_uint32 IE_Imp_MsWord_97::m_iNextENote [private] |
Referenced by _beginChar(), _beginPara(), _findNextENoteSection(), _handleNotesText(), and _insertNoteIfAppropriate().
UT_uint32 IE_Imp_MsWord_97::m_iNextFNote [private] |
Referenced by _beginChar(), _beginPara(), _findNextFNoteSection(), _handleNotesText(), and _insertNoteIfAppropriate().
UT_sint32 IE_Imp_MsWord_97::m_iNextTextbox [private] |
Referenced by _findNextTextboxSection(), and _handleTextboxesText().
Referenced by _handleHeadersText().
UT_sint32 IE_Imp_MsWord_97::m_iRight [private] |
Referenced by _cell_open(), and _row_open().
int IE_Imp_MsWord_97::m_iRowsRemaining [private] |
Referenced by _beginPara().
UT_sint32 IE_Imp_MsWord_97::m_iTextboxCount [private] |
Referenced by _handleTextBoxes(), and _handleTextboxesText().
UT_uint32 IE_Imp_MsWord_97::m_iTextboxesEnd [private] |
Referenced by _beginPara(), _docProc(), _eleProc(), and _handleTextboxesText().
UT_uint32 IE_Imp_MsWord_97::m_iTextboxesStart [private] |
Referenced by _beginPara(), _docProc(), _handleTextBoxes(), and _handleTextboxesText().
UT_uint32 IE_Imp_MsWord_97::m_iTextEnd [private] |
Referenced by _beginChar(), _beginPara(), and _docProc().
UT_uint32 IE_Imp_MsWord_97::m_iTextStart [private] |
Referenced by _beginChar(), _beginPara(), and _docProc().
UT_uint32 IE_Imp_MsWord_97::m_nSections [private] |
Referenced by _beginSect(), _flush(), and _loadFile().
UT_String IE_Imp_MsWord_97::m_paraProps [private] |
Referenced by _beginPara(), _handleNotesText(), and _insertHeaderSection().
UT_String IE_Imp_MsWord_97::m_paraStyle [private] |
Referenced by _beginPara(), _handleNotesText(), and _insertHeaderSection().
bookmark* IE_Imp_MsWord_97::m_pBookmarks [private] |
Referenced by _handleBookmarks(), _insertBookmarkIfAppropriate(), and ~IE_Imp_MsWord_97().
footnote* IE_Imp_MsWord_97::m_pEndnotes [private] |
Referenced by _beginChar(), _beginPara(), _handleNotes(), _handleNotesText(), _insertNoteIfAppropriate(), and ~IE_Imp_MsWord_97().
footnote* IE_Imp_MsWord_97::m_pFootnotes [private] |
Referenced by _beginChar(), _beginPara(), _handleNotes(), _handleNotesText(), _insertNoteIfAppropriate(), and ~IE_Imp_MsWord_97().
header* IE_Imp_MsWord_97::m_pHeaders [private] |
pf_Frag* IE_Imp_MsWord_97::m_pNotesEndSection [private] |
Referenced by _appendObject(), _appendSpan(), _appendStrux(), _findNextENoteSection(), and _findNextFNoteSection().
pf_Frag* IE_Imp_MsWord_97::m_pTextboxEndSection [private] |
Referenced by _appendObject(), _appendSpan(), _appendStrux(), and _findNextTextboxSection().
textbox* IE_Imp_MsWord_97::m_pTextboxes [private] |
Referenced by _handleTextBoxes(), _handleTextboxesText(), and ~IE_Imp_MsWord_97().
UT_UCS4String IE_Imp_MsWord_97::m_pTextRun [private] |
Referenced by _appendChar(), _endSect(), and _flush().
UT_Stack IE_Imp_MsWord_97::m_stackField [private] |
Referenced by _handleCommandField(), and _handleFieldEnd().
Referenced by _beginPara().
Referenced by _beginPara(), and _cell_open().
UT_GenericVector<MsColSpan *> IE_Imp_MsWord_97::m_vecColumnWidths [private] |
Referenced by _build_ColumnWidths(), _cell_open(), _table_close(), _table_open(), and findMatchSpan().
UT_GenericVector<emObject*> IE_Imp_MsWord_97::m_vecEmObjects [private] |
Referenced by _flush(), _insertBookmark(), and ~IE_Imp_MsWord_97().
UT_GenericVector<textboxPos *> IE_Imp_MsWord_97::m_vecTextboxPos [private] |
Referenced by _findNextTextboxSection(), IE_Imp_MsWord_97(), and ~IE_Imp_MsWord_97().
Referenced by _beginPara().
UT_Vector IE_Imp_MsWord_97::m_vLists [private] |
Referenced by _beginPara(), and ~IE_Imp_MsWord_97().