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_pDoc->GetNumRuleTable();
207 
208  SwNumRule* pOutlineRule = m_pDoc->GetOutlineNumRule();
209  if (IsExportNumRule(*pOutlineRule))
210  GetNumberingId(*pOutlineRule);
211 
212  for (auto n = rListTable.size(); n;)
213  {
214  SwNumRule* pRule = rListTable[--n];
215  if (!SwDoc::IsUsed(*pRule))
216  continue;
217 
218  if (IsExportNumRule(*pRule))
219  GetNumberingId(*pRule);
220  }
221 }
222 
224 {
225  SAL_INFO("sw.rtf", OSL_THIS_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", OSL_THIS_FUNC << " end");
253 }
254 
256 {
257  int nRevAuthors = m_pDoc->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& rLeftFormat,
290  const SwFrameFormat& rFirstPageFormat, sal_uInt8 /*nBreakCode*/)
291 {
292  // headers
293  if (nHeadFootFlags & nsHdFtFlags::WW8_HEADER_EVEN)
295 
296  if (nHeadFootFlags & nsHdFtFlags::WW8_HEADER_ODD)
298 
299  if (nHeadFootFlags & nsHdFtFlags::WW8_HEADER_FIRST)
300  WriteHeaderFooter(rFirstPageFormat, true, OOO_STRING_SVTOOLS_RTF_HEADERF, true);
301 
302  // footers
303  if (nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_EVEN)
305 
306  if (nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_ODD)
308 
309  if (nHeadFootFlags & nsHdFtFlags::WW8_FOOTER_FIRST)
310  WriteHeaderFooter(rFirstPageFormat, false, OOO_STRING_SVTOOLS_RTF_FOOTERF, true);
311 }
312 
313 void RtfExport::OutputField(const SwField* pField, ww::eField eFieldType, const OUString& rFieldCmd,
314  FieldFlags nMode)
315 {
316  m_pAttrOutput->WriteField_Impl(pField, eFieldType, rFieldCmd, nMode);
317 }
318 
319 void RtfExport::WriteFormData(const ::sw::mark::IFieldmark& /*rFieldmark*/)
320 {
321  SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC);
322 }
323 
324 void RtfExport::WriteHyperlinkData(const ::sw::mark::IFieldmark& /*rFieldmark*/)
325 {
326  SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC);
327 }
328 
329 void RtfExport::DoComboBox(const OUString& /*rName*/, const OUString& /*rHelp*/,
330  const OUString& /*rToolTip*/, const OUString& /*rSelected*/,
331  const uno::Sequence<OUString>& /*rListItems*/)
332 {
333  // this is handled in RtfAttributeOutput::OutputFlyFrame_Impl
334 }
335 
337 {
338  OUString sResult = pField->ExpandField(true, nullptr);
339  const OUString& rHelp = pField->GetHelp();
340  OUString sName = pField->GetPar2();
341  const OUString& rStatus = pField->GetToolTip();
342  m_pAttrOutput->RunText().append("{" OOO_STRING_SVTOOLS_RTF_FIELD
344  "{ FORMTEXT }");
345  m_pAttrOutput->RunText().append(
348  if (!rHelp.isEmpty())
350  if (!rStatus.isEmpty())
352  m_pAttrOutput->RunText().append(OOO_STRING_SVTOOLS_RTF_FFTYPETXT "0");
353 
354  if (!sName.isEmpty())
355  m_pAttrOutput->RunText()
358  .append("}");
359  if (!rHelp.isEmpty())
360  m_pAttrOutput->RunText()
363  .append("}");
364  m_pAttrOutput->RunText()
367  .append("}");
368  if (!rStatus.isEmpty())
369  m_pAttrOutput->RunText()
372  .append("}");
373  m_pAttrOutput->RunText().append("}}}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " ");
374  m_pAttrOutput->RunText()
376  .append("}}");
377 }
378 
380 {
381  // Completely unused for Rtf export... only here for code sharing
382  // purpose with binary export
383 
384  return 0;
385 }
386 
388 {
389  Strm()
391  .WriteChar('{')
394  Strm().WriteChar('}');
395 }
396 
398 {
399  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start");
400  m_pStyles->OutputStylesTable();
401  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end");
402 }
403 
405 {
406  const SwPageFootnoteInfo& rFootnoteInfo = m_pDoc->GetPageDesc(0).GetFootnoteInfo();
407  // Request a separator only in case the width is larger than zero.
408  bool bSeparator = double(rFootnoteInfo.GetWidth()) > 0;
409 
410  Strm()
411  .WriteChar('{')
414  if (bSeparator)
416  Strm().WriteChar('}');
417 }
418 
420 {
421  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start");
422 
423  if (std::unique_ptr<SvxBrushItem> oBrush = getBackground(); oBrush)
424  {
429 
430  std::vector<std::pair<OString, OString>> aProperties;
431  aProperties.push_back(std::make_pair<OString, OString>("shapeType", "1"));
432  aProperties.push_back(std::make_pair<OString, OString>(
433  "fillColor", OString::number(wwUtility::RGBToBGR(oBrush->GetColor()))));
434  for (const std::pair<OString, OString>& rPair : aProperties)
435  {
438  Strm().WriteOString(rPair.first);
440  Strm().WriteOString(rPair.second);
441  Strm().WriteCharPtr("}}");
442  }
443  Strm().WriteChar('}'); // shpinst
444  Strm().WriteChar('}'); // shp
445  Strm().WriteChar('}'); // background
446  }
447 
448  SwTableNode* pTableNode = m_pCurPam->GetNode().FindTableNode();
449  if (m_pWriter && m_pWriter->m_bWriteOnlyFirstTable && pTableNode != nullptr)
450  {
451  m_pCurPam->GetPoint()->nNode = *pTableNode;
452  m_pCurPam->GetMark()->nNode = *(pTableNode->EndOfSectionNode());
453  }
454  else
455  {
456  m_pCurPam->GetPoint()->nNode
458  }
459 
460  WriteText();
461 
462  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end");
463 }
464 
466 {
467  OString aGenerator
468  = OUStringToOString(utl::DocInfoHelper::GetGeneratorString(), RTL_TEXTENCODING_UTF8);
469  Strm()
471  .WriteOString(aGenerator)
472  .WriteChar('}');
474 
475  SwDocShell* pDocShell(m_pDoc->GetDocShell());
476  uno::Reference<document::XDocumentProperties> xDocProps;
477  if (pDocShell)
478  {
479  uno::Reference<document::XDocumentPropertiesSupplier> xDPS(pDocShell->GetModel(),
480  uno::UNO_QUERY);
481  xDocProps.set(xDPS->getDocumentProperties());
482  }
483 
484  if (xDocProps.is())
485  {
486  // Handle user-defined properties.
487  uno::Reference<beans::XPropertyContainer> xUserDefinedProperties
488  = xDocProps->getUserDefinedProperties();
489  if (xUserDefinedProperties.is())
490  {
491  uno::Reference<beans::XPropertySet> xPropertySet(xUserDefinedProperties,
492  uno::UNO_QUERY);
493  uno::Reference<beans::XPropertySetInfo> xPropertySetInfo
494  = xPropertySet->getPropertySetInfo();
495  // Do we have explicit markup in RTF for this property name?
496  if (xPropertySetInfo->hasPropertyByName("Company"))
497  {
498  OUString aValue;
499  xPropertySet->getPropertyValue("Company") >>= aValue;
501  }
502  }
503 
504  OutUnicode(OOO_STRING_SVTOOLS_RTF_TITLE, xDocProps->getTitle(), true);
505  OutUnicode(OOO_STRING_SVTOOLS_RTF_SUBJECT, xDocProps->getSubject());
506 
508  ::comphelper::string::convertCommaSeparated(xDocProps->getKeywords()));
509  OutUnicode(OOO_STRING_SVTOOLS_RTF_DOCCOMM, xDocProps->getDescription());
510 
511  OutUnicode(OOO_STRING_SVTOOLS_RTF_AUTHOR, xDocProps->getAuthor());
512  OutDateTime(OOO_STRING_SVTOOLS_RTF_CREATIM, xDocProps->getCreationDate());
513 
514  OutUnicode(OOO_STRING_SVTOOLS_RTF_AUTHOR, xDocProps->getModifiedBy());
515  OutDateTime(OOO_STRING_SVTOOLS_RTF_REVTIM, xDocProps->getModificationDate());
516 
517  OutDateTime(OOO_STRING_SVTOOLS_RTF_PRINTIM, xDocProps->getPrintDate());
518  }
519 
520  Strm().WriteChar('}');
521 }
522 
524 {
526  OutULong(nType);
527 }
528 
529 void RtfExport::WriteUserPropValue(const OUString& rValue)
530 {
533  Strm().WriteChar('}');
534 }
535 
537 {
538  Strm().WriteChar('{').WriteCharPtr(
540 
541  SwDocShell* pDocShell(m_pDoc->GetDocShell());
542  uno::Reference<document::XDocumentProperties> xDocProps;
543  if (pDocShell)
544  {
545  uno::Reference<document::XDocumentPropertiesSupplier> xDPS(pDocShell->GetModel(),
546  uno::UNO_QUERY);
547  xDocProps.set(xDPS->getDocumentProperties());
548  }
549  else
550  {
551  // Clipboard document, read metadata from the meta field manager.
553  xDocProps.set(rManager.getDocumentProperties());
554  }
555 
556  if (xDocProps.is())
557  {
558  // Handle user-defined properties.
559  uno::Reference<beans::XPropertyContainer> xUserDefinedProperties
560  = xDocProps->getUserDefinedProperties();
561  if (xUserDefinedProperties.is())
562  {
563  uno::Reference<beans::XPropertySet> xPropertySet(xUserDefinedProperties,
564  uno::UNO_QUERY);
565  const uno::Sequence<beans::Property> aProperties
566  = xPropertySet->getPropertySetInfo()->getProperties();
567 
568  for (const beans::Property& rProperty : aProperties)
569  {
570  if (rProperty.Name.startsWith("Company"))
571  // We have explicit markup in RTF for this property.
572  continue;
573 
574  // Property name.
576  Strm().WriteCharPtr(
577  msfilter::rtfutil::OutString(rProperty.Name, m_eDefaultEncoding).getStr());
578  Strm().WriteChar('}');
579 
580  // Property value.
581  OUString aValue;
582  double fValue;
583  bool bValue;
584  util::DateTime aDate;
585  uno::Any aAny = xPropertySet->getPropertyValue(rProperty.Name);
586  if (aAny >>= bValue)
587  {
588  WriteUserPropType(11);
589  WriteUserPropValue(OUString::number(static_cast<int>(bValue)));
590  }
591  else if (aAny >>= aValue)
592  {
593  WriteUserPropType(30);
594  WriteUserPropValue(aValue);
595  }
596  else if (aAny >>= fValue)
597  {
598  aValue = OUString::number(fValue);
599  if (aValue.indexOf('.') == -1)
600  {
601  // Integer.
603  WriteUserPropValue(aValue);
604  }
605  else
606  {
607  // Real number.
609  WriteUserPropValue(aValue);
610  }
611  }
612  else if (aAny >>= aDate)
613  {
614  WriteUserPropType(64);
615  // Format is 'YYYY. MM. DD.'.
616  aValue += OUString::number(aDate.Year) + ". ";
617  if (aDate.Month < 10)
618  aValue += "0";
619  aValue += OUString::number(aDate.Month) + ". ";
620  if (aDate.Day < 10)
621  aValue += "0";
622  aValue += OUString::number(aDate.Day) + ".";
623  WriteUserPropValue(aValue);
624  }
625  }
626  }
627  }
628 
629  Strm().WriteChar('}');
630 }
631 
633 {
634  // Write page descriptions (page styles)
635  std::size_t nSize = m_pDoc->GetPageDescCnt();
636  if (!nSize)
637  return;
638 
640  m_bOutPageDescs = true;
641  Strm()
642  .WriteChar('{')
645  for (std::size_t n = 0; n < nSize; ++n)
646  {
647  const SwPageDesc& rPageDesc = m_pDoc->GetPageDesc(n);
648 
649  Strm()
651  .WriteChar('{')
654  OutULong(static_cast<sal_uLong>(rPageDesc.ReadUseOn()));
655 
656  OutPageDescription(rPageDesc, false);
657 
658  // search for the next page description
659  std::size_t i = nSize;
660  while (i)
661  if (rPageDesc.GetFollow() == &m_pDoc->GetPageDesc(--i))
662  break;
664  OutULong(i).WriteChar(' ');
665  Strm()
666  .WriteCharPtr(
668  .WriteCharPtr(";}");
669  }
671  m_bOutPageDescs = false;
672 
673  // reset table infos, otherwise the depth of the cells will be incorrect,
674  // in case the page style (header or footer) had tables
675  m_pTableInfo = std::make_shared<ww8::WW8TableInfo>();
676 }
677 
679 {
680  // Make the header
681  Strm()
682  .WriteChar('{')
684  .WriteChar('1')
688  // If this not exist, MS don't understand our ansi characters (0x80-0xff).
689  Strm().WriteCharPtr("\\adeflang1025");
690 
691  // Font table
692  WriteFonts();
693 
694  m_pStyles = std::make_unique<MSWordStyles>(*this);
695  // Color and stylesheet table
696  WriteStyles();
697 
698  // List table
699  BuildNumbering();
700  WriteNumbering();
701 
702  WriteRevTab();
703 
704  WriteInfo();
705  WriteUserProps();
706  // Default TabSize
707  Strm()
708  .WriteOString(m_pAttrOutput->GetTabStop().makeStringAndClear())
709  .WriteCharPtr(SAL_NEWLINE_STRING);
710 
711  // Automatic hyphenation: it's a global setting in Word, it's a paragraph setting in Writer.
712  // Set it's value to "auto" and disable on paragraph level, if no hyphenation is used there.
714  OutULong(1);
715 
716  // Zoom
718  if (pViewShell && pViewShell->GetViewOptions()->GetZoomType() == SvxZoomType::PERCENT)
719  {
721  OutULong(pViewShell->GetViewOptions()->GetZoom());
722  }
723  // Record changes?
726  // Mirror margins?
729  // Init sections
730  m_pSections = new MSWordSections(*this);
731 
732  // Page description
734 
735  // Enable form protection by default if needed, as there is no switch to
736  // enable it on a per-section basis. OTOH don't always enable it as it
737  // breaks moving of drawings - so write it only in case there is really a
738  // protected section in the document.
739  for (auto const& pSectionFormat : m_pDoc->GetSections())
740  {
741  if (!pSectionFormat->IsInUndo() && pSectionFormat->GetProtect().IsContentProtected())
742  {
744  break;
745  }
746  }
747 
748  // enable form field shading
750 
751  // size and empty margins of the page
752  if (m_pDoc->GetPageDescCnt())
753  {
754  // Seeking the first SwFormatPageDesc. If no set, the default is valid
755  const SwFormatPageDesc* pSttPgDsc = nullptr;
756  {
757  const SwNode& rSttNd
759  const SfxItemSet* pSet = nullptr;
760 
761  if (rSttNd.IsContentNode())
762  pSet = &rSttNd.GetContentNode()->GetSwAttrSet();
763  else if (rSttNd.IsTableNode())
764  pSet = &rSttNd.GetTableNode()->GetTable().GetFrameFormat()->GetAttrSet();
765 
766  else if (rSttNd.IsSectionNode())
767  pSet = &rSttNd.GetSectionNode()->GetSection().GetFormat()->GetAttrSet();
768 
769  if (pSet)
770  {
771  std::size_t nPosInDoc;
772  pSttPgDsc = &pSet->Get(RES_PAGEDESC);
773  if (!pSttPgDsc->GetPageDesc())
774  pSttPgDsc = nullptr;
775  else if (m_pDoc->FindPageDesc(pSttPgDsc->GetPageDesc()->GetName(), &nPosInDoc))
776  {
777  Strm()
778  .WriteChar('{')
781  OutULong(nPosInDoc).WriteChar('}');
782  }
783  }
784  }
785  const SwPageDesc& rPageDesc
786  = pSttPgDsc ? *pSttPgDsc->GetPageDesc() : m_pDoc->GetPageDesc(0);
787  const SwFrameFormat& rFormatPage = rPageDesc.GetMaster();
788 
789  {
790  if (rPageDesc.GetLandscape())
792 
793  const SwFormatFrameSize& rSz = rFormatPage.GetFrameSize();
794  // Clipboard document is always created without a printer, then
795  // the size will be always LONG_MAX! Solution then is to use A4
796  if (LONG_MAX == rSz.GetHeight() || LONG_MAX == rSz.GetWidth())
797  {
800  OutULong(a4.Height()).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_PAPERW);
801  OutULong(a4.Width());
802  }
803  else
804  {
806  OutULong(rSz.GetHeight()).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_PAPERW);
807  OutULong(rSz.GetWidth());
808  }
809  }
810 
811  {
812  const SvxLRSpaceItem& rLR = rFormatPage.GetLRSpace();
814  OutLong(rLR.GetLeft()).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_MARGR);
815  OutLong(rLR.GetRight());
816  }
817 
818  {
819  const SvxULSpaceItem& rUL = rFormatPage.GetULSpace();
821  OutLong(rUL.GetUpper()).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_MARGB);
822  OutLong(rUL.GetLower());
823  }
824 
825  Strm()
828  m_pAttrOutput->SectFootnoteEndnotePr();
829  // All sections are unlocked by default
831  OutLong(1);
832  OutPageDescription(rPageDesc, true); // Changed bCheckForFirstPage to true so headers
833  // following title page are correctly added - i13107
834  if (pSttPgDsc)
835  {
836  m_pCurrentPageDesc = &rPageDesc;
837  }
838  }
839 
840  // line numbering
841  const SwLineNumberInfo& rLnNumInfo = m_pDoc->GetLineNumberInfo();
842  if (rLnNumInfo.IsPaintLineNumbers())
843  {
844  sal_uLong nLnNumRestartNo = 0;
845  if (const WW8_SepInfo* pSectionInfo = m_pSections->CurrentSectionInfo())
846  nLnNumRestartNo = pSectionInfo->nLnNumRestartNo;
847 
848  AttrOutput().SectionLineNumbering(nLnNumRestartNo, rLnNumInfo);
849  }
850 
851  {
852  // write the footnotes and endnotes-out Info
853  const SwFootnoteInfo& rFootnoteInfo = m_pDoc->GetFootnoteInfo();
854 
855  const char* pOut = FTNPOS_CHAPTER == rFootnoteInfo.m_ePos ? OOO_STRING_SVTOOLS_RTF_ENDDOC
858  OutLong(rFootnoteInfo.m_nFootnoteOffset + 1);
859 
860  switch (rFootnoteInfo.m_eNum)
861  {
862  case FTNNUM_PAGE:
864  break;
865  case FTNNUM_DOC:
867  break;
868  default:
870  break;
871  }
872  Strm().WriteCharPtr(pOut);
873 
874  switch (rFootnoteInfo.m_aFormat.GetNumberingType())
875  {
879  break;
883  break;
884  case SVX_NUM_ROMAN_LOWER:
886  break;
887  case SVX_NUM_ROMAN_UPPER:
889  break;
892  break;
893  default:
895  break;
896  }
897  Strm().WriteCharPtr(pOut);
898 
899  const SwEndNoteInfo& rEndNoteInfo = m_pDoc->GetEndNoteInfo();
900 
901  Strm()
905  OutLong(rEndNoteInfo.m_nFootnoteOffset + 1);
906 
907  switch (rEndNoteInfo.m_aFormat.GetNumberingType())
908  {
912  break;
916  break;
917  case SVX_NUM_ROMAN_LOWER:
919  break;
920  case SVX_NUM_ROMAN_UPPER:
922  break;
925  break;
926  default:
928  break;
929  }
930  Strm().WriteCharPtr(pOut);
931  }
932 
934  // RTF default is true, so write compat flag if this should be false.
936 
938 
940 
941  WriteMainText();
942 
943  Strm().WriteChar('}');
944 
945  return ERRCODE_NONE;
946 }
947 
948 void RtfExport::PrepareNewPageDesc(const SfxItemSet* pSet, const SwNode& rNd,
949  const SwFormatPageDesc* pNewPgDescFormat,
950  const SwPageDesc* pNewPgDesc)
951 {
952  const SwSectionFormat* pFormat = GetSectionFormat(rNd);
953  const sal_uLong nLnNm = GetSectionLineNo(pSet, rNd);
954 
955  OSL_ENSURE(pNewPgDescFormat || pNewPgDesc, "Neither page desc format nor page desc provided.");
956 
957  if (pNewPgDescFormat)
958  m_pSections->AppendSection(*pNewPgDescFormat, rNd, pFormat, nLnNm);
959  else if (pNewPgDesc)
960  m_pSections->AppendSection(pNewPgDesc, rNd, pFormat, nLnNm);
961 
962  // Don't insert a page break, when we're changing page style just because the next page has to be a different one.
963  if (!m_pAttrOutput->GetPrevPageDesc()
964  || m_pAttrOutput->GetPrevPageDesc()->GetFollow() != pNewPgDesc)
966 }
967 
969 {
970  bool bRet(false);
971 
972  if (SfxItemState::SET != rFormat.GetItemState(RES_PARATR_NUMRULE, false))
973  {
974  if (const SwFormat* pParent = rFormat.DerivedFrom())
975  {
976  if (static_cast<const SwTextFormatColl*>(pParent)
977  ->IsAssignedToListLevelOfOutlineStyle())
978  {
979  // Level 9 disables the outline
981 
982  bRet = true;
983  }
984  }
985  }
986 
987  return bRet;
988 }
989 
990 void RtfExport::OutputEndNode(const SwEndNode& rEndNode)
991 {
992  if (TXT_MAINTEXT == m_nTextTyp && rEndNode.StartOfSectionNode()->IsTableNode())
993  // End node of a table: see if a section break should be written after the table.
994  AttrOutput().SectionBreaks(rEndNode);
995 }
996 
997 void RtfExport::OutputGrfNode(const SwGrfNode& /*rGrfNode*/)
998 {
999  /* noop, see RtfAttributeOutput::FlyFrameGraphic */
1000 }
1001 
1002 void RtfExport::OutputOLENode(const SwOLENode& /*rOLENode*/)
1003 {
1004  /* noop, see RtfAttributeOutput::FlyFrameOLE */
1005 }
1006 
1007 void RtfExport::OutputLinkedOLE(const OUString& /*rLinked*/) {}
1008 
1010 {
1011  m_nCurrentNodeIndex = rNode.GetIndex();
1012  if (!m_bOutOutlineOnly || rNode.IsOutline())
1014  m_nCurrentNodeIndex = 0;
1015 }
1016 
1017 void RtfExport::AppendSection(const SwPageDesc* pPageDesc, const SwSectionFormat* pFormat,
1018  sal_uLong nLnNum)
1019 {
1020  m_pSections->AppendSection(pPageDesc, pFormat, nLnNum);
1022 }
1023 
1025  std::shared_ptr<SwUnoCursor>& pCurrentPam, SwPaM* pOriginalPam,
1026  Writer* pWriter, bool bOutOutlineOnly)
1027  : MSWordExportBase(pDocument, pCurrentPam, pOriginalPam)
1028  , m_pFilter(pFilter)
1029  , m_pWriter(pWriter)
1030  , m_pSections(nullptr)
1031  , m_bOutOutlineOnly(bOutOutlineOnly)
1032  , m_eDefaultEncoding(
1033  rtl_getTextEncodingFromWindowsCharset(sw::ms::rtl_TextEncodingToWinCharset(DEF_ENCODING)))
1034  , m_eCurrentEncoding(m_eDefaultEncoding)
1035  , m_bRTFFlySyntax(false)
1036  , m_nCurrentNodeIndex(0)
1037 {
1038  m_bExportModeRTF = true;
1039  // the attribute output for the document
1040  m_pAttrOutput = std::make_unique<RtfAttributeOutput>(*this);
1041  // that just causes problems for RTF
1042  m_bSubstituteBullets = false;
1043  // needed to have a complete font table
1045  // the related SdrExport
1046  m_pSdrExport = std::make_unique<RtfSdrExport>(*this);
1047 
1048  if (!m_pWriter)
1050 }
1051 
1052 RtfExport::~RtfExport() = default;
1053 
1055 {
1056  if (m_pStream)
1057  return *m_pStream;
1058 
1059  return m_pWriter->Strm();
1060 }
1061 
1062 void RtfExport::setStream() { m_pStream = std::make_unique<SvMemoryStream>(); }
1063 
1065 {
1066  OString aRet;
1067 
1068  if (m_pStream)
1069  aRet = OString(static_cast<const char*>(m_pStream->GetData()), m_pStream->Tell());
1070 
1071  return aRet;
1072 }
1073 
1075 
1077 
1078 SvStream& RtfExport::OutLong(long nVal) { return Writer::OutLong(Strm(), nVal); }
1079 
1080 void RtfExport::OutUnicode(const char* pToken, const OUString& rContent, bool bUpr)
1081 {
1082  if (!rContent.isEmpty())
1083  {
1084  if (!bUpr)
1085  {
1086  Strm().WriteChar('{').WriteCharPtr(pToken).WriteChar(' ');
1087  Strm().WriteCharPtr(
1088  msfilter::rtfutil::OutString(rContent, m_eCurrentEncoding).getStr());
1089  Strm().WriteChar('}');
1090  }
1091  else
1092  Strm().WriteCharPtr(
1093  msfilter::rtfutil::OutStringUpr(pToken, rContent, m_eCurrentEncoding).getStr());
1094  }
1095 }
1096 
1097 void RtfExport::OutDateTime(const char* pStr, const util::DateTime& rDT)
1098 {
1104  OutULong(rDT.Minutes).WriteChar('}');
1105 }
1106 
1107 sal_uInt16 RtfExport::GetColor(const Color& rColor) const
1108 {
1109  for (const auto& rEntry : m_aColTable)
1110  if (rEntry.second == rColor)
1111  {
1112  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " returning " << rEntry.first << " ("
1113  << rColor.GetRed() << "," << rColor.GetGreen() << ","
1114  << rColor.GetBlue() << ")");
1115  return rEntry.first;
1116  }
1117  OSL_FAIL("No such Color in m_aColTable!");
1118  return 0;
1119 }
1120 
1121 void RtfExport::InsColor(const Color& rCol)
1122 {
1123  sal_uInt16 n;
1124  bool bAutoColorInTable = false;
1125  for (const auto& rEntry : m_aColTable)
1126  {
1127  if (rEntry.second == rCol)
1128  return; // Already in the table
1129  if (rEntry.second == COL_AUTO)
1130  bAutoColorInTable = true;
1131  }
1132  if (rCol == COL_AUTO)
1133  // COL_AUTO gets value 0
1134  n = 0;
1135  else
1136  {
1137  // other colors get values >0
1138  n = m_aColTable.size();
1139  if (!bAutoColorInTable)
1140  // reserve value "0" for COL_AUTO (if COL_AUTO wasn't inserted until now)
1141  n++;
1142  }
1143  m_aColTable.insert(std::pair<sal_uInt16, Color>(n, rCol));
1144 }
1145 
1147 {
1148  const editeng::SvxBorderLine* pLine = nullptr;
1149 
1150  if (rBox.GetTop())
1151  {
1152  pLine = rBox.GetTop();
1153  InsColor(pLine->GetColor());
1154  }
1155  if (rBox.GetBottom() && pLine != rBox.GetBottom())
1156  {
1157  pLine = rBox.GetBottom();
1158  InsColor(pLine->GetColor());
1159  }
1160  if (rBox.GetLeft() && pLine != rBox.GetLeft())
1161  {
1162  pLine = rBox.GetLeft();
1163  InsColor(pLine->GetColor());
1164  }
1165  if (rBox.GetRight() && pLine != rBox.GetRight())
1166  InsColor(rBox.GetRight()->GetColor());
1167 }
1168 
1170 {
1171  // Build the table from rPool since the colors provided to
1172  // RtfAttributeOutput callbacks are too late.
1173  const SfxItemPool& rPool = m_pDoc->GetAttrPool();
1174 
1175  // MSO Word uses a default color table with 16 colors (which is used e.g. for highlighting)
1184  InsColor(COL_BLUE);
1185  InsColor(COL_CYAN);
1188  InsColor(COL_RED);
1190  InsColor(COL_GRAY);
1192 
1193  // char color
1194  {
1195  auto pCol = GetDfltAttr(RES_CHRATR_COLOR);
1196  InsColor(pCol->GetValue());
1197  if ((pCol = rPool.GetPoolDefaultItem(RES_CHRATR_COLOR)))
1198  InsColor(pCol->GetValue());
1199  for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_CHRATR_COLOR))
1200  {
1201  if ((pCol = dynamic_cast<const SvxColorItem*>(pItem)))
1202  InsColor(pCol->GetValue());
1203  }
1204 
1205  auto pUnder = GetDfltAttr(RES_CHRATR_UNDERLINE);
1206  InsColor(pUnder->GetColor());
1207  for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_CHRATR_UNDERLINE))
1208  {
1209  if ((pUnder = dynamic_cast<const SvxUnderlineItem*>(pItem)))
1210  InsColor(pUnder->GetColor());
1211  }
1212 
1213  auto pOver = GetDfltAttr(RES_CHRATR_OVERLINE);
1214  InsColor(pOver->GetColor());
1215  for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_CHRATR_OVERLINE))
1216  {
1217  if ((pOver = dynamic_cast<const SvxOverlineItem*>(pItem)))
1218  InsColor(pOver->GetColor());
1219  }
1220  }
1221 
1222  // background color
1223  static const sal_uInt16 aBrushIds[] = { RES_BACKGROUND, RES_CHRATR_BACKGROUND, 0 };
1224 
1225  for (const sal_uInt16* pIds = aBrushIds; *pIds; ++pIds)
1226  {
1227  auto pBackground = static_cast<const SvxBrushItem*>(GetDfltAttr(*pIds));
1228  InsColor(pBackground->GetColor());
1229  if ((pBackground = static_cast<const SvxBrushItem*>(rPool.GetPoolDefaultItem(*pIds))))
1230  {
1231  InsColor(pBackground->GetColor());
1232  }
1233  for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(*pIds))
1234  {
1235  if ((pBackground = static_cast<const SvxBrushItem*>(pItem)))
1236  {
1237  InsColor(pBackground->GetColor());
1238  }
1239  }
1240  }
1241 
1242  // shadow color
1243  {
1244  auto pShadow = GetDfltAttr(RES_SHADOW);
1245  InsColor(pShadow->GetColor());
1246  if (nullptr != (pShadow = rPool.GetPoolDefaultItem(RES_SHADOW)))
1247  {
1248  InsColor(pShadow->GetColor());
1249  }
1250  for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_SHADOW))
1251  {
1252  if ((pShadow = dynamic_cast<const SvxShadowItem*>(pItem)))
1253  {
1254  InsColor(pShadow->GetColor());
1255  }
1256  }
1257  }
1258 
1259  // frame border color
1260  {
1261  const SvxBoxItem* pBox;
1262  if (nullptr != (pBox = rPool.GetPoolDefaultItem(RES_BOX)))
1263  InsColorLine(*pBox);
1264  for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_BOX))
1265  {
1266  if ((pBox = dynamic_cast<const SvxBoxItem*>(pItem)))
1267  InsColorLine(*pBox);
1268  }
1269  }
1270 
1271  {
1272  const SvxBoxItem* pCharBox;
1273  if ((pCharBox = rPool.GetPoolDefaultItem(RES_CHRATR_BOX)))
1274  InsColorLine(*pCharBox);
1275  for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_CHRATR_BOX))
1276  {
1277  if ((pCharBox = dynamic_cast<const SvxBoxItem*>(pItem)))
1278  InsColorLine(*pCharBox);
1279  }
1280  }
1281 
1282  // TextFrame or paragraph background solid fill.
1283  for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(XATTR_FILLCOLOR))
1284  {
1285  if (auto pColorItem = dynamic_cast<const XFillColorItem*>(pItem))
1286  InsColor(pColorItem->GetColorValue());
1287  }
1288 
1289  for (std::size_t n = 0; n < m_aColTable.size(); ++n)
1290  {
1291  const Color& rCol = m_aColTable[n];
1292  if (n || COL_AUTO != rCol)
1293  {
1295  OutULong(rCol.GetRed()).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_GREEN);
1296  OutULong(rCol.GetGreen()).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_BLUE);
1297  OutULong(rCol.GetBlue());
1298  }
1299  Strm().WriteChar(';');
1300  }
1301 }
1302 
1303 void RtfExport::InsStyle(sal_uInt16 nId, const OString& rStyle)
1304 {
1305  m_aStyTable.insert(std::pair<sal_uInt16, OString>(nId, rStyle));
1306 }
1307 
1308 OString* RtfExport::GetStyle(sal_uInt16 nId)
1309 {
1310  auto it = m_aStyTable.find(nId);
1311  if (it != m_aStyTable.end())
1312  return &it->second;
1313  return nullptr;
1314 }
1315 
1316 sal_uInt16 RtfExport::GetRedline(const OUString& rAuthor)
1317 {
1318  auto it = m_aRedlineTable.find(rAuthor);
1319  if (it != m_aRedlineTable.end())
1320  return it->second;
1321 
1322  const sal_uInt16 nId = m_aRedlineTable.size();
1323  m_aRedlineTable.insert(std::pair<OUString, sal_uInt16>(rAuthor, nId));
1324  return nId;
1325 }
1326 
1327 const OUString* RtfExport::GetRedline(sal_uInt16 nId)
1328 {
1329  for (const auto& rEntry : m_aRedlineTable)
1330  if (rEntry.second == nId)
1331  return &rEntry.first;
1332  return nullptr;
1333 }
1334 
1335 void RtfExport::OutPageDescription(const SwPageDesc& rPgDsc, bool bCheckForFirstPage)
1336 {
1337  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start");
1338  const SwPageDesc* pSave = m_pCurrentPageDesc;
1339 
1340  m_pCurrentPageDesc = &rPgDsc;
1341  if (bCheckForFirstPage && m_pCurrentPageDesc->GetFollow()
1344 
1347 
1348  const SwFormat* pFormat = &m_pCurrentPageDesc->GetMaster(); //GetLeft();
1349  m_bOutPageDescs = true;
1350  if (m_pCurrentPageDesc != &rPgDsc)
1352  OutputFormat(*pFormat, true, false);
1353  m_pFirstPageItemSet = nullptr;
1354  m_bOutPageDescs = false;
1355 
1356  // normal header / footer (without a style)
1357  const SfxPoolItem* pItem;
1359  == SfxItemState::SET)
1360  WriteHeaderFooter(*pItem, true);
1362  == SfxItemState::SET)
1363  WriteHeaderFooter(*pItem, false);
1364 
1365  // title page
1366  if (m_pCurrentPageDesc != &rPgDsc)
1367  {
1369  m_pCurrentPageDesc = &rPgDsc;
1371  == SfxItemState::SET)
1372  WriteHeaderFooter(*pItem, true);
1374  == SfxItemState::SET)
1375  WriteHeaderFooter(*pItem, false);
1376  }
1377 
1378  // numbering type
1380  std::nullopt);
1381 
1382  m_pCurrentPageDesc = pSave;
1383  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end");
1384 }
1385 
1386 void RtfExport::WriteHeaderFooter(const SfxPoolItem& rItem, bool bHeader)
1387 {
1388  if (bHeader)
1389  {
1390  const auto& rHeader = static_cast<const SwFormatHeader&>(rItem);
1391  if (!rHeader.IsActive())
1392  return;
1393  }
1394  else
1395  {
1396  const auto& rFooter = static_cast<const SwFormatFooter&>(rItem);
1397  if (!rFooter.IsActive())
1398  return;
1399  }
1400 
1401  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start");
1402 
1403  const char* pStr = (bHeader ? OOO_STRING_SVTOOLS_RTF_HEADER : OOO_STRING_SVTOOLS_RTF_FOOTER);
1404  /* is this a title page? */
1406  {
1409  }
1410  Strm().WriteChar('{').WriteCharPtr(pStr);
1412  Strm().WriteChar('}');
1413 
1414  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end");
1415 }
1416 
1417 void RtfExport::WriteHeaderFooter(const SwFrameFormat& rFormat, bool bHeader, const char* pStr,
1418  bool bTitlepg)
1419 {
1420  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start");
1421 
1422  m_pAttrOutput->WriteHeaderFooter_Impl(rFormat, bHeader, pStr, bTitlepg);
1423 
1424  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end");
1425 }
1426 
1427 namespace
1428 {
1430 class SwRTFWriter : public Writer
1431 {
1432 private:
1433  bool m_bOutOutlineOnly;
1434 
1435 public:
1436  SwRTFWriter(const OUString& rFilterName, const OUString& rBaseURL);
1437 
1438  ErrCode WriteStream() override;
1439 };
1440 }
1441 
1442 SwRTFWriter::SwRTFWriter(const OUString& rFilterName, const OUString& rBaseURL)
1443 {
1444  SetBaseURL(rBaseURL);
1445  // export outline nodes, only (send outline to clipboard/presentation)
1446  m_bOutOutlineOnly = rFilterName.startsWith("O");
1447 }
1448 
1449 ErrCode SwRTFWriter::WriteStream()
1450 {
1451  std::shared_ptr<SwUnoCursor> pCurPam(m_pDoc->CreateUnoCursor(*m_pCurrentPam->End(), false));
1452  pCurPam->SetMark();
1453  *pCurPam->GetPoint() = *m_pCurrentPam->Start();
1454  RtfExport aExport(nullptr, m_pDoc, pCurPam, m_pCurrentPam.get(), this, m_bOutOutlineOnly);
1455  aExport.ExportDocument(true);
1456  return ERRCODE_NONE;
1457 }
1458 
1459 extern "C" SAL_DLLPUBLIC_EXPORT void ExportRTF(const OUString& rFltName, const OUString& rBaseURL,
1460  WriterRef& xRet)
1461 {
1462  xRet = new SwRTFWriter(rFltName, rBaseURL);
1463 }
1464 
1465 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long GetLeft() const
SvxNumType GetNumberingType() const
long Width() const
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:682
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:1076
#define OOO_STRING_SVTOOLS_RTF_FOOTERL
std::shared_ptr< SwUnoCursor > CreateUnoCursor(const SwPosition &rPos, bool bTableCursor=false)
Definition: doc.cxx:1781
RedlineFlags m_nOrigRedlineFlags
Remember the original redline mode.
Definition: wrtww8.hxx:493
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(93)
SVX_NUM_CHARS_UPPER_LETTER_N
sal_uLong GetIndex() const
Definition: node.hxx:282
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:1593
Class to collect and output the sections/headers/footers.
Definition: wrtww8.hxx:198
constexpr::Color COL_BROWN(0x80, 0x80, 0x00)
void WriteMainText()
Definition: rtfexport.cxx:419
#define LO_STRING_SVTOOLS_RTF_LISTPICTURE
constexpr::Color COL_BLACK(0x00, 0x00, 0x00)
OString * GetStyle(sal_uInt16 nId)
Definition: rtfexport.cxx:1308
sal_uInt8 GetRed() const
bool IsSectionNode() const
Definition: node.hxx:644
void WriteHeaderFooter(const SfxPoolItem &rItem, bool bHeader)
Definition: rtfexport.cxx:1386
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:990
#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:218
sal_uInt16 GetLower() const
MSWordSections * m_pSections
Sections/headers/footers.
Definition: rtfexport.hxx:46
#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:329
SwPageDesc * GetPageDesc()
Definition: fmtpdsc.hxx:62
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:570
bool IsOutline() const
Returns if this text node is an outline.
Definition: ndtxt.cxx:3994
static SvStream & OutLong(SvStream &rStrm, long nVal)
Definition: writer.cxx:226
SvStream & WriteInt32(sal_Int32 nInt32)
SwDocShell * GetDocShell()
Definition: doc.hxx:1350
constexpr TypedWhichId< SwFormatHeader > RES_HEADER(96)
constexpr::Color COL_LIGHTGREEN(0x00, 0xFF, 0x00)
long Height() const
#define OOO_STRING_SVTOOLS_RTF_AFTNNALC
const SwNumFormat * GetNumFormat(sal_uInt16 i) const
Definition: number.cxx:88
const SfxPoolItem * GetPoolDefaultItem(sal_uInt16 nWhich) const
RtfColorTable m_aColTable
Definition: rtfexport.hxx:226
constexpr::Color COL_RED(0x80, 0x00, 0x00)
long GetWidth() const
static sal_uLong GetSectionLineNo(const SfxItemSet *pSet, const SwNode &rNd)
Line number of the section start.
Definition: ww8atr.cxx:645
void OutputGrfNode(const SwGrfNode &rGrfNode) override
Output SwGrfNode.
Definition: rtfexport.cxx:997
#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
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
void WriteFontTable(SvStream *pTableStream, WW8Fib &pFib)
Definition: wrtw8sty.cxx:915
RtfExport(RtfExportFilter *pFilter, SwDoc *pDocument, std::shared_ptr< SwUnoCursor > &pCurrentPam, SwPaM *pOriginalPam, Writer *pWriter, bool bOutOutlineOnly=false)
Pass the pDocument, pCurrentPam and pOriginalPam to the base class.
Definition: rtfexport.cxx:1024
Base class of all fields.
Definition: fldbas.hxx:293
void WriteNumbering() override
Write the numbering table.
Definition: rtfexport.cxx:223
#define OOO_STRING_SVTOOLS_RTF_PGDSCNXT
SVX_NUM_CHARS_UPPER_LETTER
knows all meta-fields in the document.
Definition: fmtmeta.hxx:198
#define OOO_STRING_SVTOOLS_RTF_FORMFIELD
SvStream & Strm()
Definition: rtfexport.cxx:1054
sal_Int64 n
bool m_bOutPageDescs
PageDescs (section properties) are being written.
Definition: wrtww8.hxx:558
Definition: doc.hxx:186
void DoFormText(const SwInputField *pField) override
Definition: rtfexport.cxx:336
#define OOO_STRING_SVTOOLS_RTF_FFNAME
#define OOO_STRING_SVTOOLS_RTF_FTNNALC
sal_Int16 nId
#define OOO_STRING_SVTOOLS_RTF_ANSI
constexpr::Color COL_GRAY(0x80, 0x80, 0x80)
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
#define OOO_STRING_SVTOOLS_RTF_FIELD
constexpr::Color COL_LIGHTRED(0xFF, 0x00, 0x00)
SwSectionFormat * GetFormat()
Definition: section.hxx:337
SvStream & WriteOString(const OString &rStr)
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
constexpr::Color COL_YELLOW(0xFF, 0xFF, 0x00)
#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
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
SwTableFormat * GetFrameFormat()
Definition: swtable.hxx:201
const OUString & GetHelp() const
Definition: expfld.cxx:1407
#define OOO_STRING_SVTOOLS_RTF_AUTHOR
bool m_bOutOutlineOnly
Definition: rtfexport.hxx:49
virtual void SectionBreak(sal_uInt8 nC, bool bBreakAfter, const WW8_SepInfo *pSectionInfo=nullptr)=0
Write a section break msword::ColumnBreak or msword::PageBreak bBreakAfter: the break must be schedul...
const OUString & GetName() const
Definition: pagedesc.hxx:187
sal_uInt16 GetRedline(const OUString &rAuthor)
Definition: rtfexport.cxx:1316
size_type size() const
Definition: docary.hxx:266
#define OOO_STRING_SVTOOLS_RTF_AFTNSTART
constexpr::Color COL_MAGENTA(0x80, 0x00, 0x80)
const SwSection & GetSection() const
Definition: node.hxx:541
SwDoc * m_pDoc
Definition: docbm.cxx:1192
Writer * m_pWriter
Definition: rtfexport.hxx:40
void OutputField(const SwField *pField, ww::eField eFieldType, const OUString &rFieldCmd, FieldFlags nMode=FieldFlags::All) override
Write the field.
Definition: rtfexport.cxx:313
#define OOO_STRING_SVTOOLS_RTF_AFTNNAR
constexpr::Color COL_AUTO(0xFF, 0xFF, 0xFF, 0xFF)
const SwPageFootnoteInfo & GetFootnoteInfo() const
Definition: pagedesc.hxx:196
void WriteText()
Iterate through the nodes and call the appropriate OutputNode() on them.
Definition: wrtww8.cxx:2769
sal_uInt16 sal_Unicode
void AppendBookmarks(const SwTextNode &rNode, sal_Int32 nCurrentPos, sal_Int32 nLen) override
Definition: rtfexport.cxx:116
FieldFlags
Definition: wrtww8.hxx:146
SwTableNode * GetTableNode()
Definition: node.hxx:599
bool m_bWriteOnlyFirstTable
Definition: shellio.hxx:415
#define OOO_STRING_SVTOOLS_RTF_FTNNAR
PropertiesInfo aProperties
void InsStyle(sal_uInt16 nId, const OString &rStyle)
Definition: rtfexport.cxx:1303
The class that does all the actual RTF export-related work.
Definition: rtfexport.hxx:36
bool m_bExportModeRTF
Definition: wrtww8.hxx:574
void InsColorLine(const SvxBoxItem &rBox)
Definition: rtfexport.cxx:1146
#define OOO_STRING_SVTOOLS_RTF_HEADERF
constexpr::Color COL_LIGHTCYAN(0x00, 0xFF, 0xFF)
#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:523
void OutputFormat(const SwFormat &rFormat, bool bPapFormat, bool bChpFormat, bool bFlyFormat=false)
Output attributes.
Definition: ww8atr.cxx:788
#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:1009
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:1007
std::shared_ptr< SwUnoCursor > & m_pCurPam
Definition: wrtww8.hxx:581
PAPER_A4
eField
Definition: fields.hxx:26
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
oslFileHandle & pOut
SVX_NUM_ROMAN_UPPER
sal_uInt32 RGBToBGR(::Color nColour)
Definition: ww8struc.hxx:1078
bool DisallowInheritingOutlineNumbering(const SwFormat &rFormat) override
Return value indicates if an inherited outline numbering is suppressed.
Definition: rtfexport.cxx:968
const SwTable & GetTable() const
Definition: node.hxx:497
const HdFtFlags WW8_FOOTER_EVEN
Definition: ww8scan.hxx:1590
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
#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:483
#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:1459
const OUString & GetSuffix() const
#define OOO_STRING_SVTOOLS_RTF_YR
sal_uInt8 GetBlue() const
#define OOO_STRING_SVTOOLS_RTF_SP
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:1589
SwPageDesc * FindPageDesc(const OUString &rName, size_t *pPos=nullptr) const
Definition: docdesc.cxx:821
Base class for various Writer styles.
Definition: format.hxx:43
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:1534
void InsColor(const Color &rCol)
Definition: rtfexport.cxx:1121
OString OutStringUpr(const char *pToken, const OUString &rStr, rtl_TextEncoding eDestEnc)
bool IsContentNode() const
Definition: node.hxx:628
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:97
const editeng::SvxBorderLine * GetTop() const
void WriteFormData(const ::sw::mark::IFieldmark &rFieldmark) override
Write the data of the form field.
Definition: rtfexport.cxx:319
#define OOO_STRING_SVTOOLS_RTF_FTNRSTCONT
Style of a layout element.
Definition: frmfmt.hxx:57
#define OOO_STRING_SVTOOLS_RTF_HEADERL
void WriteHeadersFooters(sal_uInt8 nHeadFootFlags, const SwFrameFormat &rFormat, const SwFrameFormat &rLeftFormat, const SwFrameFormat &rFirstPageFormat, sal_uInt8 nBreakCode) override
Output the actual headers and footers.
Definition: rtfexport.cxx:288
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:131
void WriteUserProps()
Writes the userprops group: user defined document properties.
Definition: rtfexport.cxx:536
#define OOO_STRING_SVTOOLS_RTF_AENDDOC
const SwPageDesc & GetPageDesc(const size_t i) const
Definition: doc.hxx:880
void setStream()
From now on, let Strm() return a memory stream, not a real one.
Definition: rtfexport.cxx:1062
#define OOO_STRING_SVTOOLS_RTF_LANDSCAPE
const Color & GetColor() const
bool GetLandscape() const
Definition: pagedesc.hxx:190
#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:2167
sal_uInt16 m_nFootnoteOffset
Definition: ftninfo.hxx:47
SwContentNode * GetContentNode()
Definition: node.hxx:615
#define OOO_STRING_SVTOOLS_RTF_PGDSC
UseOnPage ReadUseOn() const
Definition: pagedesc.hxx:215
virtual void SectionPageNumbering(sal_uInt16 nNumType, const ::std::optional< sal_uInt16 > &oPageRestartNumber)=0
The style of the page numbers.
const WW8_SepInfo * CurrentSectionInfo()
The most recent WW8_SepInfo.
Definition: wrtw8sty.cxx:1087
size_t GetPageDescCnt() const
Definition: doc.hxx:879
size_t size() const
Definition: docary.hxx:84
void WriteRevTab()
Write the revision table.
Definition: rtfexport.cxx:255
#define OOO_STRING_SVTOOLS_RTF_SECTD
SvxNumberType m_aFormat
Definition: ftninfo.hxx:46
#define OOO_STRING_SVTOOLS_RTF_PGDSCTBL
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
Definition: format.cxx:396
Writer & GetWriter()
#define OOO_STRING_SVTOOLS_RTF_SHP
void WriteStyles()
Definition: rtfexport.cxx:397
#define OOO_STRING_SVTOOLS_RTF_RED
constexpr::Color COL_LIGHTMAGENTA(0xFF, 0x00, 0xFF)
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:1335
constexpr TypedWhichId< SvxOverlineItem > RES_CHRATR_OVERLINE(38)
#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:404
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
SvStream & OutLong(long nVal)
Definition: rtfexport.cxx:1078
void OutDateTime(const char *pStr, const css::util::DateTime &rDT)
Definition: rtfexport.cxx:1097
const SwPageDesc * GetFollow() const
Definition: pagedesc.hxx:246
#define OOO_STRING_SVTOOLS_RTF_FFSTATTEXT
void AppendSection(const SwPageDesc *pPageDesc, const SwSectionFormat *pFormat, sal_uLong nLnNum) override
Definition: rtfexport.cxx:1017
void WriteHeaderFooterText(const SwFormat &rFormat, bool bHeader)
Write header/footer text.
Definition: wrtw8sty.cxx:1977
OString OUStringToOString(const OUString &str, ConnectionSettings const *settings)
sal_uInt8 GetGreen() const
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
void AppendSection(const SwPageDesc *pPd, const SwSectionFormat *pSectionFormat, sal_uLong nLnNumRestartNo, bool bIsFirstParagraph=false)
Definition: wrtw8sty.cxx:1095
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:78
void WriteFonts()
Definition: rtfexport.cxx:387
#define OOO_STRING_SVTOOLS_RTF_FTNRESTART
sal_uInt16 GetNumberingId(const SwNumRule &rNumRule)
Return the numeric id of the numbering rule.
Definition: wrtw8num.cxx:114
void WriteFootnoteSettings()
Definition: rtfexport.cxx:404
SwFormat * DerivedFrom() const
Definition: format.hxx:108
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:217
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
#define OOO_STRING_SVTOOLS_RTF_LISTOVERRIDETABLE
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:80
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:1064
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
Definition: fldbas.cxx:443
OString OutString(const OUString &rStr, rtl_TextEncoding eDestEnc, bool bUnicode=true)
void resetStream()
Return back to the real stream.
Definition: rtfexport.cxx:1074
Footnote information.
Definition: pagedesc.hxx:48
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:334
#define OOO_STRING_SVTOOLS_RTF_HEADER
#define OOO_STRING_SVTOOLS_RTF_KEYWORDS
const SwPageDesc * m_pCurrentPageDesc
Definition: wrtww8.hxx:500
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:462
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CJK_WEIGHT(26)
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
#define ERRCODE_NONE
bool IsPaintLineNumbers() const
Definition: lineinfo.hxx:80
#define OOO_STRING_SVTOOLS_RTF_LNDSCPSXN
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:836
void OutputOLENode(const SwOLENode &rOLENode) override
Output SwOLENode.
Definition: rtfexport.cxx:1002
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:1065
#define OOO_STRING_SVTOOLS_RTF_AFTNNRUC
bool bLoadAllFonts
If true, all fonts are loaded before processing the document.
Definition: wrtww8.hxx:341
#define OOO_STRING_SVTOOLS_RTF_FLDINST
#define SAL_INFO(area, stream)
#define OOO_STRING_SVTOOLS_RTF_PGDSCUSE
const HdFtFlags WW8_HEADER_FIRST
Definition: ww8scan.hxx:1592
bool IsUsed(const SwModify &) const
Definition: poolfmt.cxx:84
static SvStream & OutULong(SvStream &rStrm, sal_uLong nVal)
Definition: writer.cxx:235
void OutColorTable()
Definition: rtfexport.cxx:1169
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:175
SwNodes & GetNodes()
Definition: doc.hxx:405
#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:552
void NumberingDefinitions()
Write static data of SwNumRule - LSTF.
Definition: wrtw8num.cxx:213
::sw::MetaFieldManager & GetMetaFieldManager()
Definition: doc.cxx:127
#define LO_STRING_SVTOOLS_RTF_VIEWBKSP
sal_uInt16 GetId(const SvxFontItem &rFont)
Definition: wrtw8sty.cxx:898
ErrCode ExportDocument_Impl() override
Format-dependent part of the actual export.
Definition: rtfexport.cxx:678
void ExportGrfBullet(const SwTextNode &rNd) override
Definition: rtfexport.cxx:177
#define OOO_STRING_SVTOOLS_RTF_LEVEL
constexpr::Color COL_WHITE(0xFF, 0xFF, 0xFF)
bool GetBookmarks(const SwTextNode &rNd, sal_Int32 nStt, sal_Int32 nEnd, IMarkVector &rArr)
Definition: wrtw8nds.cxx:1903
#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:379
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:1951
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:723
long GetRight() const
#define OOO_STRING_SVTOOLS_RTF_PROPNAME
constexpr::Color COL_LIGHTBLUE(0x00, 0x00, 0xFF)
#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:324
#define OOO_STRING_SVTOOLS_RTF_ENDDOC
const OUString & GetToolTip() const
Definition: expfld.cxx:1417
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:1578
constexpr TypedWhichId< SwFormatFooter > RES_FOOTER(97)
SVX_NUM_SYMBOL_CHICAGO
#define OOO_STRING_SVTOOLS_RTF_SV
SwFootnotePos m_ePos
Definition: ftninfo.hxx:96
Base class for WW8Export and DocxExport.
Definition: wrtww8.hxx:453
sal_uInt16 GetColor(const Color &rColor) const
Definition: rtfexport.cxx:1107
#define OOO_STRING_SVTOOLS_RTF_FTNSTART
bool IsTableNode() const
Definition: node.hxx:640
constexpr::Color COL_BLUE(0x00, 0x00, 0x80)
#define OOO_STRING_SVTOOLS_RTF_DEFF
SwSectionNode * GetSectionNode()
Definition: node.hxx:607
Ends a section of nodes in the document model.
Definition: node.hxx:333
void OutUnicode(const char *pToken, const OUString &rContent, bool bUpr=false)
Definition: rtfexport.cxx:1080
#define LO_STRING_SVTOOLS_RTF_HTMAUTSP
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:116
#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:588
void PrepareNewPageDesc(const SfxItemSet *pSet, const SwNode &rNd, const SwFormatPageDesc *pNewPgDescFormat, const SwPageDesc *pNewPgDesc) override
Get ready for a new section.
Definition: rtfexport.cxx:948
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
Definition: ndarr.hxx:161
long GetHeight() const
#define OOO_STRING_SVTOOLS_RTF_MARGMIRROR
#define OOO_STRING_SVTOOLS_RTF_FORMPROT
void WritePageDescTable()
Writes the writer-specific group.
Definition: rtfexport.cxx:632
SwSectionFormats & GetSections()
Definition: doc.hxx:1336
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:1397
const SwFootnoteInfo & GetFootnoteInfo() const
Definition: doc.hxx:626
OUString convertCommaSeparated(uno::Sequence< OUString > const &i_rSeq)
wwFontHelper m_aFontHelper
Definition: wrtww8.hxx:456
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(107)
#define OOO_STRING_SVTOOLS_RTF_HR
SwDoc * m_pDoc
Definition: wrtww8.hxx:579
const SwEndNoteInfo & GetEndNoteInfo() const
Definition: doc.hxx:628
#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:1518
const HdFtFlags WW8_FOOTER_ODD
Definition: ww8scan.hxx:1591
std::vector< const Graphic * > m_vecBulletPic
Vector to record all the graphics of bullets.
Definition: wrtww8.hxx:923
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1317
static const SwSectionFormat * GetSectionFormat(const SwNode &rNd)
Format of the section.
Definition: ww8atr.cxx:632
#define OOO_STRING_SVTOOLS_RTF_VIEWSCALE
void AbstractNumberingDefinitions()
Write all Levels for all SwNumRules - LVLF.
Definition: wrtw8num.cxx:409
void WriteInfo()
Definition: rtfexport.cxx:465
SwNumRule * GetOutlineNumRule() const
Definition: doc.hxx:1023
void WriteUserPropValue(const OUString &rValue)
Writes a single user property value.
Definition: rtfexport.cxx:529
sal_uInt16 GetUpper() const
std::unique_ptr< MSWordStyles > m_pStyles
Definition: wrtww8.hxx:506
ErrCode ExportDocument(bool bWriteAll)
The main function to export the document.
Definition: wrtww8.cxx:3282
const HdFtFlags WW8_HEADER_EVEN
Definition: ww8scan.hxx:1588
#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:79
static bool IsExportNumRule(const SwNumRule &rRule)
Definition: rtfexport.cxx:184
#define OOO_STRING_SVTOOLS_RTF_AFTNNRLC
const SvxNumberType & GetNumType() const
Definition: pagedesc.hxx:193