Classes | Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

IE_Imp_RTF Class Reference

#include <ie_imp_RTF.h>

Inheritance diagram for IE_Imp_RTF:
IE_Imp

List of all members.

Classes

struct  _rtfAbiListTable

Public Types

enum  PictFormat {
  picNone, picPNG, picJPEG, picBMP,
  picWMF, picPICT, picEMF, picGIF,
  picSVG
}

Public Member Functions

 IE_Imp_RTF (PD_Document *pDocument)
 ~IE_Imp_RTF ()
virtual bool supportsLoadStylesOnly () const
virtual bool pasteFromBuffer (PD_DocumentRange *pDocRange, const unsigned char *pData, UT_uint32 lenData, const char *szEncoding=0)
UT_sint32 get_vecWord97ListsCount (void) const
RTF_msword97_listget_vecWord97NthList (UT_sint32 i) const
bool isWord97Lists (void) const
bool FlushStoredChars (bool forceInsertPara=false)
bool PushRTFState ()
bool PopRTFState ()
bool ParseChar (UT_UCSChar ch, bool no_convert=1)
void setStruxImage (bool b)
bool isStruxImage (void) const
bool TranslateKeywordID (RTF_KEYWORD_ID keywordID, UT_sint32 param, bool fParam)
bool insertStrux (PTStruxType pts, const gchar **attrs=NULL, const gchar **props=NULL)
bool StandardKeywordParser (IE_Imp_RTFGroupParser *parser)
bool HandlePicture ()
void clearImageName (void)
bool SkipCurrentGroup (bool bConsumeLastBrace=false)
bool HandleAbiTable (void)
bool HandleAbiCell (void)
bool HandleAbiEndTable (void)
bool HandleAbiEndCell (void)
bool HandleAbiLists (void)
bool HandleAbiMathml (void)
bool CreateDataItemfromStream (void)
bool HandleAbiEmbed (void)
bool isPastedTableOpen (void)
bool markPasteBlock (void)
bool isBlockNeededForPasteTable (void)
bool HandleLists (_rtfListTable &rtfListTable)
UT_uint32 mapID (UT_uint32 id)
UT_uint32 mapParentID (UT_uint32 id)
bool ResetCellAttributes (void)
bool ResetTableAttributes (void)
ie_imp_tablegetTable (void)
ie_imp_cellgetCell (void)
void FlushCellProps (void)
void FlushTableProps (void)
void OpenTable (bool bDontFlush=false)
void CloseTable (bool bForceClose=false)
void SaveRowInfo (void)
void RemoveRowInfo (void)
void HandleCell (void)
void HandleCellX (UT_sint32 cellx)
void HandleRow (void)
UT_sint32 getPasteDepth (void)
void closePastedTableIfNeeded (void)
void HandleShapeText (RTFProps_FrameProps &frame)
void addFrame (RTFProps_FrameProps &frame)
bool isFrameIn (void)
bool bUseInsertNotAppend (void)

Protected Member Functions

virtual UT_Error _loadFile (GsfInput *input)
UT_Error _parseFile (GsfInput *fp)
UT_Error _writeHeader (GsfInput *fp)
UT_Error _parseHdrFtr ()
UT_Error _parseText ()

Private Types

enum  RTFBookmarkType { RBT_START = 0, RBT_END }
enum  RTFTokenType {
  RTF_TOKEN_NONE = 0, RTF_TOKEN_OPEN_BRACE, RTF_TOKEN_CLOSE_BRACE, RTF_TOKEN_KEYWORD,
  RTF_TOKEN_DATA, RTF_TOKEN_ERROR = -1
}

Private Member Functions

bool AddChar (UT_UCSChar ch)
bool StartNewPara ()
bool HandleParKeyword ()
bool StartNewSection ()
bool ParseRTFKeyword ()
bool ReadCharFromFileWithCRLF (unsigned char *pCh)
bool ReadCharFromFile (unsigned char *pCh)
bool ReadContentFromFile (UT_UTF8String &str)
std::string s_unEscapeXMLString ()
 Reads back data that was written with IE_Exp_RTF::s_escapeXMLString().
UT_UCS4Char ReadHexChar (void)
bool SkipBackChar (unsigned char ch)
bool ReadKeyword (unsigned char *pKeyword, UT_sint32 *pParam, bool *pParamUsed, UT_uint32 keywordBuffLen)
bool TranslateKeyword (unsigned char *pKeyword, UT_sint32 param, bool fParam)
RTF_KEYWORD_ID KeywordToID (const char *keyword)
bool HandleStarKeyword ()
bool HandlePCData (UT_UTF8String &str)
bool HandlePCData (std::string &str)
bool ReadColourTable ()
bool ReadFontTable ()
bool RegisterFont (RTFFontTableItem::FontFamilyEnum fontFamily, RTFFontTableItem::FontPitch pitch, UT_uint16 fontIndex, int charSet, int codepage, UT_UTF8String sFontNames[])
bool PostProcessAndValidatePanose (UT_UTF8String &Panose)
bool ReadRevisionTable ()
void setEncoding ()
bool ReadRDFTriples ()
bool HandleObject ()
bool HandleField ()
bool HandleStyleDefinition (void)
bool HandleHeaderFooter (RTFHdrFtr::HdrFtrType hftype, UT_uint32 &headerID)
bool StuffCurrentGroup (UT_ByteBuf &buf)
bool LoadPictData (PictFormat format, const char *image_name, struct RTFProps_ImageProps &imgProps, bool isBinary=false, long binaryLen=0)
bool InsertImage (const FG_Graphic *, const char *image_name, const struct RTFProps_ImageProps &imgProps)
RTFFontTableItemGetNthTableFont (UT_sint32 fontNum)
UT_uint32 GetNthTableColour (UT_sint32 colNum)
UT_sint32 GetNthTableBgColour (UT_sint32 colNum)
bool ReadListTable (void)
bool HandleListLevel (RTF_msword97_list *pList, UT_uint32 levelCount)
bool HandleTableList (void)
char * getCharsInsideBrace (void)
bool ParseCharParaProps (unsigned char *pKeyword, UT_sint32 param, bool fParam, RTFProps_CharProps *pChars, RTFProps_ParaProps *pParas, RTFProps_bCharProps *pbChars, RTFProps_bParaProps *pbParas)
bool ReadListOverrideTable (void)
bool HandleTableListOverride (void)
bool buildAllProps (std::string &s, RTFProps_ParaProps *pParas, RTFProps_CharProps *pChars, RTFProps_bParaProps *pbParas, RTFProps_bCharProps *pbChars)
bool ResetCharacterAttributes ()
bool buildCharacterProps (std::string &propBuffer)
bool ApplyCharacterAttributes ()
bool HandleBoolCharacterProp (bool state, bool *pProp)
bool HandleDeleted (bool state)
bool HandleBold (bool state)
bool HandleItalic (bool state)
bool HandleHidden (bool state)
bool HandleUnderline (bool state)
bool HandleOverline (bool state)
bool HandleStrikeout (bool state)
bool HandleTopline (bool state)
bool HandleBotline (bool state)
bool HandleSuperscript (bool state)
bool HandleSuperscriptPosition (UT_uint32 pos)
bool HandleSubscript (bool state)
bool HandleSubscriptPosition (UT_uint32 pos)
bool HandleFontSize (long sizeInHalfPoints)
bool HandleBookmark (RTFBookmarkType type)
bool HandleRDFAnchor (RTFBookmarkType type)
bool HandleListTag (long id)
bool HandleDeltaMoveID ()
bool HandleRevisedText (PP_RevisionType eType, UT_uint32 iId)
bool HandleRevisedTextTimestamp (UT_uint32 iDttm)
bool HandleFloatCharacterProp (double val, double *pProp)
bool HandleU32CharacterProp (UT_uint32 val, UT_uint32 *pProp)
bool HandleFace (UT_uint32 fontNumber)
bool HandleColour (UT_uint32 colourNumber)
bool HandleBackgroundColour (UT_uint32 colourNumber)
bool ResetParagraphAttributes ()
bool ApplyParagraphAttributes (bool bDontInsert=false)
bool SetParaJustification (RTFProps_ParaProps::ParaJustification just)
bool AddTabstop (UT_sint32 stopDist, eTabType tabType, eTabLeader tableader)
bool AddTabstop (UT_sint32 stopDist, eTabType tabType, eTabLeader tabLeader, RTFProps_ParaProps *pParas)
void HandleNote ()
void StartAnnotation ()
void EndAnnotation ()
void HandleAnnotation ()
void HandleNoteReference ()
void HandleShape (void)
void HandleShapePict (void)
bool HandleInfoMetaData (void)
void _setStringProperty (std::string &sPropString, const char *szProp, const char *szVal)
bool ApplySectionAttributes ()
bool ResetSectionAttributes ()
RTFTokenType NextToken (unsigned char *pKeyword, UT_sint32 *pParam, bool *pParamUsed, UT_uint32 len, bool bIgnoreWhiteSpace=false)
UT_Error _isBidiDocument ()
bool _appendSpan ()
bool _insertSpan ()
void _formRevisionAttr (std::string &s, const std::string &props, const std::string &style)
_rtfAbiListTablegetAbiList (UT_uint32 i) const
RTF_msword97_listOverride_getTableListOverride (UT_uint32 id)
void _appendHdrFtr ()
bool _appendField (const gchar *xmlField, const gchar **pszAttribs=NULL)
gchar * _parseFldinstBlock (UT_ByteBuf &buf, gchar *xmlField, bool &isXML)

