LCOV - code coverage report
Current view: top level - writerfilter/source/rtftok - rtfdocumentimpl.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 21 21 100.0 %
Date: 2014-11-03 Functions: 23 23 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             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  */
       9             : 
      10             : #ifndef INCLUDED_WRITERFILTER_SOURCE_RTFTOK_RTFDOCUMENTIMPL_HXX
      11             : #define INCLUDED_WRITERFILTER_SOURCE_RTFTOK_RTFDOCUMENTIMPL_HXX
      12             : 
      13             : #include <stack>
      14             : #include <queue>
      15             : #include <boost/optional.hpp>
      16             : #include <boost/tuple/tuple.hpp>
      17             : 
      18             : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
      19             : #include <com/sun/star/beans/XPropertySet.hpp>
      20             : #include <com/sun/star/document/XDocumentProperties.hpp>
      21             : #include <oox/helper/graphichelper.hxx>
      22             : #include <oox/mathml/importutils.hxx>
      23             : #include <rtl/strbuf.hxx>
      24             : #include <comphelper/sequenceasvector.hxx>
      25             : 
      26             : #include <rtftok/RTFDocument.hxx>
      27             : #include <rtfreferencetable.hxx>
      28             : #include <rtfsprm.hxx>
      29             : #include <rtflistener.hxx>
      30             : 
      31             : class SvStream;
      32             : 
      33             : namespace writerfilter
      34             : {
      35             : namespace rtftok
      36             : {
      37             : enum RTFBorderState
      38             : {
      39             :     BORDER_NONE,
      40             :     BORDER_PARAGRAPH,
      41             :     BORDER_PARAGRAPH_BOX,
      42             :     BORDER_CELL,
      43             :     BORDER_PAGE,
      44             :     BORDER_CHARACTER
      45             : };
      46             : 
      47             : /// Minimalistic buffer of elements for nested cells.
      48             : enum RTFBufferTypes
      49             : {
      50             :     BUFFER_PROPS,
      51             :     BUFFER_NESTROW,
      52             :     BUFFER_CELLEND,
      53             :     BUFFER_STARTRUN,
      54             :     BUFFER_TEXT,
      55             :     BUFFER_UTEXT,
      56             :     BUFFER_ENDRUN,
      57             :     BUFFER_PAR,
      58             :     BUFFER_STARTSHAPE,
      59             :     BUFFER_ENDSHAPE,
      60             :     BUFFER_RESOLVESUBSTREAM
      61             : };
      62             : 
      63             : /// Form field types
      64             : enum RTFFormFieldTypes
      65             : {
      66             :     FORMFIELD_NONE,
      67             :     FORMFIELD_TEXT,
      68             :     FORMFIELD_CHECKBOX,
      69             :     FORMFIELD_LIST
      70             : };
      71             : 
      72             : enum RTFBmpStyles
      73             : {
      74             :     BMPSTYLE_NONE,
      75             :     BMPSTYLE_PNG,
      76             :     BMPSTYLE_JPEG
      77             : };
      78             : 
      79             : enum RTFFieldStatus
      80             : {
      81             :     FIELD_NONE,
      82             :     FIELD_INSTRUCTION,
      83             :     FIELD_RESULT
      84             : };
      85             : 
      86             : struct TableRowBuffer;
      87             : 
      88             : /// A buffer storing dmapper calls.
      89             : typedef ::boost::tuple<RTFBufferTypes, RTFValue::Pointer_t,
      90             :         ::boost::shared_ptr<TableRowBuffer> > Buf_t;
      91             : typedef std::deque< Buf_t > RTFBuffer_t;
      92             : 
      93             : /// holds one nested table row
      94          12 : struct TableRowBuffer
      95             : {
      96             :     RTFBuffer_t buffer;
      97             :     ::std::deque<RTFSprms> cellsSprms;
      98             :     ::std::deque<RTFSprms> cellsAttributes;
      99             :     int nCells;
     100             :     writerfilter::Reference<Properties>::Pointer_t pParaProperties;
     101             :     writerfilter::Reference<Properties>::Pointer_t pFrameProperties;
     102             :     writerfilter::Reference<Properties>::Pointer_t pRowProperties;
     103             : 
     104          12 :     TableRowBuffer(RTFBuffer_t const& rBuffer,
     105             :                    ::std::deque<RTFSprms> const& rSprms,
     106             :                    ::std::deque<RTFSprms> const& rAttributes,
     107             :                    int const i_nCells)
     108             :         : buffer(rBuffer)
     109             :         , cellsSprms(rSprms), cellsAttributes(rAttributes)
     110          12 :         , nCells(i_nCells)
     111          12 :     {}
     112             : };
     113             : 
     114             : /// An entry in the color table.
     115             : class RTFColorTableEntry
     116             : {
     117             : public:
     118             :     RTFColorTableEntry();
     119             :     sal_uInt8 nRed;
     120             :     sal_uInt8 nGreen;
     121             :     sal_uInt8 nBlue;
     122             : };
     123             : 
     124             : /// Stores the properties of a shape.
     125      846488 : class RTFShape
     126             : {
     127             : public:
     128             :     RTFShape();
     129             :     std::vector< std::pair<OUString, OUString> > aProperties; ///< Properties of a single shape.
     130             :     std::vector< std::pair<OUString, OUString> > aGroupProperties; ///< Properties applied on the groupshape.
     131             :     sal_Int32 nLeft;
     132             :     sal_Int32 nTop;
     133             :     sal_Int32 nRight;
     134             :     sal_Int32 nBottom;
     135             :     boost::optional<sal_Int32> oZ; ///< Z-Order of the shape.
     136             :     sal_Int16 nHoriOrientRelation; ///< Horizontal text::RelOrientation for drawinglayer shapes.
     137             :     sal_Int16 nVertOrientRelation; ///< Vertical text::RelOrientation for drawinglayer shapes.
     138             :     sal_uInt32 nHoriOrientRelationToken; ///< Horizontal dmapper token for Writer pictures.
     139             :     sal_uInt32 nVertOrientRelationToken; ///< Vertical dmapper token for Writer pictures.
     140             :     int nWrap;
     141             :     /// If shape is below text (true) or text is below shape (false).
     142             :     bool bInBackground;
     143             :     /// Wrap polygon, written by RTFSdrImport::resolve(), read by RTFDocumentImpl::resolvePict().
     144             :     RTFSprms aWrapPolygonSprms;
     145             : };
     146             : 
     147             : /// Stores the properties of a drawing object.
     148      126538 : class RTFDrawingObject : public RTFShape
     149             : {
     150             : public:
     151             :     RTFDrawingObject();
     152             :     css::uno::Reference<css::drawing::XShape> xShape;
     153             :     css::uno::Reference<css::beans::XPropertySet> xPropertySet;
     154             :     std::vector<css::beans::PropertyValue> aPendingProperties;
     155             :     sal_uInt8 nLineColorR, nLineColorG, nLineColorB;
     156             :     bool bHasLineColor;
     157             :     sal_uInt8 nFillColorR, nFillColorG, nFillColorB;
     158             :     bool bHasFillColor;
     159             :     sal_Int32 nDhgt;
     160             :     sal_Int32 nFLine;
     161             :     sal_Int32 nPolyLineCount;
     162             :     comphelper::SequenceAsVector<css::awt::Point> aPolyLinePoints;
     163             :     bool bHadShapeText;
     164             : };
     165             : 
     166             : /// Stores the properties of a picture.
     167             : class RTFPicture
     168             : {
     169             : public:
     170             :     RTFPicture();
     171             :     sal_uInt16 nWidth, nHeight;
     172             :     sal_uInt16 nGoalWidth, nGoalHeight;
     173             :     sal_uInt16 nScaleX, nScaleY;
     174             :     short nCropT, nCropB, nCropL, nCropR;
     175             :     sal_uInt16 eWMetafile;
     176             :     RTFBmpStyles nStyle;
     177             : };
     178             : 
     179             : class RTFParserState;
     180             : 
     181             : /// Stores the properties of a frame
     182      130012 : class RTFFrame
     183             : {
     184             : private:
     185             :     RTFParserState* m_pParserState;
     186             :     sal_Int32 nX, nY, nW, nH;
     187             :     sal_Int32 nHoriPadding, nVertPadding;
     188             :     sal_Int32 nHoriAlign, nHoriAnchor, nVertAlign, nVertAnchor;
     189             :     Id nHRule;
     190             :     boost::optional<Id> oWrap;
     191             : public:
     192             :     RTFFrame(RTFParserState* pParserState);
     193             :     sal_Int16 nAnchorType;
     194             : 
     195             :     /// Convert the stored properties to Sprms
     196             :     RTFSprms getSprms();
     197             :     /// Store a property
     198             :     void setSprm(Id nId, Id nValue);
     199             :     bool hasProperties();
     200             :     /// If we got tokens indicating we're in a frame.
     201             :     bool inFrame();
     202             : };
     203             : 
     204             : class RTFDocumentImpl;
     205             : 
     206             : /// State of the parser, which gets saved / restored when changing groups.
     207      126538 : class RTFParserState
     208             : {
     209             : public:
     210             :     RTFParserState(RTFDocumentImpl* pDocumentImpl);
     211             :     /// Resets aFrame.
     212             :     void resetFrame();
     213             : 
     214             :     RTFDocumentImpl* m_pDocumentImpl;
     215             :     RTFInternalState nInternalState;
     216             :     RTFDestinationState nDestinationState;
     217             :     RTFFieldStatus nFieldStatus;
     218             :     RTFBorderState nBorderState;
     219             :     // font table, stylesheet table
     220             :     RTFSprms aTableSprms;
     221             :     RTFSprms aTableAttributes;
     222             :     // reset by plain
     223             :     RTFSprms aCharacterSprms;
     224             :     RTFSprms aCharacterAttributes;
     225             :     // reset by pard
     226             :     RTFSprms aParagraphSprms;
     227             :     RTFSprms aParagraphAttributes;
     228             :     // reset by sectd
     229             :     RTFSprms aSectionSprms;
     230             :     RTFSprms aSectionAttributes;
     231             :     // reset by trowd
     232             :     RTFSprms aTableRowSprms;
     233             :     RTFSprms aTableRowAttributes;
     234             :     // reset by cellx
     235             :     RTFSprms aTableCellSprms;
     236             :     RTFSprms aTableCellAttributes;
     237             :     // reset by tx
     238             :     RTFSprms aTabAttributes;
     239             : 
     240             :     RTFColorTableEntry aCurrentColor;
     241             : 
     242             :     rtl_TextEncoding nCurrentEncoding;
     243             : 
     244             :     /// Current \uc value.
     245             :     int nUc;
     246             :     /// Characters to skip, set to nUc by \u.
     247             :     int nCharsToSkip;
     248             :     /// Characters to read, once in binary mode.
     249             :     int nBinaryToRead;
     250             : 
     251             :     /// Next list level index to use when parsing list table.
     252             :     int nListLevelNum;
     253             :     /// List level entries, which will form a list entry later.
     254             :     RTFSprms aListLevelEntries;
     255             : 
     256             :     /// List of character positions in leveltext to replace.
     257             :     std::vector<sal_Int32> aLevelNumbers;
     258             : 
     259             :     RTFPicture aPicture;
     260             :     RTFShape aShape;
     261             :     RTFDrawingObject aDrawingObject;
     262             :     RTFFrame aFrame;
     263             : 
     264             :     /// Maps to OOXML's ascii, cs or eastAsia.
     265             :     enum { LOCH, HICH, DBCH } eRunType;
     266             :     /// ltrch or rtlch
     267             :     bool isRightToLeft;
     268             : 
     269             :     // Info group.
     270             :     int nYear;
     271             :     int nMonth;
     272             :     int nDay;
     273             :     int nHour;
     274             :     int nMinute;
     275             : 
     276             :     /// Text from special destinations.
     277             :     OUStringBuffer aDestinationText;
     278             :     /// point to the buffer of the current destination
     279             :     OUStringBuffer* pDestinationText;
     280             : 
     281             :     /// Index of the current style.
     282             :     int nCurrentStyleIndex;
     283             :     /// Index of the current character style.
     284             :     int nCurrentCharacterStyleIndex;
     285             : 
     286             :     /// Points to the active buffer, if there is one.
     287             :     RTFBuffer_t* pCurrentBuffer;
     288             : 
     289             :     /// If we're inside a \listpicture group.
     290             :     bool bInListpicture;
     291             : 
     292             :     /// If we're inside a \background group.
     293             :     bool bInBackground;
     294             : 
     295             :     bool bHadShapeText;
     296             :     bool bInShapeGroup; ///< If we're inside a \shpgrp group.
     297             :     bool bInShape; ///< If we're inside a \shp group.
     298             :     bool bCreatedShapeGroup; ///< A GroupShape was created and pushed to the parent stack.
     299             :     bool bStartedTrackchange; ///< Track change is started, need to end it before popping.
     300             : };
     301             : 
     302             : /// An RTF stack is similar to std::stack, except that it has an operator[].
     303        1628 : struct RTFStack : public std::deque<RTFParserState>
     304             : {
     305   107293454 :     RTFParserState& top()
     306             :     {
     307   107293454 :         return back();
     308             :     }
     309       31426 :     void pop()
     310             :     {
     311       31426 :         return pop_back();
     312             :     }
     313       31434 :     void push(RTFParserState const& rState)
     314             :     {
     315       31434 :         return push_back(rState);
     316             :     }
     317             : };
     318             : 
     319             : class RTFTokenizer;
     320             : class RTFSdrImport;
     321             : 
     322             : /// Implementation of the RTFDocument interface.
     323             : class RTFDocumentImpl
     324             :     : public RTFDocument, public RTFListener
     325             : {
     326             : public:
     327             :     typedef ::boost::shared_ptr<RTFDocumentImpl> Pointer_t;
     328             :     RTFDocumentImpl(css::uno::Reference<css::uno::XComponentContext> const& xContext,
     329             :                     css::uno::Reference<css::io::XInputStream> const& xInputStream,
     330             :                     css::uno::Reference<css::lang::XComponent> const& xDstDoc,
     331             :                     css::uno::Reference<css::frame::XFrame> const& xFrame,
     332             :                     css::uno::Reference<css::task::XStatusIndicator> const& xStatusIndicator);
     333             :     virtual ~RTFDocumentImpl();
     334             : 
     335             :     // RTFDocument
     336             :     virtual void resolve(Stream& rHandler) SAL_OVERRIDE;
     337             : 
     338             :     // RTFListener
     339             :     virtual int dispatchDestination(RTFKeyword nKeyword) SAL_OVERRIDE;
     340             :     virtual int dispatchFlag(RTFKeyword nKeyword) SAL_OVERRIDE;
     341             :     virtual int dispatchSymbol(RTFKeyword nKeyword) SAL_OVERRIDE;
     342             :     virtual int dispatchToggle(RTFKeyword nKeyword, bool bParam, int nParam) SAL_OVERRIDE;
     343             :     virtual int dispatchValue(RTFKeyword nKeyword, int nParam) SAL_OVERRIDE;
     344             :     virtual int resolveChars(char ch) SAL_OVERRIDE;
     345             :     virtual int pushState() SAL_OVERRIDE;
     346             :     virtual int popState() SAL_OVERRIDE;
     347             :     virtual RTFDestinationState getDestinationState() SAL_OVERRIDE;
     348             :     virtual void setDestinationState(RTFDestinationState nDestinationState) SAL_OVERRIDE;
     349             :     virtual RTFInternalState getInternalState() SAL_OVERRIDE;
     350             :     virtual void setInternalState(RTFInternalState nInternalState) SAL_OVERRIDE;
     351             :     virtual bool getSkipUnknown() SAL_OVERRIDE;
     352             :     virtual void setSkipUnknown(bool bSkipUnknown) SAL_OVERRIDE;
     353             :     virtual void finishSubstream() SAL_OVERRIDE;
     354             :     virtual bool isSubstream() const SAL_OVERRIDE;
     355             : 
     356       64164 :     Stream& Mapper()
     357             :     {
     358       64164 :         return *m_pMapperStream;
     359             :     }
     360             :     void setSubstream(bool bIsSubtream);
     361             :     void setSuperstream(RTFDocumentImpl* pSuperstream);
     362             :     void setStreamType(Id nId);
     363             :     void setAuthor(OUString& rAuthor);
     364             :     void setAuthorInitials(OUString& rAuthorInitials);
     365             :     void setIgnoreFirst(OUString& rIgnoreFirst);
     366             :     void seek(sal_Size nPos);
     367         558 :     css::uno::Reference<css::lang::XMultiServiceFactory> getModelFactory()
     368             :     {
     369         558 :         return m_xModelFactory;
     370             :     }
     371             :     bool isInBackground();
     372             :     void setDestinationText(OUString& rString);
     373             :     /// Resolve a picture: If not inline, then anchored.
     374             :     int resolvePict(bool bInline, css::uno::Reference<css::drawing::XShape> const& xShape);
     375             : 
     376             :     /// If this is the first run of the document, starts the initial paragraph.
     377             :     void checkFirstRun();
     378             :     /// If the initial paragraph is started.
     379         310 :     bool getFirstRun()
     380             :     {
     381         310 :         return m_bFirstRun;
     382             :     }
     383             :     /// If we need to add a dummy paragraph before a section break.
     384             :     void setNeedPar(bool bNeedPar);
     385             :     /// Return the dmapper index of an RTF index for fonts.
     386             :     int getFontIndex(int nIndex);
     387             :     /// Return the name of the font, based on a dmapper index.
     388             :     OUString getFontName(int nIndex);
     389             :     /// Return the style name of an RTF style index.
     390             :     OUString getStyleName(int nIndex);
     391             :     /// Return the encoding associated with a font index.
     392             :     rtl_TextEncoding getEncoding(int nFontIndex);
     393             :     /// Get the default parser state.
     394             :     RTFParserState& getDefaultState();
     395             :     oox::GraphicHelper& getGraphicHelper();
     396             : 
     397             : private:
     398             :     SvStream& Strm();
     399             :     sal_uInt32 getColorTable(sal_uInt32 nIndex);
     400             :     writerfilter::Reference<Properties>::Pointer_t createStyleProperties();
     401             :     void resetSprms();
     402             :     void resetAttributes();
     403             :     void resolveSubstream(sal_Size nPos, Id nId);
     404             :     void resolveSubstream(sal_Size nPos, Id nId, OUString& rIgnoreFirst);
     405             : 
     406             :     void text(OUString& rString);
     407             :     // Sends a single character to dmapper, taking care of buffering.
     408             :     void singleChar(sal_uInt8 nValue, bool bRunProps = false);
     409             :     // Sends run properties to dmapper, taking care of buffering.
     410             :     void runProps();
     411             :     void runBreak();
     412             :     void parBreak();
     413             :     void tableBreak();
     414             :     writerfilter::Reference<Properties>::Pointer_t getProperties(RTFSprms& rAttributes, RTFSprms& rSprms);
     415             :     void checkNeedPap();
     416             :     void sectBreak(bool bFinal);
     417             :     void prepareProperties(
     418             :         RTFParserState& rState,
     419             :         writerfilter::Reference<Properties>::Pointer_t&,
     420             :         writerfilter::Reference<Properties>::Pointer_t&,
     421             :         writerfilter::Reference<Properties>::Pointer_t&,
     422             :         int const nCells, int const nCurrentCellX);
     423             :     /// Send the passed properties to dmapper.
     424             :     void sendProperties(
     425             :         writerfilter::Reference<Properties>::Pointer_t const&,
     426             :         writerfilter::Reference<Properties>::Pointer_t const&,
     427             :         writerfilter::Reference<Properties>::Pointer_t const&);
     428             :     void replayRowBuffer(RTFBuffer_t& rBuffer,
     429             :                          ::std::deque<RTFSprms>& rCellsSrpms,
     430             :                          ::std::deque<RTFSprms>& rCellsAttributes,
     431             :                          int const nCells);
     432             :     void replayBuffer(RTFBuffer_t& rBuffer,
     433             :                       RTFSprms*      const pSprms,
     434             :                       RTFSprms const* const pAttributes);
     435             :     /// If we have some unicode or hex characters to send.
     436             :     void checkUnicode(bool bUnicode, bool bHex);
     437             :     /// If we need a final section break at the end of the document.
     438             :     void setNeedSect(bool bNeedSect = true);
     439             :     void resetTableRowProperties();
     440             :     void backupTableRowProperties();
     441             :     void restoreTableRowProperties();
     442             : 
     443             :     css::uno::Reference<css::uno::XComponentContext> const& m_xContext;
     444             :     css::uno::Reference<css::io::XInputStream> const& m_xInputStream;
     445             :     css::uno::Reference<css::lang::XComponent> const& m_xDstDoc;
     446             :     css::uno::Reference<css::frame::XFrame> const& m_xFrame;
     447             :     css::uno::Reference<css::task::XStatusIndicator> const& m_xStatusIndicator;
     448             :     css::uno::Reference<css::lang::XMultiServiceFactory> m_xModelFactory;
     449             :     css::uno::Reference<css::document::XDocumentProperties> m_xDocumentProperties;
     450             :     boost::shared_ptr<SvStream> m_pInStream;
     451             :     Stream* m_pMapperStream;
     452             :     boost::shared_ptr<RTFSdrImport> m_pSdrImport;
     453             :     boost::shared_ptr<RTFTokenizer> m_pTokenizer;
     454             :     RTFStack m_aStates;
     455             :     /// Read by RTF_PARD.
     456             :     RTFParserState m_aDefaultState;
     457             :     bool m_bSkipUnknown;
     458             :     /// Font index <-> encoding map, *not* part of the parser state
     459             :     std::map<int, rtl_TextEncoding> m_aFontEncodings;
     460             :     /// Font index <-> name map.
     461             :     std::map<int, OUString> m_aFontNames;
     462             :     /// Maps the non-continuous font indexes to the continuous dmapper indexes.
     463             :     std::vector<int> m_aFontIndexes;
     464             :     /// Maps style indexes to style names.
     465             :     std::map<int, OUString> m_aStyleNames;
     466             :     /// Color index <-> RGB color value map
     467             :     std::vector<sal_uInt32> m_aColorTable;
     468             :     bool m_bFirstRun;
     469             :     /// If paragraph properties should be emitted on next run.
     470             :     bool m_bNeedPap;
     471             :     /// If we need to emit a CR at the end of substream.
     472             :     bool m_bNeedCr;
     473             :     /// Original value of m_bNeedCr -- saved/restored before/after textframes.
     474             :     bool m_bNeedCrOrig;
     475             :     bool m_bNeedPar;
     476             :     /// If set, an empty paragraph will be added at the end of the document.
     477             :     bool m_bNeedFinalPar;
     478             :     /// The list table and list override table combined.
     479             :     RTFSprms m_aListTableSprms;
     480             :     /// The settings table attributes.
     481             :     RTFSprms m_aSettingsTableAttributes;
     482             :     /// The settings table sprms.
     483             :     RTFSprms m_aSettingsTableSprms;
     484             : 
     485             :     oox::StorageRef m_xStorage;
     486             :     boost::shared_ptr<oox::GraphicHelper> m_pGraphicHelper;
     487             : 
     488             :     /// cell props buffer for nested tables, reset by \nestrow
     489             :     /// the \nesttableprops is a destination and must follow the
     490             :     /// nested cells, so it should be sufficient to store the
     491             :     /// currently active one, no need for a stack of them
     492             :     int m_nNestedCells;
     493             :     std::deque<RTFSprms> m_aNestedTableCellsSprms;
     494             :     std::deque<RTFSprms> m_aNestedTableCellsAttributes;
     495             :     /// cell props buffer for top-level table, reset by \row
     496             :     int m_nTopLevelCells;
     497             :     std::deque<RTFSprms> m_aTopLevelTableCellsSprms;
     498             :     std::deque<RTFSprms> m_aTopLevelTableCellsAttributes;
     499             :     /// backup of top-level props, to support inheriting cell props
     500             :     int m_nInheritingCells;
     501             :     std::deque<RTFSprms> m_aTableInheritingCellsSprms;
     502             :     std::deque<RTFSprms> m_aTableInheritingCellsAttributes;
     503             : 
     504             :     /// Current cellx value (nested table)
     505             :     int m_nNestedCurrentCellX;
     506             :     /// Current cellx value (top-level table)
     507             :     int m_nTopLevelCurrentCellX;
     508             : 
     509             :     // Backup of what \trowd clears, to work around invalid input.
     510             :     RTFSprms m_aBackupTableRowSprms;
     511             :     RTFSprms m_aBackupTableRowAttributes;
     512             :     int m_nBackupTopLevelCurrentCellX;
     513             : 
     514             :     /// Buffered table cells, till cell definitions are not reached.
     515             :     /// for nested table, one buffer per table level
     516             :     std::deque< RTFBuffer_t > m_aTableBufferStack;
     517             :     /// Buffered superscript, till footnote is reached (or not).
     518             :     RTFBuffer_t m_aSuperBuffer;
     519             : 
     520             :     bool m_bHasFootnote;
     521             :     /// Superstream of this substream.
     522             :     RTFDocumentImpl* m_pSuperstream;
     523             :     /// Type of the stream: header, footer, footnote, etc.
     524             :     Id m_nStreamType;
     525             :     std::queue< std::pair<Id, sal_Size> > m_nHeaderFooterPositions;
     526             :     sal_Size m_nGroupStartPos;
     527             :     /// Ignore the first occurrence of this text.
     528             :     OUString m_aIgnoreFirst;
     529             :     /// Bookmark name <-> index map.
     530             :     std::map<OUString, int> m_aBookmarks;
     531             :     /// Revision index <-> author map.
     532             :     std::map<int, OUString> m_aAuthors;
     533             :     /// Annotation author of the next annotation.
     534             :     OUString m_aAuthor;
     535             :     /// Initials of author of the next annotation.
     536             :     OUString m_aAuthorInitials;
     537             : 
     538             :     RTFSprms m_aFormfieldSprms;
     539             :     RTFSprms m_aFormfieldAttributes;
     540             :     RTFFormFieldTypes m_nFormFieldType;
     541             : 
     542             :     RTFSprms m_aObjectSprms;
     543             :     RTFSprms m_aObjectAttributes;
     544             :     /** If we are in an object group and if the we use its
     545             :      *  \objdata element.
     546             :      *  (if we don't use the \objdata we use the \result element)*/
     547             :     bool m_bObject;
     548             :     /// Contents of the objdata group.
     549             :     boost::shared_ptr<SvStream> m_pObjectData;
     550             :     /// If the data for a picture is a binary one, it's stored here.
     551             :     boost::shared_ptr<SvStream> m_pBinaryData;
     552             : 
     553             :     RTFReferenceTable::Entries_t m_aFontTableEntries;
     554             :     int m_nCurrentFontIndex;
     555             :     /// Used only during font table parsing till we don't know the font name.
     556             :     int m_nCurrentEncoding;
     557             :     /// Raw default font index, use getFont() on it to get a real one.
     558             :     int m_nDefaultFontIndex;
     559             : 
     560             :     RTFReferenceTable::Entries_t m_aStyleTableEntries;
     561             :     int m_nCurrentStyleIndex;
     562             :     bool m_bFormField;
     563             :     /// If a frame start token is already sent to dmapper (nesting them is not OK).
     564             :     bool m_bIsInFrame;
     565             :     // Unicode characters are collected here so we don't have to send them one by one.
     566             :     OUStringBuffer m_aUnicodeBuffer;
     567             :     /// Same for hex characters.
     568             :     OStringBuffer m_aHexBuffer;
     569             :     /// Formula import.
     570             :     oox::formulaimport::XmlStreamBuilder m_aMathBuffer;
     571             :     /// Normal text property, that is math italic and math spacing are not applied to the current run.
     572             :     bool m_bMathNor;
     573             :     /// If the next continuous section break should be ignored.
     574             :     bool m_bIgnoreNextContSectBreak;
     575             :     /// clean up a synthetic page break, see RTF_PAGE
     576             :     /// if inactive value is -1, otherwise the RTF_SKB* to restore
     577             :     RTFKeyword m_nResetBreakOnSectBreak;
     578             :     /// If a section break is needed before the end of the doc (false right after a section break).
     579             :     bool m_bNeedSect;
     580             :     /// If aFrame.inFrame() was true in the previous state.
     581             :     bool m_bWasInFrame;
     582             :     /// A picture was seen in the current paragraph.
     583             :     bool m_bHadPicture;
     584             :     /// The document has multiple sections.
     585             :     bool m_bHadSect;
     586             :     /// Max width of the rows in the current table.
     587             :     int m_nCellxMax;
     588             :     /// ID of the next \listlevel picture.
     589             :     int m_nListPictureId;
     590             : };
     591             : } // namespace rtftok
     592             : } // namespace writerfilter
     593             : 
     594             : #endif // INCLUDED_WRITERFILTER_SOURCE_RTFTOK_RTFDOCUMENTIMPL_HXX
     595             : 
     596             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10