LibreOffice Module sw (master) 1
docxattributeoutput.hxx
Go to the documentation of this file.
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#include <string_view>
25
27#include "fields.hxx"
28#include <IMark.hxx>
29#include "docxexport.hxx"
30#include <wrtswtbl.hxx>
31#include <redline.hxx>
32
33#include <editeng/boxitem.hxx>
34#include <sax/fshelper.hxx>
35#include <sax/fastattribs.hxx>
36#include <vcl/vclenum.hxx>
37#include <svx/xenum.hxx>
38
39#include <fldbas.hxx>
40
41#include <vector>
42#include <optional>
47
48#include <com/sun/star/table/BorderLine2.hpp>
49#include <com/sun/star/drawing/FillStyle.hpp>
50
51class SwGrfNode;
52class SdrObject;
53enum class SvxBoxItemLine;
54enum class SwLineBreakClear;
56
57namespace docx { class FootnotesList; }
58namespace oox::drawingml { class DrawingML; }
59
61{
62 std::shared_ptr<const SwField> pField;
63 const ::sw::mark::IFieldmark* pFieldmark;
65 bool bOpen;
66 bool bSep;
67 bool bClose;
68 OUString sCmd;
70 : pFieldmark(nullptr), eType(ww::eUNKNOWN)
71 , bOpen(false), bSep(false), bClose(false)
72 {}
73};
74
76{
81};
82
94{
95 sal_Int32 tag = 0;
96 bool bUseStartEnd = false;
97 bool bWriteTag = true;
98 bool bWriteDistance = false;
99 SvxShadowLocation aShadowLocation = SvxShadowLocation::NONE;
100 std::shared_ptr<editeng::WordBorderDistances> pDistances;
101};
102
104
109{
112
115
117 sal_uInt32 m_nTableDepth;
118
120 : m_bTableCellOpen(false),
123 {
124 }
125};
126
128{
129public:
131 : m_bHasId(false)
132 , m_bStartedSdt(false)
133 , m_nSdtPrToken(0)
134 {}
135
142 OUString m_aColor;
144 OUString m_aAlias;
145 sal_Int32 m_nSdtPrToken;
146
148
149 void WriteSdtBlock(const ::sax_fastparser::FSHelperPtr& pSerializer, bool bRunTextIsOn, bool bParagraphHasDrawing);
150 void WriteExtraParams(const ::sax_fastparser::FSHelperPtr& pSerializer);
151
153 void EndSdtBlock(const ::sax_fastparser::FSHelperPtr& pSerializer);
154
155 void GetSdtParamsFromGrabBag(const uno::Sequence<beans::PropertyValue>& aGrabBagSdt);
156};
157
160{
161public:
163 virtual void RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript ) override;
164
166 virtual sal_Int32 StartParagraph(ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo,
167 bool bGenerateParaId) override;
168
170 virtual void EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ) override;
171
173 virtual void EmptyParagraph() override;
174
176 virtual void SectionBreaks(const SwNode& rNode) override;
177
179 virtual void StartParagraphProperties() override;
180
182 virtual void EndParagraphProperties(const SfxItemSet& rParagraphMarkerProperties, const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted) override;
183
185 virtual void StartRun( const SwRedlineData* pRedlineData, sal_Int32 nPos, bool bSingleEmptyRun = false ) override;
186
188 virtual void EndRun(const SwTextNode* pNode, sal_Int32 nPos, sal_Int32 nLen, bool bLastRun = false) override;
189
191 virtual void StartRunProperties() override;
192
194 virtual void EndRunProperties( const SwRedlineData* pRedlineData ) override;
195
196 virtual bool FootnoteEndnoteRefTag() override;
197
198 virtual void SectFootnoteEndnotePr() override;
199
200 virtual void WritePostitFieldReference() override;
201
203 virtual void RunText( const OUString& rText, rtl_TextEncoding eCharSet = RTL_TEXTENCODING_UTF8 ) override;
204
206 virtual void RawText(const OUString& rText, rtl_TextEncoding eCharSet) override;
207
209 virtual void StartRuby( const SwTextNode& rNode, sal_Int32 nPos, const SwFormatRuby& rRuby ) override;
210
212 virtual void EndRuby(const SwTextNode& rNode, sal_Int32 nPos) override;
213
215 virtual bool StartURL( const OUString& rUrl, const OUString& rTarget ) override;
216
218 virtual bool EndURL(bool) override;
219
220 virtual void FieldVanish(const OUString& rText, ww::eField eType, OUString const*) override;
221
225 virtual void Redline( const SwRedlineData* pRedline ) override;
226
231 void StartRedline( const SwRedlineData * pRedlineData );
232
236 void EndRedline( const SwRedlineData * pRedlineData );
237
238 virtual void SetStateOfFlyFrame( FlyProcessingState nStateOfFlyFrame ) override;
239 virtual void SetAnchorIsLinkedToNode( bool bAnchorLinkedToNode ) override;
240 virtual bool IsFlyProcessingPostponed() override;
241 virtual void ResetFlyProcessingFlag() override;
242
243 virtual void FormatDrop( const SwTextNode& rNode, const SwFormatDrop& rSwFormatDrop, sal_uInt16 nStyle, ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ) override;
244
246 virtual void ParagraphStyle( sal_uInt16 nStyle ) override;
247
248 virtual void TableInfoCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) override;
249 virtual void TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) override;
250 virtual void TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) override;
251 virtual void TableDefaultBorders( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) override;
252 void TableDefaultCellMargins( ww8::WW8TableNodeInfoInner::Pointer_t const & pTableTextNodeInfoInner );
253 virtual void TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) override;
254 virtual void TableRowRedline( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) override;
255 virtual void TableCellRedline( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) override;
256 virtual void TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) override;
257 virtual void TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) override;
258 virtual void TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) override;
259 virtual void TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) override;
260 virtual void TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner ) override;
261 virtual void TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) override;
262 virtual void TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) override;
263 virtual void TableRowEnd( sal_uInt32 nDepth ) override;
264
266 virtual void StartStyles() override;
267
269 virtual void EndStyles( sal_uInt16 nNumberOfStyles ) override;
270
272 virtual void DefaultStyle() override;
273
275 void DocDefaults( );
276
278 void LatentStyles();
279
285 void OutputDefaultItem(const SfxPoolItem& rHt);
286
288 virtual void StartStyle( const OUString& rName, StyleType eType,
289 sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 nLink, sal_uInt16 nWwId, sal_uInt16 nId,
290 bool bAutoUpdate ) override;
291
293 virtual void EndStyle() override;
294
296 virtual void StartStyleProperties( bool bParProp, sal_uInt16 nStyle ) override;
297
299 virtual void EndStyleProperties( bool bParProp ) override;
300
302 virtual void OutlineNumbering(sal_uInt8 nLvl) override;
303
306 virtual void PageBreakBefore( bool bBreak ) override;
307
311 virtual void SectionBreak( sal_uInt8 nC, bool bBreakAfter, const WW8_SepInfo* pSectionInfo = nullptr, bool bExtraPageBreak = false ) override;
312
313 // preserve DOCX page vertical alignment
314 virtual void TextVerticalAdjustment( const css::drawing::TextVerticalAdjust ) override;
315
317 virtual void StartSection() override;
318
320 virtual void EndSection() override;
321
323 virtual void SectionFormProtection( bool bProtected ) override;
324
326 virtual void SectionLineNumbering( sal_uLong nRestartNo, const SwLineNumberInfo& rLnNumInfo ) override;
327
329 virtual void SectionTitlePage() override;
330
332 virtual void SectionPageBorders( const SwFrameFormat* pFormat, const SwFrameFormat* pFirstPageFormat ) override;
333
335 virtual void SectionBiDi( bool bBiDi ) override;
336
339 virtual void SectionPageNumbering( sal_uInt16 nNumType, const ::std::optional<sal_uInt16>& oPageRestartNumber ) override;
340
342 virtual void SectionType( sal_uInt8 nBreakCode ) override;
343
345 void StartFont( const OUString& rFamilyName ) const;
346
348 void EndFont() const;
349
351 void FontAlternateName( const OUString& rName ) const;
352
354 void FontCharset( sal_uInt8 nCharSet, rtl_TextEncoding nEncoding ) const;
355
357 void FontFamilyType( FontFamily eFamily ) const;
358
360 void FontPitchType( FontPitch ePitch ) const;
361
363 void EmbedFont( std::u16string_view name, FontFamily family, FontPitch pitch );
364
366 virtual void NumberingDefinition( sal_uInt16 nId, const SwNumRule &rRule ) override;
367
369 virtual void OverrideNumberingDefinition( SwNumRule const& rRule,
370 sal_uInt16 nNum, sal_uInt16 nAbstractNum,
371 const std::map< size_t, size_t > & rLevelOverrides ) override;
372
374 virtual void StartAbstractNumbering( sal_uInt16 nId ) override;
375
377 virtual void EndAbstractNumbering() override;
378
380 virtual void NumberingLevel( sal_uInt8 nLevel,
381 sal_uInt16 nStart,
382 sal_uInt16 nNumberingType,
383 SvxAdjust eAdjust,
384 const sal_uInt8 *pNumLvlPos,
385 sal_uInt8 nFollow,
386 const wwFont *pFont,
387 const SfxItemSet *pOutSet,
388 sal_Int16 nIndentAt,
389 sal_Int16 nFirstLineIndex,
390 sal_Int16 nListTabPos,
391 const OUString &rNumberingString,
392 const SvxBrushItem* pBrush ) override;
393
394 void WriteField_Impl(const SwField* pField, ww::eField eType,
395 const OUString& rFieldCmd, FieldFlags nMode,
396 OUString const* pBookmarkName = nullptr);
397 void WriteFormData_Impl( const ::sw::mark::IFieldmark& rFieldmark );
398
399 void WriteBookmarks_Impl( std::vector< OUString >& rStarts, std::vector< OUString >& rEnds, const SwRedlineData* pRedlineData = nullptr );
400 void WriteFinalBookmarks_Impl( std::vector< OUString >& rStarts, std::vector< OUString >& rEnds );
401 void WriteAnnotationMarks_Impl( std::vector< OUString >& rStarts, std::vector< OUString >& rEnds );
403 void EndParaSdtBlock();
404
405 void WriteFloatingTable(ww8::Frame const* pParentFrame);
406
407private:
415
420
428
433
440 void FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size& rSize, const SwFlyFrameFormat* pOLEFrameFormat, SwOLENode* pOLENode, const SdrObject* pSdrObj = nullptr);
441 void WriteSrcRect(const css::uno::Reference<css::beans::XPropertySet>& xShapePropSet,
442 const SwFrameFormat* pFrameFormat);
443 void WriteOLE2Obj( const SdrObject* pSdrObj, SwOLENode& rNode, const Size& rSize, const SwFlyFrameFormat* pFlyFrameFormat, const sal_Int8 nFormulaAlignment);
444 bool WriteOLEChart( const SdrObject* pSdrObj, const Size& rSize, const SwFlyFrameFormat* pFlyFrameFormat);
445 bool WriteOLEMath( const SwOLENode& rNode, const sal_Int8 nAlign );
446 void PostponeOLE( SwOLENode& rNode, const Size& rSize, const SwFlyFrameFormat* pFlyFrameFormat );
447 void WriteOLE( SwOLENode& rNode, const Size& rSize, const SwFlyFrameFormat* rFlyFrameFormat );
448 void WriteOLEShape(const SwFlyFrameFormat& rFrameFormat, const Size& rSize,
449 const OString& rShapeId, const OUString& rImageId);
450 static OString GetOLEStyle(const SwFlyFrameFormat& rFormat, const Size& rSize);
451 void ExportOLESurround(const SwFormatSurround& rWrap);
452
453 void WriteActiveXControl(const SdrObject* pObject, const SwFrameFormat& rFrameFormat, bool bInsideRun);
454 bool ExportAsActiveXControl(const SdrObject* pObject) const;
455
456 void InitTableHelper( ww8::WW8TableNodeInfoInner::Pointer_t const & pTableTextNodeInfoInner );
457 void StartTable( ww8::WW8TableNodeInfoInner::Pointer_t const & pTableTextNodeInfoInner );
458 void StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t const & pTableTextNodeInfoInner );
459 void StartTableCell( ww8::WW8TableNodeInfoInner::Pointer_t const & pTableTextNodeInfoInner, sal_uInt32 nCell, sal_uInt32 nRow );
460 void TableCellProperties( ww8::WW8TableNodeInfoInner::Pointer_t const & pTableTextNodeInfoInner, sal_uInt32 nCell, sal_uInt32 nRow );
461 void EndTableCell( sal_uInt32 nCell );
462 void EndTableRow( );
463 void EndTable();
464 void SyncNodelessCells(ww8::WW8TableNodeInfoInner::Pointer_t const & pInner, sal_Int32 nCell, sal_uInt32 nRow);
465 void PopulateFrameProperties(const SwFrameFormat* pFrameFormat, const Size& rSize);
466 static bool TextBoxIsFramePr(const SwFrameFormat& rFrameFormat);
468 void FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointer_t const & pInner, bool bForceEmptyParagraph = false );
469
470 void WriteFFData( const FieldInfos& rInfos );
472
473 void EmbedFontStyle( std::u16string_view name, int tag, FontFamily family, FontItalic italic, FontWeight weight,
474 FontPitch pitch );
475
483 static OString TransHighlightColor( sal_uInt8 nIco );
484protected:
485
487 virtual void OutputFlyFrame_Impl( const ww8::Frame& rFormat, const Point& rNdTopLeft ) override;
488
490 virtual void CharCaseMap( const SvxCaseMapItem& rCaseMap ) override;
491
493 virtual void CharColor( const SvxColorItem& rColor) override;
494
496 virtual void CharContour( const SvxContourItem& rContour ) override;
497
499 virtual void CharCrossedOut( const SvxCrossedOutItem& rCrossedOut ) override;
500
502 virtual void CharEscapement( const SvxEscapementItem& rEscapement ) override;
503
505 virtual void CharFont( const SvxFontItem& rFont ) override;
506
508 virtual void CharFontSize( const SvxFontHeightItem& rFontSize ) override;
509
511 virtual void CharKerning( const SvxKerningItem& rKerning ) override;
512
514 virtual void CharLanguage( const SvxLanguageItem& rLanguage ) override;
515
517 virtual void CharPosture( const SvxPostureItem& rPosture ) override;
518
520 virtual void CharShadow( const SvxShadowedItem& rShadow ) override;
521
523 virtual void CharUnderline( const SvxUnderlineItem& rUnderline ) override;
524
526 virtual void CharWeight( const SvxWeightItem& rWeight ) override;
527
529 virtual void CharAutoKern( const SvxAutoKernItem& ) override;
530
532 virtual void CharAnimatedText( const SvxBlinkItem& rBlink ) override;
533
535 virtual void CharBackground( const SvxBrushItem& rBrush ) override;
536
538 virtual void CharFontCJK( const SvxFontItem& rFont ) override;
539
541 virtual void CharFontSizeCJK( const SvxFontHeightItem& rFontSize ) override { CharFontSize( rFontSize ); }
542
544 virtual void CharLanguageCJK( const SvxLanguageItem& rLanguageItem ) override { CharLanguage( rLanguageItem ); }
545
547 virtual void CharPostureCJK( const SvxPostureItem& rPosture ) override;
548
550 virtual void CharWeightCJK( const SvxWeightItem& rWeight ) override;
551
553 virtual void CharFontCTL( const SvxFontItem& rFont ) override;
554
556 virtual void CharFontSizeCTL( const SvxFontHeightItem& rFontSize ) override { CharFontSize( rFontSize ); }
557
559 virtual void CharLanguageCTL( const SvxLanguageItem& rLanguageItem ) override { CharLanguage( rLanguageItem); }
560
562 virtual void CharPostureCTL( const SvxPostureItem& rWeight ) override;
563
565 virtual void CharWeightCTL( const SvxWeightItem& rWeight ) override;
566
568 virtual void CharBidiRTL( const SfxPoolItem& ) override;
569
571 virtual void CharIdctHint( const SfxPoolItem& ) override;
572
574 virtual void CharRotate( const SvxCharRotateItem& rRotate ) override;
575
577 virtual void CharEmphasisMark( const SvxEmphasisMarkItem& rEmphasisMark ) override;
578
580 virtual void CharTwoLines( const SvxTwoLinesItem& rTwoLines ) override;
581
583 virtual void CharScaleWidth( const SvxCharScaleWidthItem& rScaleWidth ) override;
584
586 virtual void CharRelief( const SvxCharReliefItem& rRelief) override;
587
589 virtual void CharHidden( const SvxCharHiddenItem& rHidden ) override;
590
592 virtual void CharBorder( const ::editeng::SvxBorderLine* pAllBorder, const sal_uInt16 nDist, const bool bShadow ) override;
593
595 virtual void CharHighlight( const SvxBrushItem& rHighlight ) override;
596
598 virtual void TextINetFormat( const SwFormatINetFormat& ) override;
599
601 virtual void TextCharFormat( const SwFormatCharFormat& ) override;
602
604 virtual void TextFootnote_Impl( const SwFormatFootnote& ) override;
605
608
610 virtual void ParaLineSpacing_Impl( short nSpace, short nMulti ) override;
611
613 virtual void ParaAdjust( const SvxAdjustItem& rAdjust ) override;
614
616 virtual void ParaSplit( const SvxFormatSplitItem& rSplit ) override;
617
619 virtual void ParaWidows( const SvxWidowsItem& rWidows ) override;
620
622 virtual void ParaTabStop( const SvxTabStopItem& rTabStop ) override;
623
625 virtual void ParaHyphenZone( const SvxHyphenZoneItem& ) override;
626
628 virtual void ParaNumRule_Impl( const SwTextNode *pTextNd, sal_Int32 nLvl, sal_Int32 nNumId ) override;
629
631 virtual void ParaScriptSpace( const SfxBoolItem& ) override;
632
634 virtual void ParaHangingPunctuation( const SfxBoolItem& ) override;
635
637 virtual void ParaForbiddenRules( const SfxBoolItem& ) override;
638
640 virtual void ParaVerticalAlign( const SvxParaVertAlignItem& rAlign ) override;
641
643 virtual void ParaSnapToGrid( const SvxParaGridItem& ) override;
644
646 virtual void FormatFrameSize( const SwFormatFrameSize& ) override;
647
649 virtual void FormatPaperBin( const SvxPaperBinItem& ) override;
650
652 virtual void FormatLRSpace( const SvxLRSpaceItem& rLRSpace ) override;
653
655 virtual void FormatULSpace( const SvxULSpaceItem& rULSpace ) override;
656
658 virtual void FormatSurround( const SwFormatSurround& ) override;
659
661 virtual void FormatVertOrientation( const SwFormatVertOrient& ) override;
662
664 virtual void FormatHorizOrientation( const SwFormatHoriOrient& ) override;
665
667 virtual void FormatAnchor( const SwFormatAnchor& ) override;
668
670 virtual void FormatBackground( const SvxBrushItem& ) override;
671
673 virtual void FormatFillStyle( const XFillStyleItem& ) override;
674
676 virtual void FormatFillGradient( const XFillGradientItem& ) override;
677
679 virtual void FormatBox( const SvxBoxItem& ) override;
680
682 virtual void FormatColumns_Impl( sal_uInt16 nCols, const SwFormatCol & rCol, bool bEven, SwTwips nPageSize ) override;
683
685 virtual void FormatKeep( const SvxFormatKeepItem& ) override;
686
688 virtual void FormatTextGrid( const SwTextGridItem& ) override;
689
691 virtual void FormatLineNumbering( const SwFormatLineNumber& ) override;
692
694 virtual void FormatFrameDirection( const SvxFrameDirectionItem& ) override;
695
697 virtual void ParaGrabBag( const SfxGrabBagItem& ) override;
698
700 virtual void CharGrabBag( const SfxGrabBagItem& ) override;
701
702 // Sfx item RES_PARATR_OUTLINELEVEL
703 virtual void ParaOutlineLevel( const SfxUInt16Item& ) override;
704
706 virtual void WriteExpand( const SwField* pField ) override;
707
708 virtual void RefField( const SwField& rField, const OUString& rRef ) override;
709 virtual void HiddenField( const SwField& rField ) override;
710 virtual void SetField( const SwField& rField, ww::eField eType, const OUString& rCmd ) override;
711 virtual void PostitField( const SwField* pField ) override;
712 virtual bool DropdownField( const SwField* pField ) override;
713 virtual bool PlaceholderField( const SwField* pField ) override;
714
715 virtual bool AnalyzeURL( const OUString& rURL, const OUString& rTarget, OUString* pLinkURL, OUString* pMark ) override;
716
717 virtual void WriteBookmarkInActParagraph( const OUString& rName, sal_Int32 nFirstRunPos, sal_Int32 nLastRunPos ) override;
718
719 void SectionRtlGutter( const SfxBoolItem& rRtlGutter) override;
720
721 void TextLineBreak(const SwFormatLineBreak& rLineBreak) override;
722
724 void WriteLineBreak();
725
728
731
734
735private:
736
737 void DoWriteBookmarkTagStart(std::u16string_view bookmarkName);
738 void DoWriteBookmarkTagEnd(sal_Int32 nId);
739 void DoWriteMoveRangeTagStart(const OString & bookmarkName,
740 bool bFrom, const SwRedlineData* pRedlineData);
741 void DoWriteMoveRangeTagEnd(sal_Int32 nId, bool bFrom);
742 void DoWriteBookmarksStart(std::vector<OUString>& rStarts, const SwRedlineData* pRedlineData = nullptr);
743 void DoWriteBookmarksEnd(std::vector<OUString>& rEnds);
744 void DoWriteBookmarkStartIfExist(sal_Int32 nRunPos);
745 void DoWriteBookmarkEndIfExist(sal_Int32 nRunPos);
746
747 void DoWritePermissionTagStart(std::u16string_view permission);
748 void DoWritePermissionTagEnd(std::u16string_view permission);
751
754 void WritePostponedMath(const SwOLENode* pObject, sal_Int8 /*nAlign*/);
755 void WritePostponedFormControl(const SdrObject* pObject);
756 void WritePostponedActiveXControl(bool bInsideRun);
758 void WritePostponedChart();
759 void WritePostponedOLE();
762 void WriteFlyFrame(const ww8::Frame& rFrame);
763
764 void WriteFormDateStart(const OUString& sFullDate, const OUString& sDateFormat, const OUString& sLang, const uno::Sequence<beans::PropertyValue>& aGrabBagSdt);
765 void WriteSdtPlainText(const OUString& sValue, const uno::Sequence<beans::PropertyValue>& aGrabBagSdt);
766 void WriteSdtDropDownStart(std::u16string_view rName, OUString const& rSelected, uno::Sequence<OUString> const& rListItems);
767 void WriteSdtDropDownEnd(OUString const& rSelected, uno::Sequence<OUString> const& rListItems);
770
771 void StartField_Impl( const SwTextNode* pNode, sal_Int32 nPos, FieldInfos const & rInfos, bool bWriteRun = false );
772 void DoWriteCmd( std::u16string_view rCmd );
773 void CmdField_Impl( const SwTextNode* pNode, sal_Int32 nPos, FieldInfos const & rInfos, bool bWriteRun );
774 void CmdEndField_Impl( const SwTextNode* pNode, sal_Int32 nPos, bool bWriteRun );
775 void EndField_Impl( const SwTextNode* pNode, sal_Int32 nPos, FieldInfos& rInfos );
776 void DoWriteFieldRunProperties( const SwTextNode* pNode, sal_Int32 nPos, bool bWriteCombChars = false );
777
784 std::shared_ptr<SwContentControl> m_pContentControl;
795 std::unique_ptr<docx::FootnotesList> m_pFootnotesList;
796 std::unique_ptr<docx::FootnotesList> m_pEndnotesList;
799 std::unique_ptr< const WW8_SepInfo > m_pSectionInfo;
800
803
805 sal_Int32 m_nRedlineId;
806
811
814
818
821
824 std::vector< FieldInfos > m_Fields;
825 OUString m_sFieldBkm;
828
830 sal_Int32 m_nNextParaId = 1; // MUST be greater than 0
831
832 OUString m_sRawText;
833
838
840 std::vector<ww8::Frame> m_vPostponedFlys;
841
843 std::vector<OUString> m_rBookmarksStart;
844 std::vector<OUString> m_rBookmarksEnd;
846
848 std::vector<OUString> m_rFinalBookmarksStart;
849 std::vector<OUString> m_rFinalBookmarksEnd;
850
852 std::multimap<sal_Int32, OUString> m_aBookmarksOfParagraphStart;
853 std::multimap<sal_Int32, OUString> m_aBookmarksOfParagraphEnd;
854
856 std::vector<OUString> m_rPermissionsStart;
857 std::vector<OUString> m_rPermissionsEnd;
858
860 std::vector<OString> m_rAnnotationMarksStart;
861 std::vector<OString> m_rAnnotationMarksEnd;
862
864 std::map<OUString, sal_Int32> m_rOpenedBookmarksIds;
865
868
870 std::unordered_set<sal_Int32> m_rSavedBookmarksIds;
871
873 std::map<OString, sal_Int32> m_rOpenedAnnotationMarksIds;
874
877
880 std::map<OUString, std::vector<OString> > m_aSeqBookmarksNames;
881
883 std::vector<css::beans::PropertyValue> m_aTextEffectsGrabBag;
884
886 std::unique_ptr<SwWriteTable> m_xTableWrt;
887
889
895
896 // Remember that a column break has to be opened at the
897 // beginning of the next paragraph
899
900 // Remember that a page break has to be opened at the
901 // beginning of the next paragraph
903
904 // This paragraph must end with page break
905 bool m_bPageBreakAfter = false;
906
907 std::stack< std::vector<ww8::Frame> > m_aFramesOfParagraph;
910
911 // close of hyperlink needed
915 // Count nested HyperLinks
918
919 // If the exported numbering rule defines the outlines
921
923 {
924 PostponedGraphic( const SwGrfNode* n, Size s, const SdrObject* sObj )
925 : grfNode( n ), size( s ), pSdrObj(sObj) {};
926
930 };
931 std::optional< std::vector<PostponedGraphic> > m_oPostponedGraphic;
933 {
934 PostponedDiagram( const SdrObject* o, const SwFrameFormat* frm ) : object( o ), frame( frm ) {};
937 };
938 std::optional< std::vector<PostponedDiagram> > m_oPostponedDiagrams;
939
941 {
942 PostponedDrawing( const SdrObject* sdrObj, const SwFrameFormat* frm) : object( sdrObj ), frame( frm ) {};
945 };
946 std::optional< std::vector<PostponedDrawing> > m_oPostponedDMLDrawings;
947 std::optional< std::vector<PostponedDrawing> > m_oPostponedCustomShape;
948
950 {
951 PostponedOLE( SwOLENode* rObject, const Size& rSize, const SwFlyFrameFormat* rFrame ) : object( rObject ), size( rSize ), frame( rFrame ) {};
953 const Size size;
955 };
956 std::optional< std::vector<PostponedOLE> > m_oPostponedOLEs;
957
959 {
962 };
963 std::vector<PostponedMathObjects> m_aPostponedMaths;
965 unsigned int m_nChartCount;
967 {
968 PostponedChart( const SdrObject* sdrObject, const Size& rSize, const SwFlyFrameFormat* rFrame ) : object(sdrObject), size(rSize), frame(rFrame) {};
970 const Size size;
972 };
973 std::vector<PostponedChart> m_aPostponedCharts;
974 std::vector<const SdrObject*> m_aPostponedFormControls;
975 std::vector<PostponedDrawing> m_aPostponedActiveXControls;
977
979 sal_Int32 id;
980 sal_Int32 lastParaId = 0; // [MS-DOCX] 2.5.3.1 CT_CommentEx needs paraId attribute
981 };
983 std::vector<std::pair<const SwPostItField*, PostItDOCXData>> m_postitFields;
989 {
990 OString relId;
991 OString fontKey;
992 };
993
994 std::unique_ptr<TableReference> m_tableReference;
995
996 std::map< OUString, EmbeddedFontRef > m_FontFilesMap; // font file url to data
997
998 // Remember first cell (used for default borders/margins) of each table
999 std::vector<ww8::WW8TableNodeInfoInner::Pointer_t> m_TableFirstCells;
1000 // Remember last open and closed cells on each level
1001 std::vector<sal_Int32> m_LastOpenCell;
1002 std::vector<sal_Int32> m_LastClosedCell;
1003
1004 std::optional<css::drawing::FillStyle> m_oFillStyle;
1007
1009
1010 std::shared_ptr<DocxTableStyleExport> m_pTableStyleExport;
1011 // flag to check if auto spacing was set in original file
1013 // store hardcoded value which was set during import.
1015
1018
1021
1024
1025 std::vector<std::map<SvxBoxItemLine, css::table::BorderLine2>> m_aTableStyleConfs;
1026
1027 std::optional<SwLineBreakClear> m_oLineBreakClear;
1028
1029public:
1030 DocxAttributeOutput( DocxExport &rExport, const ::sax_fastparser::FSHelperPtr& pSerializer, oox::drawingml::DrawingML* pDrawingML );
1031
1032 virtual ~DocxAttributeOutput() override;
1033
1035 virtual DocxExport& GetExport() override;
1036 const DocxExport& GetExport() const { return const_cast< DocxAttributeOutput* >( this )->GetExport(); }
1037
1039 void SetSerializer( ::sax_fastparser::FSHelperPtr const & pSerializer );
1040
1042 const ::sax_fastparser::FSHelperPtr& GetSerializer( ) const { return m_pSerializer; }
1043
1045 bool HasFootnotes() const;
1046
1048 bool HasEndnotes() const;
1049
1051 void FootnotesEndnotes( bool bFootnotes );
1052
1054 static void WriteFootnoteEndnotePr( ::sax_fastparser::FSHelperPtr const & fs, int tag, const SwEndNoteInfo& info, int listtag );
1055
1056 bool HasPostitFields() const;
1057 enum class hasResolved { no, yes };
1060
1062 virtual void WriteOutliner(const OutlinerParaObject& rParaObj) override;
1063 virtual void WriteVMLTextBox(css::uno::Reference<css::drawing::XShape> xShape) override;
1065 virtual void WriteTextBox(css::uno::Reference<css::drawing::XShape> xShape) override;
1066 virtual css::uno::Reference<css::text::XTextFrame> GetUnoTextFrame(
1067 css::uno::Reference<css::drawing::XShape> xShape) override;
1068 virtual oox::drawingml::DrawingML& GetDrawingML() override;
1069 virtual bool MaybeOutputBrushItem(SfxItemSet const&) override;
1070
1071 void BulletDefinition(int nId, const Graphic& rGraphic, Size aSize) override;
1072
1073 void SetWritingHeaderFooter( bool bWritingHeaderFooter ) { m_bWritingHeaderFooter = bWritingHeaderFooter; }
1075 void SetAlternateContentChoiceOpen( bool bAltContentChoiceOpen ) { m_bAlternateContentChoiceOpen = bAltContentChoiceOpen; }
1077 void GetSdtEndBefore(const SdrObject* pSdrObj);
1078 bool IsFirstParagraph() const { return m_bIsFirstParagraph; }
1079
1084};
1085
1091{
1097 sal_uInt32 m_nTableDepth;
1100};
1101
1102namespace docx {
1103
1105
1106}
1107
1108#endif // INCLUDED_SW_SOURCE_FILTER_WW8_DOCXATTRIBUTEOUTPUT_HXX
1109
1110/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxBoxItemLine
The class that has handlers for various resource types when exporting as DOCX.
bool m_bRunTextIsOn
Flag indicating that the Run Text is being written.
virtual void EndStyle() override
End of a style in the styles table.
void WriteSdtDropDownStart(std::u16string_view rName, OUString const &rSelected, uno::Sequence< OUString > const &rListItems)
virtual bool StartURL(const OUString &rUrl, const OUString &rTarget) override
Output URL start.
rtl::Reference< sax_fastparser::FastAttributeList > m_pCharLangAttrList
std::vector< OUString > m_rBookmarksStart
Bookmarks to output.
std::vector< OString > m_rAnnotationMarksEnd
std::vector< FieldInfos > m_Fields
virtual void CharColor(const SvxColorItem &rColor) override
Sfx item Sfx item RES_CHRATR_COLOR.
void WriteFFData(const FieldInfos &rInfos)
void FlyFrameGraphic(const SwGrfNode *pGrfNode, const Size &rSize, const SwFlyFrameFormat *pOLEFrameFormat, SwOLENode *pOLENode, const SdrObject *pSdrObj=nullptr)
Output graphic fly frames or replacement graphics for OLE nodes.
virtual void WriteBookmarkInActParagraph(const OUString &rName, sal_Int32 nFirstRunPos, sal_Int32 nLastRunPos) override
Insert a bookmark inside the currently processed paragraph.
void ExportOLESurround(const SwFormatSurround &rWrap)
DocxColBreakStatus m_nColBreakStatus
virtual void WritePostitFieldReference() override
for docx w:commentReference
virtual void CharEmphasisMark(const SvxEmphasisMarkItem &rEmphasisMark) override
Sfx item RES_CHRATR_EMPHASIS_MARK.
void WriteOLE2Obj(const SdrObject *pSdrObj, SwOLENode &rNode, const Size &rSize, const SwFlyFrameFormat *pFlyFrameFormat, const sal_Int8 nFormulaAlignment)
std::vector< OUString > m_rPermissionsEnd
bool m_bIgnoreNextFill
If FormatBox() already handled fill style / gradient.
virtual void StartRuby(const SwTextNode &rNode, sal_Int32 nPos, const SwFormatRuby &rRuby) override
Output ruby start.
std::unique_ptr< docx::FootnotesList > m_pFootnotesList
OString m_sLastOpenedBookmark
Name of the last opened bookmark.
void WriteFormData_Impl(const ::sw::mark::IFieldmark &rFieldmark)
std::vector< sal_Int32 > m_LastOpenCell
bool ExportAsActiveXControl(const SdrObject *pObject) const
virtual void StartRunProperties() override
Called before we start outputting the attributes.
rtl::Reference< sax_fastparser::FastAttributeList > m_pFontsAttrList
virtual bool IsFlyProcessingPostponed() override
Is processing of fly postponed ?
void EndTableCell(sal_uInt32 nCell)
void OutputDefaultItem(const SfxPoolItem &rHt)
Similar to OutputItem(), but write something only if it is not the default.
virtual void SectFootnoteEndnotePr() override
for footnote/endnote section properties
void WriteBookmarks_Impl(std::vector< OUString > &rStarts, std::vector< OUString > &rEnds, const SwRedlineData *pRedlineData=nullptr)
std::vector< OUString > m_rFinalBookmarksEnd
void WriteField_Impl(const SwField *pField, ww::eField eType, const OUString &rFieldCmd, FieldFlags nMode, OUString const *pBookmarkName=nullptr)
virtual void FormatVertOrientation(const SwFormatVertOrient &) override
Sfx item RES_VERT_ORIENT.
virtual void TableRowEnd(sal_uInt32 nDepth) override
virtual void SetField(const SwField &rField, ww::eField eType, const OUString &rCmd) override
rtl::Reference< sax_fastparser::FastAttributeList > m_pHyperlinkAttrList
virtual void StartStyle(const OUString &rName, StyleType eType, sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 nLink, sal_uInt16 nWwId, sal_uInt16 nId, bool bAutoUpdate) override
Start of a style in the styles table.
virtual oox::drawingml::DrawingML & GetDrawingML() override
void WritePostponedMath(const SwOLENode *pObject, sal_Int8)
std::optional< std::vector< PostponedDrawing > > m_oPostponedCustomShape
std::vector< css::beans::PropertyValue > m_aTextEffectsGrabBag
GrabBag for text effects like glow, shadow, ...
const ::sax_fastparser::FSHelperPtr & GetSerializer() const
Occasionally need to use this serializer from the outside.
virtual void ParaVerticalAlign(const SvxParaVertAlignItem &rAlign) override
Sfx item RES_PARATR_VERTALIGN.
void SetAlternateContentChoiceOpen(bool bAltContentChoiceOpen)
virtual void TableDefaultBorders(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
void TextLineBreak(const SwFormatLineBreak &rLineBreak) override
RES_TXTATR_LINEBREAK, i.e. clearing breaks.
virtual void FormatSurround(const SwFormatSurround &) override
Sfx item RES_SURROUND.
virtual void FormatFillGradient(const XFillGradientItem &) override
Sfx item RES_FILL_GRADIENT.
virtual void CharHidden(const SvxCharHiddenItem &rHidden) override
Sfx item RES_CHRATR_HIDDEN.
const SwRedlineData * m_pRedlineData
Redline data to remember in the text run.
virtual void TableRowRedline(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
virtual void FormatColumns_Impl(sal_uInt16 nCols, const SwFormatCol &rCol, bool bEven, SwTwips nPageSize) override
Sfx item RES_COL.
virtual void FormatKeep(const SvxFormatKeepItem &) override
Sfx item RES_KEEP.
bool WriteOLEMath(const SwOLENode &rNode, const sal_Int8 nAlign)
void EmbedFontStyle(std::u16string_view name, int tag, FontFamily family, FontItalic italic, FontWeight weight, FontPitch pitch)
std::optional< css::drawing::FillStyle > m_oFillStyle
void DoWriteBookmarkTagEnd(sal_Int32 nId)
virtual void OutlineNumbering(sal_uInt8 nLvl) override
Numbering rule and Id.
virtual void CharFontCTL(const SvxFontItem &rFont) override
Sfx item RES_CHRATR_CTL_FONT.
bool m_bWritingField
Flag indicating that multiple runs of a field are being written.
const DocxExport & GetExport() const
void WriteFloatingTable(ww8::Frame const *pParentFrame)
virtual void CharIdctHint(const SfxPoolItem &) override
Sfx item RES_CHRATR_IdctHint.
virtual void EndRuby(const SwTextNode &rNode, sal_Int32 nPos) override
Output ruby end.
void WriteFlyFrame(const ww8::Frame &rFrame)
void WritePostponedFormControl(const SdrObject *pObject)
virtual void CharLanguageCTL(const SvxLanguageItem &rLanguageItem) override
Sfx item RES_CHRATR_CTL_LANGUAGE.
virtual void CharEscapement(const SvxEscapementItem &rEscapement) override
Sfx item RES_CHRATR_ESCAPEMENT.
virtual void StartSection() override
Start of the section properties.
static OString GetOLEStyle(const SwFlyFrameFormat &rFormat, const Size &rSize)
static OString TransHighlightColor(sal_uInt8 nIco)
Translate an ico value to the corresponding HighlightColorValues enumaration item.
virtual void OutputFlyFrame_Impl(const ww8::Frame &rFormat, const Point &rNdTopLeft) override
Output frames - the implementation.
void popFromTableExportContext(DocxTableExportContext const &rContext)
Restores from the remembered state.
virtual void CharLanguageCJK(const SvxLanguageItem &rLanguageItem) override
Sfx item RES_CHRATR_CJK_LANGUAGE.
virtual void ParaAdjust(const SvxAdjustItem &rAdjust) override
Sfx item RES_PARATR_ADJUST.
virtual void EndParagraphProperties(const SfxItemSet &rParagraphMarkerProperties, const SwRedlineData *pRedlineData, const SwRedlineData *pRedlineParagraphMarkerDeleted, const SwRedlineData *pRedlineParagraphMarkerInserted) override
Called after we end outputting the attributes.
std::unique_ptr< TableReference > m_tableReference
virtual void CharWeight(const SvxWeightItem &rWeight) override
Sfx item RES_CHRATR_WEIGHT.
void DoWriteBookmarkStartIfExist(sal_Int32 nRunPos)
void FontCharset(sal_uInt8 nCharSet, rtl_TextEncoding nEncoding) const
Font charset.
virtual void CharShadow(const SvxShadowedItem &rShadow) override
Sfx item RES_CHRATR_SHADOWED.
virtual sal_Int32 StartParagraph(ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, bool bGenerateParaId) override
Start of the paragraph.
virtual void FormatLineNumbering(const SwFormatLineNumber &) override
Sfx item RES_LINENUMBER.
virtual void EndStyles(sal_uInt16 nNumberOfStyles) override
End of the styles table.
static bool TextBoxIsFramePr(const SwFrameFormat &rFrameFormat)
void FootnotesEndnotes(bool bFootnotes)
Output the content of the footnotes.xml resp. endnotes.xml.
virtual void EmptyParagraph() override
Empty paragraph.
void WriteActiveXControl(const SdrObject *pObject, const SwFrameFormat &rFrameFormat, bool bInsideRun)
virtual void RunText(const OUString &rText, rtl_TextEncoding eCharSet=RTL_TEXTENCODING_UTF8) override
Output text (inside a run).
std::multimap< sal_Int32, OUString > m_aBookmarksOfParagraphStart
Bookmarks of the current paragraph.
virtual bool DropdownField(const SwField *pField) override
virtual void FormatFrameDirection(const SvxFrameDirectionItem &) override
Sfx item RES_FRAMEDIR.
virtual void OverrideNumberingDefinition(SwNumRule const &rRule, sal_uInt16 nNum, sal_uInt16 nAbstractNum, const std::map< size_t, size_t > &rLevelOverrides) override
Numbering definition that overrides abstract numbering definition.
virtual void CharFontSize(const SvxFontHeightItem &rFontSize) override
Sfx item RES_CHRATR_FONTSIZE.
virtual void CharLanguage(const SvxLanguageItem &rLanguage) override
Sfx item RES_CHRATR_LANGUAGE.
void StartField_Impl(const SwTextNode *pNode, sal_Int32 nPos, FieldInfos const &rInfos, bool bWriteRun=false)
virtual void StartStyleProperties(bool bParProp, sal_uInt16 nStyle) override
Start of (paragraph or run) properties of a style.
void LatentStyles()
Write latent styles.
virtual void CharWeightCTL(const SvxWeightItem &rWeight) override
Sfx item RES_CHRATR_CTL_WEIGHT.
std::shared_ptr< DocxTableStyleExport > m_pTableStyleExport
void EndFont() const
End the font.
virtual void TableNodeInfoInner(ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner) override
virtual bool AnalyzeURL(const OUString &rURL, const OUString &rTarget, OUString *pLinkURL, OUString *pMark) override
void pushToTableExportContext(DocxTableExportContext &rContext)
Stores the table export state to the passed context and resets own state.
void EmbedFont(std::u16string_view name, FontFamily family, FontPitch pitch)
Write out the font into the document, if it's an embedded font.
virtual void SectionLineNumbering(sal_uLong nRestartNo, const SwLineNumberInfo &rLnNumInfo) override
Numbering of the lines in the document.
std::vector< ww8::Frame > m_vPostponedFlys
Stores the flys what are anchored inside a fly.
virtual void WriteOutliner(const OutlinerParaObject &rParaObj) override
VMLTextExport.
virtual void TableDefinition(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
std::vector< PostponedMathObjects > m_aPostponedMaths
virtual void TextFootnote_Impl(const SwFormatFootnote &) override
Sfx item RES_TXTATR_FTN.
void WriteFinalBookmarks_Impl(std::vector< OUString > &rStarts, std::vector< OUString > &rEnds)
void WriteSdtPlainText(const OUString &sValue, const uno::Sequence< beans::PropertyValue > &aGrabBagSdt)
std::multimap< sal_Int32, OUString > m_aBookmarksOfParagraphEnd
virtual void DefaultStyle() override
Write default style.
void InitCollectedParagraphProperties()
Initialize the structures where we are going to collect some of the paragraph properties.
virtual void Redline(const SwRedlineData *pRedline) override
Output redlining.
void DocDefaults()
Write Doc Defaults.
void EndRedline(const SwRedlineData *pRedlineData)
Output redlining.
void DoWriteBookmarkTagStart(std::u16string_view bookmarkName)
virtual void CharRotate(const SvxCharRotateItem &rRotate) override
Sfx item RES_CHRATR_ROTATE.
void DoWriteBookmarkEndIfExist(sal_Int32 nRunPos)
virtual void TableBackgrounds(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
std::map< OUString, sal_Int32 > m_rOpenedBookmarksIds
Maps of the bookmarks ids.
virtual void CharBidiRTL(const SfxPoolItem &) override
Sfx item RES_CHRATR_BidiRTL.
std::vector< OUString > m_rBookmarksEnd
virtual void ParaGrabBag(const SfxGrabBagItem &) override
Sfx item RES_PARATR_GRABBAG.
std::optional< SwLineBreakClear > m_oLineBreakClear
void DoWriteMoveRangeTagStart(const OString &bookmarkName, bool bFrom, const SwRedlineData *pRedlineData)
void InitCollectedRunProperties()
Initialize the structures where we are going to collect some of the run properties.
rtl::Reference< sax_fastparser::FastAttributeList > m_pColorAttrList
Attributes of the run color.
void SyncNodelessCells(ww8::WW8TableNodeInfoInner::Pointer_t const &pInner, sal_Int32 nCell, sal_uInt32 nRow)
editeng::WordPageMargins m_pageMargins
SwRedlineData * m_pMoveRedlineData
virtual void ParaWidows(const SvxWidowsItem &rWidows) override
Sfx item RES_PARATR_WIDOWS.
void FontPitchType(FontPitch ePitch) const
Font pitch.
void DoWriteBookmarksEnd(std::vector< OUString > &rEnds)
export the end bookmarks
void SetSerializer(::sax_fastparser::FSHelperPtr const &pSerializer)
For e.g. the output of the styles, we need to switch the serializer to another one.
virtual void StartAbstractNumbering(sal_uInt16 nId) override
Start of the abstract numbering definition instance.
bool HasEndnotes() const
Do we have any endnotes?
virtual void FieldVanish(const OUString &rText, ww::eField eType, OUString const *) override
virtual void FormatULSpace(const SvxULSpaceItem &rULSpace) override
Sfx item RES_UL_SPACE.
virtual void CharFontSizeCJK(const SvxFontHeightItem &rFontSize) override
Sfx item RES_CHRATR_CJK_FONTSIZE.
rtl::Reference< sax_fastparser::FastAttributeList > m_pSectionSpacingAttrList
virtual ~DocxAttributeOutput() override
std::unordered_set< sal_Int32 > m_rSavedBookmarksIds
Set of ids of the saved bookmarks (used only for moveRange, yet)
virtual void NumberingDefinition(sal_uInt16 nId, const SwNumRule &rRule) override
Definition of a numbering instance.
virtual void ResetFlyProcessingFlag() override
Reset the flag for FlyProcessing.
virtual void TableInfoRow(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
void StartTableRow(ww8::WW8TableNodeInfoInner::Pointer_t const &pTableTextNodeInfoInner)
void DoWriteCmd(std::u16string_view rCmd)
OUString m_aStartedParagraphSdtPrAlias
Same as m_aParagraphSdtPrAlias, but its content is available till the SDT is closed.
std::vector< ww8::WW8TableNodeInfoInner::Pointer_t > m_TableFirstCells
std::map< OUString, std::vector< OString > > m_aSeqBookmarksNames
If there are bookmarks around sequence fields, this map contains the names of these bookmarks for eac...
void DoWritePermissionsEnd()
export the end permissions
virtual void TableBidi(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
virtual void StartStyles() override
Start of the styles table.
void WriteOLE(SwOLENode &rNode, const Size &rSize, const SwFlyFrameFormat *rFlyFrameFormat)
virtual void TextINetFormat(const SwFormatINetFormat &) override
Sfx item RES_TXTATR_INETFMT.
std::vector< PostponedChart > m_aPostponedCharts
void EndParaSdtBlock()
End possibly opened paragraph sdt block.
virtual void EndParagraph(ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner) override
End of the paragraph.
virtual void FormatDrop(const SwTextNode &rNode, const SwFormatDrop &rSwFormatDrop, sal_uInt16 nStyle, ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner) override
virtual void EndSection() override
End of the section properties.
void DoWriteMoveRangeTagEnd(sal_Int32 nId, bool bFrom)
void SetWritingHeaderFooter(bool bWritingHeaderFooter)
bool WriteOLEChart(const SdrObject *pSdrObj, const Size &rSize, const SwFlyFrameFormat *pFlyFrameFormat)
void BulletDefinition(int nId, const Graphic &rGraphic, Size aSize) override
Exports the definition (image, size) of a single numbering picture bullet.
virtual css::uno::Reference< css::text::XTextFrame > GetUnoTextFrame(css::uno::Reference< css::drawing::XShape > xShape) override
virtual void TextCharFormat(const SwFormatCharFormat &) override
Sfx item RES_TXTATR_CHARFMT.
virtual void FormatBox(const SvxBoxItem &) override
Sfx item RES_BOX.
virtual void CharCaseMap(const SvxCaseMapItem &rCaseMap) override
Sfx item Sfx item RES_CHRATR_CASEMAP.
virtual void CharFont(const SvxFontItem &rFont) override
Sfx item RES_CHRATR_FONT.
virtual void TableSpacing(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
virtual bool MaybeOutputBrushItem(SfxItemSet const &) override
virtual void NumberingLevel(sal_uInt8 nLevel, sal_uInt16 nStart, sal_uInt16 nNumberingType, SvxAdjust eAdjust, const sal_uInt8 *pNumLvlPos, sal_uInt8 nFollow, const wwFont *pFont, const SfxItemSet *pOutSet, sal_Int16 nIndentAt, sal_Int16 nFirstLineIndex, sal_Int16 nListTabPos, const OUString &rNumberingString, const SvxBrushItem *pBrush) override
All the numbering level information.
virtual void WriteExpand(const SwField *pField) override
Write the expanded field.
std::optional< std::vector< PostponedOLE > > m_oPostponedOLEs
virtual void FormatPaperBin(const SvxPaperBinItem &) override
Sfx item RES_PAPER_BIN.
virtual void CharAnimatedText(const SvxBlinkItem &rBlink) override
Sfx item RES_CHRATR_BLINK.
void StartFont(const OUString &rFamilyName) const
Start the font.
virtual void RawText(const OUString &rText, rtl_TextEncoding eCharSet) override
Output text (without markup).
void CmdField_Impl(const SwTextNode *pNode, sal_Int32 nPos, FieldInfos const &rInfos, bool bWriteRun)
virtual void SectionTitlePage() override
Has different headers/footers for the title page.
virtual void FormatLRSpace(const SvxLRSpaceItem &rLRSpace) override
Sfx item RES_LR_SPACE.
sal_Int32 m_nNextParaId
[MS-DOCX] section 2.6.2.3
virtual void CharUnderline(const SvxUnderlineItem &rUnderline) override
Sfx item RES_CHRATR_UNDERLINE.
std::map< OString, sal_Int32 > m_rOpenedAnnotationMarksIds
Maps of the annotation marks ids.
std::unique_ptr< SwWriteTable > m_xTableWrt
The current table helper.
o3tl::sorted_vector< const SwFrameFormat * > m_aFloatingTablesOfParagraph
virtual void CharBorder(const ::editeng::SvxBorderLine *pAllBorder, const sal_uInt16 nDist, const bool bShadow) override
Sfx item RES_CHRATR_BOX.
virtual void TableHeight(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
bool m_bWritingHeaderFooter
Flag indicating that the header \ footer are being written.
virtual void CharBackground(const SvxBrushItem &rBrush) override
Sfx item RES_CHRATR_BACKGROUND.
void EndField_Impl(const SwTextNode *pNode, sal_Int32 nPos, FieldInfos &rInfos)
std::vector< OString > m_rAnnotationMarksStart
Annotation marks to output.
void WriteCollectedRunProperties()
Output what we collected during the run properties output.
virtual void HiddenField(const SwField &rField) override
virtual void WriteTextBox(css::uno::Reference< css::drawing::XShape > xShape) override
DMLTextExport.
virtual void WriteVMLTextBox(css::uno::Reference< css::drawing::XShape > xShape) override
virtual void SectionBreaks(const SwNode &rNode) override
Called in order to output section breaks.
virtual void FormatFrameSize(const SwFormatFrameSize &) override
Sfx item RES_FRM_SIZE.
virtual void PageBreakBefore(bool bBreak) override
Page break As a paragraph property - the paragraph should be on the next page.
virtual void SetStateOfFlyFrame(FlyProcessingState nStateOfFlyFrame) override
Set the state of the Fly at current position.
bool m_bEndCharSdt
If the current SDT around runs should be ended before the current run.
virtual void TableInfoCell(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
std::vector< PostponedDrawing > m_aPostponedActiveXControls
::sax_fastparser::FSHelperPtr m_pSerializer
Fast serializer to output the data.
rtl::Reference< sax_fastparser::FastAttributeList > m_pParagraphSpacingAttrList
std::unique_ptr< docx::FootnotesList > m_pEndnotesList
virtual void ParaNumRule_Impl(const SwTextNode *pTextNd, sal_Int32 nLvl, sal_Int32 nNumId) override
Sfx item RES_PARATR_NUMRULE.
virtual void SectionPageBorders(const SwFrameFormat *pFormat, const SwFrameFormat *pFirstPageFormat) override
Description of the page borders.
FlyProcessingState m_nStateOfFlyFrame
State of the Fly at current position.
void WriteFormDateStart(const OUString &sFullDate, const OUString &sDateFormat, const OUString &sLang, const uno::Sequence< beans::PropertyValue > &aGrabBagSdt)
virtual DocxExport & GetExport() override
Return the right export class.
void StartTableCell(ww8::WW8TableNodeInfoInner::Pointer_t const &pTableTextNodeInfoInner, sal_uInt32 nCell, sal_uInt32 nRow)
virtual void ParaSnapToGrid(const SvxParaGridItem &) override
Sfx item RES_PARATR_SNAPTOGRID.
virtual bool FootnoteEndnoteRefTag() override
docx requires footnoteRef/endnoteRef tag at the beginning of each of them
sal_uInt32 m_nEmbedFlyLevel
The first frame (anchored to the main text) is 0.
std::vector< OUString > m_rPermissionsStart
Permissions to output.
oox::drawingml::DrawingML & m_rDrawingML
DrawingML access.
sal_Int32 m_nRedlineId
Id of the redline.
virtual void CharPostureCJK(const SvxPostureItem &rPosture) override
Sfx item RES_CHRATR_CJK_POSTURE.
void WriteOLEShape(const SwFlyFrameFormat &rFrameFormat, const Size &rSize, const OString &rShapeId, const OUString &rImageId)
bool m_bPreventDoubleFieldsHandling
Field data to remember in the text run.
void TableCellProperties(ww8::WW8TableNodeInfoInner::Pointer_t const &pTableTextNodeInfoInner, sal_uInt32 nCell, sal_uInt32 nRow)
virtual void TableVerticalCell(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
unsigned int m_postitFieldsMaxId
Number of postit fields which already have a commentReference written.
virtual void CharWeightCJK(const SvxWeightItem &rWeight) override
Sfx item RES_CHRATR_CJK_WEIGHT.
void WritePostponedActiveXControl(bool bInsideRun)
virtual void CharRelief(const SvxCharReliefItem &rRelief) override
Sfx item RES_CHRATR_RELIEF.
std::vector< std::pair< const SwPostItField *, PostItDOCXData > > m_postitFields
Maps postit fields to ID's, used in commentRangeStart/End, commentReference and comment....
void CmdEndField_Impl(const SwTextNode *pNode, sal_Int32 nPos, bool bWriteRun)
virtual void ParaHangingPunctuation(const SfxBoolItem &) override
Sfx item RES_PARATR_HANGINGPUNCTUATION.
std::map< OUString, EmbeddedFontRef > m_FontFilesMap
bool HasFootnotes() const
Do we have any footnotes?
virtual void SetAnchorIsLinkedToNode(bool bAnchorLinkedToNode) override
If the node has an anchor linked.
void WriteSrcRect(const css::uno::Reference< css::beans::XPropertySet > &xShapePropSet, const SwFrameFormat *pFrameFormat)
DocxExport & m_rExport
Reference to the export, where to get the data from.
std::optional< std::vector< PostponedGraphic > > m_oPostponedGraphic
const SwField * m_PendingPlaceholder
bool IsAlternateContentChoiceOpen() const
void SectionRtlGutter(const SfxBoolItem &rRtlGutter) override
RES_RTL_GUTTER.
std::vector< OUString > m_rFinalBookmarksStart
Bookmarks to output at the end.
virtual void CharFontSizeCTL(const SvxFontHeightItem &rFontSize) override
Sfx item RES_CHRATR_CTL_FONTSIZE.
virtual void SectionBiDi(bool bBiDi) override
Columns populated from right/numbers on the right side?
virtual void FormatHorizOrientation(const SwFormatHoriOrient &) override
Sfx item RES_HORI_ORIENT.
virtual void CharAutoKern(const SvxAutoKernItem &) override
Sfx item RES_CHRATR_AUTOKERN.
virtual void CharTwoLines(const SvxTwoLinesItem &rTwoLines) override
Sfx item RES_CHRATR_TWO_LINES.
void FontFamilyType(FontFamily eFamily) const
Font family.
std::vector< sal_Int32 > m_LastClosedCell
std::vector< std::map< SvxBoxItemLine, css::table::BorderLine2 > > m_aTableStyleConfs
virtual void StartRun(const SwRedlineData *pRedlineData, sal_Int32 nPos, bool bSingleEmptyRun=false) override
Start of the text run.
unsigned int m_nChartCount
count charts consistently for unit tests
virtual void ParaLineSpacing_Impl(short nSpace, short nMulti) override
Sfx item RES_PARATR_LINESPACING.
virtual void TableCanSplit(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
virtual void TextVerticalAdjustment(const css::drawing::TextVerticalAdjust) override
void DoWritePermissionsStart()
Write the start permissions.
virtual void SectionPageNumbering(sal_uInt16 nNumType, const ::std::optional< sal_uInt16 > &oPageRestartNumber) override
The style of the page numbers.
virtual void CharCrossedOut(const SvxCrossedOutItem &rCrossedOut) override
Sfx item RES_CHRATR_CROSSEDOUT.
void FontAlternateName(const OUString &rName) const
Alternate name for the font.
std::optional< std::vector< PostponedDiagram > > m_oPostponedDiagrams
virtual void FormatAnchor(const SwFormatAnchor &) override
Sfx item RES_ANCHOR.
void WriteAnnotationMarks_Impl(std::vector< OUString > &rStarts, std::vector< OUString > &rEnds)
virtual void SectionFormProtection(bool bProtected) override
Protection of forms.
virtual void CharScaleWidth(const SvxCharScaleWidthItem &rScaleWidth) override
Sfx item RES_CHRATR_SCALEW.
virtual void CharContour(const SvxContourItem &rContour) override
Sfx item Sfx item RES_CHRATR_CONTOUR.
static void WriteFootnoteEndnotePr(::sax_fastparser::FSHelperPtr const &fs, int tag, const SwEndNoteInfo &info, int listtag)
writes the footnotePr/endnotePr (depending on tag) section
void WriteLineBreak()
Writes a clearing line break at the end of run properties, if there are any.
void PostponeOLE(SwOLENode &rNode, const Size &rSize, const SwFlyFrameFormat *pFlyFrameFormat)
virtual void CharPostureCTL(const SvxPostureItem &rWeight) override
Sfx item RES_CHRATR_CTL_POSTURE.
virtual void ParaSplit(const SvxFormatSplitItem &rSplit) override
Sfx item RES_PARATR_SPLIT.
virtual void EndAbstractNumbering() override
End of the abstract numbering definition instance.
void StartRedline(const SwRedlineData *pRedlineData)
Output redlining.
virtual void CharHighlight(const SvxBrushItem &rHighlight) override
Sfx item RES_CHRATR_HIGHLIGHT.
virtual bool EndURL(bool) override
Output URL end.
void PopulateFrameProperties(const SwFrameFormat *pFrameFormat, const Size &rSize)
virtual void RTLAndCJKState(bool bIsRTL, sal_uInt16 nScript) override
Export the state of RTL/CJK.
virtual void CharFontCJK(const SvxFontItem &rFont) override
Sfx item RES_CHRATR_CJK_FONT.
virtual void SectionBreak(sal_uInt8 nC, bool bBreakAfter, const WW8_SepInfo *pSectionInfo=nullptr, bool bExtraPageBreak=false) override
Write a section break msword::ColumnBreak or msword::PageBreak bBreakAfter: the break must be schedul...
virtual void ParaHyphenZone(const SvxHyphenZoneItem &) override
Sfx item RES_PARATR_HYPHENZONE.
std::shared_ptr< SwContentControl > m_pContentControl
std::unique_ptr< const WW8_SepInfo > m_pSectionInfo
void StartTable(ww8::WW8TableNodeInfoInner::Pointer_t const &pTableTextNodeInfoInner)
virtual void ParagraphStyle(sal_uInt16 nStyle) override
Output style.
virtual void CharPosture(const SvxPostureItem &rPosture) override
Sfx item RES_CHRATR_POSTURE.
virtual void ParaTabStop(const SvxTabStopItem &rTabStop) override
Sfx item RES_PARATR_TABSTOP.
virtual void TableCellRedline(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
virtual void ParaOutlineLevel(const SfxUInt16Item &) override
std::optional< std::vector< PostponedDrawing > > m_oPostponedDMLDrawings
void FinishTableRowCell(ww8::WW8TableNodeInfoInner::Pointer_t const &pInner, bool bForceEmptyParagraph=false)
End cell, row, and even the entire table if necessary.
void WriteCollectedParagraphProperties()
Output what we collected during the run properties output.
void DoWriteFieldRunProperties(const SwTextNode *pNode, sal_Int32 nPos, bool bWriteCombChars=false)
Writes properties for run that is used to separate field implementation.
virtual void SectionType(sal_uInt8 nBreakCode) override
The type of breaking.
void GetSdtEndBefore(const SdrObject *pSdrObj)
virtual void FormatBackground(const SvxBrushItem &) override
Sfx item RES_BACKGROUND.
virtual void CharKerning(const SvxKerningItem &rKerning) override
Sfx item RES_CHRATR_KERNING.
void TableDefaultCellMargins(ww8::WW8TableNodeInfoInner::Pointer_t const &pTableTextNodeInfoInner)
virtual void EndRunProperties(const SwRedlineData *pRedlineData) override
Called after we end outputting the attributes.
bool m_bHadSectPr
Did we have a section break in this paragraph? Set by StartSection(), reset by the next StartParagrap...
std::stack< std::vector< ww8::Frame > > m_aFramesOfParagraph
std::vector< const SdrObject * > m_aPostponedFormControls
rtl::Reference< sax_fastparser::FastAttributeList > m_pEastAsianLayoutAttrList
virtual bool PlaceholderField(const SwField *pField) override
void FootnoteEndnoteReference()
Output the footnote/endnote reference (if there's one to output).
void WriteSdtDropDownEnd(OUString const &rSelected, uno::Sequence< OUString > const &rListItems)
virtual void EndRun(const SwTextNode *pNode, sal_Int32 nPos, sal_Int32 nLen, bool bLastRun=false) override
End of the text run.
virtual void ParaScriptSpace(const SfxBoolItem &) override
Sfx item RES_PARATR_SCRIPTSPACE.
virtual void PostitField(const SwField *pField) override
virtual void TableOrientation(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
DocxAttributeOutput(DocxExport &rExport, const ::sax_fastparser::FSHelperPtr &pSerializer, oox::drawingml::DrawingML *pDrawingML)
virtual void ParaForbiddenRules(const SfxBoolItem &) override
Sfx item RES_PARATR_FORBIDDEN_RULES.
virtual void FormatTextGrid(const SwTextGridItem &) override
Sfx item RES_TEXTGRID.
void DoWritePermissionTagStart(std::u16string_view permission)
void InitTableHelper(ww8::WW8TableNodeInfoInner::Pointer_t const &pTableTextNodeInfoInner)
virtual void EndStyleProperties(bool bParProp) override
End of (paragraph or run) properties of a style.
virtual void RefField(const SwField &rField, const OUString &rRef) override
rtl::Reference< sax_fastparser::FastAttributeList > m_pBackgroundAttrList
Attributes of the paragraph background.
bool m_bOpenedSectPr
Flag indicating that the section properties are being written.
void DoWriteBookmarksStart(std::vector< OUString > &rStarts, const SwRedlineData *pRedlineData=nullptr)
Write the start bookmarks.
virtual void FormatFillStyle(const XFillStyleItem &) override
Sfx item RES_FILL_STYLE.
OString m_sLastOpenedAnnotationMark
Name of the last opened annotation mark.
virtual void StartParagraphProperties() override
Called before we start outputting the attributes.
virtual void CharGrabBag(const SfxGrabBagItem &) override
Sfx item RES_CHRATR_GRABBAG.
void DoWritePermissionTagEnd(std::u16string_view permission)
The class that does all the actual DOCX export-related work.
Definition: docxexport.hxx:75
rtl::Reference< sax_fastparser::FastAttributeList > m_pTokenChildren
rtl::Reference< sax_fastparser::FastAttributeList > m_pTokenAttributes
rtl::Reference< sax_fastparser::FastAttributeList > m_pTextAttrs
void WriteExtraParams(const ::sax_fastparser::FSHelperPtr &pSerializer)
rtl::Reference< sax_fastparser::FastAttributeList > m_pDataBindingAttrs
void GetSdtParamsFromGrabBag(const uno::Sequence< beans::PropertyValue > &aGrabBagSdt)
void EndSdtBlock(const ::sax_fastparser::FSHelperPtr &pSerializer)
Closes a currently open SDT block.
void WriteSdtBlock(const ::sax_fastparser::FSHelperPtr &pSerializer, bool bRunTextIsOn, bool bParagraphHasDrawing)
Stores the properties of a content control.
Base class of all fields.
Definition: fldbas.hxx:292
FlyAnchors.
Definition: fmtanchr.hxx:37
If SwFormatDrop is a Client, it is the CharFormat that describes the font for the DropCaps.
Definition: paratr.hxx:63
SfxPoolItem subclass that wraps an SwLineBreakClear.
Style of a layout element.
Definition: frmfmt.hxx:62
< purpose of derivation from SwClient: character style for displaying the numbers.
Definition: lineinfo.hxx:39
Base class of the Writer document model elements.
Definition: node.hxx:84
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:86
Make exporting a Writer Frame easy.
std::shared_ptr< WW8TableInfo > Pointer_t
std::shared_ptr< WW8TableNodeInfoInner > Pointer_t
std::shared_ptr< WW8TableNodeInfo > Pointer_t
Collects and outputs fonts.
Definition: wrtww8.hxx:297
DocxColBreakStatus
@ COLBRK_WRITEANDPOSTPONE
@ COLBRK_POSTPONE
@ COLBRK_WRITE
@ COLBRK_NONE
EmbeddedObjectRef * pObject
FilterGroup & rTarget
DocumentType eType
FontPitch
FontItalic
FontFamily
SwLineBreakClear
Defines the location of a line break text wrapping restart.
const char * name
sal_Int64 n
sal_uInt16 nPos
sal_Int16 nNumType
rtl::Reference< FastAttributeList > SurroundToVMLWrap(SwFormatSurround const &rSurround)
std::shared_ptr< FastSerializerHelper > FSHelperPtr
FontWeight
sal_uInt32 tag
StyleType
@HTML
eUNKNOWN
sal_Int16 nId
sal_uIntPtr sal_uLong
PostponedChart(const SdrObject *sdrObject, const Size &rSize, const SwFlyFrameFormat *rFrame)
PostponedDiagram(const SdrObject *o, const SwFrameFormat *frm)
PostponedDrawing(const SdrObject *sdrObj, const SwFrameFormat *frm)
PostponedGraphic(const SwGrfNode *n, Size s, const SdrObject *sObj)
PostponedOLE(SwOLENode *rObject, const Size &rSize, const SwFlyFrameFormat *rFrame)
All the information that should be stashed away when we're in the middle of of a table export and sti...
DocxAttributeOutput & m_rOutput
ww8::WW8TableInfo::Pointer_t m_pTableInfo
DocxTableExportContext(DocxAttributeOutput &rOutput)
std::shared_ptr< const SwField > pField
const ::sw::mark::IFieldmark * pFieldmark
A structure that holds information about the options selected when outputting a border to DOCX.
std::shared_ptr< editeng::WordBorderDistances > pDistances
SvxShadowLocation aShadowLocation
A structure that holds flags for the table export.
bool m_bTableCellOpen
Remember if we are in an open cell, or not.
sal_uInt32 m_nTableDepth
Remember the current table depth.
bool m_bTableCellParaSdtOpen
If paragraph sdt got opened in this table cell.
SvxShadowLocation
SvxAdjust
tools::Long SwTwips
Definition: swtypes.hxx:51
unsigned char sal_uInt8
signed char sal_Int8
FlyProcessingState
enum to state the present state of the fly
Definition: wrtww8.hxx:166
FieldFlags
Definition: wrtww8.hxx:143