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)
284 Strm().WriteOString(";}");
285 }
287}
288
289void RtfExport::WriteHeadersFooters(sal_uInt8 nHeadFootFlags, const SwFrameFormat& rFormat,
290 const SwFrameFormat& rLeftHeaderFormat,
291 const SwFrameFormat& rLeftFooterFormat,
292 const SwFrameFormat& rFirstPageFormat, sal_uInt8 /*nBreakCode*/,
293 bool /*bEvenAndOddHeaders*/)
294{
295 // headers
296 if (nHeadFootFlags & nsHdFtFlags::WW8_HEADER_EVEN)
297 WriteHeaderFooter(rLeftHeaderFormat, true, OOO_STRING_SVTOOLS_RTF_HEADERL);
298
299 if (nHeadFootFlags & nsHdFtFlags::WW8_HEADER_ODD)
301
302 if (nHeadFootFlags & nsHdFtFlags::WW8_HEADER_FIRST)
303 WriteHeaderFooter(rFirstPageFormat, true, OOO_STRING_SVTOOLS_RTF_HEADERF, true);
304
305 // footers
306 if (nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_EVEN)
307 WriteHeaderFooter(rLeftFooterFormat, false, OOO_STRING_SVTOOLS_RTF_FOOTERL);
308
309 if (nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_ODD)
311
312 if (nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_FIRST)
313 WriteHeaderFooter(rFirstPageFormat, false, OOO_STRING_SVTOOLS_RTF_FOOTERF, true);
314}
315
316void RtfExport::OutputField(const SwField* pField, ww::eField eFieldType, const OUString& rFieldCmd,
317 FieldFlags nMode)
318{
319 m_pAttrOutput->WriteField_Impl(pField, eFieldType, rFieldCmd, nMode);
320}
321
322void RtfExport::WriteFormData(const ::sw::mark::IFieldmark& rFieldmark)
323{
324 sal_Int32 nType;
325 if (rFieldmark.GetFieldname() == ODF_FORMDROPDOWN)
326 {
327 nType = 2;
328 }
329 /* TODO
330 else if (rFieldmark.GetFieldname() == ODF_FORMCHECKBOX)
331 {
332 nType = 1;
333 }
334 else if (rFieldmark.GetFieldname() == ODF_FORMTEXT)
335 {
336 nType = 0;
337 }
338*/
339 else
340 {
341 SAL_INFO("sw.rtf", "unknown field type");
342 return;
343 }
344 m_pAttrOutput->RunText().append(
347 m_pAttrOutput->RunText().append(nType);
348 if (rFieldmark.GetFieldname() == ODF_FORMDROPDOWN)
349 {
351 uno::Sequence<OUString> entries;
352 if (auto const it = rFieldmark.GetParameters()->find(ODF_FORMDROPDOWN_LISTENTRY);
353 it != rFieldmark.GetParameters()->end())
354 {
355 it->second >>= entries;
356 }
357 if (auto const it = rFieldmark.GetParameters()->find(ODF_FORMDROPDOWN_RESULT);
358 it != rFieldmark.GetParameters()->end())
359 {
360 sal_Int32 result(-1);
361 it->second >>= result;
362 if (0 <= result && result < entries.getLength())
363 {
365 m_pAttrOutput->RunText().append(result);
366 }
367 }
368 for (OUString const& rEntry : entries)
369 {
370 m_pAttrOutput->RunText().append(
372 m_pAttrOutput->RunText().append(
374 m_pAttrOutput->RunText().append("}");
375 }
376 }
377 m_pAttrOutput->RunText().append("}}"); // close FORMFIELD destination
378}
379
380void RtfExport::WriteHyperlinkData(const ::sw::mark::IFieldmark& /*rFieldmark*/)
381{
382 SAL_INFO("sw.rtf", "TODO: " << __func__);
383}
384
385void RtfExport::DoComboBox(const OUString& /*rName*/, const OUString& /*rHelp*/,
386 const OUString& /*rToolTip*/, const OUString& /*rSelected*/,
387 const uno::Sequence<OUString>& /*rListItems*/)
388{
389 // this is handled in RtfAttributeOutput::OutputFlyFrame_Impl
390}
391
393{
394 OUString sResult = pField->ExpandField(true, nullptr);
395 const OUString& rHelp = pField->GetHelp();
396 OUString sName = pField->GetPar2();
397 const OUString& rStatus = pField->GetToolTip();
398 m_pAttrOutput->RunText().append("{" OOO_STRING_SVTOOLS_RTF_FIELD
400 "{ FORMTEXT }");
401 m_pAttrOutput->RunText().append(
404 if (!rHelp.isEmpty())
406 if (!rStatus.isEmpty())
408 m_pAttrOutput->RunText().append(OOO_STRING_SVTOOLS_RTF_FFTYPETXT "0");
409
410 if (!sName.isEmpty())
411 m_pAttrOutput->RunText().append(
414 if (!rHelp.isEmpty())
415 m_pAttrOutput->RunText().append(
418 m_pAttrOutput->RunText().append(
421 if (!rStatus.isEmpty())
422 m_pAttrOutput->RunText().append(
425 m_pAttrOutput->RunText().append("}}}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " ");
427 + "}}");
428}
429
430sal_uInt64 RtfExport::ReplaceCr(sal_uInt8 /*nChar*/)
431{
432 // Completely unused for Rtf export... only here for code sharing
433 // purpose with binary export
434
435 return 0;
436}
437
439{
440 Strm()
442 .WriteChar('{')
445 Strm().WriteChar('}');
446}
447
449{
450 SAL_INFO("sw.rtf", __func__ << " start");
451 m_pStyles->OutputStylesTable();
452 SAL_INFO("sw.rtf", __func__ << " end");
453}
454
456{
457 const SwPageFootnoteInfo& rFootnoteInfo = m_rDoc.GetPageDesc(0).GetFootnoteInfo();
458 // Request a separator only in case the width is larger than zero.
459 bool bSeparator = double(rFootnoteInfo.GetWidth()) > 0;
460
461 Strm()
462 .WriteChar('{')
465 if (bSeparator)
467 Strm().WriteChar('}');
468}
469
471{
472 SAL_INFO("sw.rtf", __func__ << " start");
473
474 if (std::unique_ptr<SvxBrushItem> oBrush = getBackground(); oBrush)
475 {
480
481 std::vector<std::pair<OString, OString>> aProperties{
482 { "shapeType", "1" },
483 { "fillColor", OString::number(wwUtility::RGBToBGR(oBrush->GetColor())) }
484 };
485 for (const std::pair<OString, OString>& rPair : aProperties)
486 {
489 Strm().WriteOString(rPair.first);
491 Strm().WriteOString(rPair.second);
492 Strm().WriteOString("}}");
493 }
494 Strm().WriteChar('}'); // shpinst
495 Strm().WriteChar('}'); // shp
496 Strm().WriteChar('}'); // background
497 }
498
499 SwTableNode* pTableNode = m_pCurPam->GetPointNode().FindTableNode();
500 if (m_pWriter && m_pWriter->m_bWriteOnlyFirstTable && pTableNode != nullptr)
501 {
502 m_pCurPam->GetPoint()->Assign(*pTableNode);
503 m_pCurPam->GetMark()->Assign(*pTableNode->EndOfSectionNode());
504 }
505 else
506 {
507 m_pCurPam->GetPoint()->Assign(*m_rDoc.GetNodes().GetEndOfContent().StartOfSectionNode());
508 }
509
510 WriteText();
511
512 SAL_INFO("sw.rtf", __func__ << " end");
513}
514
516{
517 OString aGenerator
519 Strm()
521 .WriteOString(aGenerator)
522 .WriteChar('}');
524
525 SwDocShell* pDocShell(m_rDoc.GetDocShell());
526 uno::Reference<document::XDocumentProperties> xDocProps;
527 if (pDocShell)
528 {
529 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(pDocShell->GetModel(),
530 uno::UNO_QUERY);
531 xDocProps.set(xDPS->getDocumentProperties());
532 }
533
534 if (xDocProps.is())
535 {
536 // Handle user-defined properties.
537 uno::Reference<beans::XPropertyContainer> xUserDefinedProperties
538 = xDocProps->getUserDefinedProperties();
539 if (xUserDefinedProperties.is())
540 {
541 uno::Reference<beans::XPropertySet> xPropertySet(xUserDefinedProperties,
542 uno::UNO_QUERY);
543 uno::Reference<beans::XPropertySetInfo> xPropertySetInfo
544 = xPropertySet->getPropertySetInfo();
545 // Do we have explicit markup in RTF for this property name?
546 if (xPropertySetInfo->hasPropertyByName("Company"))
547 {
548 OUString aValue;
549 xPropertySet->getPropertyValue("Company") >>= aValue;
551 }
552 }
553
554 OutUnicode(OOO_STRING_SVTOOLS_RTF_TITLE, xDocProps->getTitle(), true);
555 OutUnicode(OOO_STRING_SVTOOLS_RTF_SUBJECT, xDocProps->getSubject());
556
558 ::comphelper::string::convertCommaSeparated(xDocProps->getKeywords()));
559 OutUnicode(OOO_STRING_SVTOOLS_RTF_DOCCOMM, xDocProps->getDescription());
560
561 OutUnicode(OOO_STRING_SVTOOLS_RTF_AUTHOR, xDocProps->getAuthor());
562 OutDateTime(OOO_STRING_SVTOOLS_RTF_CREATIM, xDocProps->getCreationDate());
563
564 OutUnicode(OOO_STRING_SVTOOLS_RTF_AUTHOR, xDocProps->getModifiedBy());
565 OutDateTime(OOO_STRING_SVTOOLS_RTF_REVTIM, xDocProps->getModificationDate());
566
567 OutDateTime(OOO_STRING_SVTOOLS_RTF_PRINTIM, xDocProps->getPrintDate());
568 }
569
570 Strm().WriteChar('}');
571}
572
574{
576}
577
578void RtfExport::WriteUserPropValue(std::u16string_view rValue)
579{
582 Strm().WriteChar('}');
583}
584
586{
589
590 SwDocShell* pDocShell(m_rDoc.GetDocShell());
591 uno::Reference<document::XDocumentProperties> xDocProps;
592 if (pDocShell)
593 {
594 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(pDocShell->GetModel(),
595 uno::UNO_QUERY);
596 xDocProps.set(xDPS->getDocumentProperties());
597 }
598 else
599 {
600 // Clipboard document, read metadata from the meta field manager.
602 xDocProps.set(rManager.getDocumentProperties());
603 }
604
605 if (xDocProps.is())
606 {
607 // Handle user-defined properties.
608 uno::Reference<beans::XPropertyContainer> xUserDefinedProperties
609 = xDocProps->getUserDefinedProperties();
610 if (xUserDefinedProperties.is())
611 {
612 uno::Reference<beans::XPropertySet> xPropertySet(xUserDefinedProperties,
613 uno::UNO_QUERY);
614 const uno::Sequence<beans::Property> aProperties
615 = xPropertySet->getPropertySetInfo()->getProperties();
616
617 for (const beans::Property& rProperty : aProperties)
618 {
619 if (rProperty.Name.startsWith("Company"))
620 // We have explicit markup in RTF for this property.
621 continue;
622
623 // Property name.
627 Strm().WriteChar('}');
628
629 // Property value.
630 OUString aValue;
631 double fValue;
632 bool bValue;
633 util::DateTime aDate;
634 uno::Any aAny = xPropertySet->getPropertyValue(rProperty.Name);
635 if (aAny >>= bValue)
636 {
638 WriteUserPropValue(OUString::number(static_cast<int>(bValue)));
639 }
640 else if (aAny >>= aValue)
641 {
643 WriteUserPropValue(aValue);
644 }
645 else if (aAny >>= fValue)
646 {
647 aValue = OUString::number(fValue);
648 if (aValue.indexOf('.') == -1)
649 {
650 // Integer.
652 WriteUserPropValue(aValue);
653 }
654 else
655 {
656 // Real number.
658 WriteUserPropValue(aValue);
659 }
660 }
661 else if (aAny >>= aDate)
662 {
664 // Format is 'YYYY. MM. DD.'.
665 aValue += OUString::number(aDate.Year) + ". ";
666 if (aDate.Month < 10)
667 aValue += "0";
668 aValue += OUString::number(aDate.Month) + ". ";
669 if (aDate.Day < 10)
670 aValue += "0";
671 aValue += OUString::number(aDate.Day) + ".";
672 WriteUserPropValue(aValue);
673 }
674 }
675 }
676 }
677
678 Strm().WriteChar('}');
679}
680
682{
683 SwDocShell* pDocShell(m_rDoc.GetDocShell());
684 if (!pDocShell)
685 return;
686
687 uno::Reference<text::XTextFieldsSupplier> xModel(pDocShell->GetModel(), uno::UNO_QUERY);
688 uno::Reference<container::XNameAccess> xTextFieldMasters = xModel->getTextFieldMasters();
689 uno::Sequence<rtl::OUString> aMasterNames = xTextFieldMasters->getElementNames();
690 if (!aMasterNames.hasElements())
691 {
692 return;
693 }
694
695 // Only write docVars if there will be at least a single docVar.
696 constexpr OUStringLiteral aPrefix(u"com.sun.star.text.fieldmaster.User.");
697 for (const auto& rMasterName : std::as_const(aMasterNames))
698 {
699 if (!rMasterName.startsWith(aPrefix))
700 {
701 // Not a user field.
702 continue;
703 }
704
705 uno::Reference<beans::XPropertySet> xField;
706 xTextFieldMasters->getByName(rMasterName) >>= xField;
707 if (!xField.is())
708 {
709 continue;
710 }
711
712 OUString aKey = rMasterName.copy(aPrefix.getLength());
713 OUString aValue;
714 xField->getPropertyValue("Content") >>= aValue;
715
718 Strm().WriteChar(' ');
719
720 Strm().WriteChar('{');
722 Strm().WriteChar('}');
723
724 Strm().WriteChar('{');
726 Strm().WriteChar('}');
727
728 Strm().WriteChar('}');
729 }
730}
731
733{
734 // Write page descriptions (page styles)
735 std::size_t nSize = m_rDoc.GetPageDescCnt();
736 if (!nSize)
737 return;
738
740 m_bOutPageDescs = true;
741 Strm()
742 .WriteChar('{')
745 for (std::size_t n = 0; n < nSize; ++n)
746 {
747 const SwPageDesc& rPageDesc = m_rDoc.GetPageDesc(n);
748
749 Strm()
751 .WriteChar('{')
754 Strm().WriteNumberAsString(static_cast<sal_uLong>(rPageDesc.ReadUseOn()));
755
756 OutPageDescription(rPageDesc, false);
757
758 // search for the next page description
759 std::size_t i = nSize;
760 while (i)
761 if (rPageDesc.GetFollow() == &m_rDoc.GetPageDesc(--i))
762 break;
765 Strm()
767 .WriteOString(";}");
768 }
770 m_bOutPageDescs = false;
771
772 // reset table infos, otherwise the depth of the cells will be incorrect,
773 // in case the page style (header or footer) had tables
774 m_pTableInfo = std::make_shared<ww8::WW8TableInfo>();
775}
776
778{
779 // Make the header
780 Strm()
781 .WriteChar('{')
783 .WriteChar('1')
788 // If this not exist, MS don't understand our ansi characters (0x80-0xff).
789 Strm().WriteOString("\\adeflang1025");
790
791 // Font table
792 WriteFonts();
793
794 m_pStyles = std::make_unique<MSWordStyles>(*this);
795 // Color and stylesheet table
796 WriteStyles();
797
798 // List table
801
802 WriteRevTab();
803
804 WriteInfo();
806 WriteDocVars();
807
808 // Default TabSize
810 m_pAttrOutput->GetTabStop().setLength(0);
811
812 // Automatic hyphenation: it's a global setting in Word, it's a paragraph setting in Writer.
813 // Set it's value to "auto" and disable on paragraph level, if no hyphenation is used there.
815 Strm().WriteOString("1");
816
817 // Zoom
819 if (pViewShell && pViewShell->GetViewOptions()->GetZoomType() == SvxZoomType::PERCENT)
820 {
823 }
824 // Record changes?
827 // Mirror margins?
830
831 // Gutter at top?
834 {
836 }
837
838 // Init sections
839 m_pSections = std::make_unique<MSWordSections>(*this);
840
841 // Page description
843
844 // Enable form protection by default if needed, as there is no switch to
845 // enable it on a per-section basis. OTOH don't always enable it as it
846 // breaks moving of drawings - so write it only in case there is really a
847 // protected section in the document.
848 for (auto const& pSectionFormat : m_rDoc.GetSections())
849 {
850 if (!pSectionFormat->IsInUndo() && pSectionFormat->GetProtect().IsContentProtected())
851 {
853 break;
854 }
855 }
856
857 // enable form field shading
859
860 // Enable breaking wrapped tables across pages: the "no" in the control word's name is
861 // confusing.
863 {
865 }
866
867 // size and empty margins of the page
869 {
870 // Seeking the first SwFormatPageDesc. If no set, the default is valid
871 const SwFormatPageDesc* pSttPgDsc = nullptr;
872 {
873 const SwNode& rSttNd
875 const SfxItemSet* pSet = nullptr;
876
877 if (rSttNd.IsContentNode())
878 pSet = &rSttNd.GetContentNode()->GetSwAttrSet();
879 else if (rSttNd.IsTableNode())
880 pSet = &rSttNd.GetTableNode()->GetTable().GetFrameFormat()->GetAttrSet();
881
882 else if (rSttNd.IsSectionNode())
883 pSet = &rSttNd.GetSectionNode()->GetSection().GetFormat()->GetAttrSet();
884
885 if (pSet)
886 {
887 std::size_t nPosInDoc;
888 pSttPgDsc = &pSet->Get(RES_PAGEDESC);
889 if (!pSttPgDsc->GetPageDesc())
890 pSttPgDsc = nullptr;
891 else if (m_rDoc.FindPageDesc(pSttPgDsc->GetPageDesc()->GetName(), &nPosInDoc))
892 {
893 Strm()
894 .WriteChar('{')
897 Strm().WriteNumberAsString(nPosInDoc).WriteChar('}');
898 }
899 }
900 }
901 const SwPageDesc& rPageDesc = pSttPgDsc ? *pSttPgDsc->GetPageDesc() : m_rDoc.GetPageDesc(0);
902 const SwFrameFormat& rFormatPage = rPageDesc.GetMaster();
903
904 {
905 if (rPageDesc.GetLandscape())
907
908 const SwFormatFrameSize& rSz = rFormatPage.GetFrameSize();
909 // Clipboard document is always created without a printer, then
910 // the size will be always LONG_MAX! Solution then is to use A4
911 if (LONG_MAX == rSz.GetHeight() || LONG_MAX == rSz.GetWidth())
912 {
917 }
918 else
919 {
921 Strm()
925 }
926 }
927
928 {
929 const SvxLRSpaceItem& rLR = rFormatPage.GetLRSpace();
933 }
934
935 {
936 const SvxULSpaceItem& rUL = rFormatPage.GetULSpace();
940 }
941
942 Strm()
945 m_pAttrOutput->SectFootnoteEndnotePr();
946 // All sections are unlocked by default
948 Strm().WriteOString("1");
949 OutPageDescription(rPageDesc, true); // Changed bCheckForFirstPage to true so headers
950 // following title page are correctly added - i13107
951 if (pSttPgDsc)
952 {
953 m_pCurrentPageDesc = &rPageDesc;
954 }
955 }
956
957 // line numbering
958 const SwLineNumberInfo& rLnNumInfo = m_rDoc.GetLineNumberInfo();
959 if (rLnNumInfo.IsPaintLineNumbers())
960 {
961 sal_uLong nLnNumRestartNo = 0;
962 if (const WW8_SepInfo* pSectionInfo = m_pSections->CurrentSectionInfo())
963 nLnNumRestartNo = pSectionInfo->nLnNumRestartNo;
964
965 AttrOutput().SectionLineNumbering(nLnNumRestartNo, rLnNumInfo);
966 }
967
968 {
969 // write the footnotes and endnotes-out Info
970 const SwFootnoteInfo& rFootnoteInfo = m_rDoc.GetFootnoteInfo();
971
972 const char* pOut = FTNPOS_CHAPTER == rFootnoteInfo.m_ePos ? OOO_STRING_SVTOOLS_RTF_ENDDOC
975 Strm().WriteNumberAsString(rFootnoteInfo.m_nFootnoteOffset + 1);
976
977 switch (rFootnoteInfo.m_eNum)
978 {
979 case FTNNUM_PAGE:
981 break;
982 case FTNNUM_DOC:
984 break;
985 default:
987 break;
988 }
990
991 switch (rFootnoteInfo.m_aFormat.GetNumberingType())
992 {
996 break;
1000 break;
1003 break;
1006 break;
1009 break;
1010 default:
1012 break;
1013 }
1015
1016 const SwEndNoteInfo& rEndNoteInfo = m_rDoc.GetEndNoteInfo();
1017
1018 Strm()
1022 Strm().WriteNumberAsString(rEndNoteInfo.m_nFootnoteOffset + 1);
1023
1024 switch (rEndNoteInfo.m_aFormat.GetNumberingType())
1025 {
1029 break;
1033 break;
1036 break;
1039 break;
1042 break;
1043 default:
1045 break;
1046 }
1048 }
1049
1051 // RTF default is true, so write compat flag if this should be false.
1053
1055
1057
1058 WriteMainText();
1059
1060 Strm().WriteChar('}');
1061
1062 return ERRCODE_NONE;
1063}
1064
1066 const SwFormatPageDesc* pNewPgDescFormat,
1067 const SwPageDesc* pNewPgDesc, bool bExtraPageBreak)
1068{
1069 const SwSectionFormat* pFormat = GetSectionFormat(rNd);
1070 const sal_uLong nLnNm = GetSectionLineNo(pSet, rNd);
1071
1072 OSL_ENSURE(pNewPgDescFormat || pNewPgDesc, "Neither page desc format nor page desc provided.");
1073
1074 if (pNewPgDescFormat)
1075 m_pSections->AppendSection(*pNewPgDescFormat, rNd, pFormat, nLnNm);
1076 else if (pNewPgDesc)
1077 m_pSections->AppendSection(pNewPgDesc, rNd, pFormat, nLnNm);
1078
1079 // Don't insert a page break, when we're changing page style just because the next page has to be a different one.
1080 if (!m_pAttrOutput->GetPrevPageDesc()
1081 || m_pAttrOutput->GetPrevPageDesc()->GetFollow() != pNewPgDesc)
1082 AttrOutput().SectionBreak(msword::PageBreak, false, m_pSections->CurrentSectionInfo(),
1083 bExtraPageBreak);
1084}
1085
1087{
1088 bool bRet(false);
1089
1090 if (SfxItemState::SET != rFormat.GetItemState(RES_PARATR_NUMRULE, false))
1091 {
1092 if (const SwFormat* pParent = rFormat.DerivedFrom())
1093 {
1094 if (static_cast<const SwTextFormatColl*>(pParent)
1095 ->IsAssignedToListLevelOfOutlineStyle())
1096 {
1097 // Level 9 disables the outline
1099
1100 bRet = true;
1101 }
1102 }
1103 }
1104
1105 return bRet;
1106}
1107
1109{
1110 if (TXT_MAINTEXT == m_nTextTyp && rEndNode.StartOfSectionNode()->IsTableNode())
1111 // End node of a table: see if a section break should be written after the table.
1112 AttrOutput().SectionBreaks(rEndNode);
1113}
1114
1115void RtfExport::OutputGrfNode(const SwGrfNode& /*rGrfNode*/)
1116{
1117 /* noop, see RtfAttributeOutput::FlyFrameGraphic */
1118}
1119
1120void RtfExport::OutputOLENode(const SwOLENode& /*rOLENode*/)
1121{
1122 /* noop, see RtfAttributeOutput::FlyFrameOLE */
1123}
1124
1125void RtfExport::OutputLinkedOLE(const OUString& /*rLinked*/) {}
1126
1128{
1129 m_nCurrentNodeIndex = rNode.GetIndex();
1130 if (!m_bOutOutlineOnly || rNode.IsOutline())
1133}
1134
1135void RtfExport::AppendSection(const SwPageDesc* pPageDesc, const SwSectionFormat* pFormat,
1136 sal_uLong nLnNum)
1137{
1138 m_pSections->AppendSection(pPageDesc, pFormat, nLnNum);
1139 AttrOutput().SectionBreak(msword::PageBreak, false, m_pSections->CurrentSectionInfo());
1140}
1141
1143 std::shared_ptr<SwUnoCursor>& pCurrentPam, SwPaM& rOriginalPam,
1144 Writer* pWriter, bool bOutOutlineOnly)
1145 : MSWordExportBase(rDocument, pCurrentPam, &rOriginalPam)
1146 , m_pFilter(pFilter)
1147 , m_pWriter(pWriter)
1148 , m_bOutOutlineOnly(bOutOutlineOnly)
1149 , m_eDefaultEncoding(
1150 rtl_getTextEncodingFromWindowsCharset(sw::ms::rtl_TextEncodingToWinCharset(DEF_ENCODING)))
1151 , m_eCurrentEncoding(m_eDefaultEncoding)
1152 , m_bRTFFlySyntax(false)
1153 , m_nCurrentNodeIndex(0)
1154{
1155 m_bExportModeRTF = true;
1156 // the attribute output for the document
1157 m_pAttrOutput = std::make_unique<RtfAttributeOutput>(*this);
1158 // that just causes problems for RTF
1159 m_bSubstituteBullets = false;
1160 // needed to have a complete font table
1162 // the related SdrExport
1163 m_pSdrExport = std::make_unique<RtfSdrExport>(*this);
1164
1165 if (!m_pWriter)
1167}
1168
1169RtfExport::~RtfExport() = default;
1170
1172{
1173 if (m_pStream)
1174 return *m_pStream;
1175
1176 return m_pWriter->Strm();
1177}
1178
1179void RtfExport::setStream() { m_pStream = std::make_unique<SvMemoryStream>(); }
1180
1182{
1183 OString aRet;
1184
1185 if (m_pStream)
1186 aRet = OString(static_cast<const char*>(m_pStream->GetData()), m_pStream->Tell());
1187
1188 return aRet;
1189}
1190
1192
1193void RtfExport::OutUnicode(std::string_view pToken, std::u16string_view rContent, bool bUpr)
1194{
1195 if (rContent.empty())
1196 return;
1197
1198 if (!bUpr)
1199 {
1200 Strm().WriteChar('{').WriteOString(pToken).WriteChar(' ');
1202 Strm().WriteChar('}');
1203 }
1204 else
1206}
1207
1208void RtfExport::OutDateTime(std::string_view pStr, const util::DateTime& rDT)
1209{
1215 Strm().WriteNumberAsString(rDT.Minutes).WriteChar('}');
1216}
1217
1218sal_uInt16 RtfExport::GetColor(const Color& rColor) const
1219{
1220 for (const auto& rEntry : m_aColTable)
1221 if (rEntry.second == rColor)
1222 {
1223 SAL_INFO("sw.rtf", __func__ << " returning " << rEntry.first << " (" << rColor.GetRed()
1224 << "," << rColor.GetGreen() << "," << rColor.GetBlue()
1225 << ")");
1226 return rEntry.first;
1227 }
1228 OSL_FAIL("No such Color in m_aColTable!");
1229 return 0;
1230}
1231
1233{
1234 sal_uInt16 n;
1235 bool bAutoColorInTable = false;
1236 for (const auto& rEntry : m_aColTable)
1237 {
1238 if (rEntry.second == rCol)
1239 return; // Already in the table
1240 if (rEntry.second == COL_AUTO)
1241 bAutoColorInTable = true;
1242 }
1243 if (rCol == COL_AUTO)
1244 // COL_AUTO gets value 0
1245 n = 0;
1246 else
1247 {
1248 // other colors get values >0
1249 n = m_aColTable.size();
1250 if (!bAutoColorInTable)
1251 // reserve value "0" for COL_AUTO (if COL_AUTO wasn't inserted until now)
1252 n++;
1253 }
1254 m_aColTable.insert(std::pair<sal_uInt16, Color>(n, rCol));
1255}
1256
1258{
1259 const editeng::SvxBorderLine* pLine = nullptr;
1260
1261 if (rBox.GetTop())
1262 {
1263 pLine = rBox.GetTop();
1264 InsColor(pLine->GetColor());
1265 }
1266 if (rBox.GetBottom() && pLine != rBox.GetBottom())
1267 {
1268 pLine = rBox.GetBottom();
1269 InsColor(pLine->GetColor());
1270 }
1271 if (rBox.GetLeft() && pLine != rBox.GetLeft())
1272 {
1273 pLine = rBox.GetLeft();
1274 InsColor(pLine->GetColor());
1275 }
1276 if (rBox.GetRight() && pLine != rBox.GetRight())
1277 InsColor(rBox.GetRight()->GetColor());
1278}
1279
1281{
1282 // Build the table from rPool since the colors provided to
1283 // RtfAttributeOutput callbacks are too late.
1284 const SfxItemPool& rPool = m_rDoc.GetAttrPool();
1285
1286 // MSO Word uses a default color table with 16 colors (which is used e.g. for highlighting)
1303
1304 // char color
1305 {
1306 auto pCol = GetDfltAttr(RES_CHRATR_COLOR);
1307 InsColor(pCol->GetValue());
1309 if (pCol)
1310 InsColor(pCol->GetValue());
1311 for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_CHRATR_COLOR))
1312 {
1313 pCol = dynamic_cast<const SvxColorItem*>(pItem);
1314 if (pCol)
1315 InsColor(pCol->GetValue());
1316 }
1317
1318 auto pUnder = GetDfltAttr(RES_CHRATR_UNDERLINE);
1319 InsColor(pUnder->GetColor());
1320 for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_CHRATR_UNDERLINE))
1321 {
1322 pUnder = dynamic_cast<const SvxUnderlineItem*>(pItem);
1323 if (pUnder)
1324 InsColor(pUnder->GetColor());
1325 }
1326
1327 auto pOver = GetDfltAttr(RES_CHRATR_OVERLINE);
1328 InsColor(pOver->GetColor());
1329 for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_CHRATR_OVERLINE))
1330 {
1331 pOver = dynamic_cast<const SvxOverlineItem*>(pItem);
1332 if (pOver)
1333 InsColor(pOver->GetColor());
1334 }
1335 }
1336
1337 // background color
1338 static const sal_uInt16 aBrushIds[] = { RES_BACKGROUND, RES_CHRATR_BACKGROUND, 0 };
1339
1340 for (const sal_uInt16* pIds = aBrushIds; *pIds; ++pIds)
1341 {
1342 auto pBackground = static_cast<const SvxBrushItem*>(GetDfltAttr(*pIds));
1343 InsColor(pBackground->GetColor());
1344 pBackground = static_cast<const SvxBrushItem*>(rPool.GetPoolDefaultItem(*pIds));
1345 if (pBackground)
1346 {
1347 InsColor(pBackground->GetColor());
1348 }
1349 for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(*pIds))
1350 {
1351 pBackground = static_cast<const SvxBrushItem*>(pItem);
1352 if (pBackground)
1353 {
1354 InsColor(pBackground->GetColor());
1355 }
1356 }
1357 }
1358
1359 // shadow color
1360 {
1361 auto pShadow = GetDfltAttr(RES_SHADOW);
1362 InsColor(pShadow->GetColor());
1363 pShadow = rPool.GetPoolDefaultItem(RES_SHADOW);
1364 if (nullptr != pShadow)
1365 {
1366 InsColor(pShadow->GetColor());
1367 }
1368 for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_SHADOW))
1369 {
1370 pShadow = dynamic_cast<const SvxShadowItem*>(pItem);
1371 if (pShadow)
1372 {
1373 InsColor(pShadow->GetColor());
1374 }
1375 }
1376 }
1377
1378 // frame border color
1379 {
1380 const SvxBoxItem* pBox = rPool.GetPoolDefaultItem(RES_BOX);
1381 if (nullptr != pBox)
1382 InsColorLine(*pBox);
1383 for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_BOX))
1384 {
1385 pBox = dynamic_cast<const SvxBoxItem*>(pItem);
1386 if (pBox)
1387 InsColorLine(*pBox);
1388 }
1389 }
1390
1391 {
1392 const SvxBoxItem* pCharBox = rPool.GetPoolDefaultItem(RES_CHRATR_BOX);
1393 if (pCharBox)
1394 InsColorLine(*pCharBox);
1395 for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_CHRATR_BOX))
1396 {
1397 pCharBox = dynamic_cast<const SvxBoxItem*>(pItem);
1398 if (pCharBox)
1399 InsColorLine(*pCharBox);
1400 }
1401 }
1402
1403 // TextFrame or paragraph background solid fill.
1404 for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(XATTR_FILLCOLOR))
1405 {
1406 if (auto pColorItem = dynamic_cast<const XFillColorItem*>(pItem))
1407 InsColor(pColorItem->GetColorValue());
1408 }
1409
1410 for (std::size_t n = 0; n < m_aColTable.size(); ++n)
1411 {
1412 const Color& rCol = m_aColTable[n];
1413 if (n || COL_AUTO != rCol)
1414 {
1419 }
1420 Strm().WriteChar(';');
1421 }
1422}
1423
1424void RtfExport::InsStyle(sal_uInt16 nId, const OString& rStyle)
1425{
1426 m_aStyTable.insert(std::pair<sal_uInt16, OString>(nId, rStyle));
1427}
1428
1429OString* RtfExport::GetStyle(sal_uInt16 nId)
1430{
1431 auto it = m_aStyTable.find(nId);
1432 if (it != m_aStyTable.end())
1433 return &it->second;
1434 return nullptr;
1435}
1436
1437sal_uInt16 RtfExport::GetRedline(const OUString& rAuthor)
1438{
1439 const sal_uInt16 nId = m_aRedlineTable.size();
1440 // insert if we don't already have one
1441 auto[it, inserted] = m_aRedlineTable.insert(std::pair<OUString, sal_uInt16>(rAuthor, nId));
1442 (void)inserted;
1443 return it->second;
1444}
1445
1446const OUString* RtfExport::GetRedline(sal_uInt16 nId)
1447{
1448 for (const auto& rEntry : m_aRedlineTable)
1449 if (rEntry.second == nId)
1450 return &rEntry.first;
1451 return nullptr;
1452}
1453
1454void RtfExport::OutPageDescription(const SwPageDesc& rPgDsc, bool bCheckForFirstPage)
1455{
1456 SAL_INFO("sw.rtf", __func__ << " start");
1457 const SwPageDesc* pSave = m_pCurrentPageDesc;
1458
1459 m_pCurrentPageDesc = &rPgDsc;
1460 if (bCheckForFirstPage && m_pCurrentPageDesc->GetFollow()
1463
1466
1467 const SwFormat* pFormat = &m_pCurrentPageDesc->GetMaster(); //GetLeft();
1468 m_bOutPageDescs = true;
1469 if (m_pCurrentPageDesc != &rPgDsc)
1471 OutputFormat(*pFormat, true, false);
1472 m_pFirstPageItemSet = nullptr;
1473 m_bOutPageDescs = false;
1474
1475 // normal header / footer (without a style)
1476 const SfxPoolItem* pItem;
1478 == SfxItemState::SET)
1479 WriteHeaderFooter(*pItem, true);
1481 == SfxItemState::SET)
1482 WriteHeaderFooter(*pItem, false);
1483
1484 // title page
1485 if (m_pCurrentPageDesc != &rPgDsc)
1486 {
1488 m_pCurrentPageDesc = &rPgDsc;
1490 == SfxItemState::SET)
1491 WriteHeaderFooter(*pItem, true);
1493 == SfxItemState::SET)
1494 WriteHeaderFooter(*pItem, false);
1495 }
1496
1497 // numbering type
1499 std::nullopt);
1500
1501 m_pCurrentPageDesc = pSave;
1502 SAL_INFO("sw.rtf", __func__ << " end");
1503}
1504
1505void RtfExport::WriteHeaderFooter(const SfxPoolItem& rItem, bool bHeader)
1506{
1507 if (bHeader)
1508 {
1509 const auto& rHeader = static_cast<const SwFormatHeader&>(rItem);
1510 if (!rHeader.IsActive())
1511 return;
1512 }
1513 else
1514 {
1515 const auto& rFooter = static_cast<const SwFormatFooter&>(rItem);
1516 if (!rFooter.IsActive())
1517 return;
1518 }
1519
1520 SAL_INFO("sw.rtf", __func__ << " start");
1521
1522 const char* pStr = (bHeader ? OOO_STRING_SVTOOLS_RTF_HEADER : OOO_STRING_SVTOOLS_RTF_FOOTER);
1523 /* is this a title page? */
1525 {
1528 }
1529 Strm().WriteChar('{').WriteOString(pStr);
1531 Strm().WriteChar('}');
1532
1533 SAL_INFO("sw.rtf", __func__ << " end");
1534}
1535
1536void RtfExport::WriteHeaderFooter(const SwFrameFormat& rFormat, bool bHeader, const char* pStr,
1537 bool bTitlepg)
1538{
1539 SAL_INFO("sw.rtf", __func__ << " start");
1540
1541 m_pAttrOutput->WriteHeaderFooter_Impl(rFormat, bHeader, pStr, bTitlepg);
1542
1543 SAL_INFO("sw.rtf", __func__ << " end");
1544}
1545
1546namespace
1547{
1549class SwRTFWriter : public Writer
1550{
1551private:
1552 bool m_bOutOutlineOnly;
1553
1554public:
1555 SwRTFWriter(std::u16string_view rFilterName, const OUString& rBaseURL);
1556
1557 ErrCode WriteStream() override;
1558};
1559}
1560
1561SwRTFWriter::SwRTFWriter(std::u16string_view rFilterName, const OUString& rBaseURL)
1562{
1563 SetBaseURL(rBaseURL);
1564 // export outline nodes, only (send outline to clipboard/presentation)
1565 m_bOutOutlineOnly = o3tl::starts_with(rFilterName, u"O");
1566}
1567
1568ErrCode SwRTFWriter::WriteStream()
1569{
1570 std::shared_ptr<SwUnoCursor> pCurPam(m_pDoc->CreateUnoCursor(*m_pCurrentPam->End(), false));
1571 pCurPam->SetMark();
1572 *pCurPam->GetPoint() = *m_pCurrentPam->Start();
1573 RtfExport aExport(nullptr, *m_pDoc, pCurPam, *m_pCurrentPam, this, m_bOutOutlineOnly);
1574 aExport.ExportDocument(true);
1575 return ERRCODE_NONE;
1576}
1577
1578extern "C" SAL_DLLPUBLIC_EXPORT void ExportRTF(std::u16string_view rFltName,
1579 const OUString& rBaseURL, WriterRef& xRet)
1580{
1581 xRet = new SwRTFWriter(rFltName, rBaseURL);
1582}
1583
1584/* 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
Provides access to settings of a document.
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:2900
sal_uInt8 m_nTextTyp
Definition: wrtww8.hxx:549
void WriteHeaderFooterText(const SwFormat &rFormat, bool bHeader)
Write header/footer text.
Definition: wrtw8sty.cxx:2119
int CollectGrfsOfBullets()
Populates m_vecBulletPic with all the bullet graphics used by numberings.
Definition: wrtww8.cxx:1526
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:922
std::unique_ptr< SvxBrushItem > getBackground()
Get background color of the document, if there is one.
Definition: wrtww8.cxx:1510
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:705
const SwPageDesc * m_pCurrentPageDesc
Definition: wrtww8.hxx:497
bool GetBookmarks(const SwTextNode &rNd, sal_Int32 nStt, sal_Int32 nEnd, IMarkVector &rArr)
Definition: wrtw8nds.cxx:1948
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:1995
void OutputFormat(const SwFormat &rFormat, bool bPapFormat, bool bChpFormat, bool bFlyFormat=false)
Output attributes.
Definition: ww8atr.cxx:887
virtual void OutputTextNode(SwTextNode &)
Output SwTextNode.
Definition: wrtw8nds.cxx:2252
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:692
void AbstractNumberingDefinitions()
Write all Levels for all SwNumRules - LVLF.
Definition: wrtw8num.cxx:384
void BulletDefinitions()
Write the numbering picture bullets.
Definition: wrtww8.cxx:1567
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
void OutDateTime(std::string_view pStr, const css::util::DateTime &rDT)
Definition: rtfexport.cxx:1208
sal_uInt16 GetColor(const Color &rColor) const
Definition: rtfexport.cxx:1218
void WriteUserPropValue(std::u16string_view rValue)
Writes a single user property value.
Definition: rtfexport.cxx:578
void OutputGrfNode(const SwGrfNode &rGrfNode) override
Output SwGrfNode.
Definition: rtfexport.cxx:1115
void WriteStyles()
Definition: rtfexport.cxx:448
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:1108
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:322
void WriteHeaderFooter(const SfxPoolItem &rItem, bool bHeader)
Definition: rtfexport.cxx:1505
RtfColorTable m_aColTable
Definition: rtfexport.hxx:227
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:1179
std::map< OUString, sal_uInt16 > m_aRedlineTable
Definition: rtfexport.hxx:229
std::unique_ptr< RtfSdrExport > m_pSdrExport
Definition: rtfexport.hxx:48
void OutPageDescription(const SwPageDesc &rPgDsc, bool bCheckForFirstPage)
Definition: rtfexport.cxx:1454
const SfxItemSet * m_pFirstPageItemSet
Item set of the first page during export of a follow page format.
Definition: rtfexport.hxx:233
void OutputOLENode(const SwOLENode &rOLENode) override
Output SwOLENode.
Definition: rtfexport.cxx:1120
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:1142
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:289
std::unique_ptr< SvMemoryStream > m_pStream
If set, then Strm() returns this stream, instead of m_pWriter's stream.
Definition: rtfexport.hxx:231
void OutUnicode(std::string_view pToken, std::u16string_view rContent, bool bUpr=false)
Definition: rtfexport.cxx:1193
void OutputTextNode(SwTextNode &rNode) override
Output SwTextNode is depending on outline export mode.
Definition: rtfexport.cxx:1127
void InsColorLine(const SvxBoxItem &rBox)
Definition: rtfexport.cxx:1257
void AppendBookmark(const OUString &rName) override
Definition: rtfexport.cxx:145
void WriteUserPropType(int nType)
Writes a single user property type.
Definition: rtfexport.cxx:573
void AppendBookmarks(const SwTextNode &rNode, sal_Int32 nCurrentPos, sal_Int32 nLen, const SwRedlineData *pSwRedlineData=nullptr) override
Definition: rtfexport.cxx:120
OString getStream()
Get the contents of the memory stream as a string.
Definition: rtfexport.cxx:1181
void WriteFonts()
Definition: rtfexport.cxx:438
void OutColorTable()
Definition: rtfexport.cxx:1280
void WriteInfo()
Definition: rtfexport.cxx:515
void WriteUserProps()
Writes the userprops group: user defined document properties.
Definition: rtfexport.cxx:585
rtl_TextEncoding m_eCurrentEncoding
Definition: rtfexport.hxx:166
AttributeOutputBase & AttrOutput() const override
Access to the attribute output class.
Definition: rtfexport.cxx:80
void DoFormText(const SwInputField *pField) override
Definition: rtfexport.cxx:392
void OutputField(const SwField *pField, ww::eField eFieldType, const OUString &rFieldCmd, FieldFlags nMode=FieldFlags::All) override
Write the field.
Definition: rtfexport.cxx:316
SvStream & Strm()
Definition: rtfexport.cxx:1171
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:777
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:1065
void OutputLinkedOLE(const OUString &rLink) override
Definition: rtfexport.cxx:1125
void AppendSection(const SwPageDesc *pPageDesc, const SwSectionFormat *pFormat, sal_uLong nLnNum) override
Definition: rtfexport.cxx:1135
sal_uInt16 GetRedline(const OUString &rAuthor)
Definition: rtfexport.cxx:1437
bool DisallowInheritingOutlineNumbering(const SwFormat &rFormat) override
Return value indicates if an inherited outline numbering is suppressed.
Definition: rtfexport.cxx:1086
void resetStream()
Return back to the real stream.
Definition: rtfexport.cxx:1191
void WritePageDescTable()
Writes the writer-specific \pgdsctbl group.
Definition: rtfexport.cxx:732
void DoComboBox(const OUString &rName, const OUString &rHelp, const OUString &ToolTip, const OUString &rSelected, const css::uno::Sequence< OUString > &rListItems) override
Definition: rtfexport.cxx:385
void WriteFootnoteSettings()
Definition: rtfexport.cxx:455
RtfSdrExport & SdrExporter() const
Access to the Rtf Sdr exporter.
Definition: rtfexport.cxx:84
void InsColor(const Color &rCol)
Definition: rtfexport.cxx:1232
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:228
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:380
void WriteMainText()
Definition: rtfexport.cxx:470
void WriteDocVars()
Writes document variables.
Definition: rtfexport.cxx:681
OString * GetStyle(sal_uInt16 nId)
Definition: rtfexport.cxx:1429
sal_uInt64 ReplaceCr(sal_uInt8 nChar) override
Definition: rtfexport.cxx:430
void InsStyle(sal_uInt16 nId, const OString &rStyle)
Definition: rtfexport.cxx:1424
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 & WriteNumberAsString(N n)
SvStream & WriteOString(std::string_view rStr)
SvStream & WriteChar(char nChar)
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:727
Definition: doc.hxx:197
SwPageDesc * FindPageDesc(const OUString &rName, size_t *pPos=nullptr) const
Definition: docdesc.cxx:947
SwSectionFormats & GetSections()
Definition: doc.hxx:1356
const SwFootnoteInfo & GetFootnoteInfo() const
Definition: doc.hxx:645
bool IsUsed(const sw::BroadcastingModify &) const
Definition: poolfmt.cxx:86
size_t GetPageDescCnt() const
Definition: doc.hxx:895
const SwNumRuleTable & GetNumRuleTable() const
Definition: doc.hxx:1081
SwNumRule * GetOutlineNumRule() const
Definition: doc.hxx:1039
const SwLineNumberInfo & GetLineNumberInfo() const
Definition: lineinfo.cxx:49
SwNodes & GetNodes()
Definition: doc.hxx:422
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:349
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:419
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:190
const SwEndNoteInfo & GetEndNoteInfo() const
Definition: doc.hxx:647
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1337
::sw::MetaFieldManager & GetMetaFieldManager()
Definition: doc.cxx:137
SwDocShell * GetDocShell()
Definition: doc.hxx:1370
const SwPageDesc & GetPageDesc(const size_t i) const
Definition: doc.hxx:896
Ends a section of nodes in the document model.
Definition: node.hxx:378
sal_uInt16 m_nFootnoteOffset
Definition: ftninfo.hxx:47
SvxNumberType m_aFormat
Definition: ftninfo.hxx:46
Base class of all fields.
Definition: fldbas.hxx:296
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
Definition: fldbas.cxx:491
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:98
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:100
Style of a layout element.
Definition: frmfmt.hxx:72
const OUString & GetHelp() const
Definition: expfld.cxx:1412
const OUString & GetToolTip() const
Definition: expfld.cxx:1422
virtual OUString GetPar2() const override
aPromptText
Definition: expfld.cxx:1402
< 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:98
SwSectionNode * GetSectionNode()
Definition: node.hxx:658
SwNodeOffset GetIndex() const
Definition: node.hxx:312
bool IsContentNode() const
Definition: node.hxx:188
bool IsSectionNode() const
Definition: node.hxx:192
bool IsTableNode() const
Definition: node.hxx:191
const SwStartNode * StartOfSectionNode() const
Definition: node.hxx:153
SwContentNode * GetContentNode()
Definition: node.hxx:666
SwTableNode * GetTableNode()
Definition: node.hxx:650
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:695
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:188
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:268
const SwSection & GetSection() const
Definition: node.hxx:590
SwSectionFormat * GetFormat()
Definition: section.hxx:341
const SwTable & GetTable() const
Definition: node.hxx:542
SwTableFormat * GetFrameFormat()
Definition: swtable.hxx:209
Represents the style of a paragraph.
Definition: fmtcol.hxx:61
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
bool IsOutline() const
Returns if this text node is an outline.
Definition: ndtxt.cxx:4138
size_t size() const
Definition: docary.hxx:88
SvxZoomType GetZoomType() const
Definition: viewopt.hxx:710
sal_uInt16 GetZoom() const
Definition: viewopt.hxx:669
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:452
bool m_bWriteOnlyFirstTable
Definition: shellio.hxx:413
SvStream & Strm()
Definition: writer.cxx:193
virtual ErrCode WriteStream()=0
const Color & GetColor() const
knows all meta-fields in the document.
Definition: fmtmeta.hxx:202
const css::uno::Reference< css::document::XDocumentProperties > & getDocumentProperties() const
Definition: fmtatr2.cxx:856
static OUString GetGeneratorString()
sal_uInt16 GetId(const SvxFontItem &rFont)
Definition: wrtw8sty.cxx:950
void WriteFontTable(SvStream *pTableStream, WW8Fib &pFib)
Definition: wrtw8sty.cxx:967
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
OUString sName
@ FTNNUM_PAGE
Definition: ftninfo.hxx:87
@ FTNNUM_DOC
Definition: ftninfo.hxx:87
@ FTNPOS_CHAPTER
Definition: ftninfo.hxx:82
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
constexpr TypedWhichId< SwFormatHeader > RES_HEADER(102)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(113)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(99)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
constexpr TypedWhichId< SwFormatFooter > RES_FOOTER(103)
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
constexpr TypedWhichId< SvxOverlineItem > RES_CHRATR_OVERLINE(38)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(112)
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_CHRATR_BOX(40)
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
const SfxPoolItem * GetDfltAttr(sal_uInt16 nWhich)
Get the default attribute from corresponding default attribute table.
Definition: hints.cxx:147
sal_Int64 n
DECL_LISTENERMULTIPLEXER_END void SAL_CALL inserted(::sal_Int32 ID) override
const long LONG_MAX
#define SAL_INFO(area, stream)
int i
OString OutStringUpr(std::string_view pToken, std::u16string_view rStr, rtl_TextEncoding eDestEnc)
OString OutString(std::u16string_view rStr, rtl_TextEncoding eDestEnc, bool bUnicode=true)
const sal_uInt8 PageBreak
const HdFtFlags WW8_HEADER_FIRST
Definition: ww8scan.hxx:1601
const HdFtFlags WW8_FOOTER_ODD
Definition: ww8scan.hxx:1600
const HdFtFlags WW8_FOOTER_EVEN
Definition: ww8scan.hxx:1599
const HdFtFlags WW8_HEADER_EVEN
Definition: ww8scan.hxx:1597
const HdFtFlags WW8_FOOTER_FIRST
Definition: ww8scan.hxx:1602
const HdFtFlags WW8_HEADER_ODD
Definition: ww8scan.hxx:1598
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.
sal_uInt32 RGBToBGR(::Color nColour)
Definition: ww8struc.hxx:1087
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:1578
#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 LO_STRING_SVTOOLS_RTF_NOBRKWRPTBL
#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:254
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)