LibreOffice Module sw (master)  1
rtfattributeoutput.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_RTFATTRIBUTEOUTPUT_HXX
21 #define INCLUDED_SW_SOURCE_FILTER_WW8_RTFATTRIBUTEOUTPUT_HXX
22 
23 #include <memory>
24 #include <com/sun/star/drawing/FillStyle.hpp>
25 
26 #include "attributeoutputbase.hxx"
27 #include "rtfstringbuffer.hxx"
28 
29 #include <wrtswtbl.hxx>
30 
31 #include <rtl/strbuf.hxx>
32 
33 #include <optional>
34 
35 class SwGrfNode;
36 class SwOLENode;
37 class SwFlyFrameFormat;
38 class RtfExport;
39 
42 {
43  friend class RtfStringBufferValue;
44  friend class SaveRunState;
45 
46 public:
48  void RTLAndCJKState(bool bIsRTL, sal_uInt16 nScript) override;
49 
51  sal_Int32 StartParagraph(ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo,
52  bool bGenerateParaId) override;
53 
55  void EndParagraph(ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner) override;
56 
58  void EmptyParagraph() override;
59 
61  void SectionBreaks(const SwNode& rNode) override;
62 
64  void StartParagraphProperties() override;
65 
67  void EndParagraphProperties(const SfxItemSet& rParagraphMarkerProperties,
68  const SwRedlineData* pRedlineData,
69  const SwRedlineData* pRedlineParagraphMarkerDeleted,
70  const SwRedlineData* pRedlineParagraphMarkerInserted) override;
71 
73  void StartRun(const SwRedlineData* pRedlineData, sal_Int32 nPos,
74  bool bSingleEmptyRun = false) override;
75 
77  void EndRun(const SwTextNode* pNode, sal_Int32 nPos, bool bLastRun = false) override;
78 
80  void StartRunProperties() override;
81 
83  void EndRunProperties(const SwRedlineData* pRedlineData) override;
84 
86  void RunText(const OUString& rText, rtl_TextEncoding eCharSet = RTL_TEXTENCODING_UTF8) override;
87 
88  // Access to (anyway) private buffers, used by the sdr exporter
89  OStringBuffer& RunText();
90  OString MoveCharacterProperties(bool aAutoWriteRtlLtr = false);
91 
93  void RawText(const OUString& rText, rtl_TextEncoding eCharSet) override;
94 
96  void StartRuby(const SwTextNode& rNode, sal_Int32 nPos, const SwFormatRuby& rRuby) override;
97 
99  void EndRuby(const SwTextNode& rNode, sal_Int32 nPos) override;
100 
102  bool StartURL(const OUString& rUrl, const OUString& rTarget) override;
103 
105  bool EndURL(bool isAtEndOfParagraph) override;
106 
107  void FieldVanish(const OUString& rText, ww::eField eType,
108  OUString const* pBookmarkName) override;
109 
113  void Redline(const SwRedlineData* pRedline) override;
114 
115  void FormatDrop(const SwTextNode& rNode, const SwFormatDrop& rSwFormatDrop, sal_uInt16 nStyle,
116  ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo,
117  ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner) override;
118 
120  void ParagraphStyle(sal_uInt16 nStyle) override;
121 
122  void TableInfoCell(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
123  void TableInfoRow(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
124  void TableDefinition(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
125  void
126  TableDefaultBorders(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
127  void TableBackgrounds(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
128  void TableRowRedline(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
129  void TableCellRedline(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
130  void TableHeight(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
131  void TableCanSplit(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
132  void TableBidi(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
133  void TableVerticalCell(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
134  void TableNodeInfoInner(ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner) override;
135  void TableOrientation(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
136  void TableSpacing(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
137  void TableRowEnd(sal_uInt32 nDepth) override;
138 
140  void StartStyles() override;
141 
143  void EndStyles(sal_uInt16 nNumberOfStyles) override;
144 
146  void DefaultStyle() override;
147 
149  void StartStyle(const OUString& rName, StyleType eType, sal_uInt16 nBase, sal_uInt16 nNext,
150  sal_uInt16 nWwId, sal_uInt16 nId, bool bAutoUpdate) override;
151 
153  void EndStyle() override;
154 
156  void StartStyleProperties(bool bParProp, sal_uInt16 nStyle) override;
157 
159  void EndStyleProperties(bool bParProp) override;
160 
162  void OutlineNumbering(sal_uInt8 nLvl) override;
163 
166  void PageBreakBefore(bool bBreak) override;
167 
170  void SectionBreak(sal_uInt8 nC, bool bBreakAfter, const WW8_SepInfo* pSectionInfo = nullptr,
171  bool bExtraPageBreak = false) override;
172 
174  void StartSection() override;
175 
177  void EndSection() override;
178 
180  void SectionFormProtection(bool bProtected) override;
181 
183  void SectionLineNumbering(sal_uLong nRestartNo, const SwLineNumberInfo& rLnNumInfo) override;
184 
186  void SectionTitlePage() override;
187 
189  void SectionPageBorders(const SwFrameFormat* pFormat,
190  const SwFrameFormat* pFirstPageFormat) override;
191 
193  void SectionBiDi(bool bBiDi) override;
194 
197  void SectionPageNumbering(sal_uInt16 nNumType,
198  const ::std::optional<sal_uInt16>& oPageRestartNumber) override;
199 
201  void SectionType(sal_uInt8 nBreakCode) override;
202 
203  void SectFootnoteEndnotePr() override;
204 
205  void WriteFootnoteEndnotePr(bool bFootnote, const SwEndNoteInfo& rInfo);
206 
208  void NumberingDefinition(sal_uInt16 nId, const SwNumRule& rRule) override;
209 
211  void StartAbstractNumbering(sal_uInt16 nId) override;
212 
214  void EndAbstractNumbering() override;
215 
217  void
218  NumberingLevel(sal_uInt8 nLevel, sal_uInt16 nStart, sal_uInt16 nNumberingType,
219  SvxAdjust eAdjust, const sal_uInt8* pNumLvlPos, sal_uInt8 nFollow,
220  const wwFont* pFont, const SfxItemSet* pOutSet, sal_Int16 nIndentAt,
221  sal_Int16 nFirstLineIndex, sal_Int16 nListTabPos,
222  const OUString& rNumberingString,
223  const SvxBrushItem* pBrush) override; //For i120928,to export graphic of bullet
224 
225  void WriteField_Impl(const SwField* pField, ww::eField eType, const OUString& rFieldCmd,
226  FieldFlags nMode);
227  void WriteBookmarks_Impl(std::vector<OUString>& rStarts, std::vector<OUString>& rEnds);
228  void WriteAnnotationMarks_Impl(std::vector<OUString>& rStarts, std::vector<OUString>& rEnds);
229  void WriteHeaderFooter_Impl(const SwFrameFormat& rFormat, bool bHeader, const char* pStr,
230  bool bTitlepg);
231  void WriteBookmarkInActParagraph(const OUString& /*rName*/, sal_Int32 /*nFirstRunPos*/,
232  sal_Int32 /*nLastRunPos*/) override{};
233 
234 protected:
236  void OutputFlyFrame_Impl(const ww8::Frame& rFrame, const Point& rNdTopLeft) override;
237 
239  void CharCaseMap(const SvxCaseMapItem& rCaseMap) override;
240 
242  void CharColor(const SvxColorItem& rColor) override;
243 
245  void CharContour(const SvxContourItem& rContour) override;
246 
248  void CharCrossedOut(const SvxCrossedOutItem& rCrossedOut) override;
249 
251  void CharEscapement(const SvxEscapementItem& rEscapement) override;
252 
254  void CharFont(const SvxFontItem& rFont) override;
255 
257  void CharFontSize(const SvxFontHeightItem& rFontSize) override;
258 
260  void CharKerning(const SvxKerningItem& rKerning) override;
261 
263  void CharLanguage(const SvxLanguageItem& rLanguage) override;
264 
266  void CharPosture(const SvxPostureItem& rPosture) override;
267 
269  void CharShadow(const SvxShadowedItem& rShadow) override;
270 
272  void CharUnderline(const SvxUnderlineItem& rUnderline) override;
273 
275  void CharWeight(const SvxWeightItem& rWeight) override;
276 
278  void CharAutoKern(const SvxAutoKernItem& rAutoKern) override;
279 
281  void CharAnimatedText(const SvxBlinkItem& rBlink) override;
282 
284  void CharBackground(const SvxBrushItem& rBrush) override;
285 
287  void CharFontCJK(const SvxFontItem& rFont) override;
288 
290  void CharFontSizeCJK(const SvxFontHeightItem& rFontSize) override;
291 
293  void CharLanguageCJK(const SvxLanguageItem& rLanguageItem) override;
294 
296  void CharPostureCJK(const SvxPostureItem& rPosture) override;
297 
299  void CharWeightCJK(const SvxWeightItem& rWeight) override;
300 
302  void CharFontCTL(const SvxFontItem& rFont) override;
303 
305  void CharFontSizeCTL(const SvxFontHeightItem& rFontSize) override;
306 
308  void CharLanguageCTL(const SvxLanguageItem& rLanguageItem) override;
309 
311  void CharPostureCTL(const SvxPostureItem& rPosture) override;
312 
314  void CharWeightCTL(const SvxWeightItem& rWeight) override;
315 
317  void CharBidiRTL(const SfxPoolItem& rItem) override;
318 
320  void CharIdctHint(const SfxPoolItem& rItem) override;
321 
323  void CharRotate(const SvxCharRotateItem& rRotate) override;
324 
326  void CharEmphasisMark(const SvxEmphasisMarkItem& rEmphasisMark) override;
327 
329  void CharTwoLines(const SvxTwoLinesItem& rTwoLines) override;
330 
332  void CharScaleWidth(const SvxCharScaleWidthItem& rScaleWidth) override;
333 
335  void CharRelief(const SvxCharReliefItem& rRelief) override;
336 
338  void CharHidden(const SvxCharHiddenItem& rHidden) override;
339 
341  void CharBorder(const ::editeng::SvxBorderLine* pAllBorder, sal_uInt16 nDist,
342  bool bShadow) override;
343 
345  void CharHighlight(const SvxBrushItem& rBrush) override;
346 
348  void TextINetFormat(const SwFormatINetFormat& rURL) override;
349 
351  void TextCharFormat(const SwFormatCharFormat& rCharFormat) override;
352 
354  void TextFootnote_Impl(const SwFormatFootnote& rFootnote) override;
355 
357  void ParaLineSpacing_Impl(short nSpace, short nMulti) override;
358 
360  void ParaAdjust(const SvxAdjustItem& rAdjust) override;
361 
363  void ParaSplit(const SvxFormatSplitItem& rSplit) override;
364 
366  void ParaWidows(const SvxWidowsItem& rWidows) override;
367 
369  void ParaTabStop(const SvxTabStopItem& rTabStop) override;
370 
372  void ParaHyphenZone(const SvxHyphenZoneItem& rHyphenZone) override;
373 
375  void ParaNumRule_Impl(const SwTextNode* pTextNd, sal_Int32 nLvl, sal_Int32 nNumId) override;
376 
378  void ParaScriptSpace(const SfxBoolItem& rScriptSpace) override;
379 
381  void ParaHangingPunctuation(const SfxBoolItem& rItem) override;
382 
384  void ParaForbiddenRules(const SfxBoolItem& rItem) override;
385 
387  void ParaVerticalAlign(const SvxParaVertAlignItem& rAlign) override;
388 
390  void ParaSnapToGrid(const SvxParaGridItem& rItem) override;
391 
393  void FormatFrameSize(const SwFormatFrameSize& rSize) override;
394 
396  void FormatPaperBin(const SvxPaperBinItem& rItem) override;
397 
399  void FormatLRSpace(const SvxLRSpaceItem& rLRSpace) override;
400 
402  void FormatULSpace(const SvxULSpaceItem& rULSpace) override;
403 
405  void FormatSurround(const SwFormatSurround& rSurround) override;
406 
408  void FormatVertOrientation(const SwFormatVertOrient& rFlyVert) override;
409 
411  void FormatHorizOrientation(const SwFormatHoriOrient& rFlyHori) override;
412 
414  void FormatAnchor(const SwFormatAnchor& rAnchor) override;
415 
417  void FormatBackground(const SvxBrushItem& rBrush) override;
418 
420  void FormatFillStyle(const XFillStyleItem& rFillStyle) override;
421 
423  void FormatFillGradient(const XFillGradientItem& rFillGradient) override;
424 
426  void FormatBox(const SvxBoxItem& rBox) override;
427 
429  void FormatColumns_Impl(sal_uInt16 nCols, const SwFormatCol& rCol, bool bEven,
430  SwTwips nPageSize) override;
431 
433  void FormatKeep(const SvxFormatKeepItem& rItem) override;
434 
436  void FormatTextGrid(const SwTextGridItem& rItem) override;
437 
439  void FormatLineNumbering(const SwFormatLineNumber& rNumbering) override;
440 
442  void FormatFrameDirection(const SvxFrameDirectionItem& rDirection) override;
443 
445  void ParaGrabBag(const SfxGrabBagItem& rItem) override;
446 
448  void CharGrabBag(const SfxGrabBagItem& rItem) override;
449 
451  void ParaOutlineLevel(const SfxUInt16Item& rItem) override;
452 
454  void WriteExpand(const SwField* pField) override;
455 
456  void RefField(const SwField& rField, const OUString& rRef) override;
457  void HiddenField(const SwField& rField) override;
458  void SetField(const SwField& rField, ww::eField eType, const OUString& rCmd) override;
459  void PostitField(const SwField* pField) override;
460  bool DropdownField(const SwField* pField) override;
461  bool PlaceholderField(const SwField* pField) override;
462 
463  void SectionRtlGutter(const SfxBoolItem& rRtlGutter) override;
464 
465 private:
468 
469  OStringBuffer m_aTabStop;
470 
473 
475  void FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat, const SwGrfNode* pGrfNode);
476  void FlyFrameOLE(const SwFlyFrameFormat* pFlyFrameFormat, SwOLENode& rOLENode,
477  const Size& rSize);
478  void FlyFrameOLEReplacement(const SwFlyFrameFormat* pFlyFrameFormat, SwOLENode& rOLENode,
479  const Size& rSize);
481  bool FlyFrameOLEMath(const SwFlyFrameFormat* pFlyFrameFormat, SwOLENode& rOLENode,
482  const Size& rSize);
483 
484  /*
485  * Table methods.
486  */
487  void InitTableHelper(const ww8::WW8TableNodeInfoInner::Pointer_t& pTableTextNodeInfoInner);
488  void StartTable();
489  void StartTableRow(const ww8::WW8TableNodeInfoInner::Pointer_t& pTableTextNodeInfoInner);
490  void StartTableCell();
491  void TableCellProperties(const ww8::WW8TableNodeInfoInner::Pointer_t& pTableTextNodeInfoInner);
492  void EndTableCell();
493  void EndTableRow();
494  void EndTable();
495 
498 
499  void WriteTextFootnoteNumStr(const SwFormatFootnote& rFootnote);
500 
501  /*
502  * Current style name and its ID.
503  */
504  OUString m_rStyleName;
505  sal_uInt16 m_nStyleId;
506  /*
507  * Current list ID.
508  */
509  sal_uInt16 m_nListId;
510  /*
511  * This is needed because the call order is: run text, run properties, paragraph properties.
512  * What we need is the opposite.
513  */
516  /*
517  * This is written after runs.
518  */
519  OStringBuffer m_aAfterRuns;
520  /*
521  * Same for colors and stylesheets: first we just want to output colors,
522  * need to buffer the stylesheet table to output it after the color one.
523  */
524  OStringBuffer m_aStylesheet;
525  /*
526  * This one just holds the style commands in the current style.
527  */
528  OStringBuffer m_aStyles;
529  /*
530  * This is the same as m_aStyles but the contents of it is Assoc.
531  */
532  OStringBuffer m_aStylesAssocHich;
533  OStringBuffer m_aStylesAssocDbch;
534  OStringBuffer m_aStylesAssocRtlch;
535  OStringBuffer m_aStylesAssocLtrch;
536 
537  bool m_bIsRTL;
538  sal_uInt16 m_nScript;
540 
544  std::map<OString, sal_Int32> m_rOpenedAnnotationMarksIds;
545 
546  /*
547  * The current table helper.
548  */
549  std::unique_ptr<SwWriteTable> m_pTableWrt;
550 
551  /*
552  * Remember if we are in an open cell, or not.
553  */
555 
556  /*
557  * Remember the current table depth.
558  */
559  sal_uInt32 m_nTableDepth;
560 
561  /*
562  * Remember if we wrote a \cell or not.
563  */
565 
566  /*
567  * For late output of row definitions.
568  */
569  OStringBuffer m_aRowDefs;
570 
571  /*
572  * Is a column break needed after the next \par?
573  */
575 
576  /*
577  * If section breaks should be buffered to m_aSectionBreaks
578  */
580  OStringBuffer m_aSectionBreaks;
581 
582  /*
583  * If section headers (and footers) should be buffered to
584  * m_aSectionHeaders.
585  */
587  OStringBuffer m_aSectionHeaders;
588 
589  /*
590  * Support for starting multiple tables at the same cell.
591  * If the current table is the last started one.
592  */
594  /*
595  * List of already started but not yet defined tables (need to be defined
596  * after the nested tables).
597  */
598  std::vector<OString> m_aTables;
599  /*
600  * If cell info is already output.
601  */
603 
606 
608  std::map<sal_uInt32, sal_uInt32> m_aCells;
609 
611 
614 
615  bool m_bInRun;
616 
617  bool m_bInRuby;
618 
620  std::map<sal_uInt16, const SwPostItField*> m_aPostitFields;
621 
624 
625  std::vector<std::pair<OString, OString>> m_aFlyProperties;
626 
627  std::optional<css::drawing::FillStyle> m_oFillStyle;
628 
630  std::stack<OUString> m_aURLs;
631 
640 
641 public:
642  explicit RtfAttributeOutput(RtfExport& rExport);
643 
644  ~RtfAttributeOutput() override;
645 
647  MSWordExportBase& GetExport() override;
648 
649  // These are used by wwFont::WriteRtf()
651  void StartFont(const OUString& rFamilyName) const;
652 
654  void EndFont() const;
655 
657  void FontAlternateName(const OUString& rName) const;
658 
660  void FontCharset(sal_uInt8 nCharSet) const;
661 
663  void FontFamilyType(FontFamily eFamily, const wwFont& rFont) const;
664 
666  void FontPitchType(FontPitch ePitch) const;
667 
668  void BulletDefinition(int nId, const Graphic& rGraphic, Size aSize) override;
669 
671  void writeTextFrame(const ww8::Frame& rFrame, bool bTextBox = false);
672 
673  OStringBuffer& GetTabStop() { return m_aTabStop; }
674 
675  const SwPageDesc* GetPrevPageDesc() const { return m_pPrevPageDesc; }
676 };
677 
678 #endif // INCLUDED_SW_SOURCE_FILTER_WW8_RTFATTRIBUTEOUTPUT_HXX
679 
680 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void FormatBackground(const SvxBrushItem &rBrush) override
Sfx item RES_BACKGROUND.
void FormatTextGrid(const SwTextGridItem &rItem) override
Sfx item RES_TEXTGRID.
void CharFontCTL(const SvxFontItem &rFont) override
Sfx item RES_CHRATR_CTL_FONT.
std::map< sal_uInt32, sal_uInt32 > m_aCells
Number of cells from the table definition, by depth.
void StartRun(const SwRedlineData *pRedlineData, sal_Int32 nPos, bool bSingleEmptyRun=false) override
Start of the text run.
Wrapper around OStringBuffers, so less hexdump of graphics have to be kept in memory during RTF expor...
bool EndURL(bool isAtEndOfParagraph) override
Output URL end.
void TableHeight(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
void CharGrabBag(const SfxGrabBagItem &rItem) override
Sfx item RES_CHRATR_GRABBAG.
bool m_bParaBeforeAutoSpacing
If original file had .
void Redline(const SwRedlineData *pRedline) override
Output redlining.
void TableSpacing(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
void TextINetFormat(const SwFormatINetFormat &rURL) override
Sfx item RES_TXTATR_INETFMT.
void FormatULSpace(const SvxULSpaceItem &rULSpace) override
Sfx item RES_UL_SPACE.
void FormatColumns_Impl(sal_uInt16 nCols, const SwFormatCol &rCol, bool bEven, SwTwips nPageSize) override
Sfx item RES_COL.
void FormatKeep(const SvxFormatKeepItem &rItem) override
Sfx item RES_KEEP.
Contains a buffered string or graphic during RTF export.
void EndRuby(const SwTextNode &rNode, sal_Int32 nPos) override
Output ruby end.
void CharKerning(const SvxKerningItem &rKerning) override
Sfx item RES_CHRATR_KERNING.
void ParaSnapToGrid(const SvxParaGridItem &rItem) override
Sfx item RES_PARATR_SNAPTOGRID.
void CharBidiRTL(const SfxPoolItem &rItem) override
Sfx item RES_CHRATR_BidiRTL.
void WriteBookmarks_Impl(std::vector< OUString > &rStarts, std::vector< OUString > &rEnds)
void EndRun(const SwTextNode *pNode, sal_Int32 nPos, bool bLastRun=false) override
End of the text run.
void StartTableRow(const ww8::WW8TableNodeInfoInner::Pointer_t &pTableTextNodeInfoInner)
RtfAttributeOutput(RtfExport &rExport)
void CharBackground(const SvxBrushItem &rBrush) override
Sfx item RES_CHRATR_BACKGROUND.
void FormatVertOrientation(const SwFormatVertOrient &rFlyVert) override
Sfx item RES_VERT_ORIENT.
void PostitField(const SwField *pField) override
sal_Int32 m_nParaBeforeSpacing
If m_bParaBeforeAutoSpacing is set, value of .
sal_uIntPtr sal_uLong
void SectionPageNumbering(sal_uInt16 nNumType, const ::std::optional< sal_uInt16 > &oPageRestartNumber) override
The style of the page numbers.
void CharHighlight(const SvxBrushItem &rBrush) override
Sfx item RES_CHRATR_HIGHLIGHT.
void FormatDrop(const SwTextNode &rNode, const SwFormatDrop &rSwFormatDrop, sal_uInt16 nStyle, ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner) override
bool FlyFrameOLEMath(const SwFlyFrameFormat *pFlyFrameFormat, SwOLENode &rOLENode, const Size &rSize)
Math export.
Base class of all fields.
Definition: fldbas.hxx:289
std::stack< OUString > m_aURLs
If we're in the process of exporting a hyperlink, then its URL.
void ParaHangingPunctuation(const SfxBoolItem &rItem) override
Sfx item RES_PARATR_HANGINGPUNCTUATION.
void SectionRtlGutter(const SfxBoolItem &rRtlGutter) override
RES_RTL_GUTTER.
void ParaNumRule_Impl(const SwTextNode *pTextNd, sal_Int32 nLvl, sal_Int32 nNumId) override
Sfx item RES_PARATR_NUMRULE.
void ParaSplit(const SvxFormatSplitItem &rSplit) override
Sfx item RES_PARATR_SPLIT.
void StartFont(const OUString &rFamilyName) const
Start the font.
void CharFontCJK(const SvxFontItem &rFont) override
Sfx item RES_CHRATR_CJK_FONT.
void FlyFrameGraphic(const SwFlyFrameFormat *pFlyFrameFormat, const SwGrfNode *pGrfNode)
Output graphic fly frames.
OStringBuffer & GetTabStop()
void TableInfoCell(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
void ParaWidows(const SvxWidowsItem &rWidows) override
Sfx item RES_PARATR_WIDOWS.
void FormatSurround(const SwFormatSurround &rSurround) override
Sfx item RES_SURROUND.
void EndStyles(sal_uInt16 nNumberOfStyles) override
End of the styles table.
void RefField(const SwField &rField, const OUString &rRef) override
void CharLanguage(const SvxLanguageItem &rLanguage) override
Sfx item RES_CHRATR_LANGUAGE.
void StartAbstractNumbering(sal_uInt16 nId) override
Start of the abstract numbering definition instance.
void StartStyles() override
Start of the styles table.
void FormatFrameSize(const SwFormatFrameSize &rSize) override
Sfx item RES_FRM_SIZE.
void SectionTitlePage() override
Has different headers/footers for the title page.
void CharPostureCTL(const SvxPostureItem &rPosture) override
Sfx item RES_CHRATR_CTL_POSTURE.
void SectFootnoteEndnotePr() override
for footnote/endnote section properties
void FlyFrameOLE(const SwFlyFrameFormat *pFlyFrameFormat, SwOLENode &rOLENode, const Size &rSize)
void SectionBiDi(bool bBiDi) override
Columns populated from right/numbers on the right side?
bool m_bSingleEmptyRun
If we're in a paragraph that has a single empty run only.
void CharCaseMap(const SvxCaseMapItem &rCaseMap) override
Sfx item Sfx item RES_CHRATR_CASEMAP.
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.
void StartSection() override
Start of the section properties.
sal_Int32 m_nParaAfterSpacing
If m_bParaBeforeAutoSpacing is set, value of.
void TableBidi(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
void CharWeight(const SvxWeightItem &rWeight) override
Sfx item RES_CHRATR_WEIGHT.
static bool bFootnote
Definition: insfnote.cxx:33
void TableBackgrounds(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
std::vector< OString > m_aTables
void NumberingDefinition(sal_uInt16 nId, const SwNumRule &rRule) override
Definition of a numbering instance.
void TableDefinition(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
void WriteExpand(const SwField *pField) override
Write the expanded field.
void CharBorder(const ::editeng::SvxBorderLine *pAllBorder, sal_uInt16 nDist, bool bShadow) override
Sfx item RES_CHRATR_BOX.
void ParaAdjust(const SvxAdjustItem &rAdjust) override
Sfx item RES_PARATR_ADJUST.
void WriteHeaderFooter_Impl(const SwFrameFormat &rFormat, bool bHeader, const char *pStr, bool bTitlepg)
FieldFlags
Definition: wrtww8.hxx:141
bool m_bTableRowEnded
If we ended a table row without starting a new one.
void FontCharset(sal_uInt8 nCharSet) const
Font charset.
void FontPitchType(FontPitch ePitch) const
Font pitch.
void CharScaleWidth(const SvxCharScaleWidthItem &rScaleWidth) override
Sfx item RES_CHRATR_SCALEW.
The class that does all the actual RTF export-related work.
Definition: rtfexport.hxx:36
void ParaForbiddenRules(const SfxBoolItem &rItem) override
Sfx item RES_PARATR_FORBIDDEN_RULES.
void EndParagraphProperties(const SfxItemSet &rParagraphMarkerProperties, const SwRedlineData *pRedlineData, const SwRedlineData *pRedlineParagraphMarkerDeleted, const SwRedlineData *pRedlineParagraphMarkerInserted) override
Called after we end outputting the attributes.
void ParaScriptSpace(const SfxBoolItem &rScriptSpace) override
Sfx item RES_PARATR_SCRIPTSPACE.
void PageBreakBefore(bool bBreak) override
Page break As a paragraph property - the paragraph should be on the next page.
The class that has handlers for various resource types when exporting as RTF.
StyleType
void TableVerticalCell(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
const SwPageDesc * m_pPrevPageDesc
Access to the page style of the previous paragraph.
void WriteFootnoteEndnotePr(bool bFootnote, const SwEndNoteInfo &rInfo)
void FormatFillGradient(const XFillGradientItem &rFillGradient) override
Sfx item RES_FILL_GRADIENT.
void ParaVerticalAlign(const SvxParaVertAlignItem &rAlign) override
Sfx item RES_PARATR_VERTALIGN.
void FontAlternateName(const OUString &rName) const
Alternate name for the font.
void CharAutoKern(const SvxAutoKernItem &rAutoKern) override
Sfx item RES_CHRATR_AUTOKERN.
void ParagraphStyle(sal_uInt16 nStyle) override
Output style.
void WriteField_Impl(const SwField *pField, ww::eField eType, const OUString &rFieldCmd, FieldFlags nMode)
void TableOrientation(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
void CharUnderline(const SvxUnderlineItem &rUnderline) override
Sfx item RES_CHRATR_UNDERLINE.
Collects and outputs fonts.
Definition: wrtww8.hxx:295
RtfStringBuffer m_aRunText
RtfExport & m_rExport
Reference to the export, where to get the data from.
void EndSection() override
End of the section properties.
void TableCanSplit(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
void CharRelief(const SvxCharReliefItem &rRelief) override
Sfx item RES_CHRATR_RELIEF.
void StartRuby(const SwTextNode &rNode, sal_Int32 nPos, const SwFormatRuby &rRuby) override
Output ruby start.
void DefaultStyle() override
Write default style.
void FontFamilyType(FontFamily eFamily, const wwFont &rFont) const
Font family.
OStringBuffer m_aStylesAssocLtrch
void EndFont() const
End the font.
std::unique_ptr< SwWriteTable > m_pTableWrt
Style of a layout element.
Definition: frmfmt.hxx:59
OString MoveCharacterProperties(bool aAutoWriteRtlLtr=false)
void BulletDefinition(int nId, const Graphic &rGraphic, Size aSize) override
Exports the definition (image, size) of a single numbering picture bullet.
OStringBuffer m_aStylesAssocDbch
void TableCellRedline(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
void TableRowRedline(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
SvxAdjust
void CharPostureCJK(const SvxPostureItem &rPosture) override
Sfx item RES_CHRATR_CJK_POSTURE.
void WriteTextFootnoteNumStr(const SwFormatFootnote &rFootnote)
void TableRowEnd(sal_uInt32 nDepth) override
void WriteAnnotationMarks_Impl(std::vector< OUString > &rStarts, std::vector< OUString > &rEnds)
std::optional< css::drawing::FillStyle > m_oFillStyle
void StartStyleProperties(bool bParProp, sal_uInt16 nStyle) override
Start of (paragraph or run) properties of a style.
void EndRunProperties(const SwRedlineData *pRedlineData) override
Called after we end outputting the attributes.
void EmptyParagraph() override
Empty paragraph.
const SwPageDesc * GetPrevPageDesc() const
FlyAnchors.
Definition: fmtanchr.hxx:34
void OutputFlyFrame_Impl(const ww8::Frame &rFrame, const Point &rNdTopLeft) override
Output frames - the implementation.
void CharLanguageCJK(const SvxLanguageItem &rLanguageItem) override
Sfx item RES_CHRATR_CJK_LANGUAGE.
void writeTextFrame(const ww8::Frame &rFrame, bool bTextBox=false)
Handles just the { ...} part of a shape export.
std::map< sal_uInt16, const SwPostItField * > m_aPostitFields
Maps ID's to postit fields, used in atrfstart/end and atnref.
void CharEscapement(const SvxEscapementItem &rEscapement) override
Sfx item RES_CHRATR_ESCAPEMENT.
void TableNodeInfoInner(ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner) override
void CharFontSizeCJK(const SvxFontHeightItem &rFontSize) override
Sfx item RES_CHRATR_CJK_FONTSIZE.
void StartStyle(const OUString &rName, StyleType eType, sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 nWwId, sal_uInt16 nId, bool bAutoUpdate) override
Start of a style in the styles table.
void FieldVanish(const OUString &rText, ww::eField eType, OUString const *pBookmarkName) override
void WriteBookmarkInActParagraph(const OUString &, sal_Int32, sal_Int32) override
Insert a bookmark inside the currently processed paragraph.
void HiddenField(const SwField &rField) override
void CharColor(const SvxColorItem &rColor) override
Sfx item Sfx item RES_CHRATR_COLOR.
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.
void SectionBreaks(const SwNode &rNode) override
Called in order to output section breaks.
void CharEmphasisMark(const SvxEmphasisMarkItem &rEmphasisMark) override
Sfx item RES_CHRATR_EMPHASIS_MARK.
void CharFontSize(const SvxFontHeightItem &rFontSize) override
Sfx item RES_CHRATR_FONTSIZE.
OStringBuffer m_aSectionHeaders
MSWordExportBase & GetExport() override
Return the right export class.
FontPitch
void FormatBox(const SvxBoxItem &rBox) override
Sfx item RES_BOX.
void CharFontSizeCTL(const SvxFontHeightItem &rFontSize) override
Sfx item RES_CHRATR_CTL_FONTSIZE.
void RawText(const OUString &rText, rtl_TextEncoding eCharSet) override
Output text (without markup).
void TableDefaultBorders(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
void TableInfoRow(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
void EndStyle() override
End of a style in the styles table.
void CharTwoLines(const SvxTwoLinesItem &rTwoLines) override
Sfx item RES_CHRATR_TWO_LINES.
std::map< OString, sal_Int32 > m_rOpenedAnnotationMarksIds
Maps annotation mark names to ID's.
void FormatFrameDirection(const SvxFrameDirectionItem &rDirection) override
Sfx item RES_FRAMEDIR.
void InitTableHelper(const ww8::WW8TableNodeInfoInner::Pointer_t &pTableTextNodeInfoInner)
tools::Long SwTwips
Definition: swtypes.hxx:52
void FormatLRSpace(const SvxLRSpaceItem &rLRSpace) override
Sfx item RES_LR_SPACE.
void CharShadow(const SvxShadowedItem &rShadow) override
Sfx item RES_CHRATR_SHADOWED.
< purpose of derivation from SwClient: character style for displaying the numbers.
Definition: lineinfo.hxx:37
void ParaOutlineLevel(const SfxUInt16Item &rItem) override
Sfx item RES_PARATR_OUTLINELEVEL.
OStringBuffer m_aSectionBreaks
void SetField(const SwField &rField, ww::eField eType, const OUString &rCmd) override
FontFamily
void CharPosture(const SvxPostureItem &rPosture) override
Sfx item RES_CHRATR_POSTURE.
void ParaLineSpacing_Impl(short nSpace, short nMulti) override
Sfx item RES_PARATR_LINESPACING.
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
void ParaHyphenZone(const SvxHyphenZoneItem &rHyphenZone) override
Sfx item RES_PARATR_HYPHENZONE.
void FormatAnchor(const SwFormatAnchor &rAnchor) override
Sfx item RES_ANCHOR.
bool StartURL(const OUString &rUrl, const OUString &rTarget) override
Output URL start.
bool PlaceholderField(const SwField *pField) override
void CharContour(const SvxContourItem &rContour) override
Sfx item Sfx item RES_CHRATR_CONTOUR.
void ParaGrabBag(const SfxGrabBagItem &rItem) override
Sfx item RES_PARATR_GRABBAG.
void SectionFormProtection(bool bProtected) override
Protection of forms.
void CharAnimatedText(const SvxBlinkItem &rBlink) override
Sfx item RES_CHRATR_BLINK.
void TextCharFormat(const SwFormatCharFormat &rCharFormat) override
Sfx item RES_TXTATR_CHARFMT.
bool DropdownField(const SwField *pField) override
void CharFont(const SvxFontItem &rFont) override
Sfx item RES_CHRATR_FONT.
OStringBuffer m_aStylesAssocHich
unsigned char sal_uInt8
Make exporting a Writer Frame easy.
void TableCellProperties(const ww8::WW8TableNodeInfoInner::Pointer_t &pTableTextNodeInfoInner)
OStringBuffer & RunText()
void CharWeightCTL(const SvxWeightItem &rWeight) override
Sfx item RES_CHRATR_CTL_WEIGHT.
sal_Int32 StartParagraph(ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, bool bGenerateParaId) override
Start of the paragraph.
void OutlineNumbering(sal_uInt8 nLvl) override
Numbering rule and Id.
OStringBuffer m_aStylesAssocRtlch
std::shared_ptr< WW8TableNodeInfoInner > Pointer_t
void StartRunProperties() override
Called before we start outputting the attributes.
void CharLanguageCTL(const SvxLanguageItem &rLanguageItem) override
Sfx item RES_CHRATR_CTL_LANGUAGE.
void FormatLineNumbering(const SwFormatLineNumber &rNumbering) override
Sfx item RES_LINENUMBER.
void FormatHorizOrientation(const SwFormatHoriOrient &rFlyHori) override
Sfx item RES_HORI_ORIENT.
void FlyFrameOLEReplacement(const SwFlyFrameFormat *pFlyFrameFormat, SwOLENode &rOLENode, const Size &rSize)
std::vector< std::pair< OString, OString > > m_aFlyProperties
void FormatPaperBin(const SvxPaperBinItem &rItem) override
Sfx item RES_PAPER_BIN.
void RTLAndCJKState(bool bIsRTL, sal_uInt16 nScript) override
Export the state of RTL/CJK.
void EndStyleProperties(bool bParProp) override
End of (paragraph or run) properties of a style.
void CharHidden(const SvxCharHiddenItem &rHidden) override
Sfx item RES_CHRATR_HIDDEN.
bool m_bParaAfterAutoSpacing
If original file had .
Base class for WW8Export and DocxExport.
Definition: wrtww8.hxx:449
void SectionType(sal_uInt8 nBreakCode) override
The type of breaking.
void CharCrossedOut(const SvxCrossedOutItem &rCrossedOut) override
Sfx item RES_CHRATR_CROSSEDOUT.
const Size * m_pFlyFrameSize
When exporting fly frames, this holds the real size of the frame.
sal_Int32 m_nCurrentAnnotationMarkId
void CharRotate(const SvxCharRotateItem &rRotate) override
Sfx item RES_CHRATR_ROTATE.
void FinishTableRowCell(const ww8::WW8TableNodeInfoInner::Pointer_t &pInner)
End cell, row, and even the entire table if necessary.
If SwFormatDrop is a Client, it is the CharFormat that describes the font for the DropCaps...
Definition: paratr.hxx:62
save the current run state around exporting things that contain paragraphs themselves like text frame...
void TextFootnote_Impl(const SwFormatFootnote &rFootnote) override
Sfx item RES_TXTATR_FTN.
void SectionPageBorders(const SwFrameFormat *pFormat, const SwFrameFormat *pFirstPageFormat) override
Description of the page borders.
void FormatFillStyle(const XFillStyleItem &rFillStyle) override
Sfx item RES_FILL_STYLE.
std::shared_ptr< WW8TableNodeInfo > Pointer_t
~RtfAttributeOutput() override
void StartParagraphProperties() override
Called before we start outputting the attributes.
void CharIdctHint(const SfxPoolItem &rItem) override
Sfx item RES_CHRATR_IdctHint.
void EndParagraph(ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner) override
End of the paragraph.
void EndAbstractNumbering() override
End of the abstract numbering definition instance.
void SectionLineNumbering(sal_uLong nRestartNo, const SwLineNumberInfo &rLnNumInfo) override
Numbering of the lines in the document.
void CharWeightCJK(const SvxWeightItem &rWeight) override
Sfx item RES_CHRATR_CJK_WEIGHT.
void ParaTabStop(const SvxTabStopItem &rTabStop) override
Sfx item RES_PARATR_TABSTOP.
Base class of the Writer document model elements.
Definition: node.hxx:80