Static Private Member Functions

static bool digVal (char ch, int &value, int base)
static bool hexVal (char c, int &value)
static void _initialKeywordSort (void)

Private Attributes

UT_GrowBuf m_gbBlock
char * m_szFileDirName
int m_groupCount
bool m_newParaFlagged
bool m_newSectionFlagged
int m_cbBin
UT_uint32 m_currentHdrID
UT_uint32 m_currentFtrID
UT_uint32 m_currentHdrEvenID
UT_uint32 m_currentFtrEvenID
UT_uint32 m_currentHdrFirstID
UT_uint32 m_currentFtrFirstID
UT_uint32 m_currentHdrLastID
UT_uint32 m_currentFtrLastID
UT_Stack m_stateStack
RTFStateStore m_currentRTFState
std::vector< RTFFontTableItem * > m_fontTable
std::vector< UT_sint32m_colourTable
std::vector< RTFHdrFtr * > m_hdrFtrTable
std::vector< std::string > m_styleTable
std::vector< _rtfAbiListTable * > m_vecAbiListTable
UT_uint32 m_numLists
bool m_bisAbiList
bool m_bisNOTList
bool m_bParaHasRTFList
bool m_bParaHasRTFContinue
GsfInput * m_pImportFile
const unsigned char * m_pPasteBuffer
UT_uint32 m_lenPasteBuffer
const unsigned char * m_pCurrentCharInPasteBuffer
PT_DocPosition m_dposPaste
PT_DocPosition m_dOrigPos
UT_uint32 deflangid
UT_UCS4_mbtowc m_mbtowc
bool m_parsingHdrFtr
UT_uint32 m_icurOverride
UT_uint32 m_icurOverrideLevel
std::vector< RTF_msword97_list * > m_vecWord97Lists
std::vector
< RTF_msword97_listOverride * > 
m_vecWord97ListOverride
bool m_bAppendAnyway
RTFProps_SectionProps m_sectdProps
ie_imp_table_control m_TableControl
pf_Frag_Struxm_lastCellSDH
bool m_bNestTableProps
bool m_bParaWrittenForSection
bool m_bCellBlank
bool m_bEndTableOpen
bool m_bInFootnote
UT_sint32 m_iDepthAtFootnote
UT_uint32 m_iLastFootnoteId
UT_uint32 m_iLastEndnoteId
std::string m_hyperlinkBase
UT_uint32 m_iHyperlinkOpen
UT_uint32 m_iRDFAnchorOpen
bool m_bBidiMode
UT_Stack m_pasteTableStack
bool m_bFootnotePending
bool m_bFtnReferencePending
bool m_bNoteIsFNote
bool m_bStyleImportDone
bool m_bCellHandled
bool m_bContentFlushed
bool m_bRowJustPassed
UT_sint32 m_iStackLevelAtRow
bool m_bDoCloseTable
UT_sint32 m_iNoCellsSinceLastRow
RTFStateStore m_FootnoteRefState
bool m_bFieldRecognized
UT_sint32 m_iIsInHeaderFooter
bool m_bSectionHasPara
bool m_bStruxInserted
bool m_bStruxImage
UT_UTF8String m_sImageName
bool m_bFrameStruxIn
UT_BidiCharType m_iAutoBidiOverride
UT_BidiCharType m_iBidiLastType
UT_BidiCharType m_iBidiNextType
const char * m_szDefaultEncoding
int m_iDefaultFontNumber
PT_DocPosition m_dPosBeforeFootnote
bool m_bMovedPos
ABI_RTF_Annotationm_pAnnotation
pf_Fragm_pDelayedFrag
PT_DocPosition m_posSavedDocPosition
bool m_bInAnnotation
bool m_bFrameTextBox
bool m_bParaActive
bool m_bCellActive
std::string m_ctMoveID
PD_XMLIDCreatorHandle m_XMLIDCreatorHandle
std::map< std::string,
std::string > 
m_rdfAnchorCloseXMLIDs

Static Private Attributes

static bool keywordSorted = false

Member Enumeration Documentation

Enumerator:
picNone 
picPNG 
picJPEG 
picBMP 
picWMF 
picPICT 
picEMF 
picGIF 
picSVG 
Enumerator:
RBT_START 
RBT_END 
enum IE_Imp_RTF::RTFTokenType [private]
Enumerator:
RTF_TOKEN_NONE 
RTF_TOKEN_OPEN_BRACE 
RTF_TOKEN_CLOSE_BRACE 
RTF_TOKEN_KEYWORD 
RTF_TOKEN_DATA 
RTF_TOKEN_ERROR 

Constructor & Destructor Documentation


Member Function Documentation

RTF_msword97_listOverride * IE_Imp_RTF::_getTableListOverride ( UT_uint32  id  )  [private]

Get list override of given id

Parameters:
id Id of list override
Returns:
List override or NULL if not found

The old code in ApplyParagraphAttributes would use the given id as an index to the vector of list overrides. But these can be given arbitrary ids from 1 to 2000, so the code would not always have worked. Also, and more relevant, this function handles an id of 0, as output by StarWriter/OpenOffice even though it is not allowed in the spec.

References RTF_msword97_listOverride::m_RTF_listID, m_vecWord97ListOverride, and UT_ASSERT_NOT_REACHED.

Referenced by ApplyParagraphAttributes().

void IE_Imp_RTF::_initialKeywordSort ( void   )  [static, private]
UT_Error IE_Imp_RTF::_isBidiDocument (  )  [private]
UT_Error IE_Imp_RTF::_loadFile ( GsfInput *  input  )  [protected, virtual]
UT_Error IE_Imp_RTF::_parseHdrFtr (  )  [protected]
void IE_Imp_RTF::_setStringProperty ( std::string &  sPropsString,
const char *  szProp,
const char *  szVal 
) [private]

Set a property, value pair in the supplied string. This is just a convience wrapper function to use const char * strings

References UT_std_string_setProperty().

Referenced by TranslateKeywordID().

UT_Error IE_Imp_RTF::_writeHeader ( GsfInput *  fp  )  [protected]

Referenced by _loadFile().

bool IE_Imp_RTF::AddChar ( UT_UCSChar  ch  )  [private]
bool IE_Imp_RTF::ApplyParagraphAttributes ( bool  bDontInsert = false  )  [private]

Now insert this into the pAuto List

