LCOV - code coverage report
Current view: top level - libreoffice/writerfilter/source/rtftok - rtfdocumentimpl.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 3 3 100.0 %
Date: 2012-12-27 Functions: 9 9 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * Version: MPL 1.1 / GPLv3+ / LGPLv3+
       4             :  *
       5             :  * The contents of this file are subject to the Mozilla Public License Version
       6             :  * 1.1 (the "License"); you may not use this file except in compliance with
       7             :  * the License. You may obtain a copy of the License at
       8             :  * http://www.mozilla.org/MPL/
       9             :  *
      10             :  * Software distributed under the License is distributed on an "AS IS" basis,
      11             :  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
      12             :  * for the specific language governing rights and limitations under the
      13             :  * License.
      14             :  *
      15             :  * The Initial Developer of the Original Code is
      16             :  *       Miklos Vajna <vmiklos@frugalware.org>
      17             :  * Portions created by the Initial Developer are Copyright (C) 2011 the
      18             :  * Initial Developer. All Rights Reserved.
      19             :  *
      20             :  * Contributor(s):
      21             :  *
      22             :  * Alternatively, the contents of this file may be used under the terms of
      23             :  * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
      24             :  * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
      25             :  * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
      26             :  * instead of those above.
      27             :  */
      28             : 
      29             : #ifndef _RTFDOCUMENTIMPL_HXX_
      30             : #define _RTFDOCUMENTIMPL_HXX_
      31             : 
      32             : #include <stack>
      33             : #include <queue>
      34             : 
      35             : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
      36             : #include <com/sun/star/beans/XPropertySet.hpp>
      37             : #include <com/sun/star/document/XDocumentProperties.hpp>
      38             : #include <oox/helper/graphichelper.hxx>
      39             : #include <oox/mathml/importutils.hxx>
      40             : #include <rtl/strbuf.hxx>
      41             : 
      42             : #include <rtftok/RTFDocument.hxx>
      43             : #include <rtfreferencetable.hxx>
      44             : #include <rtfsprm.hxx>
      45             : 
      46             : class SvStream;
      47             : 
      48             : namespace writerfilter {
      49             :     namespace rtftok {
      50             :         enum RTFInternalState
      51             :         {
      52             :             INTERNAL_NORMAL,
      53             :             INTERNAL_BIN,
      54             :             INTERNAL_HEX
      55             :         };
      56             : 
      57             :         // Note that this is not a 1:1 mapping between destination control
      58             :         // words, e.g. RTF_PICT gets mapped to DESTINATION_PICT or
      59             :         // DESTINATION_SHAPEPROPERTYVALUEPICT, etc.
      60             :         enum RTFDesitnationState
      61             :         {
      62             :             DESTINATION_NORMAL,
      63             :             DESTINATION_SKIP,
      64             :             DESTINATION_FONTTABLE,
      65             :             DESTINATION_FONTENTRY,
      66             :             DESTINATION_COLORTABLE,
      67             :             DESTINATION_STYLESHEET,
      68             :             DESTINATION_STYLEENTRY,
      69             :             DESTINATION_FIELD,
      70             :             DESTINATION_FIELDINSTRUCTION,
      71             :             DESTINATION_FIELDRESULT,
      72             :             DESTINATION_LISTTABLE,
      73             :             DESTINATION_LISTENTRY,
      74             :             DESTINATION_LISTOVERRIDETABLE,
      75             :             DESTINATION_LISTOVERRIDEENTRY,
      76             :             DESTINATION_LISTLEVEL,
      77             :             DESTINATION_LEVELTEXT,
      78             :             DESTINATION_LEVELNUMBERS,
      79             :             DESTINATION_SHPPICT,
      80             :             DESTINATION_PICT,
      81             :             DESTINATION_PICPROP,
      82             :             DESTINATION_SHAPEPROPERTY,
      83             :             DESTINATION_SHAPEPROPERTYNAME,
      84             :             DESTINATION_SHAPEPROPERTYVALUE,
      85             :             DESTINATION_SHAPE,
      86             :             DESTINATION_SHAPEINSTRUCTION,
      87             :             DESTINATION_SHAPEPROPERTYVALUEPICT,
      88             :             DESTINATION_NESTEDTABLEPROPERTIES,
      89             :             DESTINATION_FOOTNOTE,
      90             :             DESTINATION_BOOKMARKSTART,
      91             :             DESTINATION_BOOKMARKEND,
      92             :             DESTINATION_REVISIONTABLE,
      93             :             DESTINATION_REVISIONENTRY,
      94             :             DESTINATION_SHAPETEXT,
      95             :             DESTINATION_FORMFIELD,
      96             :             DESTINATION_FORMFIELDNAME,
      97             :             DESTINATION_FORMFIELDLIST,
      98             :             DESTINATION_DATAFIELD,
      99             :             DESTINATION_INFO,
     100             :             DESTINATION_CREATIONTIME,
     101             :             DESTINATION_REVISIONTIME,
     102             :             DESTINATION_PRINTTIME,
     103             :             DESTINATION_AUTHOR,
     104             :             DESTINATION_KEYWORDS,
     105             :             DESTINATION_OPERATOR,
     106             :             DESTINATION_COMPANY,
     107             :             DESTINATION_COMMENT,
     108             :             DESTINATION_OBJECT,
     109             :             DESTINATION_OBJDATA,
     110             :             DESTINATION_RESULT,
     111             :             DESTINATION_ANNOTATIONDATE,
     112             :             DESTINATION_ANNOTATIONAUTHOR,
     113             :             DESTINATION_FALT,
     114             :             DESTINATION_FLYMAINCONTENT,
     115             :             DESTINATION_DRAWINGOBJECT,
     116             :             DESTINATION_PARAGRAPHNUMBERING,
     117             :             DESTINATION_PARAGRAPHNUMBERING_TEXTBEFORE,
     118             :             DESTINATION_PARAGRAPHNUMBERING_TEXTAFTER,
     119             :             DESTINATION_TITLE,
     120             :             DESTINATION_SUBJECT,
     121             :             DESTINATION_DOCCOMM,
     122             :             DESTINATION_ATNID,
     123             :             DESTINATION_MOMATH,
     124             :             DESTINATION_MR,
     125             :             DESTINATION_MF,
     126             :             DESTINATION_MFPR,
     127             :             DESTINATION_MCTRLPR,
     128             :             DESTINATION_MNUM,
     129             :             DESTINATION_MDEN,
     130             :             DESTINATION_MACC,
     131             :             DESTINATION_MACCPR,
     132             :             DESTINATION_MCHR,
     133             :             DESTINATION_MPOS,
     134             :             DESTINATION_MVERTJC,
     135             :             DESTINATION_MSTRIKEH,
     136             :             DESTINATION_MDEGHIDE,
     137             :             DESTINATION_ME,
     138             :             DESTINATION_MBAR,
     139             :             DESTINATION_MBARPR,
     140             :             DESTINATION_MD,
     141             :             DESTINATION_MDPR,
     142             :             DESTINATION_MBEGCHR,
     143             :             DESTINATION_MSEPCHR,
     144             :             DESTINATION_MENDCHR,
     145             :             DESTINATION_MFUNC,
     146             :             DESTINATION_MFUNCPR,
     147             :             DESTINATION_MFNAME,
     148             :             DESTINATION_MLIMLOW,
     149             :             DESTINATION_MLIMLOWPR,
     150             :             DESTINATION_MLIM,
     151             :             DESTINATION_MM,
     152             :             DESTINATION_MMPR,
     153             :             DESTINATION_MMR,
     154             :             DESTINATION_MNARY,
     155             :             DESTINATION_MNARYPR,
     156             :             DESTINATION_MSUB,
     157             :             DESTINATION_MSUP,
     158             :             DESTINATION_MSUBHIDE,
     159             :             DESTINATION_MSUPHIDE,
     160             :             DESTINATION_MLIMUPP,
     161             :             DESTINATION_MLIMUPPPR,
     162             :             DESTINATION_MGROUPCHR,
     163             :             DESTINATION_MGROUPCHRPR,
     164             :             DESTINATION_MBORDERBOX,
     165             :             DESTINATION_MBORDERBOXPR,
     166             :             DESTINATION_MRAD,
     167             :             DESTINATION_MRADPR,
     168             :             DESTINATION_MDEG,
     169             :             DESTINATION_MSSUB,
     170             :             DESTINATION_MSSUBPR,
     171             :             DESTINATION_MSSUP,
     172             :             DESTINATION_MSSUPPR,
     173             :             DESTINATION_MSSUBSUP,
     174             :             DESTINATION_MSSUBSUPPR,
     175             :             DESTINATION_MSPRE,
     176             :             DESTINATION_MSPREPR,
     177             :             DESTINATION_MTYPE,
     178             :             DESTINATION_MGROW,
     179             :             DESTINATION_MBOX,
     180             :             DESTINATION_MEQARR,
     181             :         };
     182             : 
     183             :         enum RTFBorderState
     184             :         {
     185             :             BORDER_NONE,
     186             :             BORDER_PARAGRAPH,
     187             :             BORDER_PARAGRAPH_BOX,
     188             :             BORDER_CELL,
     189             :             BORDER_PAGE
     190             :         };
     191             : 
     192             :         enum RTFErrors
     193             :         {
     194             :             ERROR_OK,
     195             :             ERROR_GROUP_UNDER,
     196             :             ERROR_GROUP_OVER,
     197             :             ERROR_EOF,
     198             :             ERROR_HEX_INVALID,
     199             :             ERROR_CHAR_OVER
     200             :         };
     201             : 
     202             :         /// Minimalistic buffer of elements for nested cells.
     203             :         enum RTFBufferTypes
     204             :         {
     205             :             BUFFER_PROPS,
     206             :             BUFFER_CELLEND,
     207             :             BUFFER_STARTRUN,
     208             :             BUFFER_TEXT,
     209             :             BUFFER_UTEXT,
     210             :             BUFFER_ENDRUN,
     211             :             BUFFER_PAR
     212             :         };
     213             : 
     214             :         /// Form field types
     215             :         enum RTFFormFieldTypes
     216             :         {
     217             :             FORMFIELD_NONE,
     218             :             FORMFIELD_TEXT,
     219             :             FORMFIELD_CHECKBOX,
     220             :             FORMFIELD_LIST
     221             :         };
     222             : 
     223             :         enum RTFBmpStyles
     224             :         {
     225             :             BMPSTYLE_NONE,
     226             :             BMPSTYLE_PNG,
     227             :             BMPSTYLE_JPEG
     228             :         };
     229             : 
     230             :         enum RTFFieldStatus
     231             :         {
     232             :             FIELD_NONE,
     233             :             FIELD_INSTRUCTION,
     234             :             FIELD_RESULT
     235             :         };
     236             : 
     237             :         /// A buffer storing dmapper calls.
     238             :         typedef std::deque< std::pair<RTFBufferTypes, RTFValue::Pointer_t> > RTFBuffer_t;
     239             : 
     240             :         /// An entry in the color table.
     241             :         class RTFColorTableEntry
     242             :         {
     243             :             public:
     244             :                 RTFColorTableEntry();
     245             :                 sal_uInt8 nRed;
     246             :                 sal_uInt8 nGreen;
     247             :                 sal_uInt8 nBlue;
     248             :         };
     249             : 
     250             :         /// Stores the properties of a shape.
     251       43845 :         class RTFShape
     252             :         {
     253             :             public:
     254             :                 RTFShape();
     255             :                 std::vector< std::pair<rtl::OUString, rtl::OUString> > aProperties;
     256             :                 sal_Int32 nLeft;
     257             :                 sal_Int32 nTop;
     258             :                 sal_Int32 nRight;
     259             :                 sal_Int32 nBottom;
     260             :                 sal_Int16 nHoriOrientRelation;
     261             :                 sal_Int16 nVertOrientRelation;
     262             :                 int nWrap;
     263             :         };
     264             : 
     265             :         /// Stores the properties of a drawing object.
     266       21678 :         class RTFDrawingObject : public RTFShape
     267             :         {
     268             :             public:
     269             :                 RTFDrawingObject();
     270             :                 uno::Reference<drawing::XShape> xShape;
     271             :                 uno::Reference<beans::XPropertySet> xPropertySet;
     272             :                 std::vector<beans::PropertyValue> aPendingProperties;
     273             :                 sal_uInt8 nLineColorR, nLineColorG, nLineColorB;
     274             :                 bool bHasLineColor;
     275             :                 sal_uInt8 nFillColorR, nFillColorG, nFillColorB;
     276             :                 bool bHasFillColor;
     277             :                 sal_Int32 nDhgt;
     278             :                 sal_Int32 nFLine;
     279             :                 sal_Int32 nPolyLineCount;
     280             :                 uno::Sequence<awt::Point> aPolyLinePoints;
     281             :         };
     282             : 
     283             :         /// Stores the properties of a picture.
     284             :         class RTFPicture
     285             :         {
     286             :             public:
     287             :                 RTFPicture();
     288             :                 sal_uInt16 nWidth, nHeight;
     289             :                 sal_uInt16 nGoalWidth, nGoalHeight;
     290             :                 sal_uInt16 nScaleX, nScaleY;
     291             :                 short nCropT, nCropB, nCropL, nCropR;
     292             :                 sal_uInt16 eWMetafile;
     293             :                 RTFBmpStyles nStyle;
     294             :         };
     295             : 
     296             :         class RTFParserState;
     297             : 
     298             :         /// Stores the properties of a frame
     299             :         class RTFFrame
     300             :         {
     301             :             private:
     302             :                 RTFParserState* m_pParserState;
     303             :                 sal_Int32 nX, nY, nW, nH;
     304             :                 sal_Int32 nHoriPadding, nVertPadding;
     305             :                 sal_Int32 nHoriAlign, nHoriAnchor, nVertAlign, nVertAnchor;
     306             :                 Id nHRule;
     307             :             public:
     308             :                 RTFFrame(RTFParserState* pParserState);
     309             :                 sal_Int16 nAnchorType;
     310             : 
     311             :                 /// Convert the stored properties to Sprms
     312             :                 RTFSprms getSprms();
     313             :                 /// Store a property
     314             :                 void setSprm(Id nId, Id nValue);
     315             :                 bool hasProperties();
     316             :                 /// If we got tokens indicating we're in a frame.
     317             :                 bool inFrame();
     318             :         };
     319             : 
     320             :         class RTFDocumentImpl;
     321             : 
     322             :         /// State of the parser, which gets saved / restored when changing groups.
     323       21678 :         class RTFParserState
     324             :         {
     325             :             public:
     326             :                 RTFParserState(RTFDocumentImpl* pDocumentImpl);
     327             :                 /// Resets aFrame.
     328             :                 void resetFrame();
     329             : 
     330             :                 RTFDocumentImpl* m_pDocumentImpl;
     331             :                 RTFInternalState nInternalState;
     332             :                 RTFDesitnationState nDestinationState;
     333             :                 RTFFieldStatus nFieldStatus;
     334             :                 RTFBorderState nBorderState;
     335             :                 // font table, stylesheet table
     336             :                 RTFSprms aTableSprms;
     337             :                 RTFSprms aTableAttributes;
     338             :                 // reset by plain
     339             :                 RTFSprms aCharacterSprms;
     340             :                 RTFSprms aCharacterAttributes;
     341             :                 // reset by pard
     342             :                 RTFSprms aParagraphSprms;
     343             :                 RTFSprms aParagraphAttributes;
     344             :                 // reset by sectd
     345             :                 RTFSprms aSectionSprms;
     346             :                 RTFSprms aSectionAttributes;
     347             :                 // reset by trowd
     348             :                 RTFSprms aTableRowSprms;
     349             :                 RTFSprms aTableRowAttributes;
     350             :                 // reset by cellx
     351             :                 RTFSprms aTableCellSprms;
     352             :                 RTFSprms aTableCellAttributes;
     353             :                 // reset by row/nestrow
     354             :                 std::deque<RTFSprms> aTableCellsSprms;
     355             :                 std::deque<RTFSprms> aTableCellsAttributes;
     356             :                 // backup of the above two, to support inheriting cell props
     357             :                 std::deque<RTFSprms> aTableInheritingCellsSprms;
     358             :                 std::deque<RTFSprms> aTableInheritingCellsAttributes;
     359             :                 // reset by tx
     360             :                 RTFSprms aTabAttributes;
     361             : 
     362             :                 RTFColorTableEntry aCurrentColor;
     363             : 
     364             :                 rtl_TextEncoding nCurrentEncoding;
     365             : 
     366             :                 /// Current \uc value.
     367             :                 int nUc;
     368             :                 /// Characters to skip, set to nUc by \u.
     369             :                 int nCharsToSkip;
     370             :                 /// Characters to read, once in binary mode.
     371             :                 int nBinaryToRead;
     372             : 
     373             :                 /// Next list level index to use when parsing list table.
     374             :                 int nListLevelNum;
     375             :                 /// List level entries, which will form a list entry later.
     376             :                 RTFSprms aListLevelEntries;
     377             : 
     378             :                 /// List of character positions in leveltext to replace.
     379             :                 std::vector<sal_Int32> aLevelNumbers;
     380             : 
     381             :                 RTFPicture aPicture;
     382             :                 RTFShape aShape;
     383             :                 RTFDrawingObject aDrawingObject;
     384             :                 RTFFrame aFrame;
     385             : 
     386             :                 /// Current cellx value.
     387             :                 int nCellX;
     388             :                 int nCells;
     389             :                 int nInheritingCells;
     390             : 
     391             :                 /// CJK or CTL?
     392             :                 bool bIsCjk;
     393             : 
     394             :                 // Info group.
     395             :                 int nYear;
     396             :                 int nMonth;
     397             :                 int nDay;
     398             :                 int nHour;
     399             :                 int nMinute;
     400             : 
     401             :                 /// Text from special destinations.
     402             :                 rtl::OUStringBuffer aDestinationText;
     403             : 
     404             :                 /// Same as the int value of NS_rtf::LN_ISTD in aParagraphAttributes, for performance reasons.
     405             :                 int nCurrentStyleIndex;
     406             :         };
     407             : 
     408             :         class RTFTokenizer;
     409             :         class RTFSdrImport;
     410             : 
     411             :         /// Implementation of the RTFDocument interface.
     412             :         class RTFDocumentImpl
     413             :             : public RTFDocument
     414             :         {
     415             :             public:
     416             :                 typedef ::boost::shared_ptr<RTFDocumentImpl> Pointer_t;
     417             :                 RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& xContext,
     418             :                                 uno::Reference<io::XInputStream> const& xInputStream,
     419             :                                 uno::Reference<lang::XComponent> const& xDstDoc,
     420             :                                 uno::Reference<frame::XFrame> const& xFrame,
     421             :                                 uno::Reference<task::XStatusIndicator> const& xStatusIndicator);
     422             :                 virtual ~RTFDocumentImpl();
     423             :                 virtual void resolve(Stream & rHandler);
     424             :                 virtual std::string getType() const;
     425             : 
     426             :                 Stream& Mapper();
     427             :                 void setSubstream(bool bIsSubtream);
     428             :                 void setSuperstream(RTFDocumentImpl *pSuperstream);
     429             :                 void setAuthor(rtl::OUString& rAuthor);
     430             :                 void setAuthorInitials(rtl::OUString& rAuthorInitials);
     431             :                 bool isSubstream() const;
     432             :                 void finishSubstream();
     433             :                 void setIgnoreFirst(rtl::OUString& rIgnoreFirst);
     434             :                 void seek(sal_uInt32 nPos);
     435             :                 uno::Reference<lang::XMultiServiceFactory> getModelFactory();
     436             :                 RTFParserState& getState();
     437             :                 void setDestinationText(rtl::OUString& rString);
     438             :                 /// Resolve a picture: If not inline, then anchored.
     439             :                 int resolvePict(bool bInline);
     440             :                 void replayShapetext();
     441             :                 bool getSkipUnknown();
     442             :                 void setSkipUnknown(bool bSkipUnknown);
     443             : 
     444             :                 // These callbacks are invoked by the tokenizer.
     445             :                 int resolveChars(char ch);
     446             :                 int pushState();
     447             :                 int popState();
     448             :                 int dispatchFlag(RTFKeyword nKeyword);
     449             :                 int dispatchDestination(RTFKeyword nKeyword);
     450             :                 int dispatchSymbol(RTFKeyword nKeyword);
     451             :                 int dispatchToggle(RTFKeyword nKeyword, bool bParam, int nParam);
     452             :                 int dispatchValue(RTFKeyword nKeyword, int nParam);
     453             : 
     454             :                 /// If this is the first run of the document, starts the initial paragraph.
     455             :                 void checkFirstRun();
     456             :                 /// If the initial paragraph is started.
     457             :                 bool getFirstRun();
     458             :                 /// If we need to add a dummy paragraph before a section break.
     459             :                 void setNeedPar(bool bNeedPar);
     460             :                 /// Return the dmapper index of an RTF index for fonts.
     461             :                 int getFontIndex(int nIndex);
     462             :                 /// Return the encoding associated with a dmapper font index.
     463             :                 rtl_TextEncoding getEncoding(sal_uInt32 nFontIndex);
     464             :                 /// Get the default parser state.
     465             :                 RTFParserState& getDefaultState();
     466             : 
     467             :             private:
     468             :                 SvStream& Strm();
     469             :                 sal_uInt32 getColorTable(sal_uInt32 nIndex);
     470             :                 RTFSprms mergeSprms();
     471             :                 RTFSprms mergeAttributes();
     472             :                 void resetSprms();
     473             :                 void resetAttributes();
     474             :                 void resolveSubstream(sal_uInt32 nPos, Id nId);
     475             :                 void resolveSubstream(sal_uInt32 nPos, Id nId, rtl::OUString& rIgnoreFirst);
     476             : 
     477             :                 void text(rtl::OUString& rString);
     478             :                 // Sends a single character to dmapper, taking care of buffering.
     479             :                 void singleChar(sal_uInt8 nValue, bool bRunProps = false);
     480             :                 // Sends run properties to dmapper, taking care of buffering.
     481             :                 void runProps();
     482             :                 void runBreak();
     483             :                 void parBreak();
     484             :                 void tableBreak();
     485             :                 writerfilter::Reference<Properties>::Pointer_t getProperties(RTFSprms& rAttributes, RTFSprms& rSprms);
     486             :                 void checkNeedPap();
     487             :                 void sectBreak(bool bFinal);
     488             :                 void replayBuffer(RTFBuffer_t& rBuffer);
     489             :                 /// If we have some unicode or hex characters to send.
     490             :                 void checkUnicode(bool bUnicode = true, bool bHex = true);
     491             :                 /// If we need a final section break at the end of the document.
     492             :                 void setNeedSect(bool bNeedSect = true);
     493             : 
     494             :                 uno::Reference<uno::XComponentContext> const& m_xContext;
     495             :                 uno::Reference<io::XInputStream> const& m_xInputStream;
     496             :                 uno::Reference<lang::XComponent> const& m_xDstDoc;
     497             :                 uno::Reference<frame::XFrame> const& m_xFrame;
     498             :                 uno::Reference<task::XStatusIndicator> const& m_xStatusIndicator;
     499             :                 uno::Reference<lang::XMultiServiceFactory> m_xModelFactory;
     500             :                 uno::Reference<document::XDocumentProperties> m_xDocumentProperties;
     501             :                 boost::shared_ptr<SvStream> m_pInStream;
     502             :                 Stream* m_pMapperStream;
     503             :                 boost::shared_ptr<RTFSdrImport> m_pSdrImport;
     504             :                 boost::shared_ptr<RTFTokenizer> m_pTokenizer;
     505             :                 std::stack<RTFParserState> m_aStates;
     506             :                 /// Read by RTF_PARD.
     507             :                 RTFParserState m_aDefaultState;
     508             :                 bool m_bSkipUnknown;
     509             :                 /// Font index <-> encoding map, *not* part of the parser state
     510             :                 std::map<int, rtl_TextEncoding> m_aFontEncodings;
     511             :                 /// Maps the non-continious font indexes to the continous dmapper indexes.
     512             :                 std::vector<int> m_aFontIndexes;
     513             :                 /// Color index <-> RGB color value map
     514             :                 std::vector<sal_uInt32> m_aColorTable;
     515             :                 bool m_bFirstRun;
     516             :                 /// If paragraph properties should be emitted on next run.
     517             :                 bool m_bNeedPap;
     518             :                 /// If we need to emit a CR at the end of substream.
     519             :                 bool m_bNeedCr;
     520             :                 bool m_bNeedPar;
     521             :                 /// If set, an empty paragraph will be added at the end of the document.
     522             :                 bool m_bNeedFinalPar;
     523             :                 /// The list table and list override table combined.
     524             :                 RTFSprms m_aListTableSprms;
     525             :                 /// The settings table attributes.
     526             :                 RTFSprms m_aSettingsTableAttributes;
     527             :                 /// The settings table sprms.
     528             :                 RTFSprms m_aSettingsTableSprms;
     529             : 
     530             :                 oox::StorageRef m_xStorage;
     531             :                 boost::shared_ptr<oox::GraphicHelper> m_pGraphicHelper;
     532             : 
     533             :                 /// Buffered table cells, till cell definitions are not reached.
     534             :                 RTFBuffer_t m_aTableBuffer;
     535             :                 /// Buffered superscript, till footnote is reached (or not).
     536             :                 RTFBuffer_t m_aSuperBuffer;
     537             :                 /// Buffered shape text.
     538             :                 RTFBuffer_t m_aShapetextBuffer;
     539             :                 /// Points to the active buffer, if there is one.
     540             :                 RTFBuffer_t* m_pCurrentBuffer;
     541             : 
     542             :                 bool m_bHasFootnote;
     543             :                 /// Superstream of this substream.
     544             :                 RTFDocumentImpl *m_pSuperstream;
     545             :                 std::queue< std::pair<Id, sal_uInt32> > m_nHeaderFooterPositions;
     546             :                 sal_uInt32 m_nGroupStartPos;
     547             :                 /// Ignore the first occurrence of this text.
     548             :                 rtl::OUString m_aIgnoreFirst;
     549             :                 /// Bookmark name <-> index map.
     550             :                 std::map<rtl::OUString, int> m_aBookmarks;
     551             :                 /// Revision index <-> author map.
     552             :                 std::map<int, rtl::OUString> m_aAuthors;
     553             :                 /// Annotation author of the next annotation.
     554             :                 rtl::OUString m_aAuthor;
     555             :                 /// Initials of author of the next annotation.
     556             :                 rtl::OUString m_aAuthorInitials;
     557             : 
     558             :                 RTFSprms m_aFormfieldSprms;
     559             :                 RTFSprms m_aFormfieldAttributes;
     560             :                 RTFFormFieldTypes m_nFormFieldType;
     561             : 
     562             :                 RTFSprms m_aObjectSprms;
     563             :                 RTFSprms m_aObjectAttributes;
     564             :                 /// If we are in an object group.
     565             :                 bool m_bObject;
     566             :                 /// Contents of the objdata group.
     567             :                 boost::shared_ptr<SvStream> m_pObjectData;
     568             :                 /// If the data for a picture is a binary one, it's stored here.
     569             :                 boost::shared_ptr<SvStream> m_pBinaryData;
     570             : 
     571             :                 RTFReferenceTable::Entries_t m_aFontTableEntries;
     572             :                 int m_nCurrentFontIndex;
     573             : 
     574             :                 RTFReferenceTable::Entries_t m_aStyleTableEntries;
     575             :                 int m_nCurrentStyleIndex;
     576             :                 bool m_bFormField;
     577             :                 /// If a frame start token is already sent to dmapper (nesting them is not OK).
     578             :                 bool m_bIsInFrame;
     579             :                 // Unicode characters are collected here so we don't have to send them one by one.
     580             :                 rtl::OUStringBuffer m_aUnicodeBuffer;
     581             :                 /// Same for hex characters.
     582             :                 rtl::OStringBuffer m_aHexBuffer;
     583             :                 /// Formula import.
     584             :                 oox::formulaimport::XmlStreamBuilder m_aMathBuffer;
     585             :                 /// If the next continous section break should be ignored.
     586             :                 bool m_bIgnoreNextContSectBreak;
     587             :                 /// If a section break is needed before the end of the doc (false right after a section break).
     588             :                 bool m_bNeedSect;
     589             :                 /// If aFrame.inFrame() was true in the previous state.
     590             :                 bool m_bWasInFrame;
     591             :                 /// A picture was seen in the current paragraph.
     592             :                 bool m_bHadPicture;
     593             :                 /// The document has multiple sections.
     594             :                 bool m_bHadSect;
     595             :         };
     596             :     } // namespace rtftok
     597             : } // namespace writerfilter
     598             : 
     599             : #endif // _RTFDOCUMENTIMPL_HXX_
     600             : 
     601             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10