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