LibreOffice Module sw (master) 1
rtfexport.cxx
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#include <sal/config.h>
21
22#include "rtfexport.hxx"
23
24#include <string_view>
25
26#include "rtfexportfilter.hxx"
27#include "rtfsdrexport.hxx"
29#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
30#include <com/sun/star/frame/XModel.hpp>
31#include <com/sun/star/i18n/ScriptType.hpp>
32#include <com/sun/star/beans/XPropertySet.hpp>
33#include <com/sun/star/beans/XPropertySetInfo.hpp>
34#include <com/sun/star/text/XTextFieldsSupplier.hpp>
35#include <docsh.hxx>
36#include <viewsh.hxx>
37#include <viewopt.hxx>
38#include <fmtpdsc.hxx>
39#include <ftninfo.hxx>
40#include <fmthdft.hxx>
41#include <editeng/colritem.hxx>
42#include <editeng/udlnitem.hxx>
43#include <editeng/fontitem.hxx>
44#include <editeng/paperinf.hxx>
45#include <editeng/brushitem.hxx>
46#include <editeng/protitem.hxx>
47#include <editeng/lrspitem.hxx>
48#include <editeng/ulspitem.hxx>
49#include <editeng/boxitem.hxx>
50#include <editeng/shaditem.hxx>
51#include <lineinfo.hxx>
52#include <redline.hxx>
53#include <swmodule.hxx>
55#include <comphelper/string.hxx>
56#include <svtools/rtfkeywd.hxx>
59#include <xmloff/odffields.hxx>
60#include <o3tl/string_view.hxx>
61#include <osl/diagnose.h>
62#include <rtl/tencinfo.h>
63#include <sal/log.hxx>
64#include <svx/xflclit.hxx>
65#include <fmtmeta.hxx>
67#include <fmtfsize.hxx>
68#include <ndtxt.hxx>
69#include <numrule.hxx>
70#include <frmatr.hxx>
71#include <swtable.hxx>
72#include <IMark.hxx>
73
74using namespace ::com::sun::star;
75
76// the default text encoding for the export, if it doesn't fit unicode will
77// be used
78#define DEF_ENCODING RTL_TEXTENCODING_ASCII_US
79
81
83
85
86bool RtfExport::CollapseScriptsforWordOk(sal_uInt16 nScript, sal_uInt16 nWhich)
87{
88 // FIXME is this actually true for rtf? - this is copied from DOCX
89 if (nScript == i18n::ScriptType::ASIAN)
90 {
91 // for asian in ww8, there is only one fontsize
92 // and one fontstyle (posture/weight)
93 switch (nWhich)
94 {
98 return false;
99 default:
100 break;
101 }
102 }
103 else if (nScript != i18n::ScriptType::COMPLEX)
104 {
105 // for western in ww8, there is only one fontsize
106 // and one fontstyle (posture/weight)
107 switch (nWhich)
108 {
112 return false;
113 default:
114 break;
115 }
116 }
117 return true;
118}
119
120void RtfExport::AppendBookmarks(const SwTextNode& rNode, sal_Int32 nCurrentPos, sal_Int32 nLen,
121 const SwRedlineData* /*pRedlineData*/)
122{
123 std::vector<OUString> aStarts;
124 std::vector<OUString> aEnds;
125
126 IMarkVector aMarks;
127 if (GetBookmarks(rNode, nCurrentPos, nCurrentPos + nLen, aMarks))
128 {
129 for (const auto& pMark : aMarks)
130 {
131 const sal_Int32 nStart = pMark->GetMarkStart().GetContentIndex();
132 const sal_Int32 nEnd = pMark->GetMarkEnd().GetContentIndex();
133
134 if (nStart == nCurrentPos)
135 aStarts.push_back(pMark->GetName());
136
137 if (nEnd == nCurrentPos)
138 aEnds.push_back(pMark->GetName());
139 }
140 }
141
142 m_pAttrOutput->WriteBookmarks_Impl(aStarts, aEnds);
143}
144
145void RtfExport::AppendBookmark(const OUString& rName)
146{
147 std::vector<OUString> aStarts{ rName };
148 std::vector<OUString> aEnds{ rName };
149
150 m_pAttrOutput->WriteBookmarks_Impl(aStarts, aEnds);
151}
152
153void RtfExport::AppendAnnotationMarks(const SwWW8AttrIter& rAttrs, sal_Int32 nCurrentPos,
154 sal_Int32 nLen)
155{
156 std::vector<OUString> aStarts;
157 std::vector<OUString> aEnds;
158
159 IMarkVector aMarks;
160 if (GetAnnotationMarks(rAttrs, nCurrentPos, nCurrentPos + nLen, aMarks))
161 {
162 for (const auto& pMark : aMarks)
163 {
164 const sal_Int32 nStart = pMark->GetMarkStart().GetContentIndex();
165 const sal_Int32 nEnd = pMark->GetMarkEnd().GetContentIndex();
166
167 if (nStart == nCurrentPos)
168 aStarts.push_back(pMark->GetName());
169
170 if (nEnd == nCurrentPos)
171 aEnds.push_back(pMark->GetName());
172 }
173 }
174
175 m_pAttrOutput->WriteAnnotationMarks_Impl(aStarts, aEnds);
176}
177
178//For i120928,to export graphic of bullet for RTF filter
180{
181 // Noop, would be too late, see WriteNumbering() instead.
182}
183
184void RtfExport::WriteChar(sal_Unicode /*c*/) { /* WriteChar() has nothing to do for rtf. */}
185
186static bool IsExportNumRule(const SwNumRule& rRule)
187{
188 sal_uInt8 nEnd = MAXLEVEL;
189 while (nEnd-- && !rRule.GetNumFormat(nEnd))
190 ;
191 ++nEnd;
192
193 sal_uInt8 nLvl;
194
195 for (nLvl = 0; nLvl < nEnd; ++nLvl)
196 {
197 const SwNumFormat* pNFormat = &rRule.Get(nLvl);
198 if (SVX_NUM_NUMBER_NONE != pNFormat->GetNumberingType() || !pNFormat->GetPrefix().isEmpty()
199 || (!pNFormat->GetSuffix().isEmpty() && pNFormat->GetSuffix() != "."))
200 break;
201 }
202
203 return nLvl != nEnd;
204}
205
207{
208 const SwNumRuleTable& rListTable = m_rDoc.GetNumRuleTable();
209
210 SwNumRule* pOutlineRule = m_rDoc.GetOutlineNumRule();
211 if (IsExportNumRule(*pOutlineRule))
212 GetNumberingId(*pOutlineRule);
213
214 for (auto n = rListTable.size(); n;)
215 {
216 SwNumRule* pRule = rListTable[--n];
217 if (!m_rDoc.IsUsed(*pRule))
218 continue;
219
220 if (IsExportNumRule(*pRule))
221 GetNumberingId(*pRule);
222 }
223}
224
226{
227 SAL_INFO("sw.rtf", __func__ << " start");
228
229 if (!m_pUsedNumTable)
230 return; // no numbering is used
231
232 Strm()
233 .WriteChar('{')
236
238 if (!m_vecBulletPic.empty())
239 Strm()
240 .WriteChar('{')
244 if (!m_vecBulletPic.empty())
245 Strm().WriteChar('}');
246
248 Strm().WriteChar('}');
249
252 Strm().WriteChar('}');
253
254 SAL_INFO("sw.rtf", __func__ << " end");
255}
256
258{
260
261 if (nRevAuthors < 1)
262 return;
263
264 // RTF always seems to use Unknown as the default first entry
265 GetRedline("Unknown");
266
268 {
269 GetRedline(SW_MOD()->GetRedlineAuthor(pRedl->GetAuthor()));
270 }
271
272 // Now write the table
273 Strm()
274 .WriteChar('{')
277 .WriteChar(' ');
278 for (std::size_t i = 0; i < m_aRedlineTable.size(); ++i)
279 {
280 const OUString* pAuthor = GetRedline(i);
281 Strm().WriteChar('{');
282 if (pAuthor)
285 Strm().WriteCharPtr(";}");
286 }
288}
289
290void RtfExport::WriteHeadersFooters(sal_uInt8 nHeadFootFlags, const SwFrameFormat& rFormat,
291 const SwFrameFormat& rLeftHeaderFormat,
292 const SwFrameFormat& rLeftFooterFormat,
293 const SwFrameFormat& rFirstPageFormat, sal_uInt8 /*nBreakCode*/,
294 bool /*bEvenAndOddHeaders*/)
295{
296 // headers
297 if (nHeadFootFlags & nsHdFtFlags::WW8_HEADER_EVEN)
298 WriteHeaderFooter(rLeftHeaderFormat, true, OOO_STRING_SVTOOLS_RTF_HEADERL);
299
300 if (nHeadFootFlags & nsHdFtFlags::WW8_HEADER_ODD)
302
303 if (nHeadFootFlags & nsHdFtFlags::WW8_HEADER_FIRST)
304 WriteHeaderFooter(rFirstPageFormat, true, OOO_STRING_SVTOOLS_RTF_HEADERF, true);
305
306 // footers
307 if (nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_EVEN)
308 WriteHeaderFooter(rLeftFooterFormat, false, OOO_STRING_SVTOOLS_RTF_FOOTERL);
309
310 if (nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_ODD)
312
313 if (nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_FIRST)
314 WriteHeaderFooter(rFirstPageFormat, false, OOO_STRING_SVTOOLS_RTF_FOOTERF, true);
315}
316
317void RtfExport::OutputField(const SwField* pField, ww::eField eFieldType, const OUString& rFieldCmd,
318 FieldFlags nMode)
319{
320 m_pAttrOutput->WriteField_Impl(pField, eFieldType, rFieldCmd, nMode);
321}
322
323void RtfExport::WriteFormData(const ::sw::mark::IFieldmark& rFieldmark)
324{
325 sal_Int32 nType;
326 if (rFieldmark.GetFieldname() == ODF_FORMDROPDOWN)
327 {
328 nType = 2;
329 }
330 /* TODO
331 else if (rFieldmark.GetFieldname() == ODF_FORMCHECKBOX)
332 {
333 nType = 1;
334 }
335 else if (rFieldmark.GetFieldname() == ODF_FORMTEXT)
336 {
337 nType = 0;
338 }
339*/
340 else
341 {
342 SAL_INFO("sw.rtf", "unknown field type");
343 return;
344 }
345 m_pAttrOutput->RunText().append(
348 m_pAttrOutput->RunText().append(nType);
349 if (rFieldmark.GetFieldname() == ODF_FORMDROPDOWN)
350 {
352 uno::Sequence<OUString> entries;
353 if (auto const it = rFieldmark.GetParameters()->find(ODF_FORMDROPDOWN_LISTENTRY);
354 it != rFieldmark.GetParameters()->end())
355 {
356 it->second >>= entries;
357 }
358 if (auto const it = rFieldmark.GetParameters()->find(ODF_FORMDROPDOWN_RESULT);
359 it != rFieldmark.GetParameters()->end())
360 {
361 sal_Int32 result(-1);
362 it->second >>= result;
363 if (0 <= result && result < entries.getLength())
364 {
366 m_pAttrOutput->RunText().append(result);
367 }
368 }
369 for (OUString const& rEntry : entries)
370 {
371 m_pAttrOutput->RunText().append(
373 m_pAttrOutput->RunText().append(
375 m_pAttrOutput->RunText().append("}");
376 }
377 }
378 m_pAttrOutput->RunText().append("}}"); // close FORMFIELD destination
379}
380
381void RtfExport::WriteHyperlinkData(const ::sw::mark::IFieldmark& /*rFieldmark*/)
382{
383 SAL_INFO("sw.rtf", "TODO: " << __func__);
384}
385
386void RtfExport::DoComboBox(const OUString& /*rName*/, const OUString& /*rHelp*/,
387 const OUString& /*rToolTip*/, const OUString& /*rSelected*/,
388 const uno::Sequence<OUString>& /*rListItems*/)
389{
390 // this is handled in RtfAttributeOutput::OutputFlyFrame_Impl
391}
392
394{
395 OUString sResult = pField->ExpandField(true, nullptr);
396 const OUString& rHelp = pField->GetHelp();
397 OUString sName = pField->GetPar2();
398 const OUString& rStatus = pField->GetToolTip();
399 m_pAttrOutput->RunText().append("{" OOO_STRING_SVTOOLS_RTF_FIELD
401 "{ FORMTEXT }");
402 m_pAttrOutput->RunText().append(
405 if (!rHelp.isEmpty())
407 if (!rStatus.isEmpty())
409 m_pAttrOutput->RunText().append(OOO_STRING_SVTOOLS_RTF_FFTYPETXT "0");
410
411 if (!sName.isEmpty())
412 m_pAttrOutput->RunText().append(
415 if (!rHelp.isEmpty())
416 m_pAttrOutput->RunText().append(
419 m_pAttrOutput->RunText().append(
422 if (!rStatus.isEmpty())
423 m_pAttrOutput->RunText().append(
426 m_pAttrOutput->RunText().append("}}}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " ");
428 + "}}");
429}
430
431sal_uInt64 RtfExport::ReplaceCr(sal_uInt8 /*nChar*/)
432{
433 // Completely unused for Rtf export... only here for code sharing
434 // purpose with binary export
435
436 return 0;
437}
438
440{
441 Strm()
443 .WriteChar('{')
446 Strm().WriteChar('}');
447}
448
450{
451 SAL_INFO("sw.rtf", __func__ << " start");
452 m_pStyles->OutputStylesTable();
453 SAL_INFO("sw.rtf", __func__ << " end");
454}
455
457{
458 const SwPageFootnoteInfo& rFootnoteInfo = m_rDoc.GetPageDesc(0).GetFootnoteInfo();
459 // Request a separator only in case the width is larger than zero.
460 bool bSeparator = double(rFootnoteInfo.GetWidth()) > 0;
461
462 Strm()
463 .WriteChar('{')
466 if (bSeparator)
468 Strm().WriteChar('}');
469}
470
472{
473 SAL_INFO("sw.rtf", __func__ << " start");
474
475 if (std::unique_ptr<SvxBrushItem> oBrush = getBackground(); oBrush)
476 {
481
482 std::vector<std::pair<OString, OString>> aProperties{
483 { "shapeType", "1" },
484 { "fillColor", OString::number(wwUtility::RGBToBGR(oBrush->GetColor())) }
485 };
486 for (const std::pair<OString, OString>& rPair : aProperties)
487 {
490 Strm().WriteOString(rPair.first);
492 Strm().WriteOString(rPair.second);
493 Strm().WriteCharPtr("}}");
494 }
495 Strm().WriteChar('}'); // shpinst
496 Strm().WriteChar('}'); // shp
497 Strm().WriteChar('}'); // background
498 }
499
500 SwTableNode* pTableNode = m_pCurPam->GetPointNode().FindTableNode();
501 if (m_pWriter && m_pWriter->m_bWriteOnlyFirstTable && pTableNode != nullptr)
502 {
503 m_pCurPam->GetPoint()->Assign(*pTableNode);
504 m_pCurPam->GetMark()->Assign(*pTableNode->EndOfSectionNode());
505 }
506 else
507 {
508 m_pCurPam->GetPoint()->Assign(*m_rDoc.GetNodes().GetEndOfContent().StartOfSectionNode());
509 }
510
511 WriteText();
512
513 SAL_INFO("sw.rtf", __func__ << " end");
514}
515
517{
518 OString aGenerator
520 Strm()
522 .WriteOString(aGenerator)
523 .WriteChar('}');
525
526 SwDocShell* pDocShell(m_rDoc.GetDocShell());
527 uno::Reference<document::XDocumentProperties> xDocProps;
528 if (pDocShell)
529 {
530 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(pDocShell->GetModel(),
531 uno::UNO_QUERY);
532 xDocProps.set(xDPS->getDocumentProperties());
533 }
534
535 if (xDocProps.is())
536 {
537 // Handle user-defined properties.
538 uno::Reference<beans::XPropertyContainer> xUserDefinedProperties
539 = xDocProps->getUserDefinedProperties();
540 if (xUserDefinedProperties.is())
541 {
542 uno::Reference<beans::XPropertySet> xPropertySet(xUserDefinedProperties,
543 uno::UNO_QUERY);
544 uno::Reference<beans::XPropertySetInfo> xPropertySetInfo
545 = xPropertySet->getPropertySetInfo();
546 // Do we have explicit markup in RTF for this property name?
547 if (xPropertySetInfo->hasPropertyByName("Company"))
548 {
549 OUString aValue;
550 xPropertySet->getPropertyValue("Company") >>= aValue;
552 }
553 }
554
555 OutUnicode(OOO_STRING_SVTOOLS_RTF_TITLE, xDocProps->getTitle(), true);
556 OutUnicode(OOO_STRING_SVTOOLS_RTF_SUBJECT, xDocProps->getSubject());
557
559 ::comphelper::string::convertCommaSeparated(xDocProps->getKeywords()));
560 OutUnicode(OOO_STRING_SVTOOLS_RTF_DOCCOMM, xDocProps->getDescription());
561
562 OutUnicode(OOO_STRING_SVTOOLS_RTF_AUTHOR, xDocProps->getAuthor());
563 OutDateTime(OOO_STRING_SVTOOLS_RTF_CREATIM, xDocProps->getCreationDate());
564
565 OutUnicode(OOO_STRING_SVTOOLS_RTF_AUTHOR, xDocProps->getModifiedBy());
566 OutDateTime(OOO_STRING_SVTOOLS_RTF_REVTIM, xDocProps->getModificationDate());
567
568 OutDateTime(OOO_STRING_SVTOOLS_RTF_PRINTIM, xDocProps->getPrintDate());
569 }
570
571 Strm().WriteChar('}');
572}
573
575{
578}
579
580void RtfExport::WriteUserPropValue(const OUString& rValue)
581{
584 Strm().WriteChar('}');
585}
586
588{
591
592 SwDocShell* pDocShell(m_rDoc.GetDocShell());
593 uno::Reference<document::XDocumentProperties> xDocProps;
594 if (pDocShell)
595 {
596 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(pDocShell->GetModel(),
597 uno::UNO_QUERY);
598 xDocProps.set(xDPS->getDocumentProperties());
599 }
600 else
601 {
602 // Clipboard document, read metadata from the meta field manager.
604 xDocProps.set(rManager.getDocumentProperties());
605 }
606
607 if (xDocProps.is())
608 {
609 // Handle user-defined properties.
610 uno::Reference<beans::XPropertyContainer> xUserDefinedProperties
611 = xDocProps->getUserDefinedProperties();
612 if (xUserDefinedProperties.is())
613 {
614 uno::Reference<beans::XPropertySet> xPropertySet(xUserDefinedProperties,
615 uno::UNO_QUERY);
616 const uno::Sequence<beans::Property> aProperties
617 = xPropertySet->getPropertySetInfo()->getProperties();
618
619 for (const beans::Property& rProperty : aProperties)
620 {
621 if (rProperty.Name.startsWith("Company"))
622 // We have explicit markup in RTF for this property.
623 continue;
624
625 // Property name.
628 msfilter::rtfutil::OutString(rProperty.Name, m_eDefaultEncoding).getStr());
629 Strm().WriteChar('}');
630
631 // Property value.
632 OUString aValue;
633 double fValue;
634 bool bValue;
635 util::DateTime aDate;
636 uno::Any aAny = xPropertySet->getPropertyValue(rProperty.Name);
637 if (aAny >>= bValue)
638 {
640 WriteUserPropValue(OUString::number(static_cast<int>(bValue)));
641 }
642 else if (aAny >>= aValue)
643 {
645 WriteUserPropValue(aValue);
646 }
647 else if (aAny >>= fValue)
648 {
649 aValue = OUString::number(fValue);
650 if (aValue.indexOf('.') == -1)
651 {
652 // Integer.
654 WriteUserPropValue(aValue);
655 }
656 else
657 {
658 // Real number.
660 WriteUserPropValue(aValue);
661 }
662 }
663 else if (aAny >>= aDate)
664 {
666 // Format is 'YYYY. MM. DD.'.
667 aValue += OUString::number(aDate.Year) + ". ";
668 if (aDate.Month < 10)
669 aValue += "0";
670 aValue += OUString::number(aDate.Month) + ". ";
671 if (aDate.Day < 10)
672 aValue += "0";
673 aValue += OUString::number(aDate.Day) + ".";
674 WriteUserPropValue(aValue);
675 }
676 }
677 }
678 }
679
680 Strm().WriteChar('}');
681}
682
684{
685 SwDocShell* pDocShell(m_rDoc.GetDocShell());
686 if (!pDocShell)
687 return;
688
689 uno::Reference<text::XTextFieldsSupplier> xModel(pDocShell->GetModel(), uno::UNO_QUERY);
690 uno::Reference<container::XNameAccess> xTextFieldMasters = xModel->getTextFieldMasters();
691 uno::Sequence<rtl::OUString> aMasterNames = xTextFieldMasters->getElementNames();
692 if (!aMasterNames.hasElements())
693 {
694 return;
695 }
696
697 // Only write docVars if there will be at least a single docVar.
698 constexpr OUStringLiteral aPrefix(u"com.sun.star.text.fieldmaster.User.");
699 for (const auto& rMasterName : std::as_const(aMasterNames))
700 {
701 if (!rMasterName.startsWith(aPrefix))
702 {
703 // Not a user field.
704 continue;
705 }
706
707 uno::Reference<beans::XPropertySet> xField;
708 xTextFieldMasters->getByName(rMasterName) >>= xField;
709 if (!xField.is())
710 {
711 continue;
712 }
713
714 OUString aKey = rMasterName.copy(aPrefix.getLength());
715 OUString aValue;
716 xField->getPropertyValue("Content") >>= aValue;
717
720 Strm().WriteChar(' ');
721
722 Strm().WriteChar('{');
724 Strm().WriteChar('}');
725
726 Strm().WriteChar('{');
728 Strm().WriteChar('}');
729
730 Strm().WriteChar('}');
731 }
732}
733
735{
736 // Write page descriptions (page styles)
737 std::size_t nSize = m_rDoc.GetPageDescCnt();
738 if (!nSize)
739 return;
740
742 m_bOutPageDescs = true;
743 Strm()
744 .WriteChar('{')
747 for (std::size_t n = 0; n < nSize; ++n)
748 {
749 const SwPageDesc& rPageDesc = m_rDoc.GetPageDesc(n);
750
751 Strm()
753 .WriteChar('{')
756 OutULong(static_cast<sal_uLong>(rPageDesc.ReadUseOn()));
757
758 OutPageDescription(rPageDesc, false);
759
760 // search for the next page description
761 std::size_t i = nSize;
762 while (i)
763 if (rPageDesc.GetFollow() == &m_rDoc.GetPageDesc(--i))
764 break;
766 OutULong(i).WriteChar(' ');
767 Strm()
770 .WriteCharPtr(";}");
771 }
773 m_bOutPageDescs = false;
774
775 // reset table infos, otherwise the depth of the cells will be incorrect,
776 // in case the page style (header or footer) had tables
777 m_pTableInfo = std::make_shared<ww8::WW8TableInfo>();
778}
779
781{
782 // Make the header
783 Strm()
784 .WriteChar('{')
786 .WriteChar('1')
790 // If this not exist, MS don't understand our ansi characters (0x80-0xff).
791 Strm().WriteCharPtr("\\adeflang1025");
792
793 // Font table
794 WriteFonts();
795
796 m_pStyles = std::make_unique<MSWordStyles>(*this);
797 // Color and stylesheet table
798 WriteStyles();
799
800 // List table
803
804 WriteRevTab();
805
806 WriteInfo();
808 WriteDocVars();
809
810 // Default TabSize
812 m_pAttrOutput->GetTabStop().setLength(0);
813
814 // Automatic hyphenation: it's a global setting in Word, it's a paragraph setting in Writer.
815 // Set it's value to "auto" and disable on paragraph level, if no hyphenation is used there.
817 OutULong(1);
818
819 // Zoom
821 if (pViewShell && pViewShell->GetViewOptions()->GetZoomType() == SvxZoomType::PERCENT)
822 {
824 OutULong(pViewShell->GetViewOptions()->GetZoom());
825 }
826 // Record changes?
829 // Mirror margins?
832
833 // Gutter at top?
835 {
837 }
838
839 // Init sections
840 m_pSections = std::make_unique<MSWordSections>(*this);
841
842 // Page description
844
845 // Enable form protection by default if needed, as there is no switch to
846 // enable it on a per-section basis. OTOH don't always enable it as it
847 // breaks moving of drawings - so write it only in case there is really a
848 // protected section in the document.
849 for (auto const& pSectionFormat : m_rDoc.GetSections())
850 {
851 if (!pSectionFormat->IsInUndo() && pSectionFormat->GetProtect().IsContentProtected())
852 {
854 break;
855 }
856 }
857
858 // enable form field shading
860
861 // size and empty margins of the page
863 {
864 // Seeking the first SwFormatPageDesc. If no set, the default is valid
865 const SwFormatPageDesc* pSttPgDsc = nullptr;
866 {
867 const SwNode& rSttNd
869 const SfxItemSet* pSet = nullptr;
870
871 if (rSttNd.IsContentNode())
872 pSet = &rSttNd.GetContentNode()->GetSwAttrSet();
873 else if (rSttNd.IsTableNode())
874 pSet = &rSttNd.GetTableNode()->GetTable().GetFrameFormat()->GetAttrSet();
875
876 else if (rSttNd.IsSectionNode())
877 pSet = &rSttNd.GetSectionNode()->GetSection().GetFormat()->GetAttrSet();
878
879 if (pSet)
880 {
881 std::size_t nPosInDoc;
882 pSttPgDsc = &pSet->Get(RES_PAGEDESC);
883 if (!pSttPgDsc->GetPageDesc())
884 pSttPgDsc = nullptr;
885 else if (m_rDoc.FindPageDesc(pSttPgDsc->GetPageDesc()->GetName(), &nPosInDoc))
886 {
887 Strm()
888 .WriteChar('{')
891 OutULong(nPosInDoc).WriteChar('}');
892 }
893 }
894 }
895 const SwPageDesc& rPageDesc = pSttPgDsc ? *pSttPgDsc->GetPageDesc() : m_rDoc.GetPageDesc(0);
896 const SwFrameFormat& rFormatPage = rPageDesc.GetMaster();
897
898 {
899 if (rPageDesc.GetLandscape())
901
902 const SwFormatFrameSize& rSz = rFormatPage.GetFrameSize();
903 // Clipboard document is always created without a printer, then
904 // the size will be always LONG_MAX! Solution then is to use A4
905 if (LONG_MAX == rSz.GetHeight() || LONG_MAX == rSz.GetWidth())
906 {
910 OutULong(a4.Width());
911 }
912 else
913 {
916 OutULong(rSz.GetWidth());
917 }
918 }
919
920 {
921 const SvxLRSpaceItem& rLR = rFormatPage.GetLRSpace();
924 OutLong(rLR.GetRight());
925 }
926
927 {
928 const SvxULSpaceItem& rUL = rFormatPage.GetULSpace();
931 OutLong(rUL.GetLower());
932 }
933
934 Strm()
937 m_pAttrOutput->SectFootnoteEndnotePr();
938 // All sections are unlocked by default
940 OutLong(1);
941 OutPageDescription(rPageDesc, true); // Changed bCheckForFirstPage to true so headers
942 // following title page are correctly added - i13107
943 if (pSttPgDsc)
944 {
945 m_pCurrentPageDesc = &rPageDesc;
946 }
947 }
948
949 // line numbering
950 const SwLineNumberInfo& rLnNumInfo = m_rDoc.GetLineNumberInfo();
951 if (rLnNumInfo.IsPaintLineNumbers())
952 {
953 sal_uLong nLnNumRestartNo = 0;
954 if (const WW8_SepInfo* pSectionInfo = m_pSections->CurrentSectionInfo())
955 nLnNumRestartNo = pSectionInfo->nLnNumRestartNo;
956
957 AttrOutput().SectionLineNumbering(nLnNumRestartNo, rLnNumInfo);
958 }
959
960 {
961 // write the footnotes and endnotes-out Info
962 const SwFootnoteInfo& rFootnoteInfo = m_rDoc.GetFootnoteInfo();
963
964 const char* pOut = FTNPOS_CHAPTER == rFootnoteInfo.m_ePos ? OOO_STRING_SVTOOLS_RTF_ENDDOC
967 OutLong(rFootnoteInfo.m_nFootnoteOffset + 1);
968
969 switch (rFootnoteInfo.m_eNum)
970 {
971 case FTNNUM_PAGE:
973 break;
974 case FTNNUM_DOC:
976 break;
977 default:
979 break;
980 }
982
983 switch (rFootnoteInfo.m_aFormat.GetNumberingType())
984 {
988 break;
992 break;
995 break;
998 break;
1001 break;
1002 default:
1004 break;
1005 }
1007
1008 const SwEndNoteInfo& rEndNoteInfo = m_rDoc.GetEndNoteInfo();
1009
1010 Strm()
1014 OutLong(rEndNoteInfo.m_nFootnoteOffset + 1);
1015
1016 switch (rEndNoteInfo.m_aFormat.GetNumberingType())
1017 {
1021 break;
1025 break;
1028 break;
1031 break;
1034 break;
1035 default:
1037 break;
1038 }
1040 }
1041
1043 // RTF default is true, so write compat flag if this should be false.
1045
1047
1049
1050 WriteMainText();
1051
1052 Strm().WriteChar('}');
1053
1054 return ERRCODE_NONE;
1055}
1056
1058 const SwFormatPageDesc* pNewPgDescFormat,
1059 const SwPageDesc* pNewPgDesc, bool bExtraPageBreak)
1060{
1061 const SwSectionFormat* pFormat = GetSectionFormat(rNd);
1062 const sal_uLong nLnNm = GetSectionLineNo(pSet, rNd);
1063
1064 OSL_ENSURE(pNewPgDescFormat || pNewPgDesc, "Neither page desc format nor page desc provided.");
1065
1066 if (pNewPgDescFormat)
1067 m_pSections->AppendSection(*pNewPgDescFormat, rNd, pFormat, nLnNm);
1068 else if (pNewPgDesc)
1069 m_pSections->AppendSection(pNewPgDesc, rNd, pFormat, nLnNm);
1070
1071 // Don't insert a page break, when we're changing page style just because the next page has to be a different one.
1072 if (!m_pAttrOutput->GetPrevPageDesc()
1073 || m_pAttrOutput->GetPrevPageDesc()->GetFollow() != pNewPgDesc)
1074 AttrOutput().SectionBreak(msword::PageBreak, false, m_pSections->CurrentSectionInfo(),
1075 bExtraPageBreak);
1076}
1077
1079{
1080 bool bRet(false);
1081
1082 if (SfxItemState::SET != rFormat.GetItemState(RES_PARATR_NUMRULE, false))
1083 {
1084 if (const SwFormat* pParent = rFormat.DerivedFrom())
1085 {
1086 if (static_cast<const SwTextFormatColl*>(pParent)
1087 ->IsAssignedToListLevelOfOutlineStyle())
1088 {
1089 // Level 9 disables the outline
1091
1092 bRet = true;
1093 }
1094 }
1095 }
1096
1097 return bRet;
1098}
1099
1101{
1102 if (TXT_MAINTEXT == m_nTextTyp && rEndNode.StartOfSectionNode()->IsTableNode())
1103 // End node of a table: see if a section break should be written after the table.
1104 AttrOutput().SectionBreaks(rEndNode);
1105}
1106
1107void RtfExport::OutputGrfNode(const SwGrfNode& /*rGrfNode*/)
1108{
1109 /* noop, see RtfAttributeOutput::FlyFrameGraphic */
1110}
1111
1112void RtfExport::OutputOLENode(const SwOLENode& /*rOLENode*/)
1113{
1114 /* noop, see RtfAttributeOutput::FlyFrameOLE */
1115}
1116
1117void RtfExport::OutputLinkedOLE(const OUString& /*rLinked*/) {}
1118
1120{
1121 m_nCurrentNodeIndex = rNode.GetIndex();
1122 if (!m_bOutOutlineOnly || rNode.IsOutline())
1125}
1126
1127void RtfExport::AppendSection(const SwPageDesc* pPageDesc, const SwSectionFormat* pFormat,
1128 sal_uLong nLnNum)
1129{
1130 m_pSections->AppendSection(pPageDesc, pFormat, nLnNum);
1131 AttrOutput().SectionBreak(msword::PageBreak, false, m_pSections->CurrentSectionInfo());
1132}
1133
1135 std::shared_ptr<SwUnoCursor>& pCurrentPam, SwPaM& rOriginalPam,
1136 Writer* pWriter, bool bOutOutlineOnly)
1137 : MSWordExportBase(rDocument, pCurrentPam, &rOriginalPam)
1138 , m_pFilter(pFilter)
1139 , m_pWriter(pWriter)
1140 , m_bOutOutlineOnly(bOutOutlineOnly)
1141 , m_eDefaultEncoding(
1142 rtl_getTextEncodingFromWindowsCharset(sw::ms::rtl_TextEncodingToWinCharset(DEF_ENCODING)))
1143 , m_eCurrentEncoding(m_eDefaultEncoding)
1144 , m_bRTFFlySyntax(false)
1145 , m_nCurrentNodeIndex(0)
1146{
1147 m_bExportModeRTF = true;
1148 // the attribute output for the document
1149 m_pAttrOutput = std::make_unique<RtfAttributeOutput>(*this);
1150 // that just causes problems for RTF
1151 m_bSubstituteBullets = false;
1152 // needed to have a complete font table
1154 // the related SdrExport
1155 m_pSdrExport = std::make_unique<RtfSdrExport>(*this);
1156
1157 if (!m_pWriter)
1159}
1160
1161RtfExport::~RtfExport() = default;
1162
1164{
1165 if (m_pStream)
1166 return *m_pStream;
1167
1168 return m_pWriter->Strm();
1169}
1170
1171void RtfExport::setStream() { m_pStream = std::make_unique<SvMemoryStream>(); }
1172
1174{
1175 OString aRet;
1176
1177 if (m_pStream)
1178 aRet = OString(static_cast<const char*>(m_pStream->GetData()), m_pStream->Tell());
1179
1180 return aRet;
1181}
1182
1184
1186
1188
1189void RtfExport::OutUnicode(const char* pToken, const OUString& rContent, bool bUpr)
1190{
1191 if (rContent.isEmpty())
1192 return;
1193
1194 if (!bUpr)
1195 {
1196 Strm().WriteChar('{').WriteCharPtr(pToken).WriteChar(' ');
1198 Strm().WriteChar('}');
1199 }
1200 else
1202 msfilter::rtfutil::OutStringUpr(pToken, rContent, m_eCurrentEncoding).getStr());
1203}
1204
1205void RtfExport::OutDateTime(const char* pStr, const util::DateTime& rDT)
1206{
1212 OutULong(rDT.Minutes).WriteChar('}');
1213}
1214
1215sal_uInt16 RtfExport::GetColor(const Color& rColor) const
1216{
1217 for (const auto& rEntry : m_aColTable)
1218 if (rEntry.second == rColor)
1219 {
1220 SAL_INFO("sw.rtf", __func__ << " returning " << rEntry.first << " (" << rColor.GetRed()
1221 << "," << rColor.GetGreen() << "," << rColor.GetBlue()
1222 << ")");
1223 return rEntry.first;
1224 }
1225 OSL_FAIL("No such Color in m_aColTable!");
1226 return 0;
1227}
1228
1230{
1231 sal_uInt16 n;
1232 bool bAutoColorInTable = false;
1233 for (const auto& rEntry : m_aColTable)
1234 {
1235 if (rEntry.second == rCol)
1236 return; // Already in the table
1237 if (rEntry.second == COL_AUTO)
1238 bAutoColorInTable = true;
1239 }
1240 if (rCol == COL_AUTO)
1241 // COL_AUTO gets value 0
1242 n = 0;
1243 else
1244 {
1245 // other colors get values >0
1246 n = m_aColTable.size();
1247 if (!bAutoColorInTable)
1248 // reserve value "0" for COL_AUTO (if COL_AUTO wasn't inserted until now)
1249 n++;
1250 }
1251 m_aColTable.insert(std::pair<sal_uInt16, Color>(n, rCol));
1252}
1253
1255{
1256 const editeng::SvxBorderLine* pLine = nullptr;
1257
1258 if (rBox.GetTop())
1259 {
1260 pLine = rBox.GetTop();
1261 InsColor(pLine->GetColor());
1262 }
1263 if (rBox.GetBottom() && pLine != rBox.GetBottom())
1264 {
1265 pLine = rBox.GetBottom();
1266 InsColor(pLine->GetColor());
1267 }
1268 if (rBox.GetLeft() && pLine != rBox.GetLeft())
1269 {
1270 pLine = rBox.GetLeft();
1271 InsColor(pLine->GetColor());
1272 }
1273 if (rBox.GetRight() && pLine != rBox.GetRight())
1274 InsColor(rBox.GetRight()->GetColor());
1275}
1276
1278{
1279 // Build the table from rPool since the colors provided to
1280 // RtfAttributeOutput callbacks are too late.
1281 const SfxItemPool& rPool = m_rDoc.GetAttrPool();
1282
1283 // MSO Word uses a default color table with 16 colors (which is used e.g. for highlighting)
1300
1301 // char color
1302 {
1303 auto pCol = GetDfltAttr(RES_CHRATR_COLOR);
1304 InsColor(pCol->GetValue());
1306 if (pCol)
1307 InsColor(pCol->GetValue());
1308 for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_CHRATR_COLOR))
1309 {
1310 pCol = dynamic_cast<const SvxColorItem*>(pItem);
1311 if (pCol)
1312 InsColor(pCol->GetValue());
1313 }
1314
1315 auto pUnder = GetDfltAttr(RES_CHRATR_UNDERLINE);
1316 InsColor(pUnder->GetColor());
1317 for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_CHRATR_UNDERLINE))
1318 {
1319 pUnder = dynamic_cast<const SvxUnderlineItem*>(pItem);
1320 if (pUnder)
1321 InsColor(pUnder->GetColor());
1322 }
1323
1324 auto pOver = GetDfltAttr(RES_CHRATR_OVERLINE);
1325 InsColor(pOver->GetColor());
1326 for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_CHRATR_OVERLINE))
1327 {
1328 pOver = dynamic_cast<const SvxOverlineItem*>(pItem);
1329 if (pOver)
1330 InsColor(pOver->GetColor());
1331 }
1332 }
1333
1334 // background color
1335 static const sal_uInt16 aBrushIds[] = { RES_BACKGROUND, RES_CHRATR_BACKGROUND, 0 };
1336
1337 for (const sal_uInt16* pIds = aBrushIds; *pIds; ++pIds)
1338 {
1339 auto pBackground = static_cast<const SvxBrushItem*>(GetDfltAttr(*pIds));
1340 InsColor(pBackground->GetColor());
1341 pBackground = static_cast<const SvxBrushItem*>(rPool.GetPoolDefaultItem(*pIds));
1342 if (pBackground)
1343 {
1344 InsColor(pBackground->GetColor());
1345 }
1346 for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(*pIds))
1347 {
1348 pBackground = static_cast<const SvxBrushItem*>(pItem);
1349 if (pBackground)
1350 {
1351 InsColor(pBackground->GetColor());
1352 }
1353 }
1354 }
1355
1356 // shadow color
1357 {
1358 auto pShadow = GetDfltAttr(RES_SHADOW);
1359 InsColor(pShadow->GetColor());
1360 pShadow = rPool.GetPoolDefaultItem(RES_SHADOW);
1361 if (nullptr != pShadow)
1362 {
1363 InsColor(pShadow->GetColor());
1364 }
1365 for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_SHADOW))
1366 {
1367 pShadow = dynamic_cast<const SvxShadowItem*>(pItem);
1368 if (pShadow)
1369 {
1370 InsColor(pShadow->GetColor());
1371 }
1372 }
1373 }
1374
1375 // frame border color
1376 {
1377 const SvxBoxItem* pBox = rPool.GetPoolDefaultItem(RES_BOX);
1378 if (nullptr != pBox)
1379 InsColorLine(*pBox);
1380 for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_BOX))
1381 {
1382 pBox = dynamic_cast<const SvxBoxItem*>(pItem);
1383 if (pBox)
1384 InsColorLine(*pBox);
1385 }
1386 }
1387
1388 {
1389 const SvxBoxItem* pCharBox = rPool.GetPoolDefaultItem(RES_CHRATR_BOX);
1390 if (pCharBox)
1391 InsColorLine(*pCharBox);
1392 for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_CHRATR_BOX))
1393 {
1394 pCharBox = dynamic_cast<const SvxBoxItem*>(pItem);
1395 if (pCharBox)
1396 InsColorLine(*pCharBox);
1397 }
1398 }
1399
1400 // TextFrame or paragraph background solid fill.
1401 for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(XATTR_FILLCOLOR))
1402 {
1403 if (auto pColorItem = dynamic_cast<const XFillColorItem*>(pItem))
1404 InsColor(pColorItem->GetColorValue());
1405 }
1406
1407 for (std::size_t n = 0; n < m_aColTable.size(); ++n)
1408 {
1409 const Color& rCol = m_aColTable[n];
1410 if (n || COL_AUTO != rCol)
1411 {
1415 OutULong(rCol.GetBlue());
1416 }
1417 Strm().WriteChar(';');
1418 }
1419}
1420
1421void RtfExport::InsStyle(sal_uInt16 nId, const OString& rStyle)
1422{
1423 m_aStyTable.insert(std::pair<sal_uInt16, OString>(nId, rStyle));
1424}
1425
1426OString* RtfExport::GetStyle(sal_uInt16 nId)
1427{
1428 auto it = m_aStyTable.find(nId);
1429 if (it != m_aStyTable.end())
1430 return &it->second;
1431 return nullptr;
1432}
1433
1434sal_uInt16 RtfExport::GetRedline(const OUString& rAuthor)
1435{
1436 auto it = m_aRedlineTable.find(rAuthor);
1437 if (it != m_aRedlineTable.end())
1438 return it->second;
1439
1440 const sal_uInt16 nId = m_aRedlineTable.size();
1441 m_aRedlineTable.insert(std::pair<OUString, sal_uInt16>(rAuthor, nId));
1442 return nId;
1443}
1444
1445const OUString* RtfExport::GetRedline(sal_uInt16 nId)
1446{
1447 for (const auto& rEntry : m_aRedlineTable)
1448 if (rEntry.second == nId)
1449 return &rEntry.first;
1450 return nullptr;
1451}
1452
1453void RtfExport::OutPageDescription(const SwPageDesc& rPgDsc, bool bCheckForFirstPage)
1454{
1455 SAL_INFO("sw.rtf", __func__ << " start");
1456 const SwPageDesc* pSave = m_pCurrentPageDesc;
1457
1458 m_pCurrentPageDesc = &rPgDsc;
1459 if (bCheckForFirstPage && m_pCurrentPageDesc->GetFollow()
1462
1465
1466 const SwFormat* pFormat = &m_pCurrentPageDesc->GetMaster(); //GetLeft();
1467 m_bOutPageDescs = true;
1468 if (m_pCurrentPageDesc != &rPgDsc)
1470 OutputFormat(*pFormat, true, false);
1471 m_pFirstPageItemSet = nullptr;
1472 m_bOutPageDescs = false;
1473
1474 // normal header / footer (without a style)
1475 const SfxPoolItem* pItem;
1477 == SfxItemState::SET)
1478 WriteHeaderFooter(*pItem, true);
1480 == SfxItemState::SET)
1481 WriteHeaderFooter(*pItem, false);
1482
1483 // title page
1484 if (m_pCurrentPageDesc != &rPgDsc)
1485 {
1487 m_pCurrentPageDesc = &rPgDsc;
1489 == SfxItemState::SET)
1490 WriteHeaderFooter(*pItem, true);
1492 == SfxItemState::SET)
1493 WriteHeaderFooter(*pItem, false);
1494 }
1495
1496 // numbering type
1498 std::nullopt);
1499
1500 m_pCurrentPageDesc = pSave;
1501 SAL_INFO("sw.rtf", __func__ << " end");
1502}
1503
1504void RtfExport::WriteHeaderFooter(const SfxPoolItem& rItem, bool bHeader)
1505{
1506 if (bHeader)
1507 {
1508 const auto& rHeader = static_cast<const SwFormatHeader&>(rItem);
1509 if (!rHeader.IsActive())
1510 return;
1511 }
1512 else
1513 {
1514 const auto& rFooter = static_cast<const SwFormatFooter&>(rItem);
1515 if (!rFooter.IsActive())
1516 return;
1517 }
1518
1519 SAL_INFO("sw.rtf", __func__ << " start");
1520
1521 const char* pStr = (bHeader ? OOO_STRING_SVTOOLS_RTF_HEADER : OOO_STRING_SVTOOLS_RTF_FOOTER);
1522 /* is this a title page? */
1524 {
1527 }
1528 Strm().WriteChar('{').WriteCharPtr(pStr);
1530 Strm().WriteChar('}');
1531
1532 SAL_INFO("sw.rtf", __func__ << " end");
1533}
1534
1535void RtfExport::WriteHeaderFooter(const SwFrameFormat& rFormat, bool bHeader, const char* pStr,
1536 bool bTitlepg)
1537{
1538 SAL_INFO("sw.rtf", __func__ << " start");
1539
1540 m_pAttrOutput->WriteHeaderFooter_Impl(rFormat, bHeader, pStr, bTitlepg);
1541
1542 SAL_INFO("sw.rtf", __func__ << " end");
1543}
1544
1545namespace
1546{
1548class SwRTFWriter : public Writer
1549{
1550private:
1551 bool m_bOutOutlineOnly;
1552
1553public:
1554 SwRTFWriter(std::u16string_view rFilterName, const OUString& rBaseURL);
1555
1556 ErrCode WriteStream() override;
1557};
1558}
1559
1560SwRTFWriter::SwRTFWriter(std::u16string_view rFilterName, const OUString& rBaseURL)
1561{
1562 SetBaseURL(rBaseURL);
1563 // export outline nodes, only (send outline to clipboard/presentation)
1564 m_bOutOutlineOnly = o3tl::starts_with(rFilterName, u"O");
1565}
1566
1567ErrCode SwRTFWriter::WriteStream()
1568{
1569 std::shared_ptr<SwUnoCursor> pCurPam(m_pDoc->CreateUnoCursor(*m_pCurrentPam->End(), false));
1570 pCurPam->SetMark();
1571 *pCurPam->GetPoint() = *m_pCurrentPam->Start();
1572 RtfExport aExport(nullptr, *m_pDoc, pCurPam, *m_pCurrentPam, this, m_bOutOutlineOnly);
1573 aExport.ExportDocument(true);
1574 return ERRCODE_NONE;
1575}
1576
1577extern "C" SAL_DLLPUBLIC_EXPORT void ExportRTF(std::u16string_view rFltName,
1578 const OUString& rBaseURL, WriterRef& xRet)
1579{
1580 xRet = new SwRTFWriter(rFltName, rBaseURL);
1581}
1582
1583/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ On
RedlineFlags on.
PropertiesInfo aProperties
virtual void SectionPageNumbering(sal_uInt16 nNumType, const ::std::optional< sal_uInt16 > &oPageRestartNumber)=0
The style of the page numbers.
virtual void SectionLineNumbering(sal_uLong nRestartNo, const SwLineNumberInfo &rLnNumInfo)=0
Numbering of the lines in the document.
virtual void SectionBreaks(const SwNode &rNode)=0
Called in order to output section breaks.
virtual void SectionBreak(sal_uInt8 nC, bool bBreakAfter, const WW8_SepInfo *pSectionInfo=nullptr, bool bExtraPageBreak=false)=0
Write a section break msword::ColumnBreak or msword::PageBreak bBreakAfter: the break must be schedul...
sal_uInt8 GetBlue() const
sal_uInt8 GetRed() const
sal_uInt8 GetGreen() const
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual const SwRedlineTable & GetRedlineTable() const =0
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
Base class for WW8Export and DocxExport.
Definition: wrtww8.hxx:451
bool m_bExportModeRTF
Definition: wrtww8.hxx:571
void WriteText()
Iterate through the nodes and call the appropriate OutputNode() on them.
Definition: wrtww8.cxx:2785
sal_uInt8 m_nTextTyp
Definition: wrtww8.hxx:549
void WriteHeaderFooterText(const SwFormat &rFormat, bool bHeader)
Write header/footer text.
Definition: wrtw8sty.cxx:2074
int CollectGrfsOfBullets()
Populates m_vecBulletPic with all the bullet graphics used by numberings.
Definition: wrtww8.cxx:1522
RedlineFlags m_nOrigRedlineFlags
Remember the original redline mode.
Definition: wrtww8.hxx:488
std::vector< const Graphic * > m_vecBulletPic
Vector to record all the graphics of bullets.
Definition: wrtww8.hxx:920
std::unique_ptr< SvxBrushItem > getBackground()
Get background color of the document, if there is one.
Definition: wrtww8.cxx:1506
bool m_bSubstituteBullets
Definition: wrtww8.hxx:567
std::unique_ptr< MSWordStyles > m_pStyles
Definition: wrtww8.hxx:503
ww8::WW8TableInfo::Pointer_t m_pTableInfo
Definition: wrtww8.hxx:478
std::vector< ::sw::mark::IMark * > IMarkVector
Used to split the runs according to the bookmarks start and ends.
Definition: wrtww8.hxx:585
wwFontHelper m_aFontHelper
Definition: wrtww8.hxx:453
static sal_uLong GetSectionLineNo(const SfxItemSet *pSet, const SwNode &rNd)
Line number of the section start.
Definition: ww8atr.cxx:668
const SwPageDesc * m_pCurrentPageDesc
Definition: wrtww8.hxx:497
bool GetBookmarks(const SwTextNode &rNd, sal_Int32 nStt, sal_Int32 nEnd, IMarkVector &rArr)
Definition: wrtw8nds.cxx:1941
sal_uInt16 GetNumberingId(const SwNumRule &rNumRule)
Return the numeric id of the numbering rule.
Definition: wrtw8num.cxx:122
bool GetAnnotationMarks(const SwWW8AttrIter &rAttrs, sal_Int32 nStt, sal_Int32 nEnd, IMarkVector &rArr)
Definition: wrtw8nds.cxx:1988
void OutputFormat(const SwFormat &rFormat, bool bPapFormat, bool bChpFormat, bool bFlyFormat=false)
Output attributes.
Definition: ww8atr.cxx:835
virtual void OutputTextNode(SwTextNode &)
Output SwTextNode.
Definition: wrtw8nds.cxx:2226
std::unique_ptr< SwNumRuleTable > m_pUsedNumTable
Definition: wrtww8.hxx:460
bool m_bOutPageDescs
PageDescs (section properties) are being written.
Definition: wrtww8.hxx:555
std::shared_ptr< SwUnoCursor > & m_pCurPam
Definition: wrtww8.hxx:578
static const SwSectionFormat * GetSectionFormat(const SwNode &rNd)
Format of the section.
Definition: ww8atr.cxx:655
void AbstractNumberingDefinitions()
Write all Levels for all SwNumRules - LVLF.
Definition: wrtw8num.cxx:383
void BulletDefinitions()
Write the numbering picture bullets.
Definition: wrtww8.cxx:1563
void NumberingDefinitions()
Write static data of SwNumRule - LSTF.
Definition: wrtw8num.cxx:210
SwDoc & m_rDoc
Definition: wrtww8.hxx:576
Class to collect and output the sections/headers/footers.
Definition: wrtww8.hxx:196
The physical access to the RTF document (for writing).
Writer & GetWriter()
The class that does all the actual RTF export-related work.
Definition: rtfexport.hxx:37
void WriteNumbering() override
Write the numbering table.
Definition: rtfexport.cxx:225
sal_uInt16 GetColor(const Color &rColor) const
Definition: rtfexport.cxx:1215
void OutputGrfNode(const SwGrfNode &rGrfNode) override
Output SwGrfNode.
Definition: rtfexport.cxx:1107
void WriteStyles()
Definition: rtfexport.cxx:449
SwNodeOffset m_nCurrentNodeIndex
Index of the current SwTextNode, if any.
Definition: rtfexport.hxx:170
void WriteRevTab()
Write the revision table.
Definition: rtfexport.cxx:257
void OutputEndNode(const SwEndNode &rEndNode) override
Output SwEndNode.
Definition: rtfexport.cxx:1100
std::unique_ptr< MSWordSections > m_pSections
Sections/headers/footers.
Definition: rtfexport.hxx:46
std::unique_ptr< RtfAttributeOutput > m_pAttrOutput
Attribute output for document.
Definition: rtfexport.hxx:43
bool m_bOutOutlineOnly
Definition: rtfexport.hxx:49
void WriteFormData(const ::sw::mark::IFieldmark &rFieldmark) override
Write the data of the form field.
Definition: rtfexport.cxx:323
void WriteHeaderFooter(const SfxPoolItem &rItem, bool bHeader)
Definition: rtfexport.cxx:1504
RtfColorTable m_aColTable
Definition: rtfexport.hxx:229
Writer * m_pWriter
Definition: rtfexport.hxx:40
void WriteChar(sal_Unicode c) override
Definition: rtfexport.cxx:184
void setStream()
From now on, let Strm() return a memory stream, not a real one.
Definition: rtfexport.cxx:1171
std::map< OUString, sal_uInt16 > m_aRedlineTable
Definition: rtfexport.hxx:231
std::unique_ptr< RtfSdrExport > m_pSdrExport
Definition: rtfexport.hxx:48
void OutPageDescription(const SwPageDesc &rPgDsc, bool bCheckForFirstPage)
Definition: rtfexport.cxx:1453
const SfxItemSet * m_pFirstPageItemSet
Item set of the first page during export of a follow page format.
Definition: rtfexport.hxx:235
SvStream & OutLong(tools::Long nVal)
Definition: rtfexport.cxx:1187
void OutputOLENode(const SwOLENode &rOLENode) override
Output SwOLENode.
Definition: rtfexport.cxx:1112
RtfExport(RtfExportFilter *pFilter, SwDoc &rDocument, std::shared_ptr< SwUnoCursor > &pCurrentPam, SwPaM &rOriginalPam, Writer *pWriter, bool bOutOutlineOnly=false)
Pass the pDocument, pCurrentPam and pOriginalPam to the base class.
Definition: rtfexport.cxx:1134
MSWordSections & Sections() const override
Access to the sections/headers/footres.
Definition: rtfexport.cxx:82
void AppendAnnotationMarks(const SwWW8AttrIter &rAttrs, sal_Int32 nCurrentPos, sal_Int32 nLen) override
Definition: rtfexport.cxx:153
void WriteHeadersFooters(sal_uInt8 nHeadFootFlags, const SwFrameFormat &rFormat, const SwFrameFormat &rLeftHeaderFormat, const SwFrameFormat &rLeftFooterFormat, const SwFrameFormat &rFirstPageFormat, sal_uInt8 nBreakCode, bool bEvenAndOddHeaders) override
Output the actual headers and footers.
Definition: rtfexport.cxx:290
std::unique_ptr< SvMemoryStream > m_pStream
If set, then Strm() returns this stream, instead of m_pWriter's stream.
Definition: rtfexport.hxx:233
void OutputTextNode(SwTextNode &rNode) override
Output SwTextNode is depending on outline export mode.
Definition: rtfexport.cxx:1119
void InsColorLine(const SvxBoxItem &rBox)
Definition: rtfexport.cxx:1254
void AppendBookmark(const OUString &rName) override
Definition: rtfexport.cxx:145
void WriteUserPropType(int nType)
Writes a single user property type.
Definition: rtfexport.cxx:574
void AppendBookmarks(const SwTextNode &rNode, sal_Int32 nCurrentPos, sal_Int32 nLen, const SwRedlineData *pSwRedlineData=nullptr) override
Definition: rtfexport.cxx:120
void OutUnicode(const char *pToken, const OUString &rContent, bool bUpr=false)
Definition: rtfexport.cxx:1189
OString getStream()
Get the contents of the memory stream as a string.
Definition: rtfexport.cxx:1173
void WriteFonts()
Definition: rtfexport.cxx:439
void OutColorTable()
Definition: rtfexport.cxx:1277
void WriteInfo()
Definition: rtfexport.cxx:516
void WriteUserProps()
Writes the userprops group: user defined document properties.
Definition: rtfexport.cxx:587
rtl_TextEncoding m_eCurrentEncoding
Definition: rtfexport.hxx:166
AttributeOutputBase & AttrOutput() const override
Access to the attribute output class.
Definition: rtfexport.cxx:80
void WriteUserPropValue(const OUString &rValue)
Writes a single user property value.
Definition: rtfexport.cxx:580
void DoFormText(const SwInputField *pField) override
Definition: rtfexport.cxx:393
void OutputField(const SwField *pField, ww::eField eFieldType, const OUString &rFieldCmd, FieldFlags nMode=FieldFlags::All) override
Write the field.
Definition: rtfexport.cxx:317
void OutDateTime(const char *pStr, const css::util::DateTime &rDT)
Definition: rtfexport.cxx:1205
SvStream & Strm()
Definition: rtfexport.cxx:1163
void BuildNumbering()
This is necessary to have the numbering table ready before the main text is being processed.
Definition: rtfexport.cxx:206
ErrCode ExportDocument_Impl() override
Format-dependent part of the actual export.
Definition: rtfexport.cxx:780
void PrepareNewPageDesc(const SfxItemSet *pSet, const SwNode &rNd, const SwFormatPageDesc *pNewPgDescFormat, const SwPageDesc *pNewPgDesc, bool bExtraPageBreak=false) override
Get ready for a new section.
Definition: rtfexport.cxx:1057
void OutputLinkedOLE(const OUString &rLink) override
Definition: rtfexport.cxx:1117
void AppendSection(const SwPageDesc *pPageDesc, const SwSectionFormat *pFormat, sal_uLong nLnNum) override
Definition: rtfexport.cxx:1127
sal_uInt16 GetRedline(const OUString &rAuthor)
Definition: rtfexport.cxx:1434
SvStream & OutULong(sal_uLong nVal)
Definition: rtfexport.cxx:1185
bool DisallowInheritingOutlineNumbering(const SwFormat &rFormat) override
Return value indicates if an inherited outline numbering is suppressed.
Definition: rtfexport.cxx:1078
void resetStream()
Return back to the real stream.
Definition: rtfexport.cxx:1183
void WritePageDescTable()
Writes the writer-specific \pgdsctbl group.
Definition: rtfexport.cxx:734
void DoComboBox(const OUString &rName, const OUString &rHelp, const OUString &ToolTip, const OUString &rSelected, const css::uno::Sequence< OUString > &rListItems) override
Definition: rtfexport.cxx:386
void WriteFootnoteSettings()
Definition: rtfexport.cxx:456
RtfSdrExport & SdrExporter() const
Access to the Rtf Sdr exporter.
Definition: rtfexport.cxx:84
void InsColor(const Color &rCol)
Definition: rtfexport.cxx:1229
void ExportGrfBullet(const SwTextNode &rNd) override
Definition: rtfexport.cxx:179
~RtfExport() override
Destructor.
RtfExportFilter * m_pFilter
Pointer to the filter that owns us.
Definition: rtfexport.hxx:39
std::map< sal_uInt16, OString > m_aStyTable
Definition: rtfexport.hxx:230
bool CollapseScriptsforWordOk(sal_uInt16 nScript, sal_uInt16 nWhich) override
Guess the script (asian/western).
Definition: rtfexport.cxx:86
void WriteHyperlinkData(const ::sw::mark::IFieldmark &rFieldmark) override
Definition: rtfexport.cxx:381
void WriteMainText()
Definition: rtfexport.cxx:471
void WriteDocVars()
Writes document variables.
Definition: rtfexport.cxx:683
OString * GetStyle(sal_uInt16 nId)
Definition: rtfexport.cxx:1426
sal_uInt64 ReplaceCr(sal_uInt8 nChar) override
Definition: rtfexport.cxx:431
void InsStyle(sal_uInt16 nId, const OString &rStyle)
Definition: rtfexport.cxx:1421
rtl_TextEncoding m_eDefaultEncoding
Definition: rtfexport.hxx:165
Handles export of drawings using RTF markup.
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
const SfxPoolItem * GetPoolDefaultItem(sal_uInt16 nWhich) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
css::uno::Reference< css::frame::XModel3 > GetModel() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
SvStream & WriteInt32(sal_Int32 nInt32)
SvStream & WriteOString(std::string_view rStr)
SvStream & WriteChar(char nChar)
SvStream & WriteCharPtr(const char *pBuf)
const editeng::SvxBorderLine * GetTop() const
const editeng::SvxBorderLine * GetRight() const
const editeng::SvxBorderLine * GetLeft() const
const editeng::SvxBorderLine * GetBottom() const
tools::Long GetRight() const
tools::Long GetLeft() const
const OUString & GetPrefix() const
const OUString & GetSuffix() const
SvxNumType GetNumberingType() const
static Size GetPaperSize(Paper ePaper, MapUnit eUnit=MapUnit::MapTwip)
tools::Long GetHeight() const
tools::Long GetWidth() const
sal_uInt16 GetUpper() const
sal_uInt16 GetLower() const
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:743
Definition: doc.hxx:192
SwPageDesc * FindPageDesc(const OUString &rName, size_t *pPos=nullptr) const
Definition: docdesc.cxx:947
SwSectionFormats & GetSections()
Definition: doc.hxx:1341
const SwFootnoteInfo & GetFootnoteInfo() const
Definition: doc.hxx:634
bool IsUsed(const sw::BroadcastingModify &) const
Definition: poolfmt.cxx:86
size_t GetPageDescCnt() const
Definition: doc.hxx:884
const SwNumRuleTable & GetNumRuleTable() const
Definition: doc.hxx:1070
SwNumRule * GetOutlineNumRule() const
Definition: doc.hxx:1028
const SwLineNumberInfo & GetLineNumberInfo() const
Definition: lineinfo.cxx:49
SwNodes & GetNodes()
Definition: doc.hxx:413
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:336
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:406
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:177
const SwEndNoteInfo & GetEndNoteInfo() const
Definition: doc.hxx:636
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1322
::sw::MetaFieldManager & GetMetaFieldManager()
Definition: doc.cxx:129
SwDocShell * GetDocShell()
Definition: doc.hxx:1355
const SwPageDesc & GetPageDesc(const size_t i) const
Definition: doc.hxx:885
Ends a section of nodes in the document model.
Definition: node.hxx:355
sal_uInt16 m_nFootnoteOffset
Definition: ftninfo.hxx:47
SvxNumberType m_aFormat
Definition: ftninfo.hxx:46
Base class of all fields.
Definition: fldbas.hxx:292
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
Definition: fldbas.cxx:484
SwFootnoteNum m_eNum
Definition: ftninfo.hxx:98
SwFootnotePos m_ePos
Definition: ftninfo.hxx:97
Footer, for pageformats Client of FrameFormat describing the footer.
Definition: fmthdft.hxx:65
Header, for PageFormats Client of FrameFormat describing the header.
Definition: fmthdft.hxx:34
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:36
SwPageDesc * GetPageDesc()
Definition: fmtpdsc.hxx:61
Base class for various Writer styles.
Definition: format.hxx:47
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:74
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
Definition: format.cxx:385
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:136
SwFormat * DerivedFrom() const
Definition: format.hxx:128
const SvxULSpaceItem & GetULSpace(bool=true) const
Definition: frmatr.hxx:76
Style of a layout element.
Definition: frmfmt.hxx:62
const OUString & GetHelp() const
Definition: expfld.cxx:1418
const OUString & GetToolTip() const
Definition: expfld.cxx:1428
virtual OUString GetPar2() const override
aPromptText
Definition: expfld.cxx:1408
< purpose of derivation from SwClient: character style for displaying the numbers.
Definition: lineinfo.hxx:39
bool IsPaintLineNumbers() const
Definition: lineinfo.hxx:80
Base class of the Writer document model elements.
Definition: node.hxx:84
SwSectionNode * GetSectionNode()
Definition: node.hxx:636
SwNodeOffset GetIndex() const
Definition: node.hxx:296
bool IsContentNode() const
Definition: node.hxx:657
bool IsSectionNode() const
Definition: node.hxx:673
bool IsTableNode() const
Definition: node.hxx:669
const SwStartNode * StartOfSectionNode() const
Definition: node.hxx:137
SwContentNode * GetContentNode()
Definition: node.hxx:644
SwTableNode * GetTableNode()
Definition: node.hxx:628
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:711
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
Definition: ndarr.hxx:163
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:165
const SwNumFormat * GetNumFormat(sal_uInt16 i) const
Definition: number.cxx:97
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:87
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
const OUString & GetName() const
Definition: pagedesc.hxx:196
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:238
const SvxNumberType & GetNumType() const
Definition: pagedesc.hxx:202
bool GetLandscape() const
Definition: pagedesc.hxx:199
SwFrameFormat & GetLeft()
Definition: pagedesc.hxx:239
const SwPageDesc * GetFollow() const
Definition: pagedesc.hxx:267
const SwPageFootnoteInfo & GetFootnoteInfo() const
Definition: pagedesc.hxx:205
UseOnPage ReadUseOn() const
Definition: pagedesc.hxx:236
Footnote information.
Definition: pagedesc.hxx:49
const Fraction & GetWidth() const
Definition: pagedesc.hxx:65
size_type size() const
Definition: docary.hxx:267
const SwSection & GetSection() const
Definition: node.hxx:568
SwSectionFormat * GetFormat()
Definition: section.hxx:337
const SwTable & GetTable() const
Definition: node.hxx:522
SwTableFormat * GetFrameFormat()
Definition: swtable.hxx:204
Represents the style of a paragraph.
Definition: fmtcol.hxx:59
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:89
bool IsOutline() const
Returns if this text node is an outline.
Definition: ndtxt.cxx:4101
size_t size() const
Definition: docary.hxx:87
SvxZoomType GetZoomType() const
Definition: viewopt.hxx:546
sal_uInt16 GetZoom() const
Definition: viewopt.hxx:505
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:436
static SvStream & OutLong(SvStream &rStrm, tools::Long nVal)
Definition: writer.cxx:225
bool m_bWriteOnlyFirstTable
Definition: shellio.hxx:414
SvStream & Strm()
Definition: writer.cxx:214
virtual ErrCode WriteStream()=0
static SvStream & OutULong(SvStream &rStrm, sal_uLong nVal)
Definition: writer.cxx:234
const Color & GetColor() const
knows all meta-fields in the document.
Definition: fmtmeta.hxx:195
const css::uno::Reference< css::document::XDocumentProperties > & getDocumentProperties() const
Definition: fmtatr2.cxx:845
static OUString GetGeneratorString()
sal_uInt16 GetId(const SvxFontItem &rFont)
Definition: wrtw8sty.cxx:906
void WriteFontTable(SvStream *pTableStream, WW8Fib &pFib)
Definition: wrtw8sty.cxx:923
bool m_bLoadAllFonts
If true, all fonts are loaded before processing the document.
Definition: wrtww8.hxx:338
constexpr ::Color COL_LIGHTRED(0xFF, 0x00, 0x00)
constexpr ::Color COL_GRAY(0x80, 0x80, 0x80)
constexpr ::Color COL_GREEN(0x00, 0x80, 0x00)
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_LIGHTCYAN(0x00, 0xFF, 0xFF)
constexpr ::Color COL_MAGENTA(0x80, 0x00, 0x80)
constexpr ::Color COL_LIGHTMAGENTA(0xFF, 0x00, 0xFF)
constexpr ::Color COL_BROWN(0x80, 0x80, 0x00)
constexpr ::Color COL_YELLOW(0xFF, 0xFF, 0x00)
constexpr ::Color COL_RED(0x80, 0x00, 0x00)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
constexpr ::Color COL_LIGHTBLUE(0x00, 0x00, 0xFF)
constexpr ::Color COL_CYAN(0x00, 0x80, 0x80)
constexpr ::Color COL_LIGHTGREEN(0x00, 0xFF, 0x00)
constexpr ::Color COL_BLUE(0x00, 0x00, 0x80)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
#define SAL_NEWLINE_STRING
float u
#define ERRCODE_NONE
@ FTNNUM_PAGE
Definition: ftninfo.hxx:87
@ FTNNUM_DOC
Definition: ftninfo.hxx:87
@ FTNPOS_CHAPTER
Definition: ftninfo.hxx:82
constexpr TypedWhichId< SwFormatHeader > RES_HEADER(96)
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(107)
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(93)
constexpr TypedWhichId< SwFormatFooter > RES_FOOTER(97)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
constexpr TypedWhichId< SvxOverlineItem > RES_CHRATR_OVERLINE(38)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CJK_WEIGHT(26)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CJK_POSTURE(25)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
constexpr TypedWhichId< SvxBoxItem > RES_CHRATR_BOX(40)
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
const SfxPoolItem * GetDfltAttr(sal_uInt16 nWhich)
Get the default attribute from corresponding default attribute table.
Definition: hints.cxx:159
sal_Int64 n
const long LONG_MAX
#define SAL_INFO(area, stream)
const char * sName
int i
OString OutStringUpr(const char *pToken, const OUString &rStr, rtl_TextEncoding eDestEnc)
OString OutString(const OUString &rStr, rtl_TextEncoding eDestEnc, bool bUnicode=true)
const sal_uInt8 PageBreak
const HdFtFlags WW8_HEADER_FIRST
Definition: ww8scan.hxx:1600
const HdFtFlags WW8_FOOTER_ODD
Definition: ww8scan.hxx:1599
const HdFtFlags WW8_FOOTER_EVEN
Definition: ww8scan.hxx:1598
const HdFtFlags WW8_HEADER_EVEN
Definition: ww8scan.hxx:1596
const HdFtFlags WW8_FOOTER_FIRST
Definition: ww8scan.hxx:1601
const HdFtFlags WW8_HEADER_ODD
Definition: ww8scan.hxx:1597
constexpr bool starts_with(std::basic_string_view< charT, traits > sv, std::basic_string_view< charT, traits > x) noexcept
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
sal_uInt8 rtl_TextEncodingToWinCharset(rtl_TextEncoding eTextEncoding)
MSOffice appears to set the charset of unicode fonts to MS 932.
Dialog to specify the properties of date form field.
long Long
sal_uInt32 RGBToBGR(::Color nColour)
Definition: ww8struc.hxx:1088
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
Definition: nodeoffset.hxx:16
constexpr OUStringLiteral ODF_FORMDROPDOWN_RESULT
constexpr OUStringLiteral ODF_FORMDROPDOWN_LISTENTRY
constexpr OUStringLiteral ODF_FORMDROPDOWN
sal_Int16 nId
PAPER_A4
QPRO_FUNC_TYPE nType
SAL_DLLPUBLIC_EXPORT void ExportRTF(std::u16string_view rFltName, const OUString &rBaseURL, WriterRef &xRet)
Definition: rtfexport.cxx:1577
#define DEF_ENCODING
Definition: rtfexport.cxx:78
static bool IsExportNumRule(const SwNumRule &rRule)
Definition: rtfexport.cxx:186
#define OOO_STRING_SVTOOLS_RTF_AFTNNRLC
#define OOO_STRING_SVTOOLS_RTF_DY
#define OOO_STRING_SVTOOLS_RTF_STATICVAL
#define OOO_STRING_SVTOOLS_RTF_REVTIM
#define OOO_STRING_SVTOOLS_RTF_COMPANY
#define OOO_STRING_SVTOOLS_RTF_FTNRESTART
#define OOO_STRING_SVTOOLS_RTF_TITLEPG
#define OOO_STRING_SVTOOLS_RTF_AENDDOC
#define OOO_STRING_SVTOOLS_RTF_FLDRSLT
#define OOO_STRING_SVTOOLS_RTF_SECTD
#define OOO_STRING_SVTOOLS_RTF_SUBJECT
#define OOO_STRING_SVTOOLS_RTF_FFDEFTEXT
#define OOO_STRING_SVTOOLS_RTF_SV
#define OOO_STRING_SVTOOLS_RTF_LISTTABLE
#define OOO_STRING_SVTOOLS_RTF_PGDSCNXT
#define OOO_STRING_SVTOOLS_RTF_PGDSCUSE
#define OOO_STRING_SVTOOLS_RTF_MARGL
#define OOO_STRING_SVTOOLS_RTF_FTNBJ
#define LO_STRING_SVTOOLS_RTF_HTMAUTSP
#define OOO_STRING_SVTOOLS_RTF_RED
#define OOO_STRING_SVTOOLS_RTF_MIN
#define OOO_STRING_SVTOOLS_RTF_CHFTNSEP
#define OOO_STRING_SVTOOLS_RTF_BACKGROUND
#define OOO_STRING_SVTOOLS_RTF_KEYWORDS
#define OOO_STRING_SVTOOLS_RTF_FTNRSTCONT
#define OOO_STRING_SVTOOLS_RTF_FFL
#define OOO_STRING_SVTOOLS_RTF_MARGR
#define OOO_STRING_SVTOOLS_RTF_AUTHOR
#define OOO_STRING_SVTOOLS_RTF_RTF
#define OOO_STRING_SVTOOLS_RTF_CREATIM
#define OOO_STRING_SVTOOLS_RTF_FOOTER
#define OOO_STRING_SVTOOLS_RTF_HEADER
#define OOO_STRING_SVTOOLS_RTF_FFNAME
#define OOO_STRING_SVTOOLS_RTF_REVISIONS
#define OOO_STRING_SVTOOLS_RTF_FORMPROT
#define LO_STRING_SVTOOLS_RTF_VIEWBKSP
#define OOO_STRING_SVTOOLS_RTF_AFTNNCHI
#define OOO_STRING_SVTOOLS_RTF_FFOWNSTAT
#define OOO_STRING_SVTOOLS_RTF_FFTYPETXT
#define OOO_STRING_SVTOOLS_RTF_FTNNRUC
#define OOO_STRING_SVTOOLS_RTF_PRINTIM
#define OOO_STRING_SVTOOLS_RTF_FTNSTART
#define OOO_STRING_SVTOOLS_RTF_SP
#define OOO_STRING_SVTOOLS_RTF_AFTNNAR
#define OOO_STRING_SVTOOLS_RTF_FOOTERL
#define OOO_STRING_SVTOOLS_RTF_AFTNSTART
#define OOO_STRING_SVTOOLS_RTF_SHP
#define OOO_STRING_SVTOOLS_RTF_ENDDOC
#define OOO_STRING_SVTOOLS_RTF_FFHASLISTBOX
#define OOO_STRING_SVTOOLS_RTF_DOCVAR
#define OOO_STRING_SVTOOLS_RTF_HEADERL
#define OOO_STRING_SVTOOLS_RTF_VIEWSCALE
#define OOO_STRING_SVTOOLS_RTF_AFTNNAUC
#define OOO_STRING_SVTOOLS_RTF_YR
#define OOO_STRING_SVTOOLS_RTF_AFTNRSTCONT
#define OOO_STRING_SVTOOLS_RTF_HEADERF
#define OOO_STRING_SVTOOLS_RTF_TITLE
#define OOO_STRING_SVTOOLS_RTF_FFTYPE
#define OOO_STRING_SVTOOLS_RTF_LISTOVERRIDETABLE
#define OOO_STRING_SVTOOLS_RTF_FFSTATTEXT
#define OOO_STRING_SVTOOLS_RTF_AFTNNALC
#define LO_STRING_SVTOOLS_RTF_LISTPICTURE
#define OOO_STRING_SVTOOLS_RTF_HYPHAUTO
#define OOO_STRING_SVTOOLS_RTF_SHPINST
#define OOO_STRING_SVTOOLS_RTF_FTNNRLC
#define OOO_STRING_SVTOOLS_RTF_PGDSCTBL
#define OOO_STRING_SVTOOLS_RTF_BLUE
#define OOO_STRING_SVTOOLS_RTF_FFOWNHELP
#define OOO_STRING_SVTOOLS_RTF_FORMSHADE
#define OOO_STRING_SVTOOLS_RTF_PAPERW
#define OOO_STRING_SVTOOLS_RTF_FTNSEP
#define OOO_STRING_SVTOOLS_RTF_ANSI
#define OOO_STRING_SVTOOLS_RTF_FTNNAR
#define OOO_STRING_SVTOOLS_RTF_FLDINST
#define OOO_STRING_SVTOOLS_RTF_DOCCOMM
#define OOO_STRING_SVTOOLS_RTF_INFO
#define OOO_STRING_SVTOOLS_RTF_FOOTERF
#define OOO_STRING_SVTOOLS_RTF_MARGMIRROR
#define OOO_STRING_SVTOOLS_RTF_USERPROPS
#define OOO_STRING_SVTOOLS_RTF_LEVEL
#define OOO_STRING_SVTOOLS_RTF_LANDSCAPE
#define OOO_STRING_SVTOOLS_RTF_FIELD
#define OOO_STRING_SVTOOLS_RTF_FFRES
#define OOO_STRING_SVTOOLS_RTF_SN
#define OOO_STRING_SVTOOLS_RTF_GREEN
#define OOO_STRING_SVTOOLS_RTF_PGDSC
#define OOO_STRING_SVTOOLS_RTF_IGNORE
#define OOO_STRING_SVTOOLS_RTF_SBKNONE
#define LO_STRING_SVTOOLS_RTF_GUTTERPRL
#define OOO_STRING_SVTOOLS_RTF_AFTNNRUC
#define OOO_STRING_SVTOOLS_RTF_HR
#define OOO_STRING_SVTOOLS_RTF_SECTUNLOCKED
#define OOO_STRING_SVTOOLS_RTF_FTNNCHI
#define OOO_STRING_SVTOOLS_RTF_PAPERH
#define OOO_STRING_SVTOOLS_RTF_PROPTYPE
#define OOO_STRING_SVTOOLS_RTF_FFHELPTEXT
#define OOO_STRING_SVTOOLS_RTF_PROPNAME
#define OOO_STRING_SVTOOLS_RTF_LNDSCPSXN
#define OOO_STRING_SVTOOLS_RTF_REVTBL
#define OOO_STRING_SVTOOLS_RTF_FORMFIELD
#define OOO_STRING_SVTOOLS_RTF_FTNNALC
#define LO_STRING_SVTOOLS_RTF_GENERATOR
#define OOO_STRING_SVTOOLS_RTF_MO
#define OOO_STRING_SVTOOLS_RTF_FONTTBL
#define OOO_STRING_SVTOOLS_RTF_MARGT
#define OOO_STRING_SVTOOLS_RTF_FTNRSTPG
#define OOO_STRING_SVTOOLS_RTF_PGDSCNO
#define OOO_STRING_SVTOOLS_RTF_MARGB
#define OOO_STRING_SVTOOLS_RTF_FTNNAUC
#define OOO_STRING_SVTOOLS_RTF_DEFF
sal_uIntPtr sal_uLong
Reference< XModel > xModel
SVX_NUM_NUMBER_NONE
SVX_NUM_CHARS_LOWER_LETTER_N
SVX_NUM_CHARS_LOWER_LETTER
SVX_NUM_CHARS_UPPER_LETTER
SVX_NUM_ROMAN_UPPER
SVX_NUM_ROMAN_LOWER
SVX_NUM_SYMBOL_CHICAGO
SVX_NUM_CHARS_UPPER_LETTER_N
#define SW_MOD()
Definition: swmodule.hxx:256
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:92
unsigned char sal_uInt8
sal_uInt16 sal_Unicode
Any result
oslFileHandle & pOut
FieldFlags
Definition: wrtww8.hxx:143
@ TXT_MAINTEXT
Definition: wrtww8.hxx:158
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)