References _getTableListOverride(), fl_AutoNum::addItem(), PD_Document::addList(), PD_Document::appendFmt(), PD_Document::appendFmtMark(), PD_Document::appendObject(), PD_Document::appendSpan(), PD_Document::appendStrux(), RTF_msword97_listOverride::buildAbiListProperties(), buildCharacterProps(), bUseInsertNotAppend(), PD_Document::changeStruxFmt(), CloseTable(), DIM_IN, fl_AutoNum::findAndSetParentItem(), fl_AutoNum::fixHierarchy(), fl_AutoNum::fl_AutoNum(), FL_TAB_BAR, FL_TAB_CENTER, FL_TAB_DECIMAL, FL_TAB_LEFT, FL_TAB_RIGHT, gchar, XAP_App::getApp(), RTF_msword97_listOverride::getBgColourNumber(), RTF_msword97_listOverride::getBold(), RTF_msword97_listOverride::getColourNumber(), XAP_Frame::getCurrentView(), IE_Imp::getDoc(), RTF_msword97_listOverride::getFontNumber(), RTF_msword97_listOverride::getFontSize(), RTF_msword97_listOverride::getHasBgColour(), RTF_msword97_listOverride::getHasColour(), RTF_msword97_listOverride::getItalic(), XAP_App::getLastFocussedFrame(), PD_Document::getListByID(), PD_Document::getListsCount(), ie_imp_table_control::getNestDepth(), PD_Document::getNthList(), GetNthTableBgColour(), GetNthTableColour(), GetNthTableFont(), RTF_msword97_listOverride::getStrikeout(), PD_Document::getStruxOfTypeFromPosition(), RTF_msword97_listOverride::getSubscript(), RTF_msword97_listOverride::getSubscriptPos(), RTF_msword97_listOverride::getSuperscript(), RTF_msword97_listOverride::getSuperscriptPos(), getTable(), RTF_msword97_listOverride::getTabLeaderVect(), RTF_msword97_listOverride::getTabStopVect(), RTF_msword97_listOverride::getTabTypeVect(), RTF_msword97_listOverride::getUnderline(), fl_AutoLists::getXmlList(), fl_AutoLists::getXmlListsSize(), PD_Document::insertSpan(), insertStrux(), PD_Document::insertStruxBeforeFrag(), RTF_msword97_listOverride::isBoldChanged(), RTF_msword97_listOverride::isFontNumberChanged(), RTF_msword97_listOverride::isFontSizeChanged(), RTF_msword97_listOverride::isHasBgColourChanged(), RTF_msword97_listOverride::isHasColourChanged(), FV_View::isHdrFtrEdit(), RTF_msword97_listOverride::isItalicChanged(), fl_AutoNum::isItem(), RTF_msword97_listOverride::isStrikeoutChanged(), RTF_msword97_listOverride::isSubscriptChanged(), RTF_msword97_listOverride::isSuperscriptChanged(), RTF_msword97_listOverride::isTab(), RTF_msword97_listOverride::isUnderlineChanged(), isWord97Lists(), RTFProps_ParaProps::m_bBotBorder, m_bCellBlank, m_bDoCloseTable, m_bEndTableOpen, ABI_Paste_Table::m_bHasPastedCellStrux, ABI_Paste_Table::m_bHasPastedTableStrux, RTFProps_ParaProps::m_bInTable, RTFProps_ParaProps::m_bLeftBorder, RTFProps_ParaProps::m_bMergeBordersShading, m_bParaWrittenForSection, RTFProps_ParaProps::m_bRightBorder, m_bSectionHasPara, RTFProps_ParaProps::m_bTopBorder, m_currentRTFState, RTFProps_ParaProps::m_dir, m_dposPaste, RTFProps_ParaProps::m_iBotBorderCol, RTFProps_ParaProps::m_iBotBorderSpacing, RTFProps_ParaProps::m_iBotBorderStyle, RTFProps_ParaProps::m_iBotBorderWidth, RTFProps_ParaProps::m_iLeftBorderCol, RTFProps_ParaProps::m_iLeftBorderSpacing, RTFProps_ParaProps::m_iLeftBorderStyle, RTFProps_ParaProps::m_iLeftBorderWidth, RTFProps_ParaProps::m_indentFirst, RTFProps_ParaProps::m_indentLeft, RTFProps_ParaProps::m_indentRight, RTFProps_ParaProps::m_iOverride, RTFProps_ParaProps::m_iOverrideLevel, RTFProps_ParaProps::m_iRightBorderCol, RTFProps_ParaProps::m_iRightBorderSpacing, RTFProps_ParaProps::m_iRightBorderStyle, RTFProps_ParaProps::m_iRightBorderWidth, RTFProps_ParaProps::m_iShadingBackCol, RTFProps_ParaProps::m_iShadingForeCol, RTFProps_ParaProps::m_iShadingPattern, RTFProps_ParaProps::m_isList, RTFProps_ParaProps::m_iTopBorderCol, RTFProps_ParaProps::m_iTopBorderSpacing, RTFProps_ParaProps::m_iTopBorderStyle, RTFProps_ParaProps::m_iTopBorderWidth, RTFProps_ParaProps::m_justification, RTFProps_ParaProps::m_level, RTFProps_ParaProps::m_lineSpaceExact, RTFProps_ParaProps::m_lineSpaceVal, m_newParaFlagged, RTFStateStore::m_paraProps, m_pasteTableStack, m_pDelayedFrag, RTFFontTableItem::m_pFontName, m_posSavedDocPosition, RTFProps_ParaProps::m_pszFieldFont, RTFProps_ParaProps::m_pszListDecimal, RTFProps_ParaProps::m_pszListDelim, RTFProps_ParaProps::m_pszStyle, RTFProps_ParaProps::m_rawID, RTFProps_ParaProps::m_rawParentID, RTFStateStore::m_revAttr, RTFProps_ParaProps::m_spaceAfter, RTFProps_ParaProps::m_spaceBefore, RTFProps_ParaProps::m_startValue, RTFProps_ParaProps::m_styleNumber, m_styleTable, RTFProps_ParaProps::m_tabLeader, m_TableControl, RTFProps_ParaProps::m_tableLevel, RTFProps_ParaProps::m_tabStops, RTFProps_ParaProps::m_tabTypes, mapID(), mapParentID(), fl_AutoNum::markAsDirty(), markPasteBlock(), OpenTable(), RTFProps_ParaProps::pjCentre, RTFProps_ParaProps::pjFull, RTFProps_ParaProps::pjLeft, RTFProps_ParaProps::pjRight, PT_MAX_ATTRIBUTES, PTC_SetFmt, PTO_Field, PTX_Block, UT_UTF8String::size(), std_size_string(), PD_Document::StopList(), UT_ASSERT_HARMLESS, UT_ASSERT_NOT_REACHED, UT_BIDI_RTL, UT_convertInchesToDimensionString(), UT_convertToDimensionlessString(), UT_convertToInches(), UT_DEBUGMSG, UT_formatDimensionedValue(), UT_return_val_if_fail, UT_std_string_sprintf(), UT_UTF8String::utf8_str(), UT_Stack::viewTop(), and xxx_UT_DEBUGMSG.

Referenced by ApplyCharacterAttributes(), FlushStoredChars(), and HandleParKeyword().

bool IE_Imp_RTF::buildAllProps ( std::string &  s,
RTFProps_ParaProps pParas,
RTFProps_CharProps pChars,
RTFProps_bParaProps pbParas,
RTFProps_bCharProps pbChars 
) [private]

This method builds the property list from Paragraph and character classes pParas and pChars

References RTFProps_bCharProps::bm_bold, RTFProps_bCharProps::bm_botline, RTFProps_bCharProps::bm_fontNumber, RTFProps_bCharProps::bm_fontSize, RTFProps_bCharProps::bm_hasBgColour, RTFProps_bCharProps::bm_hasColour, RTFProps_bParaProps::bm_indentFirst, RTFProps_bParaProps::bm_indentLeft, RTFProps_bParaProps::bm_indentRight, RTFProps_bCharProps::bm_italic, RTFProps_bParaProps::bm_justification, RTFProps_bParaProps::bm_lineSpaceVal, RTFProps_bCharProps::bm_listTag, RTFProps_bCharProps::bm_overline, RTFProps_bParaProps::bm_spaceAfter, RTFProps_bParaProps::bm_spaceBefore, RTFProps_bCharProps::bm_strikeout, RTFProps_bCharProps::bm_subscript, RTFProps_bCharProps::bm_subscript_pos, RTFProps_bCharProps::bm_superscript, RTFProps_bCharProps::bm_superscript_pos, RTFProps_bCharProps::bm_topline, RTFProps_bCharProps::bm_underline, DIM_IN, FL_TAB_BAR, FL_TAB_CENTER, FL_TAB_DECIMAL, FL_TAB_LEFT, FL_TAB_RIGHT, GetNthTableBgColour(), GetNthTableColour(), GetNthTableFont(), RTFProps_CharProps::m_bgcolourNumber, RTFProps_CharProps::m_bold, RTFProps_CharProps::m_botline, RTFProps_CharProps::m_colourNumber, RTFProps_CharProps::m_fontNumber, RTFProps_CharProps::m_fontSize, RTFProps_CharProps::m_hasColour, RTFProps_ParaProps::m_indentFirst, RTFProps_ParaProps::m_indentLeft, RTFProps_ParaProps::m_indentRight, RTFProps_CharProps::m_italic, RTFProps_ParaProps::m_justification, RTFProps_ParaProps::m_lineSpaceExact, RTFProps_ParaProps::m_lineSpaceVal, RTFProps_CharProps::m_listTag, RTFProps_CharProps::m_overline, RTFFontTableItem::m_pFontName, RTFProps_ParaProps::m_spaceAfter, RTFProps_ParaProps::m_spaceBefore, RTFProps_CharProps::m_strikeout, RTFProps_CharProps::m_subscript, RTFProps_CharProps::m_superscript, RTFProps_CharProps::m_szLang, RTFProps_ParaProps::m_tabLeader, RTFProps_ParaProps::m_tabStops, RTFProps_ParaProps::m_tabTypes, RTFProps_CharProps::m_topline, RTFProps_CharProps::m_underline, RTFProps_ParaProps::pjCentre, RTFProps_ParaProps::pjFull, RTFProps_ParaProps::pjLeft, RTFProps_ParaProps::pjRight, std_size_string(), UT_ASSERT_HARMLESS, UT_ASSERT_NOT_REACHED, UT_convertInchesToDimensionString(), UT_convertToDimensionlessString(), UT_DEBUGMSG, UT_SHOULD_NOT_HAPPEN, and UT_std_string_sprintf().

