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 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_SW_SOURCE_FILTER_WW8_DOCXATTRIBUTEOUTPUT_HXX
21 : #define INCLUDED_SW_SOURCE_FILTER_WW8_DOCXATTRIBUTEOUTPUT_HXX
22 :
23 : #include <memory>
24 :
25 : #include "attributeoutputbase.hxx"
26 : #include "fields.hxx"
27 : #include "IMark.hxx"
28 : #include "docxexport.hxx"
29 :
30 : #include <sax/fshelper.hxx>
31 : #include <sax/fastattribs.hxx>
32 : #include <vcl/vclenum.hxx>
33 : #include <svx/xenum.hxx>
34 :
35 : #include <fldbas.hxx>
36 :
37 : #include <vector>
38 : #include <boost/scoped_ptr.hpp>
39 : #include <boost/optional.hpp>
40 : #include <oox/export/vmlexport.hxx>
41 : #include <oox/export/drawingml.hxx>
42 : #include <docxtablestyleexport.hxx>
43 :
44 : #include <com/sun/star/table/BorderLine2.hpp>
45 : #include <com/sun/star/drawing/FillStyle.hpp>
46 :
47 : class SwGrfNode;
48 : class SdrObject;
49 :
50 : namespace docx { class FootnotesList; }
51 : namespace oox { namespace drawingml { class DrawingML; } }
52 :
53 1081 : struct FieldInfos
54 : {
55 : std::shared_ptr<const SwField> pField;
56 : const ::sw::mark::IFieldmark* pFieldmark;
57 : ww::eField eType;
58 : bool bOpen;
59 : bool bClose;
60 : OUString sCmd;
61 338 : FieldInfos() : pFieldmark(NULL), eType(ww::eUNKNOWN), bOpen(false), bClose(false){}
62 : };
63 :
64 : enum DocxColBreakStatus
65 : {
66 : COLBRK_NONE,
67 : COLBRK_POSTPONE,
68 : COLBRK_WRITE
69 : };
70 :
71 : /**
72 : * A structure that holds information about the options selected
73 : * when outputting a border to DOCX.
74 : *
75 : * There are 3 functions that initialize this structure:
76 : * - lcl_getTableDefaultBorderOptions - retrieves the options for when outputting table default borders
77 : * - lcl_getTableCellBorderOptions - retrieves the options for when outputting table cell borders
78 : * - lcl_getBoxBorderOptions - retrieves the options for when outputting box borders
79 : *
80 : */
81 : struct OutputBorderOptions
82 : {
83 : sal_Int32 tag;
84 : bool bUseStartEnd;
85 : bool bWriteTag;
86 : bool bWriteInsideHV;
87 : bool bWriteDistance;
88 : SvxShadowLocation aShadowLocation;
89 : bool bCheckDistanceSize;
90 :
91 2450 : OutputBorderOptions() : tag(0), bUseStartEnd(false), bWriteTag(true), bWriteInsideHV(false), bWriteDistance(false), aShadowLocation(SVX_SHADOW_NONE), bCheckDistanceSize(false) {}
92 : };
93 :
94 : /**
95 : * A structure that holds information about the page margins.
96 : *
97 : */
98 : struct PageMargins
99 : {
100 : sal_uInt16 nPageMarginLeft;
101 : sal_uInt16 nPageMarginRight;
102 : sal_uInt16 nPageMarginTop;
103 : sal_uInt16 nPageMarginBottom;
104 :
105 482 : PageMargins() : nPageMarginLeft(0), nPageMarginRight(0), nPageMarginTop(0), nPageMarginBottom(0) {}
106 : };
107 :
108 : /**
109 : * All the information that should be stashed away when we're in the middle of
110 : * of a table export and still have to do something else, e.g. export a shape.
111 : */
112 1206 : struct DocxTableExportContext
113 : {
114 : ww8::WW8TableInfo::Pointer_t m_pTableInfo;
115 : bool m_bTableCellOpen;
116 : sal_uInt32 m_nTableDepth;
117 : };
118 :
119 : /**
120 : * A structure that holds flags for the table export.
121 : */
122 : struct TableReference
123 : {
124 : /// Remember if we are in an open cell, or not.
125 : bool m_bTableCellOpen;
126 :
127 : /// If paragraph sdt got opened in this table cell.
128 : bool m_bTableCellParaSdtOpen;
129 :
130 : /// Remember the current table depth.
131 : sal_uInt32 m_nTableDepth;
132 :
133 482 : TableReference()
134 : : m_bTableCellOpen(false),
135 : m_bTableCellParaSdtOpen(false),
136 482 : m_nTableDepth(0)
137 : {
138 482 : }
139 : };
140 :
141 : /// The class that has handlers for various resource types when exporting as DOCX.
142 : class DocxAttributeOutput : public AttributeOutputBase, public oox::vml::VMLTextExport, public oox::drawingml::DMLTextExport
143 : {
144 : public:
145 : /// Export the state of RTL/CJK.
146 : virtual void RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript ) SAL_OVERRIDE;
147 :
148 : /// Start of the paragraph.
149 : virtual void StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo ) SAL_OVERRIDE;
150 :
151 : /// End of the paragraph.
152 : virtual void EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ) SAL_OVERRIDE;
153 :
154 : /// Empty paragraph.
155 : virtual void EmptyParagraph() SAL_OVERRIDE;
156 :
157 : /// Called in order to output section breaks.
158 : virtual void SectionBreaks(const SwTextNode& rNode) SAL_OVERRIDE;
159 :
160 : /// Called before we start outputting the attributes.
161 : virtual void StartParagraphProperties() SAL_OVERRIDE;
162 :
163 : /// Called after we end outputting the attributes.
164 : virtual void EndParagraphProperties(const SfxItemSet& rParagraphMarkerProperties, const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted) SAL_OVERRIDE;
165 :
166 : /// Start of the text run.
167 : virtual void StartRun( const SwRedlineData* pRedlineData, bool bSingleEmptyRun = false ) SAL_OVERRIDE;
168 :
169 : /// End of the text run.
170 : virtual void EndRun() SAL_OVERRIDE;
171 :
172 : /// Called before we start outputting the attributes.
173 : virtual void StartRunProperties() SAL_OVERRIDE;
174 :
175 : /// Called after we end outputting the attributes.
176 : virtual void EndRunProperties( const SwRedlineData* pRedlineData ) SAL_OVERRIDE;
177 :
178 : virtual void FootnoteEndnoteRefTag() SAL_OVERRIDE;
179 :
180 : virtual void SectFootnoteEndnotePr() SAL_OVERRIDE;
181 :
182 : virtual void WritePostitFieldReference() SAL_OVERRIDE;
183 :
184 : /// Output text (inside a run).
185 : virtual void RunText( const OUString& rText, rtl_TextEncoding eCharSet = RTL_TEXTENCODING_UTF8 ) SAL_OVERRIDE;
186 :
187 : /// Output text (without markup).
188 : virtual void RawText( const OUString& rText, bool bForceUnicode, rtl_TextEncoding eCharSet ) SAL_OVERRIDE;
189 :
190 : /// Output ruby start.
191 : virtual void StartRuby( const SwTextNode& rNode, sal_Int32 nPos, const SwFormatRuby& rRuby ) SAL_OVERRIDE;
192 :
193 : /// Output ruby end.
194 : virtual void EndRuby() SAL_OVERRIDE;
195 :
196 : /// Output URL start.
197 : virtual bool StartURL( const OUString& rUrl, const OUString& rTarget ) SAL_OVERRIDE;
198 :
199 : /// Output URL end.
200 : virtual bool EndURL(bool) SAL_OVERRIDE;
201 :
202 : virtual void FieldVanish( const OUString& rText, ww::eField eType ) SAL_OVERRIDE;
203 :
204 : /// Output redlining.
205 : ///
206 : /// The common attribute that can be among the run properties.
207 : virtual void Redline( const SwRedlineData* pRedline ) SAL_OVERRIDE;
208 :
209 : /// Output redlining.
210 : ///
211 : /// Start of the tag that encloses the run, fills the info according to
212 : /// the value of pRedlineData.
213 : void StartRedline( const SwRedlineData * pRedlineData );
214 :
215 : /// Output redlining.
216 : ///
217 : /// End of the tag that encloses the run.
218 : void EndRedline( const SwRedlineData * pRedlineData );
219 :
220 : virtual void SetStateOfFlyFrame( FlyProcessingState nStateOfFlyFrame ) SAL_OVERRIDE;
221 : virtual void SetAnchorIsLinkedToNode( bool bAnchorLinkedToNode = false ) SAL_OVERRIDE;
222 : virtual bool IsFlyProcessingPostponed() SAL_OVERRIDE;
223 : virtual void ResetFlyProcessingFlag() SAL_OVERRIDE;
224 :
225 : virtual void FormatDrop( const SwTextNode& rNode, const SwFormatDrop& rSwFormatDrop, sal_uInt16 nStyle, ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ) SAL_OVERRIDE;
226 :
227 : /// Output style.
228 : virtual void ParagraphStyle( sal_uInt16 nStyle ) SAL_OVERRIDE;
229 :
230 : virtual void TableInfoCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
231 : virtual void TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
232 : virtual void TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
233 : virtual void TableDefaultBorders( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
234 : void TableDefaultCellMargins( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
235 : virtual void TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
236 : virtual void TableRowRedline( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
237 : virtual void TableCellRedline( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
238 : virtual void TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
239 : virtual void TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
240 : virtual void TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
241 : virtual void TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
242 : virtual void TableNodeInfo( ww8::WW8TableNodeInfo::Pointer_t pNodeInfo ) SAL_OVERRIDE;
243 : virtual void TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner ) SAL_OVERRIDE;
244 : virtual void TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
245 : virtual void TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
246 : virtual void TableRowEnd( sal_uInt32 nDepth = 1 ) SAL_OVERRIDE;
247 :
248 : /// Start of the styles table.
249 : virtual void StartStyles() SAL_OVERRIDE;
250 :
251 : /// End of the styles table.
252 : virtual void EndStyles( sal_uInt16 nNumberOfStyles ) SAL_OVERRIDE;
253 :
254 : /// Write default style.
255 : virtual void DefaultStyle( sal_uInt16 nStyle ) SAL_OVERRIDE;
256 :
257 : /// Write Doc Defaults
258 : void DocDefaults( );
259 :
260 : /// Write latent styles.
261 : void LatentStyles();
262 :
263 : /** Similar to OutputItem(), but write something only if it is not the default.
264 :
265 : This is to output the docDefaults, and we should write something out
266 : only in case it is not what MSO already uses for the document by default.
267 : */
268 : void OutputDefaultItem(const SfxPoolItem& rHt);
269 :
270 : /// Start of a style in the styles table.
271 : virtual void StartStyle( const OUString& rName, StyleType eType,
272 : sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 nWwId, sal_uInt16 nId,
273 : bool bAutoUpdate ) SAL_OVERRIDE;
274 :
275 : /// End of a style in the styles table.
276 : virtual void EndStyle() SAL_OVERRIDE;
277 :
278 : /// Start of (paragraph or run) properties of a style.
279 : virtual void StartStyleProperties( bool bParProp, sal_uInt16 nStyle ) SAL_OVERRIDE;
280 :
281 : /// End of (paragraph or run) properties of a style.
282 : virtual void EndStyleProperties( bool bParProp ) SAL_OVERRIDE;
283 :
284 : /// Numbering rule and Id.
285 : virtual void OutlineNumbering( sal_uInt8 nLvl, const SwNumFormat &rNFormat, const SwFormat &rFormat ) SAL_OVERRIDE;
286 :
287 : /// Page break
288 : /// As a paragraph property - the paragraph should be on the next page.
289 : virtual void PageBreakBefore( bool bBreak ) SAL_OVERRIDE;
290 :
291 : /// Write a section break
292 : /// msword::ColumnBreak or msword::PageBreak
293 : virtual void SectionBreak( sal_uInt8 nC, const WW8_SepInfo* pSectionInfo = NULL ) SAL_OVERRIDE;
294 :
295 : /// Start of the section properties.
296 : virtual void StartSection() SAL_OVERRIDE;
297 :
298 : /// End of the section properties.
299 : virtual void EndSection() SAL_OVERRIDE;
300 :
301 : /// Protection of forms.
302 : virtual void SectionFormProtection( bool bProtected ) SAL_OVERRIDE;
303 :
304 : /// Numbering of the lines in the document.
305 : virtual void SectionLineNumbering( sal_uLong nRestartNo, const SwLineNumberInfo& rLnNumInfo ) SAL_OVERRIDE;
306 :
307 : /// Has different headers/footers for the title page.
308 : virtual void SectionTitlePage() SAL_OVERRIDE;
309 :
310 : /// Description of the page borders.
311 : virtual void SectionPageBorders( const SwFrameFormat* pFormat, const SwFrameFormat* pFirstPageFormat ) SAL_OVERRIDE;
312 :
313 : /// Columns populated from right/numbers on the right side?
314 : virtual void SectionBiDi( bool bBiDi ) SAL_OVERRIDE;
315 :
316 : /// The style of the page numbers.
317 : ///
318 : virtual void SectionPageNumbering( sal_uInt16 nNumType, const ::boost::optional<sal_uInt16>& oPageRestartNumber ) SAL_OVERRIDE;
319 :
320 : /// The type of breaking.
321 : virtual void SectionType( sal_uInt8 nBreakCode ) SAL_OVERRIDE;
322 :
323 : /// Start the font.
324 : void StartFont( const OUString& rFamilyName ) const;
325 :
326 : /// End the font.
327 : void EndFont() const;
328 :
329 : /// Alternate name for the font.
330 : void FontAlternateName( const OUString& rName ) const;
331 :
332 : /// Font charset.
333 : void FontCharset( sal_uInt8 nCharSet, rtl_TextEncoding nEncoding ) const;
334 :
335 : /// Font family.
336 : void FontFamilyType( FontFamily eFamily ) const;
337 :
338 : /// Font pitch.
339 : void FontPitchType( FontPitch ePitch ) const;
340 :
341 : /// Write out the font into the document, if it's an embedded font.
342 : void EmbedFont( const OUString& name, FontFamily family, FontPitch pitch, rtl_TextEncoding encoding );
343 :
344 : /// Definition of a numbering instance.
345 : virtual void NumberingDefinition( sal_uInt16 nId, const SwNumRule &rRule ) SAL_OVERRIDE;
346 :
347 : /// Start of the abstract numbering definition instance.
348 : virtual void StartAbstractNumbering( sal_uInt16 nId ) SAL_OVERRIDE;
349 :
350 : /// End of the abstract numbering definition instance.
351 : virtual void EndAbstractNumbering() SAL_OVERRIDE;
352 :
353 : /// All the numbering level information.
354 : virtual void NumberingLevel( sal_uInt8 nLevel,
355 : sal_uInt16 nStart,
356 : sal_uInt16 nNumberingType,
357 : SvxAdjust eAdjust,
358 : const sal_uInt8 *pNumLvlPos,
359 : sal_uInt8 nFollow,
360 : const wwFont *pFont,
361 : const SfxItemSet *pOutSet,
362 : sal_Int16 nIndentAt,
363 : sal_Int16 nFirstLineIndex,
364 : sal_Int16 nListTabPos,
365 : const OUString &rNumberingString,
366 : const SvxBrushItem* pBrush = 0 ) SAL_OVERRIDE;
367 :
368 : void WriteField_Impl( const SwField* pField, ww::eField eType, const OUString& rFieldCmd, sal_uInt8 nMode );
369 : void WriteFormData_Impl( const ::sw::mark::IFieldmark& rFieldmark );
370 :
371 : void WriteBookmarks_Impl( std::vector< OUString >& rStarts, std::vector< OUString >& rEnds );
372 : void WriteAnnotationMarks_Impl( std::vector< OUString >& rStarts, std::vector< OUString >& rEnds );
373 : void ClearRelIdCache();
374 : /// End possibly opened paragraph sdt block.
375 : void EndParaSdtBlock();
376 :
377 : private:
378 : /// Initialize the structures where we are going to collect some of the paragraph properties.
379 : ///
380 : /// Some of the properties have to be collected from more sources, and are
381 : /// actually not written between StartParagraphProperties and
382 : /// EndParagraphProperties. They are output in this method, which is
383 : /// supposed to be called just before outputting </rPr> whenever it is done.
384 : void InitCollectedParagraphProperties();
385 :
386 : /// Output what we collected during the run properties output.
387 : ///
388 : /// @see WriteCollectedParagrapProperties().
389 : void WriteCollectedParagraphProperties();
390 :
391 : /// Initialize the structures where we are going to collect some of the run properties.
392 : ///
393 : /// This is an equivalent of InitCollectedParagraphProperties(), resp.
394 : /// WriteCollectectedParagraphProperties().
395 : ///
396 : /// @see InitCollectedParagraphProperties().
397 : void InitCollectedRunProperties();
398 :
399 : /// Output what we collected during the run properties output.
400 : ///
401 : /// @see InitCollectedRunProperies(), WriteCollectedParagraphProperties()
402 : void WriteCollectedRunProperties();
403 :
404 : /// Output graphic fly frames or replacement graphics for OLE nodes.
405 : ///
406 : /// For graphic frames, just use the first two parameters, for OLE
407 : /// replacement graphics, set the first as 0, and pass the remaining three.
408 : ///
409 : /// @see WriteOLE2Obj()
410 : void FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size& rSize, const SwFlyFrameFormat* pOLEFrameFormat = 0, SwOLENode* pOLENode = 0, const SdrObject* pSdrObj = 0);
411 : void WriteSrcRect( const SdrObject* pSdrObj );
412 : void WriteOLE2Obj( const SdrObject* pSdrObj, SwOLENode& rNode, const Size& rSize, const SwFlyFrameFormat* pFlyFrameFormat);
413 : bool WriteOLEChart( const SdrObject* pSdrObj, const Size& rSize );
414 : bool WriteOLEMath( const SdrObject* pSdrObj, const SwOLENode& rNode, const Size& rSize );
415 : bool PostponeOLE( const SdrObject* pSdrObj, SwOLENode& rNode, const Size& rSize, const SwFlyFrameFormat* pFlyFrameFormat );
416 : void WriteOLE( SwOLENode& rNode, const Size& rSize, const SwFlyFrameFormat* rFlyFrameFormat );
417 :
418 : /// checks whether the current component is a diagram
419 : static bool IsDiagram (const SdrObject* sdrObject);
420 :
421 : void InitTableHelper( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
422 : void StartTable( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
423 : void StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
424 : void StartTableCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner, sal_uInt32 nCell, sal_uInt32 nRow );
425 : void TableCellProperties( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner, sal_uInt32 nCell, sal_uInt32 nRow );
426 : void EndTableCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner, sal_uInt32 nCell, sal_uInt32 nRow );
427 : void EndTableRow( );
428 : void EndTable();
429 : void SyncNodelessCells(ww8::WW8TableNodeInfoInner::Pointer_t pInner, sal_Int32 nCell, sal_uInt32 nRow);
430 : void PopulateFrameProperties(const SwFrameFormat* pFrameFormat, const Size& rSize);
431 : static bool TextBoxIsFramePr(const SwFrameFormat& rFrameFormat);
432 : /// End cell, row, and even the entire table if necessary.
433 : void FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointer_t pInner, bool bForceEmptyParagraph = false );
434 :
435 : void WriteFFData( const FieldInfos& rInfos );
436 : void WritePendingPlaceholder();
437 :
438 : void EmbedFontStyle( const OUString& name, int tag, FontFamily family, FontItalic italic, FontWeight weight,
439 : FontPitch pitch, rtl_TextEncoding encoding );
440 :
441 : /**
442 : * Translate an ico value to the corresponding HighlightColorValues enumaration item
443 : *
444 : * @param[in] nIco ico value [0..16]
445 : * @return color name (e.g. "red"), if color is inside [1..16] range
446 : * empty string, otherwise
447 : **/
448 : static OString TransHighlightColor( sal_uInt8 nIco );
449 : protected:
450 :
451 : /// Output frames - the implementation.
452 : virtual void OutputFlyFrame_Impl( const sw::Frame& rFormat, const Point& rNdTopLeft ) SAL_OVERRIDE;
453 :
454 : /// Sfx item Sfx item RES_CHRATR_CASEMAP
455 : virtual void CharCaseMap( const SvxCaseMapItem& rCaseMap ) SAL_OVERRIDE;
456 :
457 : /// Sfx item Sfx item RES_CHRATR_COLOR
458 : virtual void CharColor( const SvxColorItem& rColor) SAL_OVERRIDE;
459 :
460 : /// Sfx item Sfx item RES_CHRATR_CONTOUR
461 : virtual void CharContour( const SvxContourItem& rContour ) SAL_OVERRIDE;
462 :
463 : /// Sfx item RES_CHRATR_CROSSEDOUT
464 : virtual void CharCrossedOut( const SvxCrossedOutItem& rCrossedOut ) SAL_OVERRIDE;
465 :
466 : /// Sfx item RES_CHRATR_ESCAPEMENT
467 : virtual void CharEscapement( const SvxEscapementItem& rEscapement ) SAL_OVERRIDE;
468 :
469 : /// Sfx item RES_CHRATR_FONT
470 : virtual void CharFont( const SvxFontItem& rFont ) SAL_OVERRIDE;
471 :
472 : /// Sfx item RES_CHRATR_FONTSIZE
473 : virtual void CharFontSize( const SvxFontHeightItem& rFontSize ) SAL_OVERRIDE;
474 :
475 : /// Sfx item RES_CHRATR_KERNING
476 : virtual void CharKerning( const SvxKerningItem& rKerning ) SAL_OVERRIDE;
477 :
478 : /// Sfx item RES_CHRATR_LANGUAGE
479 : virtual void CharLanguage( const SvxLanguageItem& rLanguage ) SAL_OVERRIDE;
480 :
481 : /// Sfx item RES_CHRATR_POSTURE
482 : virtual void CharPosture( const SvxPostureItem& rPosture ) SAL_OVERRIDE;
483 :
484 : /// Sfx item RES_CHRATR_SHADOWED
485 : virtual void CharShadow( const SvxShadowedItem& rShadow ) SAL_OVERRIDE;
486 :
487 : /// Sfx item RES_CHRATR_UNDERLINE
488 : virtual void CharUnderline( const SvxUnderlineItem& rUnderline ) SAL_OVERRIDE;
489 :
490 : /// Sfx item RES_CHRATR_WEIGHT
491 : virtual void CharWeight( const SvxWeightItem& rWeight ) SAL_OVERRIDE;
492 :
493 : /// Sfx item RES_CHRATR_AUTOKERN
494 : virtual void CharAutoKern( const SvxAutoKernItem& ) SAL_OVERRIDE;
495 :
496 : /// Sfx item RES_CHRATR_BLINK
497 : virtual void CharAnimatedText( const SvxBlinkItem& rBlink ) SAL_OVERRIDE;
498 :
499 : /// Sfx item RES_CHRATR_BACKGROUND
500 : virtual void CharBackground( const SvxBrushItem& rBrush ) SAL_OVERRIDE;
501 :
502 : /// Sfx item RES_CHRATR_CJK_FONT
503 : virtual void CharFontCJK( const SvxFontItem& rFont ) SAL_OVERRIDE;
504 :
505 : /// Sfx item RES_CHRATR_CJK_FONTSIZE
506 3 : virtual void CharFontSizeCJK( const SvxFontHeightItem& rFontSize ) SAL_OVERRIDE { CharFontSize( rFontSize ); }
507 :
508 : /// Sfx item RES_CHRATR_CJK_LANGUAGE
509 2178 : virtual void CharLanguageCJK( const SvxLanguageItem& rLanguageItem ) SAL_OVERRIDE { CharLanguage( rLanguageItem ); }
510 :
511 : /// Sfx item RES_CHRATR_CJK_POSTURE
512 : virtual void CharPostureCJK( const SvxPostureItem& rPosture ) SAL_OVERRIDE;
513 :
514 : /// Sfx item RES_CHRATR_CJK_WEIGHT
515 : virtual void CharWeightCJK( const SvxWeightItem& rWeight ) SAL_OVERRIDE;
516 :
517 : /// Sfx item RES_CHRATR_CTL_FONT
518 : virtual void CharFontCTL( const SvxFontItem& rFont ) SAL_OVERRIDE;
519 :
520 : /// Sfx item RES_CHRATR_CTL_FONTSIZE
521 9445 : virtual void CharFontSizeCTL( const SvxFontHeightItem& rFontSize ) SAL_OVERRIDE { CharFontSize( rFontSize ); }
522 :
523 : /// Sfx item RES_CHRATR_CTL_LANGUAGE
524 1925 : virtual void CharLanguageCTL( const SvxLanguageItem& rLanguageItem ) SAL_OVERRIDE { CharLanguage( rLanguageItem); }
525 :
526 : /// Sfx item RES_CHRATR_CTL_POSTURE
527 : virtual void CharPostureCTL( const SvxPostureItem& rWeight ) SAL_OVERRIDE;
528 :
529 : /// Sfx item RES_CHRATR_CTL_WEIGHT
530 : virtual void CharWeightCTL( const SvxWeightItem& rWeight ) SAL_OVERRIDE;
531 :
532 : /// Sfx item RES_CHRATR_BidiRTL
533 : virtual void CharBidiRTL( const SfxPoolItem& ) SAL_OVERRIDE;
534 :
535 : /// Sfx item RES_CHRATR_IdctHint
536 : virtual void CharIdctHint( const SfxPoolItem& ) SAL_OVERRIDE;
537 :
538 : /// Sfx item RES_CHRATR_ROTATE
539 : virtual void CharRotate( const SvxCharRotateItem& rRotate ) SAL_OVERRIDE;
540 :
541 : /// Sfx item RES_CHRATR_EMPHASIS_MARK
542 : virtual void CharEmphasisMark( const SvxEmphasisMarkItem& rEmphasisMark ) SAL_OVERRIDE;
543 :
544 : /// Sfx item RES_CHRATR_TWO_LINES
545 : virtual void CharTwoLines( const SvxTwoLinesItem& rTwoLines ) SAL_OVERRIDE;
546 :
547 : /// Sfx item RES_CHRATR_SCALEW
548 : virtual void CharScaleWidth( const SvxCharScaleWidthItem& rScaleWidth ) SAL_OVERRIDE;
549 :
550 : /// Sfx item RES_CHRATR_RELIEF
551 : virtual void CharRelief( const SvxCharReliefItem& rRelief) SAL_OVERRIDE;
552 :
553 : /// Sfx item RES_CHRATR_HIDDEN
554 : virtual void CharHidden( const SvxCharHiddenItem& rHidden ) SAL_OVERRIDE;
555 :
556 : /// Sfx item RES_CHRATR_BOX
557 : virtual void CharBorder( const ::editeng::SvxBorderLine* pAllBorder, const sal_uInt16 nDist, const bool bShadow ) SAL_OVERRIDE;
558 :
559 : /// Sfx item RES_CHRATR_HIGHLIGHT
560 : virtual void CharHighlight( const SvxBrushItem& rHighlight ) SAL_OVERRIDE;
561 :
562 : /// Sfx item RES_TXTATR_INETFMT
563 : virtual void TextINetFormat( const SwFormatINetFormat& ) SAL_OVERRIDE;
564 :
565 : /// Sfx item RES_TXTATR_CHARFMT
566 : virtual void TextCharFormat( const SwFormatCharFormat& ) SAL_OVERRIDE;
567 :
568 : /// Sfx item RES_TXTATR_FTN
569 : virtual void TextFootnote_Impl( const SwFormatFootnote& ) SAL_OVERRIDE;
570 :
571 : /// Output the footnote/endnote reference (if there's one to output).
572 : void FootnoteEndnoteReference();
573 :
574 : /// Sfx item RES_PARATR_LINESPACING
575 : virtual void ParaLineSpacing_Impl( short nSpace, short nMulti ) SAL_OVERRIDE;
576 :
577 : /// Sfx item RES_PARATR_ADJUST
578 : virtual void ParaAdjust( const SvxAdjustItem& rAdjust ) SAL_OVERRIDE;
579 :
580 : /// Sfx item RES_PARATR_SPLIT
581 : virtual void ParaSplit( const SvxFormatSplitItem& rSplit ) SAL_OVERRIDE;
582 :
583 : /// Sfx item RES_PARATR_WIDOWS
584 : virtual void ParaWidows( const SvxWidowsItem& rWidows ) SAL_OVERRIDE;
585 :
586 : /// Sfx item RES_PARATR_TABSTOP
587 : virtual void ParaTabStop( const SvxTabStopItem& rTabStop ) SAL_OVERRIDE;
588 :
589 : /// Sfx item RES_PARATR_HYPHENZONE
590 : virtual void ParaHyphenZone( const SvxHyphenZoneItem& ) SAL_OVERRIDE;
591 :
592 : /// Sfx item RES_PARATR_NUMRULE
593 : virtual void ParaNumRule_Impl( const SwTextNode *pTextNd, sal_Int32 nLvl, sal_Int32 nNumId ) SAL_OVERRIDE;
594 :
595 : /// Sfx item RES_PARATR_SCRIPTSPACE
596 : virtual void ParaScriptSpace( const SfxBoolItem& ) SAL_OVERRIDE;
597 :
598 : /// Sfx item RES_PARATR_HANGINGPUNCTUATION
599 : virtual void ParaHangingPunctuation( const SfxBoolItem& ) SAL_OVERRIDE;
600 :
601 : /// Sfx item RES_PARATR_FORBIDDEN_RULES
602 : virtual void ParaForbiddenRules( const SfxBoolItem& ) SAL_OVERRIDE;
603 :
604 : /// Sfx item RES_PARATR_VERTALIGN
605 : virtual void ParaVerticalAlign( const SvxParaVertAlignItem& rAlign ) SAL_OVERRIDE;
606 :
607 : /// Sfx item RES_PARATR_SNAPTOGRID
608 : virtual void ParaSnapToGrid( const SvxParaGridItem& ) SAL_OVERRIDE;
609 :
610 : /// Sfx item RES_FRM_SIZE
611 : virtual void FormatFrameSize( const SwFormatFrmSize& ) SAL_OVERRIDE;
612 :
613 : /// Sfx item RES_PAPER_BIN
614 : virtual void FormatPaperBin( const SvxPaperBinItem& ) SAL_OVERRIDE;
615 :
616 : /// Sfx item RES_LR_SPACE
617 : virtual void FormatLRSpace( const SvxLRSpaceItem& rLRSpace ) SAL_OVERRIDE;
618 :
619 : /// Sfx item RES_UL_SPACE
620 : virtual void FormatULSpace( const SvxULSpaceItem& rULSpace ) SAL_OVERRIDE;
621 :
622 : /// Sfx item RES_SURROUND
623 : virtual void FormatSurround( const SwFormatSurround& ) SAL_OVERRIDE;
624 :
625 : /// Sfx item RES_VERT_ORIENT
626 : virtual void FormatVertOrientation( const SwFormatVertOrient& ) SAL_OVERRIDE;
627 :
628 : /// Sfx item RES_HORI_ORIENT
629 : virtual void FormatHorizOrientation( const SwFormatHoriOrient& ) SAL_OVERRIDE;
630 :
631 : /// Sfx item RES_ANCHOR
632 : virtual void FormatAnchor( const SwFormatAnchor& ) SAL_OVERRIDE;
633 :
634 : /// Sfx item RES_BACKGROUND
635 : virtual void FormatBackground( const SvxBrushItem& ) SAL_OVERRIDE;
636 :
637 : /// Sfx item RES_FILL_STYLE
638 : virtual void FormatFillStyle( const XFillStyleItem& ) SAL_OVERRIDE;
639 :
640 : /// Sfx item RES_FILL_GRADIENT
641 : virtual void FormatFillGradient( const XFillGradientItem& ) SAL_OVERRIDE;
642 :
643 : /// Sfx item RES_BOX
644 : virtual void FormatBox( const SvxBoxItem& ) SAL_OVERRIDE;
645 :
646 : /// Sfx item RES_COL
647 : virtual void FormatColumns_Impl( sal_uInt16 nCols, const SwFormatCol & rCol, bool bEven, SwTwips nPageSize ) SAL_OVERRIDE;
648 :
649 : /// Sfx item RES_KEEP
650 : virtual void FormatKeep( const SvxFormatKeepItem& ) SAL_OVERRIDE;
651 :
652 : /// Sfx item RES_TEXTGRID
653 : virtual void FormatTextGrid( const SwTextGridItem& ) SAL_OVERRIDE;
654 :
655 : /// Sfx item RES_LINENUMBER
656 : virtual void FormatLineNumbering( const SwFormatLineNumber& ) SAL_OVERRIDE;
657 :
658 : /// Sfx item RES_FRAMEDIR
659 : virtual void FormatFrameDirection( const SvxFrameDirectionItem& ) SAL_OVERRIDE;
660 :
661 : /// Sfx item RES_PARATR_GRABBAG
662 : virtual void ParaGrabBag( const SfxGrabBagItem& ) SAL_OVERRIDE;
663 :
664 : /// Sfx item RES_CHRATR_GRABBAG
665 : virtual void CharGrabBag( const SfxGrabBagItem& ) SAL_OVERRIDE;
666 :
667 : // Sfx item RES_PARATR_OUTLINELEVEL
668 : virtual void ParaOutlineLevel( const SfxUInt16Item& ) SAL_OVERRIDE;
669 :
670 : /// Write the expanded field
671 : virtual void WriteExpand( const SwField* pField ) SAL_OVERRIDE;
672 :
673 : virtual void RefField( const SwField& rField, const OUString& rRef ) SAL_OVERRIDE;
674 : virtual void HiddenField( const SwField& rField ) SAL_OVERRIDE;
675 : virtual void SetField( const SwField& rField, ww::eField eType, const OUString& rCmd ) SAL_OVERRIDE;
676 : virtual void PostitField( const SwField* pField ) SAL_OVERRIDE;
677 : virtual bool DropdownField( const SwField* pField ) SAL_OVERRIDE;
678 : virtual bool PlaceholderField( const SwField* pField ) SAL_OVERRIDE;
679 :
680 : virtual bool AnalyzeURL( const OUString& rURL, const OUString& rTarget, OUString* pLinkURL, OUString* pMark ) SAL_OVERRIDE;
681 :
682 : /// Reference to the export, where to get the data from
683 : DocxExport &m_rExport;
684 :
685 : /// Fast serializer to output the data
686 : ::sax_fastparser::FSHelperPtr m_pSerializer;
687 :
688 : /// DrawingML access
689 : oox::drawingml::DrawingML &m_rDrawingML;
690 :
691 : private:
692 :
693 : void DoWriteBookmarks( );
694 : void DoWriteAnnotationMarks( );
695 : void WritePostponedGraphic();
696 : void WritePostponedMath(const SwOLENode* pObject);
697 : void WritePostponedFormControl(const SdrObject* pObject);
698 : void WritePostponedDiagram();
699 : void WritePostponedChart();
700 : void WritePostponedOLE();
701 : void WritePostponedVMLDrawing();
702 : void WritePostponedDMLDrawing();
703 : void WritePostponedCustomShape();
704 :
705 : void WriteSdtBlock(sal_Int32& nSdtPrToken,
706 : std::unique_ptr<sax_fastparser::FastAttributeList>& pSdtPrTokenChildren,
707 : std::unique_ptr<sax_fastparser::FastAttributeList>& pSdtPrTokenAttributes,
708 : std::unique_ptr<sax_fastparser::FastAttributeList>& pSdtPrDataBindingAttrs,
709 : OUString& rSdtPrAlias,
710 : bool bPara);
711 : /// Closes a currently open SDT block.
712 : void EndSdtBlock();
713 :
714 : void StartField_Impl( FieldInfos& rInfos, bool bWriteRun = false );
715 : void DoWriteCmd( const OUString& rCmd );
716 : void CmdField_Impl( FieldInfos& rInfos );
717 : void EndField_Impl( FieldInfos& rInfos );
718 :
719 : static void AddToAttrList( std::unique_ptr<sax_fastparser::FastAttributeList>& pAttrList, sal_Int32 nAttrName, const sal_Char* sAttrValue );
720 : static void AddToAttrList( std::unique_ptr<sax_fastparser::FastAttributeList>& pAttrList, sal_Int32 nArgs, ... );
721 :
722 : std::unique_ptr<sax_fastparser::FastAttributeList> m_pFontsAttrList;
723 : std::unique_ptr<sax_fastparser::FastAttributeList> m_pEastAsianLayoutAttrList;
724 : std::unique_ptr<sax_fastparser::FastAttributeList> m_pCharLangAttrList;
725 : std::unique_ptr<sax_fastparser::FastAttributeList> m_pSectionSpacingAttrList;
726 : std::unique_ptr<sax_fastparser::FastAttributeList> m_pParagraphSpacingAttrList;
727 : std::unique_ptr<sax_fastparser::FastAttributeList> m_pHyperlinkAttrList;
728 : /// If the current SDT around runs should be ended before the current run.
729 : bool m_bEndCharSdt;
730 : /// If an SDT around runs is currently open.
731 : bool m_bStartedCharSdt;
732 : /// If an SDT around paragraphs is currently open.
733 : bool m_bStartedParaSdt;
734 : /// Attributes of the run color
735 : std::unique_ptr<sax_fastparser::FastAttributeList> m_pColorAttrList;
736 : /// Attributes of the paragraph background
737 : std::unique_ptr<sax_fastparser::FastAttributeList> m_pBackgroundAttrList;
738 : OUString m_sOriginalBackgroundColor;
739 : OUString m_hyperLinkAnchor;
740 : bool m_endPageRef;
741 : std::unique_ptr<docx::FootnotesList> m_pFootnotesList;
742 : std::unique_ptr<docx::FootnotesList> m_pEndnotesList;
743 : int m_footnoteEndnoteRefTag;
744 : boost::scoped_ptr< const WW8_SepInfo > m_pSectionInfo;
745 :
746 : /// Redline data to remember in the text run.
747 : const SwRedlineData *m_pRedlineData;
748 :
749 : /// Id of the redline
750 : sal_Int32 m_nRedlineId;
751 :
752 : /// Flag indicating that the section properties are being written
753 : bool m_bOpenedSectPr;
754 : /// Did we have a section break in this paragraph? Set by StartSection(), reset by the next StartParagraph().
755 : bool m_bHadSectPr;
756 :
757 : /// Flag indicating that the Run Text is being written
758 : bool m_bRunTextIsOn;
759 :
760 : /// Flag indicating that the header \ footer are being written
761 : bool m_bWritingHeaderFooter;
762 : bool m_bAnchorLinkedToNode;
763 :
764 : /// Field data to remember in the text run
765 : std::vector< FieldInfos > m_Fields;
766 : OUString m_sFieldBkm;
767 : sal_Int32 m_nNextBookmarkId;
768 : sal_Int32 m_nNextAnnotationMarkId;
769 :
770 : /// Bookmarks to output
771 : std::vector<OString> m_rBookmarksStart;
772 : std::vector<OString> m_rBookmarksEnd;
773 :
774 : /// Annotation marks to output
775 : std::vector<OString> m_rAnnotationMarksStart;
776 : std::vector<OString> m_rAnnotationMarksEnd;
777 :
778 : /// Maps of the bookmarks ids
779 : std::map<OString, sal_uInt16> m_rOpenedBookmarksIds;
780 :
781 : /// Name of the last opened bookmark.
782 : OString m_sLastOpenedBookmark;
783 :
784 : /// Maps of the annotation marks ids
785 : std::map<OString, sal_uInt16> m_rOpenedAnnotationMarksIds;
786 :
787 : /// Name of the last opened annotation mark.
788 : OString m_sLastOpenedAnnotationMark;
789 :
790 : /// If there are bookmarks around sequence fields, this map contains the
791 : /// names of these bookmarks for each sequence.
792 : std::map<OUString, std::vector<OString> > m_aSeqBookmarksNames;
793 :
794 : /// GrabBag for text effexts like glow, shadow, ...
795 : std::vector<css::beans::PropertyValue> m_aTextEffectsGrabBag;
796 :
797 : /// The current table helper
798 : std::unique_ptr<SwWriteTable> m_xTableWrt;
799 :
800 : sw::Frame* m_pCurrentFrame;
801 :
802 : bool m_bParagraphOpened;
803 : bool m_bParagraphFrameOpen;
804 : bool m_bIsFirstParagraph;
805 : bool m_bAlternateContentChoiceOpen;
806 : bool m_bPostponedProcessingFly;
807 :
808 : // Remember that a column break has to be opened at the
809 : // beginning of the next paragraph
810 : DocxColBreakStatus m_nColBreakStatus;
811 :
812 : std::vector<sw::Frame> m_aFramesOfParagraph;
813 : sal_Int32 m_nTextFrameLevel;
814 :
815 : // close of hyperlink needed
816 : bool m_closeHyperlinkInThisRun;
817 : bool m_closeHyperlinkInPreviousRun;
818 : bool m_startedHyperlink;
819 : // Count nested HyperLinks
820 : sal_Int32 m_nHyperLinkCount;
821 : sal_Int16 m_nFieldsInHyperlink;
822 :
823 : struct PostponedGraphic
824 : {
825 64 : PostponedGraphic( const SwGrfNode* n, Size s, const SwFlyFrameFormat* pOLEFrameFormat, SwOLENode* pOLENode, const SdrObject* sObj )
826 64 : : grfNode( n ), size( s ), mOLEFrameFormat( pOLEFrameFormat ), mOLENode( pOLENode ), pSdrObj(sObj) {};
827 :
828 : const SwGrfNode* grfNode;
829 : Size size;
830 : const SwFlyFrameFormat* mOLEFrameFormat;
831 : SwOLENode* mOLENode;
832 : const SdrObject* pSdrObj;
833 : };
834 : std::unique_ptr< std::list<PostponedGraphic> > m_pPostponedGraphic;
835 : struct PostponedDiagram
836 : {
837 6 : PostponedDiagram( const SdrObject* o, const SwFrameFormat* frm ) : object( o ), frame( frm ) {};
838 : const SdrObject* object;
839 : const SwFrameFormat* frame;
840 : };
841 : std::unique_ptr< std::list<PostponedDiagram> > m_pPostponedDiagrams;
842 :
843 : struct PostponedDrawing
844 : {
845 71 : PostponedDrawing( const SdrObject* sdrObj, const SwFrameFormat* frm, const Point* pt ) : object( sdrObj ), frame( frm ), point( pt ) {};
846 : const SdrObject* object;
847 : const SwFrameFormat* frame;
848 : const Point* point;
849 : };
850 : std::unique_ptr< std::list<PostponedDrawing> > m_pPostponedVMLDrawings;
851 : std::unique_ptr< std::list<PostponedDrawing> > m_pPostponedDMLDrawings;
852 : std::unique_ptr< std::list<PostponedDrawing> > m_pPostponedCustomShape;
853 :
854 : struct PostponedOLE
855 : {
856 15 : PostponedOLE( SwOLENode* rObject, const Size& rSize, const SwFlyFrameFormat* rFrame ) : object( rObject ), size( rSize ), frame( rFrame ) {};
857 : SwOLENode* object;
858 : const Size size;
859 : const SwFlyFrameFormat* frame;
860 : };
861 : std::unique_ptr< std::list<PostponedOLE> > m_pPostponedOLEs;
862 :
863 : std::vector<const SwOLENode*> m_aPostponedMaths;
864 : const SdrObject* m_postponedChart;
865 : Size m_postponedChartSize;
866 : std::vector<const SdrObject*> m_aPostponedFormControls;
867 : const SwField* pendingPlaceholder;
868 : /// Maps postit fields to ID's, used in commentRangeStart/End, commentReference and comment.xml.
869 : std::vector< std::pair<const SwPostItField*, sal_Int32> > m_postitFields;
870 : /// Number of postit fields which already have a commentReference written.
871 : unsigned int m_postitFieldsMaxId;
872 : int m_anchorId;
873 : int m_nextFontId;
874 0 : struct EmbeddedFontRef
875 : {
876 : OString relId;
877 : OString fontKey;
878 : };
879 :
880 : boost::scoped_ptr<TableReference> m_tableReference;
881 :
882 : std::map< OUString, EmbeddedFontRef > fontFilesMap; // font file url to data
883 :
884 : // Remember first cell (used for default borders/margins) of each table
885 : std::vector<ww8::WW8TableNodeInfoInner::Pointer_t> tableFirstCells;
886 : // Remember last open and closed cells on each level
887 : std::vector<sal_Int32> lastOpenCell;
888 : std::vector<sal_Int32> lastClosedCell;
889 :
890 : boost::optional<css::drawing::FillStyle> m_oFillStyle;
891 : /// If FormatBox() already handled fill style / gradient.
892 : bool m_bIgnoreNextFill;
893 :
894 : /// Is fake rotation detected, so rotation with 90 degrees should be ignored in this cell?
895 : bool m_bBtLr;
896 :
897 : PageMargins m_pageMargins;
898 :
899 : boost::shared_ptr<DocxTableStyleExport> m_pTableStyleExport;
900 : // flag to check if auto spacing was set in original file
901 : bool m_bParaBeforeAutoSpacing,m_bParaAfterAutoSpacing;
902 : // store hardcoded value which was set during import.
903 : sal_Int32 m_nParaBeforeSpacing,m_nParaAfterSpacing;
904 :
905 : bool m_setFootnote;
906 :
907 : /// RelId <-> Graphic* cache, so that in case of alternate content, the same graphic only gets written once.
908 : std::map<const Graphic*, OString> m_aRelIdCache;
909 :
910 : /// members to control the existence of grabbagged SDT properties in the paragraph
911 : sal_Int32 m_nParagraphSdtPrToken;
912 : std::unique_ptr<sax_fastparser::FastAttributeList> m_pParagraphSdtPrTokenChildren;
913 : std::unique_ptr<sax_fastparser::FastAttributeList> m_pParagraphSdtPrTokenAttributes;
914 : std::unique_ptr<sax_fastparser::FastAttributeList> m_pParagraphSdtPrDataBindingAttrs;
915 : /// members to control the existence of grabbagged SDT properties in the text run
916 : sal_Int32 m_nRunSdtPrToken;
917 : /// State of the Fly at current position
918 : FlyProcessingState m_nStateOfFlyFrame;
919 : std::unique_ptr<sax_fastparser::FastAttributeList> m_pRunSdtPrTokenChildren;
920 : std::unique_ptr<sax_fastparser::FastAttributeList> m_pRunSdtPrDataBindingAttrs;
921 : /// Value of the <w:alias> paragraph SDT element.
922 : OUString m_aParagraphSdtPrAlias;
923 : /// Same as m_aParagraphSdtPrAlias, but its content is aviailable till the SDT is closed.
924 : OUString m_aStartedParagraphSdtPrAlias;
925 : OUString m_aRunSdtPrAlias;
926 : /// Currently paragraph SDT has a <w:id> child element.
927 : bool m_bParagraphSdtHasId;
928 :
929 : std::map<SvxBoxItemLine, css::table::BorderLine2> m_aTableStyleConf;
930 :
931 : public:
932 : DocxAttributeOutput( DocxExport &rExport, ::sax_fastparser::FSHelperPtr pSerializer, oox::drawingml::DrawingML* pDrawingML );
933 :
934 : virtual ~DocxAttributeOutput();
935 :
936 : /// Return the right export class.
937 : virtual DocxExport& GetExport() SAL_OVERRIDE;
938 3590 : const DocxExport& GetExport() const { return const_cast< DocxAttributeOutput* >( this )->GetExport(); }
939 :
940 : /// For eg. the output of the styles, we need to switch the serializer to an other one.
941 : void SetSerializer( ::sax_fastparser::FSHelperPtr pSerializer );
942 :
943 : /// Occasionnaly need to use this serializer from the outside
944 336 : ::sax_fastparser::FSHelperPtr GetSerializer( ) { return m_pSerializer; }
945 :
946 : /// Do we have any footnotes?
947 : bool HasFootnotes() const;
948 :
949 : /// Do we have any endnotes?
950 : bool HasEndnotes() const;
951 :
952 : /// Output the content of the footnotes.xml resp. endnotes.xml
953 : void FootnotesEndnotes( bool bFootnotes );
954 :
955 : /// writes the footnotePr/endnotePr (depending on tag) section
956 : static void WriteFootnoteEndnotePr( ::sax_fastparser::FSHelperPtr fs, int tag, const SwEndNoteInfo& info, int listtag );
957 :
958 : bool HasPostitFields() const;
959 : void WritePostitFields();
960 :
961 : /// VMLTextExport
962 : virtual void WriteOutliner(const OutlinerParaObject& rParaObj) SAL_OVERRIDE;
963 : virtual void WriteVMLTextBox(css::uno::Reference<css::drawing::XShape> xShape) SAL_OVERRIDE;
964 : /// DMLTextExport
965 : virtual void WriteTextBox(css::uno::Reference<css::drawing::XShape> xShape) SAL_OVERRIDE;
966 : virtual oox::drawingml::DrawingML& GetDrawingML() SAL_OVERRIDE;
967 :
968 : void BulletDefinition(int nId, const Graphic& rGraphic, Size aSize) SAL_OVERRIDE;
969 :
970 1074 : void SetWritingHeaderFooter( bool bWritingHeaderFooter ) { m_bWritingHeaderFooter = bWritingHeaderFooter; }
971 50 : bool GetWritingHeaderFooter( ) { return m_bWritingHeaderFooter; }
972 136 : void SetAlternateContentChoiceOpen( bool bAltContentChoiceOpen ) { m_bAlternateContentChoiceOpen = bAltContentChoiceOpen; }
973 426 : bool IsAlternateContentChoiceOpen( ) { return m_bAlternateContentChoiceOpen; }
974 : void GetSdtEndBefore(const SdrObject* pSdrObj);
975 : void SetStartedParaSdt(bool bStartedParaSdt);
976 : bool IsStartedParaSdt();
977 32 : bool IsFirstParagraph() { return m_bIsFirstParagraph; }
978 :
979 : /// Stores the table export state to the passed context and resets own state.
980 : void pushToTableExportContext(DocxTableExportContext& rContext);
981 : /// Restores from the remembered state.
982 : void popFromTableExportContext(DocxTableExportContext& rContext);
983 : };
984 :
985 : #endif // INCLUDED_SW_SOURCE_FILTER_WW8_DOCXATTRIBUTEOUTPUT_HXX
986 :
987 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|