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