Referenced by HandleStyleDefinition().

void IE_Imp_RTF::clearImageName ( void   )  [inline]
bool IE_Imp_RTF::digVal ( char  ch,
int &  value,
int  base 
) [static, private]

Referenced by hexVal().

UT_sint32 IE_Imp_RTF::get_vecWord97ListsCount ( void   )  const [inline]
RTF_msword97_list* IE_Imp_RTF::get_vecWord97NthList ( UT_sint32  i  )  const [inline]
_rtfAbiListTable* IE_Imp_RTF::getAbiList ( UT_uint32  i  )  const [inline, private]

Referenced by HandleAbiLists(), mapID(), and mapParentID().

ie_imp_cell * IE_Imp_RTF::getCell ( void   ) 
char * IE_Imp_RTF::getCharsInsideBrace ( void   )  [private]

This is a general purpose parameter reader. It returns the value of a keyword surrounded by a brace. For a construct of the form... { fred} ^ Current read point. It will return fred and swallow the closing brace. For a construct of the form { fred;} ^ Current read point. It will return fred and swallow the closing brace and semicolon. For a construct of the form { { fred;} { fred2} { { fred}}} ^ Current read point. It will return { fred;} { fred2} { { fred}} and swallow the closing brace. returns NULL on error.

References MAX_KEYWORD_LEN, ReadCharFromFile(), and SkipBackChar().

Referenced by HandleListLevel(), and HandleTableList().

UT_sint32 IE_Imp_RTF::GetNthTableBgColour ( UT_sint32  colNum  )  [private]
UT_uint32 IE_Imp_RTF::GetNthTableColour ( UT_sint32  colNum  )  [private]
RTFFontTableItem * IE_Imp_RTF::GetNthTableFont ( UT_sint32  fontNum  )  [private]
bool IE_Imp_RTF::HandleBold ( bool  state  )  [private]
bool IE_Imp_RTF::HandleBotline ( bool  state  )  [private]
bool IE_Imp_RTF::HandleDeleted ( bool  state  )  [private]
bool IE_Imp_RTF::HandleFace ( UT_uint32  fontNumber  )  [private]
bool IE_Imp_RTF::HandleField (  )  [private]

Handle a RTF field

Returns:
false if failed Once the \field has been read, handle the object contained in the current group. This is really tricky as fields are really hard to handle since most writers do whatever they want, including RTF code interleaved with field instruction. Thank you Microsoft (sorry for the rant). Call IE_Imp_RTF::_parseFldinstBlock to parse field instructions See p44 for specs.
See also:
IE_Imp_RTF::_parseFldinstBlock

References _appendField(), _parseFldinstBlock(), _parseText(), UT_ByteBuf::append(), PD_Document::appendObject(), PD_Document::appendStrux(), bUseInsertNotAppend(), FlushStoredChars(), FREEP, gchar, IE_Imp::getDoc(), PD_Document::insertObject(), PD_Document::insertStruxBeforeFrag(), m_bCellBlank, m_bEndTableOpen, m_bFieldRecognized, m_dposPaste, m_iHyperlinkOpen, m_pDelayedFrag, MAX_KEYWORD_LEN, NextToken(), PopRTFState(), PTO_Hyperlink, PTX_Block, PushRTFState(), RTF_TOKEN_CLOSE_BRACE, RTF_TOKEN_DATA, RTF_TOKEN_ERROR, RTF_TOKEN_KEYWORD, RTF_TOKEN_OPEN_BRACE, SkipCurrentGroup(), UT_ASSERT_HARMLESS, UT_ASSERT_NOT_REACHED, UT_DEBUGMSG, UT_OK, UT_SHOULD_NOT_HAPPEN, and xxx_UT_DEBUGMSG.

Referenced by TranslateKeywordID().

bool IE_Imp_RTF::HandleFloatCharacterProp ( double  val,
double *  pProp 
) [private]
bool IE_Imp_RTF::HandleFontSize ( long  sizeInHalfPoints  )  [private]
bool IE_Imp_RTF::HandleHidden ( bool  state  )  [private]
bool IE_Imp_RTF::HandleItalic ( bool  state  )  [private]
bool IE_Imp_RTF::HandleListTag ( long  id  )  [private]
bool IE_Imp_RTF::HandleObject (  )  [private]
bool IE_Imp_RTF::HandleOverline ( bool  state  )  [private]
bool IE_Imp_RTF::HandlePCData ( std::string &  str  )  [private]
void IE_Imp_RTF::HandleShapeText ( RTFProps_FrameProps frame  ) 

Handle the text inside the shape.

References addFrame(), m_bFrameStruxIn, setStruxImage(), and UT_DEBUGMSG.

Referenced by IE_Imp_ShpGroupParser::tokenKeyword().

bool IE_Imp_RTF::HandleStarKeyword (  )  [private]

References _appendField(), bUseInsertNotAppend(), CreateDataItemfromStream(), FREEP, XAP_App::getApp(), XAP_Frame::getCurrentView(), UT_Stack::getDepth(), XAP_App::getLastFocussedFrame(), HandleAbiCell(), HandleAbiEmbed(), HandleAbiEndCell(), HandleAbiEndTable(), HandleAbiLists(), HandleAbiMathml(), HandleAbiTable(), HandleBookmark(), HandleBotline(), HandleDeltaMoveID(), HandleLists(), HandleListTag(), HandleOverline(), HandleRDFAnchor(), HandleShapePict(), HandleTopline(), FV_View::isHdrFtrEdit(), FV_View::isInEndnote(), FV_View::isInFootnote(), FV_View::isInTable(), KeywordToID(), m_bFootnotePending, RTFStateStore::m_bInKeywordStar, m_bNestTableProps, m_currentRTFState, RTFStateStore::m_destinationState, m_dposPaste, m_hyperlinkBase, m_iIsInHeaderFooter, ABI_RTF_Annotation::m_iRTFLevel, m_pAnnotation, RTFStateStore::m_paraProps, m_pasteTableStack, RTFStateStore::m_revAttr, RTFProps_ParaProps::m_rtfListTable, ABI_RTF_Annotation::m_sAuthor, ABI_RTF_Annotation::m_sAuthorId, ABI_RTF_Annotation::m_sDate, m_stateStack, MAX_KEYWORD_LEN, PopRTFState(), RBT_END, RBT_START, ReadCharFromFile(), ReadContentFromFile(), ReadKeyword(), ReadListOverrideTable(), ReadListTable(), ReadRDFTriples(), ReadRevisionTable(), RTF_KW_abicellprops, RTF_KW_abiembed, RTF_KW_abiembeddata, RTF_KW_abiendcell, RTF_KW_abiendtable, RTF_KW_abifieldD, RTF_KW_abilatexdata, RTF_KW_abilist, RTF_KW_abimathml, RTF_KW_abimathmldata, RTF_KW_abirevision, RTF_KW_abitableprops, RTF_KW_annotation, RTF_KW_atnauthor, RTF_KW_atndate, RTF_KW_atnid, RTF_KW_atnref, RTF_KW_atrfend, RTF_KW_atrfstart, RTF_KW_bkmkend, RTF_KW_bkmkstart, RTF_KW_botline, RTF_KW_cs, RTF_KW_deltamoveid, RTF_KW_footnote, RTF_KW_hlinkbase, RTF_KW_listoverridetable, RTF_KW_listtable, RTF_KW_listtag, RTF_KW_nesttableprops, RTF_KW_ol, RTF_KW_pn, RTF_KW_rdf, RTF_KW_rdfanchorend, RTF_KW_rdfanchorstart, RTF_KW_revtbl, RTF_KW_shpinst, RTF_KW_shppict, RTF_KW_topline, SkipCurrentGroup(), StartAnnotation(), UT_DEBUGMSG, UT_return_val_if_fail, UT_UTF8String::utf8_str(), and xxx_UT_DEBUGMSG.

Referenced by TranslateKeywordID().

bool IE_Imp_RTF::HandleStrikeout ( bool  state  )  [private]
bool IE_Imp_RTF::HandleSubscript ( bool  state  )  [private]
bool IE_Imp_RTF::HandleSuperscript ( bool  state  )  [private]
bool IE_Imp_RTF::HandleTableList ( void   )  [private]
bool IE_Imp_RTF::HandleTopline ( bool  state  )  [private]
bool IE_Imp_RTF::HandleU32CharacterProp ( UT_uint32  val,
UT_uint32 pProp 
) [private]
bool IE_Imp_RTF::HandleUnderline ( bool  state  )  [private]
bool IE_Imp_RTF::hexVal ( char  c,
int &  value 
) [static, private]
bool IE_Imp_RTF::insertStrux ( PTStruxType  pts,
const gchar **  attrs = NULL,
const gchar **  props = NULL 
)

Handle context senstive inserts. Like inserting a table into a block Requires an extra block insert Insert into a hyperlink means the m_dposPate is additionally incremented to handle the extra end hyperlink run.

References XAP_App::getApp(), FV_View::getBlockAtPosition(), fl_ContainerLayout::getContainerType(), XAP_Frame::getCurrentView(), UT_Stack::getDepth(), IE_Imp::getDoc(), FV_View::getEditableBounds(), FV_View::getEmbedDepth(), FV_View::getHyperLinkRun(), fp_HyperlinkRun::getHyperlinkType(), XAP_App::getLastFocussedFrame(), fl_BlockLayout::getLength(), fl_ContainerLayout::getNext(), pf_Frag::getPos(), fl_BlockLayout::getPosition(), fl_ContainerLayout::getPrev(), FV_View::getTableAtPos(), PD_Document::insertStrux(), fl_TableLayout::isEndTableIn(), FV_View::isInFrame(), FV_View::isInHdrFtr(), FV_View::isInTable(), PD_Document::isTOCAtPos(), m_bStruxInserted, m_currentRTFState, RTFStateStore::m_destinationState, m_dposPaste, m_iHyperlinkOpen, m_pasteTableStack, m_posSavedDocPosition, fl_ContainerLayout::myContainingLayout(), PTX_Block, PTX_EndCell, PTX_EndFrame, PTX_EndTable, PTX_Section, PTX_SectionCell, PTX_SectionFrame, and PTX_SectionTable.

Referenced by addFrame(), ApplyParagraphAttributes(), ApplySectionAttributes(), closePastedTableIfNeeded(), FlushStoredChars(), HandleAbiCell(), HandleAbiEndCell(), HandleAbiEndTable(), HandleAbiTable(), HandleAnnotation(), HandleBookmark(), HandleNote(), HandleRDFAnchor(), HandleShape(), OpenTable(), and IE_Imp_ShpGroupParser::~IE_Imp_ShpGroupParser().

bool IE_Imp_RTF::isBlockNeededForPasteTable ( void   ) 
bool IE_Imp_RTF::isFrameIn ( void   )  [inline]
bool IE_Imp_RTF::isPastedTableOpen ( void   ) 

returns true if we've pasted a table strux and have not yet pasted a cell or we've pasted an endcell and have not yet pasted a cell

References UT_Stack::getDepth(), ABI_Paste_Table::m_bHasPastedCellStrux, ABI_Paste_Table::m_bHasPastedTableStrux, m_pasteTableStack, and UT_Stack::viewTop().

Referenced by FlushStoredChars().

bool IE_Imp_RTF::isStruxImage ( void   )  const [inline]

Referenced by addFrame(), and InsertImage().

bool IE_Imp_RTF::isWord97Lists ( void   )  const [inline]
RTF_KEYWORD_ID IE_Imp_RTF::KeywordToID ( const char *  keyword  )  [private]
bool IE_Imp_RTF::LoadPictData ( PictFormat  format,
const char *  image_name,
struct RTFProps_ImageProps imgProps,
bool  isBinary = false,
long  binaryLen = 0 
) [private]

Load the picture data

Parameters:
format the Picture Format.
image_name the name of the image. Must be unique.
imgProps the RTF properties for the image.
Returns:
true if success, otherwise false. Load the picture data from the flow. Will move the file position and assume proper RTF file structure. It will take care of inserting the picture into the document.
Todo:
TODO: We assume the data comes in hex. Check this assumption as we might have to handle binary data as well
See also:
IE_Imp_RTF::HandlePicture

References UT_ByteBuf::append(), DELETEP, abicollab::service::error(), FlushStoredChars(), FG_Graphic::getHeight(), FG_Graphic::getWidth(), RTFProps_ImageProps::height, hexVal(), iegftForRTF(), InsertImage(), IE_ImpGraphic::loadGraphic(), ReadCharFromFile(), ReadCharFromFileWithCRLF(), SkipBackChar(), UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_OK, and RTFProps_ImageProps::width.

Referenced by HandlePicture().

UT_uint32 IE_Imp_RTF::mapID ( UT_uint32  id  ) 

OK if we are pasting into the text we have to decide if the list we paste should be a new list or an old list. The user might want to swap paragraphs in a list for example.

Use the following algorithim to decide. If the docpos of the paste is within a list of the same ID as our list or if the docpos is immediately before or after a list of the same ID reuse the ID. Otherwise change it.

Now look to see if the ID has been remapped.

Do the remapping!

Now look to see if the parent ID has been remapped, if so update mapped_parentid

References bUseInsertNotAppend(), getAbiList(), IE_Imp::getDoc(), fl_AutoNum::getID(), fl_AutoNum::getLevel(), PD_Document::getListByID(), PD_Document::getListsCount(), PD_Document::getNthList(), PD_Document::getStruxOfTypeFromPosition(), fl_AutoNum::getType(), PD_Document::getUID(), fl_AutoLists::getXmlList(), fl_AutoLists::getXmlListsSize(), IE_Imp_RTF::_rtfAbiListTable::hasBeenMapped, fl_AutoNum::isContainedByList(), IE_Imp_RTF::_rtfAbiListTable::level, UT_UniqueId::List, m_bStruxInserted, m_currentRTFState, m_dposPaste, m_numLists, RTFStateStore::m_paraProps, RTFProps_ParaProps::m_pszStyle, IE_Imp_RTF::_rtfAbiListTable::mapped_id, IE_Imp_RTF::_rtfAbiListTable::mapped_parentid, IE_Imp_RTF::_rtfAbiListTable::orig_parentid, PTX_Block, and UT_ASSERT_NOT_REACHED.

Referenced by ApplyParagraphAttributes().

UT_uint32 IE_Imp_RTF::mapParentID ( UT_uint32  id  ) 

OK if we are pasting into the text we have to decide if the list we paste should be a new list or an old list. The user might want to swap paragraphs for example.

References bUseInsertNotAppend(), getAbiList(), m_numLists, and IE_Imp_RTF::_rtfAbiListTable::mapped_id.

Referenced by ApplyParagraphAttributes().

bool IE_Imp_RTF::markPasteBlock ( void   ) 
IE_Imp_RTF::RTFTokenType IE_Imp_RTF::NextToken ( unsigned char *  pKeyword,
UT_sint32 pParam,
bool *  pParamUsed,
UT_uint32  len,
bool  bIgnoreWhiteSpace = false 
) [private]

Get the next token, put it into buf, if there is an error return RTF_TOKEN_ERROR otherwise returns the RTFTokenType If it is RTF_TOKEN_DATA, data is returned byte by byte. RTF_TOKEN_KEYWORD includes control words and control symbols (like hex char). It is up to the caller to distinguish beetween them and parse them.

Return values:
pKeyword is the data
pParam is the keyword parameter if any, otherwise "". RTF spec says it should be a signed 16-bits int.
pParamUsed is a flag to tell whether there is a parameter.
Returns:
the type of the next token parsed.
Note:
Both pParam amd pParamUsed are only used if tokenType is RTF_TOKEN_KEYWORD
this changes the state of the file

References ReadCharFromFile(), ReadKeyword(), RTF_TOKEN_NONE, and UT_return_val_if_fail.

Referenced by HandleField(), HandleInfoMetaData(), HandleObject(), HandlePCData(), HandleShapePict(), ReadFontTable(), and StandardKeywordParser().

bool IE_Imp_RTF::ParseCharParaProps ( unsigned char *  pKeyword,
UT_sint32  param,
bool  fParam,
RTFProps_CharProps pChars,
RTFProps_ParaProps pParas,
RTFProps_bCharProps pbChars,
RTFProps_bParaProps pbParas 
) [private]

OK this method parses the RTF against all the character and paragraph properties. and fills the pointers to the character and paragraph classes. These are used by the list table and stylesheet reader.

References AddTabstop(), RTFProps_bCharProps::bm_bgcolourNumber, RTFProps_bCharProps::bm_bold, RTFProps_bCharProps::bm_colourNumber, RTFProps_bParaProps::bm_curTabLeader, RTFProps_bParaProps::bm_curTabType, RTFProps_bCharProps::bm_deleted, RTFProps_bCharProps::bm_fontNumber, RTFProps_bCharProps::bm_fontSize, RTFProps_bCharProps::bm_hasColour, RTFProps_bParaProps::bm_indentFirst, RTFProps_bParaProps::bm_indentLeft, RTFProps_bParaProps::bm_indentRight, RTFProps_bCharProps::bm_italic, RTFProps_bParaProps::bm_justification, RTFProps_bParaProps::bm_lineSpaceExact, RTFProps_bParaProps::bm_lineSpaceVal, RTFProps_bCharProps::bm_listTag, RTFProps_bCharProps::bm_overline, RTFProps_bParaProps::bm_spaceAfter, RTFProps_bParaProps::bm_spaceBefore, RTFProps_bCharProps::bm_strikeout, RTFProps_bCharProps::bm_subscript, RTFProps_bCharProps::bm_superscript, RTFProps_bCharProps::bm_superscript_pos, RTFProps_bCharProps::bm_underline, FL_TAB_BAR, GetNthTableFont(), HandleBoolCharacterProp(), HandleFloatCharacterProp(), HandleU32CharacterProp(), RTFProps_CharProps::m_bgcolourNumber, RTFProps_CharProps::m_bold, RTFProps_CharProps::m_colourNumber, RTFProps_ParaProps::m_curTabLeader, RTFProps_ParaProps::m_curTabType, RTFProps_CharProps::m_deleted, RTFProps_CharProps::m_fontNumber, RTFProps_CharProps::m_fontSize, RTFProps_CharProps::m_hasColour, RTFProps_ParaProps::m_indentFirst, RTFProps_ParaProps::m_indentLeft, RTFProps_ParaProps::m_indentRight, RTFProps_CharProps::m_italic, RTFProps_ParaProps::m_justification, RTFProps_ParaProps::m_lineSpaceExact, RTFProps_ParaProps::m_lineSpaceVal, RTFProps_CharProps::m_listTag, m_mbtowc, RTFProps_CharProps::m_overline, RTFProps_ParaProps::m_spaceAfter, RTFProps_ParaProps::m_spaceBefore, RTFProps_CharProps::m_strikeout, RTFProps_CharProps::m_subscript, RTFProps_CharProps::m_superscript, RTFProps_CharProps::m_superscript_pos, RTFFontTableItem::m_szEncoding, RTFProps_CharProps::m_szLang, RTFProps_CharProps::m_underline, UT_UCS4_mbtowc::setInCharset(), UT_DEBUGMSG, UT_return_val_if_fail, and wvLIDToLangConverter().

Referenced by HandleListLevel(), HandleStyleDefinition(), and HandleTableListOverride().

bool IE_Imp_RTF::ParseRTFKeyword (  )  [private]

Reads and proccesses a RTF control word and its parameter

Returns:
false if something goes wrong. Read and handle the RTF keyword. Commands are dispatched by calling TranslateKeyword This is too generic: keywords are most of the time contextual so context should be taken care of.
See also:
IE_Imp_RTF::ReadKeyword, IE_Imp_RTF::TranslateKeyword

References g_dbgLastKeyword, MAX_KEYWORD_LEN, ReadKeyword(), TranslateKeyword(), UT_DEBUGMSG, and xxx_UT_DEBUGMSG.

Referenced by _parseText().

bool IE_Imp_RTF::PostProcessAndValidatePanose ( UT_UTF8String Panose  )  [private]
bool IE_Imp_RTF::ReadCharFromFileWithCRLF ( unsigned char *  pCh  )  [private]

Reads a character from the file. Doesn't ignore CR and LF

Return values:
pCh the char read
Returns:
false if an error occured.
See also:
IE_Imp_RTF::ReadCharFromFile

References m_lenPasteBuffer, m_pCurrentCharInPasteBuffer, m_pImportFile, and m_pPasteBuffer.

Referenced by HandlePicture(), LoadPictData(), ReadCharFromFile(), ReadContentFromFile(), ReadKeyword(), SkipCurrentGroup(), StuffCurrentGroup(), and TranslateKeywordID().

bool IE_Imp_RTF::ReadColourTable (  )  [private]
bool IE_Imp_RTF::ReadContentFromFile ( UT_UTF8String str  )  [private]
UT_UCS4Char IE_Imp_RTF::ReadHexChar ( void   )  [private]
bool IE_Imp_RTF::ReadKeyword ( unsigned char *  pKeyword,
UT_sint32 pParam,
bool *  pParamUsed,
UT_uint32  keywordBuffLen 
) [private]

Read a keyword from the file.

Return values:
pKeyword the keyword buffer whose len is in keywordBuffLen Can not be NULL on input.
pParam the keyword parameter as specified by the RTF spec. 0 is there is no param.
pParamUsed true if the keyword does really have a param. false otherwise (pParam is 0 then).
Parameters:
keywordBuffLen the length of the pKeyword memory block
Returns:
false if any problem This function parse and read the keyword. It is called if a \ is encountered in the flow. *pKeyword never contains the \

References g_dbgLastKeyword, g_dbgLastParam, RTFStateStore::m_bInKeywordStar, m_currentRTFState, ReadCharFromFileWithCRLF(), SkipBackChar(), UT_DEBUGMSG, UT_return_val_if_fail, and xxx_UT_DEBUGMSG.

Referenced by _parseText(), HandleAbiLists(), HandleListLevel(), HandleLists(), HandlePicture(), HandleStarKeyword(), HandleStyleDefinition(), HandleTableList(), HandleTableListOverride(), NextToken(), ParseRTFKeyword(), ReadColourTable(), ReadListOverrideTable(), ReadListTable(), and TranslateKeywordID().

bool IE_Imp_RTF::ReadListOverrideTable ( void   )  [private]
bool IE_Imp_RTF::ReadRDFTriples (  )  [private]
bool IE_Imp_RTF::RegisterFont ( RTFFontTableItem::FontFamilyEnum  fontFamily,
RTFFontTableItem::FontPitch  pitch,
UT_uint16  fontIndex,
int  charSet,
int  codepage,
UT_UTF8String  sFontNames[] 
) [private]
void IE_Imp_RTF::RemoveRowInfo ( void   ) 

This Method Clears any information about the current row

bool IE_Imp_RTF::ResetCellAttributes ( void   ) 
bool IE_Imp_RTF::ResetCharacterAttributes (  )  [private]
bool IE_Imp_RTF::ResetParagraphAttributes (  )  [private]
bool IE_Imp_RTF::ResetSectionAttributes (  )  [private]
bool IE_Imp_RTF::ResetTableAttributes ( void   ) 
std::string IE_Imp_RTF::s_unEscapeXMLString (  )  [private]

Reads back data that was written with IE_Exp_RTF::s_escapeXMLString().

References PopRTFState(), ReadCharFromFile(), replace_all(), and s.

Referenced by ReadRDFTriples().

void IE_Imp_RTF::SaveRowInfo ( void   ) 

This Method saves the information about the current row

bool IE_Imp_RTF::SetParaJustification ( RTFProps_ParaProps::ParaJustification  just  )  [private]
void IE_Imp_RTF::setStruxImage ( bool  b  )  [inline]
bool IE_Imp_RTF::SkipBackChar ( unsigned char  ch  )  [private]

Push a char back to the stream.

Parameters:
ch the char to push back
Returns:
false if any problem Push back the char ch to the stream so it can be re-read after. Since we use buffered stdio from lib C, there should be no noticeable I/O impact. check that ungetc() works under MacOS

References m_pCurrentCharInPasteBuffer, m_pImportFile, and m_pPasteBuffer.

Referenced by _parseText(), CreateDataItemfromStream(), getCharsInsideBrace(), HandleLists(), HandlePCData(), HandlePicture(), LoadPictData(), ReadColourTable(), ReadContentFromFile(), ReadFontTable(), ReadKeyword(), ReadListOverrideTable(), ReadListTable(), SkipCurrentGroup(), StandardKeywordParser(), and StuffCurrentGroup().

bool IE_Imp_RTF::SkipCurrentGroup ( bool  bConsumeLastBrace = false  ) 

Skip the current group

Parameters:
bConsumeLastBrace pass true to discard the last }
Returns:
false if any problem raised This function read until the current group and all nested subgroups are passed. This allow skipping a chunk of the RTF file we do not understand.

References ReadCharFromFileWithCRLF(), and SkipBackChar().

Referenced by HandleField(), HandleInfoMetaData(), HandleObject(), HandlePicture(), HandleStarKeyword(), ReadFontTable(), IE_Imp_ShpGroupParser::tokenKeyword(), and TranslateKeywordID().

bool IE_Imp_RTF::StartNewSection (  )  [private]
bool IE_Imp_RTF::StuffCurrentGroup ( UT_ByteBuf buf  )  [private]

Stuff the current group into the buffer

Parameters:
buf the buffer to stuff RTF in.
Returns:
false if any problem raised This function read until the current group and all nested subgroups are passed and stuff them into the buffer. This allow saving a chunk of the RTF file for future use.

References UT_ByteBuf::append(), ReadCharFromFileWithCRLF(), and SkipBackChar().

Referenced by HandleHeaderFooter().

virtual bool IE_Imp_RTF::supportsLoadStylesOnly (  )  const [inline, virtual]
bool IE_Imp_RTF::TranslateKeyword ( unsigned char *  pKeyword,
UT_sint32  param,
bool  fParam 
) [private]
bool IE_Imp_RTF::TranslateKeywordID ( RTF_KEYWORD_ID  keywordID,
UT_sint32  param,
bool  fParam 
)

References _appendField(), _sanitizeListLevel(), _setStringProperty(), AddTabstop(), bUseInsertNotAppend(), XAP_EncodingManager::charsetFromCodepage(), CloseTable(), DIM_IN, FL_TAB_BAR, gchar, XAP_EncodingManager::get_instance(), XAP_App::getApp(), XAP_Frame::getCurrentView(), IE_Imp::getDoc(), XAP_App::getLastFocussedFrame(), IE_Imp::getLoadStylesOnly(), XAP_EncodingManager::getNative8BitEncodingName(), ie_imp_table_control::getNestDepth(), GetNthTableColour(), getTable(), HandleBackgroundColour(), HandleBold(), HandleBotline(), HandleCell(), HandleCellX(), HandleColour(), HandleFace(), HandleField(), HandleFontSize(), HandleHeaderFooter(), HandleHidden(), HandleInfoMetaData(), HandleItalic(), HandleNoteReference(), HandleObject(), HandleOverline(), HandleParKeyword(), HandlePicture(), HandleRevisedText(), HandleRevisedTextTimestamp(), HandleRow(), HandleShape(), HandleStarKeyword(), HandleStrikeout(), HandleStyleDefinition(), HandleSubscript(), HandleSubscriptPosition(), HandleSuperscript(), HandleSuperscriptPosition(), HandleTopline(), HandleUnderline(), fp_PageSize::Height(), RTFHdrFtr::hftFooter, RTFHdrFtr::hftFooterEven, RTFHdrFtr::hftFooterFirst, RTFHdrFtr::hftHeader, RTFHdrFtr::hftHeaderEven, RTFHdrFtr::hftHeaderFirst, FV_View::isHdrFtrEdit(), FV_View::isInEndnote(), FV_View::isInFootnote(), m_bBidiMode, RTFProps_CellProps::m_bBotBorder, RTFProps_ParaProps::m_bBotBorder, m_bCellActive, m_bCellBlank, m_bCellHandled, RTFProps_SectionProps::m_bColumnLine, m_bContentFlushed, m_bDoCloseTable, m_bFieldRecognized, m_bFootnotePending, RTFProps_CellProps::m_bHorizontalMerged, RTFProps_CellProps::m_bHorizontalMergedFirst, m_bInFootnote, RTFProps_ParaProps::m_bInTable, RTFProps_CellProps::m_bLeftBorder, RTFProps_ParaProps::m_bLeftBorder, RTFProps_ParaProps::m_bMergeBordersShading, m_bNestTableProps, RTFProps_SectionProps::m_bottomMargTwips, m_bParaActive, RTFProps_SectionProps::m_breakType, RTFProps_CellProps::m_bRightBorder, RTFProps_ParaProps::m_bRightBorder, m_bRowJustPassed, RTFProps_CellProps::m_bTopBorder, RTFProps_ParaProps::m_bTopBorder, RTFProps_CellProps::m_bVerticalMerged, RTFProps_CellProps::m_bVerticalMergedFirst, RTFStateStore::m_cellProps, RTFStateStore::m_charProps, RTFProps_SectionProps::m_colSpaceTwips, m_currentRTFState, RTFProps_ParaProps::m_curTabLeader, RTFProps_ParaProps::m_curTabType, RTFStateStore::m_destinationState, RTFProps_CharProps::m_dir, RTFProps_SectionProps::m_dir, RTFProps_ParaProps::m_dir, RTFProps_CharProps::m_dirOverride, PD_Document::m_docPageSize, m_dposPaste, RTFProps_CharProps::m_fontNumber, RTFProps_SectionProps::m_footerYTwips, RTFProps_SectionProps::m_gutterTwips, RTFProps_SectionProps::m_headerYTwips, RTFProps_ParaProps::m_iBotBorderCol, RTFProps_ParaProps::m_iBotBorderSpacing, RTFProps_ParaProps::m_iBotBorderStyle, RTFProps_ParaProps::m_iBotBorderWidth, RTFProps_CellProps::m_iCurBorder, RTFProps_ParaProps::m_iCurBorder, m_iDefaultFontNumber, m_iHyperlinkOpen, RTFProps_ParaProps::m_iLeftBorderCol, RTFProps_ParaProps::m_iLeftBorderSpacing, RTFProps_ParaProps::m_iLeftBorderStyle, RTFProps_ParaProps::m_iLeftBorderWidth, RTFProps_ParaProps::m_indentFirst, RTFProps_ParaProps::m_indentLeft, RTFProps_ParaProps::m_indentRight, RTFStateStore::m_internalState, RTFProps_ParaProps::m_iOverride, RTFProps_ParaProps::m_iOverrideLevel, RTFProps_ParaProps::m_iRightBorderCol, RTFProps_ParaProps::m_iRightBorderSpacing, RTFProps_ParaProps::m_iRightBorderStyle, RTFProps_ParaProps::m_iRightBorderWidth, RTFProps_ParaProps::m_iShadingBackCol, RTFProps_ParaProps::m_iShadingForeCol, RTFProps_ParaProps::m_iShadingPattern, RTFProps_ParaProps::m_isList, RTFProps_ParaProps::m_iTopBorderCol, RTFProps_ParaProps::m_iTopBorderSpacing, RTFProps_ParaProps::m_iTopBorderStyle, RTFProps_ParaProps::m_iTopBorderWidth, RTFProps_SectionProps::m_leftMargTwips, RTFProps_ParaProps::m_lineSpaceExact, RTFProps_ParaProps::m_lineSpaceVal, m_mbtowc, RTFProps_SectionProps::m_numCols, RTFStateStore::m_paraProps, RTFStateStore::m_revAttr, RTFProps_SectionProps::m_rightMargTwips, RTFProps_CellProps::m_sCellProps, m_sectdProps, RTFStateStore::m_sectionProps, RTFProps_ParaProps::m_spaceAfter, RTFProps_ParaProps::m_spaceBefore, RTFProps_ParaProps::m_styleNumber, RTFProps_CharProps::m_styleNumber, m_szDefaultEncoding, RTFProps_CharProps::m_szLang, m_TableControl, RTFProps_ParaProps::m_tableLevel, RTFProps_SectionProps::m_topMargTwips, RTFStateStore::m_unicodeAlternateSkipCount, RTFStateStore::m_unicodeInAlternate, MAX_KEYWORD_LEN, OpenTable(), ParseChar(), RTFProps_ParaProps::pjCentre, RTFProps_ParaProps::pjFull, RTFProps_ParaProps::pjLeft, RTFProps_ParaProps::pjRight, PP_REVISION_ADDITION, PP_REVISION_DELETION, PP_REVISION_FMT_CHANGE, ReadCharFromFileWithCRLF(), ReadColourTable(), ReadFontTable(), ReadKeyword(), ReadListOverrideTable(), ResetCellAttributes(), ResetCharacterAttributes(), ResetParagraphAttributes(), ResetSectionAttributes(), ResetTableAttributes(), RTF_KW_abibotline, RTF_KW_abiltr, RTF_KW_abinodiroverride, RTF_KW_abirtl, RTF_KW_abitopline, RTF_KW_aenddoc, RTF_KW_aendnotes, RTF_KW_aftnnalc, RTF_KW_aftnnar, RTF_KW_aftnnauc, RTF_KW_aftnnrlc, RTF_KW_aftnnruc, RTF_KW_aftnrestart, RTF_KW_aftnstart, RTF_KW_ansi, RTF_KW_ansicpg, RTF_KW_b, RTF_KW_BACKSLASH, RTF_KW_brdrb, RTF_KW_brdrbtw, RTF_KW_brdrcf, RTF_KW_brdrdash, RTF_KW_brdrdot, RTF_KW_brdrl, RTF_KW_brdrnone, RTF_KW_brdrr, RTF_KW_brdrs, RTF_KW_brdrt, RTF_KW_brdrw, RTF_KW_brsp, RTF_KW_bullet, RTF_KW_cb, RTF_KW_cbpat, RTF_KW_cell, RTF_KW_cellx, RTF_KW_cf, RTF_KW_cfpat, RTF_KW_chdate, RTF_KW_chdpa, RTF_KW_chdpl, RTF_KW_chftn, RTF_KW_chpgn, RTF_KW_chtime, RTF_KW_clbrdrb, RTF_KW_clbrdrl, RTF_KW_clbrdrr, RTF_KW_clbrdrt, RTF_KW_clcbpat, RTF_KW_clmgf, RTF_KW_clmrg, RTF_KW_CLOSECBRACE, RTF_KW_clvmgf, RTF_KW_clvmrg, RTF_KW_colortbl, RTF_KW_cols, RTF_KW_colsx, RTF_KW_column, RTF_KW_CR, RTF_KW_crauth, RTF_KW_crdate, RTF_KW_cs, RTF_KW_deff, RTF_KW_deleted, RTF_KW_dn, RTF_KW_emdash, RTF_KW_emspace, RTF_KW_endash, RTF_KW_enddoc, RTF_KW_endnotes, RTF_KW_enspace, RTF_KW_f, RTF_KW_fi, RTF_KW_field, RTF_KW_fldrslt, RTF_KW_fonttbl, RTF_KW_footer, RTF_KW_footerf, RTF_KW_footerl, RTF_KW_footerr, RTF_KW_footery, RTF_KW_footnote, RTF_KW_fs, RTF_KW_ftnalt, RTF_KW_ftnnalc, RTF_KW_ftnnar, RTF_KW_ftnnauc, RTF_KW_ftnnrlc, RTF_KW_ftnnruc, RTF_KW_ftnrestart, RTF_KW_ftnrstpg, RTF_KW_ftnstart, RTF_KW_gutter, RTF_KW_header, RTF_KW_headerf, RTF_KW_headerl, RTF_KW_headerr, RTF_KW_headery, RTF_KW_highlight, RTF_KW_HYPHEN, RTF_KW_i, RTF_KW_ilvl, RTF_KW_info, RTF_KW_intbl, RTF_KW_itap, RTF_KW_landscape, RTF_KW_lang, RTF_KW_ldblquote, RTF_KW_LF, RTF_KW_li, RTF_KW_line, RTF_KW_linebetcol, RTF_KW_listoverridetable, RTF_KW_listtext, RTF_KW_lquote, RTF_KW_ls, RTF_KW_ltrch, RTF_KW_ltrmark, RTF_KW_ltrpar, RTF_KW_ltrsect, RTF_KW_mac, RTF_KW_margb, RTF_KW_margbsxn, RTF_KW_margl, RTF_KW_marglsxn, RTF_KW_margr, RTF_KW_margrsxn, RTF_KW_margt, RTF_KW_margtsxn, RTF_KW_nestcell, RTF_KW_nestrow, RTF_KW_nonesttables, RTF_KW_nonshppict, RTF_KW_noproof, RTF_KW_object, RTF_KW_ol, RTF_KW_OPENCBRACE, RTF_KW_page, RTF_KW_paperh, RTF_KW_paperw, RTF_KW_par, RTF_KW_pard, RTF_KW_pc, RTF_KW_pca, RTF_KW_pict, RTF_KW_plain, RTF_KW_pntext, RTF_KW_qc, RTF_KW_qj, RTF_KW_ql, RTF_KW_qr, RTF_KW_QUOTE, RTF_KW_rdblquote, RTF_KW_revauth, RTF_KW_revauthdel, RTF_KW_revdttm, RTF_KW_revdttmdel, RTF_KW_revised, RTF_KW_ri, RTF_KW_row, RTF_KW_rquote, RTF_KW_rtf, RTF_KW_rtlch, RTF_KW_rtlmark, RTF_KW_rtlpar, RTF_KW_rtlsect, RTF_KW_s, RTF_KW_sa, RTF_KW_sb, RTF_KW_sbkcol, RTF_KW_sbkeven, RTF_KW_sbknone, RTF_KW_sbkodd, RTF_KW_sbkpage, RTF_KW_sect, RTF_KW_sectd, RTF_KW_shp, RTF_KW_sl, RTF_KW_slmult, RTF_KW_STAR, RTF_KW_strike, RTF_KW_striked, RTF_KW_stylesheet, RTF_KW_sub, RTF_KW_super, RTF_KW_tab, RTF_KW_tb, RTF_KW_TILDE, RTF_KW_tldot, RTF_KW_tleq, RTF_KW_tlhyph, RTF_KW_tlul, RTF_KW_tqc, RTF_KW_tqdec, RTF_KW_tqr, RTF_KW_trautofit, RTF_KW_trleft, RTF_KW_trowd, RTF_KW_tx, RTF_KW_u, RTF_KW_uc, RTF_KW_ul, RTF_KW_uld, RTF_KW_uldash, RTF_KW_uldashd, RTF_KW_uldashdd, RTF_KW_uldb, RTF_KW_ulnone, RTF_KW_ulth, RTF_KW_ulw, RTF_KW_ulwave, RTF_KW_UNDERSCORE, RTF_KW_up, RTF_KW_v, rtfBorderBot, rtfBorderLeft, rtfBorderRight, rtfBorderTop, rtfCellBorderBot, rtfCellBorderLeft, rtfCellBorderRight, rtfCellBorderTop, fp_PageSize::Set(), ie_imp_table::setAutoFit(), setEncoding(), AD_Document::setEncodingName(), UT_UCS4_mbtowc::setInCharset(), SetParaJustification(), ie_imp_table::setProp(), PD_Document::setProperties(), UT_UTF8String::size(), SkipCurrentGroup(), StartNewPara(), StartNewSection(), UCS_BULLET, UCS_EM_DASH, UCS_EM_SPACE, UCS_EN_DASH, UCS_EN_SPACE, UCS_FF, UCS_LDBLQUOTE, UCS_LF, UCS_LQUOTE, UCS_NBSP, UCS_RDBLQUOTE, UCS_RQUOTE, UCS_VTAB, UT_ASSERT, UT_DEBUGMSG, UT_formatDimensionString(), UT_return_val_if_fail, UT_std_string_sprintf(), fp_PageSize::Width(), wvLIDToLangConverter(), and xxx_UT_DEBUGMSG.

Referenced by HandlePCData(), IE_Imp_TextParaPropParser::tokenKeyword(), and TranslateKeyword().


Member Data Documentation

bool IE_Imp_RTF::keywordSorted = false [static, private]

Referenced by _initialKeywordSort(), and IE_Imp_RTF().

bool IE_Imp_RTF::m_bCellActive [private]

Referenced by TranslateKeywordID().

Referenced by addFrame(), and HandleShape().

bool IE_Imp_RTF::m_bisAbiList [private]
bool IE_Imp_RTF::m_bisNOTList [private]
bool IE_Imp_RTF::m_bParaActive [private]

Referenced by TranslateKeywordID().

bool IE_Imp_RTF::m_bStruxImage [private]

Referenced by insertStrux(), and mapID().

int IE_Imp_RTF::m_cbBin [private]

Referenced by ParseChar().

std::string IE_Imp_RTF::m_ctMoveID [private]
int IE_Imp_RTF::m_groupCount [private]
std::map< std::string, std::string > IE_Imp_RTF::m_rdfAnchorCloseXMLIDs [private]

Referenced by HandleRDFAnchor().

const char* IE_Imp_RTF::m_szDefaultEncoding [private]

Referenced by setEncoding(), and TranslateKeywordID().


The documentation for this class was generated from the following files: