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/i18n/ScriptType.hpp>
27 #include <com/sun/star/beans/XPropertySet.hpp>
28 #include <com/sun/star/beans/XPropertySetInfo.hpp>
29 #include <docsh.hxx>
30 #include <viewsh.hxx>
31 #include <viewopt.hxx>
32 #include <fmtpdsc.hxx>
33 #include <ftninfo.hxx>
34 #include <fmthdft.hxx>
35 #include <editeng/colritem.hxx>
36 #include <editeng/udlnitem.hxx>
37 #include <editeng/fontitem.hxx>
38 #include <editeng/paperinf.hxx>
39 #include <editeng/brushitem.hxx>
40 #include <editeng/protitem.hxx>
41 #include <editeng/lrspitem.hxx>
42 #include <editeng/ulspitem.hxx>
43 #include <editeng/boxitem.hxx>
44 #include <editeng/shaditem.hxx>
45 #include <lineinfo.hxx>
46 #include <poolfmt.hxx>
47 #include <redline.hxx>
48 #include <swmodule.hxx>
51 #include <comphelper/string.hxx>
52 #include <svtools/rtfkeywd.hxx>
55 #include <osl/diagnose.h>
56 #include <rtl/tencinfo.h>
57 #include <sal/log.hxx>
58 #if OSL_DEBUG_LEVEL > 1
59 #include <iostream>
60 #endif
61 #include <svx/xflclit.hxx>
63 #include <fmtmeta.hxx>
65 #include <fmtfsize.hxx>
66 #include <ndtxt.hxx>
67 #include <numrule.hxx>
68 #include <frmatr.hxx>
69 #include <swtable.hxx>
70 #include <IMark.hxx>
71 
72 using namespace ::com::sun::star;
73 
74 // the default text encoding for the export, if it doesn't fit unicode will
75 // be used
76 #define DEF_ENCODING RTL_TEXTENCODING_ASCII_US
77 
79 
81 
83 
84 bool RtfExport::CollapseScriptsforWordOk(sal_uInt16 nScript, sal_uInt16 nWhich)
85 {
86  // FIXME is this actually true for rtf? - this is copied from DOCX
87  if (nScript == i18n::ScriptType::ASIAN)
88  {
89  // for asian in ww8, there is only one fontsize
90  // and one fontstyle (posture/weight)
91  switch (nWhich)
92  {
94  case RES_CHRATR_POSTURE:
95  case RES_CHRATR_WEIGHT:
96  return false;
97  default:
98  break;
99  }
100  }
101  else if (nScript != i18n::ScriptType::COMPLEX)
102  {
103  // for western in ww8, there is only one fontsize
104  // and one fontstyle (posture/weight)
105  switch (nWhich)
106  {
110  return false;
111  default:
112  break;
113  }
114  }
115  return true;
116 }
117 
118 void RtfExport::AppendBookmarks(const SwTextNode& rNode, sal_Int32 nCurrentPos, sal_Int32 nLen)
119 {
120  std::vector<OUString> aStarts;
121  std::vector<OUString> aEnds;
122 
123  IMarkVector aMarks;
124  if (GetBookmarks(rNode, nCurrentPos, nCurrentPos + nLen, aMarks))
125  {
126  for (const auto& pMark : aMarks)
127  {
128  const sal_Int32 nStart = pMark->GetMarkStart().nContent.GetIndex();
129  const sal_Int32 nEnd = pMark->GetMarkEnd().nContent.GetIndex();
130 
131  if (nStart == nCurrentPos)
132  aStarts.push_back(pMark->GetName());
133 
134  if (nEnd == nCurrentPos)
135  aEnds.push_back(pMark->GetName());
136  }
137  }
138 
139  m_pAttrOutput->WriteBookmarks_Impl(aStarts, aEnds);
140 }
141 
142 void RtfExport::AppendBookmark(const OUString& rName)
143 {
144  std::vector<OUString> aStarts;
145  std::vector<OUString> aEnds;
146 
147  aStarts.push_back(rName);
148  aEnds.push_back(rName);
149 
150  m_pAttrOutput->WriteBookmarks_Impl(aStarts, aEnds);
151 }
152 
153 void RtfExport::AppendAnnotationMarks(const SwWW8AttrIter& rAttrs, sal_Int32 nCurrentPos,
154  sal_Int32 nLen)
155 {
156  std::vector<OUString> aStarts;
157  std::vector<OUString> aEnds;
158 
159  IMarkVector aMarks;
160  if (GetAnnotationMarks(rAttrs, nCurrentPos, nCurrentPos + nLen, aMarks))
161  {
162  for (const auto& pMark : aMarks)
163  {
164  const sal_Int32 nStart = pMark->GetMarkStart().nContent.GetIndex();
165  const sal_Int32 nEnd = pMark->GetMarkEnd().nContent.GetIndex();
166 
167  if (nStart == nCurrentPos)
168  aStarts.push_back(pMark->GetName());
169 
170  if (nEnd == nCurrentPos)
171  aEnds.push_back(pMark->GetName());
172  }
173  }
174 
175  m_pAttrOutput->WriteAnnotationMarks_Impl(aStarts, aEnds);
176 }
177 
178 //For i120928,to export graphic of bullet for RTF filter
180 {
181  // Noop, would be too late, see WriteNumbering() instead.
182 }
183 
184 void RtfExport::WriteChar(sal_Unicode /*c*/) { /* WriteChar() has nothing to do for rtf. */}
185 
186 static bool IsExportNumRule(const SwNumRule& rRule)
187 {
188  sal_uInt8 nEnd = MAXLEVEL;
189  while (nEnd-- && !rRule.GetNumFormat(nEnd))
190  ;
191  ++nEnd;
192 
193  sal_uInt8 nLvl;
194 
195  for (nLvl = 0; nLvl < nEnd; ++nLvl)
196  {
197  const SwNumFormat* pNFormat = &rRule.Get(nLvl);
198  if (SVX_NUM_NUMBER_NONE != pNFormat->GetNumberingType() || !pNFormat->GetPrefix().isEmpty()
199  || (!pNFormat->GetSuffix().isEmpty() && pNFormat->GetSuffix() != "."))
200  break;
201  }
202 
203  return nLvl != nEnd;
204 }
205 
207 {
208  const SwNumRuleTable& rListTable = m_pDoc->GetNumRuleTable();
209 
210  SwNumRule* pOutlineRule = m_pDoc->GetOutlineNumRule();
211  if (IsExportNumRule(*pOutlineRule))
212  GetNumberingId(*pOutlineRule);
213 
214  for (auto n = rListTable.size(); n;)
215  {
216  SwNumRule* pRule = rListTable[--n];
217  if (!SwDoc::IsUsed(*pRule))
218  continue;
219 
220  if (IsExportNumRule(*pRule))
221  GetNumberingId(*pRule);
222  }
223 }
224 
226 {
227  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start");
228 
229  if (!m_pUsedNumTable)
230  return; // no numbering is used
231 
232  Strm()
233  .WriteChar('{')
236 
238  if (!m_vecBulletPic.empty())
239  Strm()
240  .WriteChar('{')
244  if (!m_vecBulletPic.empty())
245  Strm().WriteChar('}');
246 
248  Strm().WriteChar('}');
249 
252  Strm().WriteChar('}');
253 
254  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end");
255 }
256 
258 {
259  int nRevAuthors = m_pDoc->getIDocumentRedlineAccess().GetRedlineTable().size();
260 
261  if (nRevAuthors < 1)
262  return;
263 
264  // RTF always seems to use Unknown as the default first entry
265  GetRedline("Unknown");
266 
268  {
269  GetRedline(SW_MOD()->GetRedlineAuthor(pRedl->GetAuthor()));
270  }
271 
272  // Now write the table
273  Strm()
274  .WriteChar('{')
277  .WriteChar(' ');
278  for (std::size_t i = 0; i < m_aRedlineTable.size(); ++i)
279  {
280  const OUString* pAuthor = GetRedline(i);
281  Strm().WriteChar('{');
282  if (pAuthor)
283  Strm().WriteCharPtr(
285  Strm().WriteCharPtr(";}");
286  }
288 }
289 
290 void RtfExport::WriteHeadersFooters(sal_uInt8 nHeadFootFlags, const SwFrameFormat& rFormat,
291  const SwFrameFormat& rLeftFormat,
292  const SwFrameFormat& rFirstPageFormat, sal_uInt8 /*nBreakCode*/)
293 {
294  // headers
295  if (nHeadFootFlags & nsHdFtFlags::WW8_HEADER_EVEN)
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)
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: " << OSL_THIS_FUNC);
324 }
325 
326 void RtfExport::WriteHyperlinkData(const ::sw::mark::IFieldmark& /*rFieldmark*/)
327 {
328  SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_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()
360  .append("}");
361  if (!rHelp.isEmpty())
362  m_pAttrOutput->RunText()
365  .append("}");
366  m_pAttrOutput->RunText()
369  .append("}");
370  if (!rStatus.isEmpty())
371  m_pAttrOutput->RunText()
374  .append("}");
375  m_pAttrOutput->RunText().append("}}}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " ");
376  m_pAttrOutput->RunText()
378  .append("}}");
379 }
380 
382 {
383  // Completely unused for Rtf export... only here for code sharing
384  // purpose with binary export
385 
386  return 0;
387 }
388 
390 {
391  Strm()
393  .WriteChar('{')
396  Strm().WriteChar('}');
397 }
398 
400 {
401  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start");
402  m_pStyles->OutputStylesTable();
403  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end");
404 }
405 
407 {
408  const SwPageFootnoteInfo& rFootnoteInfo = m_pDoc->GetPageDesc(0).GetFootnoteInfo();
409  // Request a separator only in case the width is larger than zero.
410  bool bSeparator = double(rFootnoteInfo.GetWidth()) > 0;
411 
412  Strm()
413  .WriteChar('{')
416  if (bSeparator)
418  Strm().WriteChar('}');
419 }
420 
422 {
423  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start");
424 
425  if (std::shared_ptr<SvxBrushItem> oBrush = getBackground(); oBrush)
426  {
431 
432  std::vector<std::pair<OString, OString>> aProperties;
433  aProperties.push_back(std::make_pair<OString, OString>("shapeType", "1"));
434  aProperties.push_back(std::make_pair<OString, OString>(
435  "fillColor", OString::number(wwUtility::RGBToBGR(oBrush->GetColor()))));
436  for (const std::pair<OString, OString>& rPair : aProperties)
437  {
440  Strm().WriteCharPtr(rPair.first.getStr());
442  Strm().WriteCharPtr(rPair.second.getStr());
443  Strm().WriteCharPtr("}}");
444  }
445  Strm().WriteChar('}'); // shpinst
446  Strm().WriteChar('}'); // shp
447  Strm().WriteChar('}'); // background
448  }
449 
450  SwTableNode* pTableNode = m_pCurPam->GetNode().FindTableNode();
451  if (m_pWriter && m_pWriter->m_bWriteOnlyFirstTable && pTableNode != nullptr)
452  {
453  m_pCurPam->GetPoint()->nNode = *pTableNode;
454  m_pCurPam->GetMark()->nNode = *(pTableNode->EndOfSectionNode());
455  }
456  else
457  {
458  m_pCurPam->GetPoint()->nNode
460  }
461 
462  WriteText();
463 
464  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end");
465 }
466 
468 {
469  OString aGenerator
470  = OUStringToOString(utl::DocInfoHelper::GetGeneratorString(), RTL_TEXTENCODING_UTF8);
471  Strm()
473  .WriteCharPtr(aGenerator.getStr())
474  .WriteChar('}');
476 
477  SwDocShell* pDocShell(m_pDoc->GetDocShell());
478  uno::Reference<document::XDocumentProperties> xDocProps;
479  if (pDocShell)
480  {
481  uno::Reference<document::XDocumentPropertiesSupplier> xDPS(pDocShell->GetModel(),
482  uno::UNO_QUERY);
483  xDocProps.set(xDPS->getDocumentProperties());
484  }
485 
486  if (xDocProps.is())
487  {
488  // Handle user-defined properties.
489  uno::Reference<beans::XPropertyContainer> xUserDefinedProperties
490  = xDocProps->getUserDefinedProperties();
491  if (xUserDefinedProperties.is())
492  {
493  uno::Reference<beans::XPropertySet> xPropertySet(xUserDefinedProperties,
494  uno::UNO_QUERY);
495  uno::Reference<beans::XPropertySetInfo> xPropertySetInfo
496  = xPropertySet->getPropertySetInfo();
497  // Do we have explicit markup in RTF for this property name?
498  if (xPropertySetInfo->hasPropertyByName("Company"))
499  {
500  OUString aValue;
501  xPropertySet->getPropertyValue("Company") >>= aValue;
503  }
504  }
505 
506  OutUnicode(OOO_STRING_SVTOOLS_RTF_TITLE, xDocProps->getTitle(), true);
507  OutUnicode(OOO_STRING_SVTOOLS_RTF_SUBJECT, xDocProps->getSubject());
508 
510  ::comphelper::string::convertCommaSeparated(xDocProps->getKeywords()));
511  OutUnicode(OOO_STRING_SVTOOLS_RTF_DOCCOMM, xDocProps->getDescription());
512 
513  OutUnicode(OOO_STRING_SVTOOLS_RTF_AUTHOR, xDocProps->getAuthor());
514  OutDateTime(OOO_STRING_SVTOOLS_RTF_CREATIM, xDocProps->getCreationDate());
515 
516  OutUnicode(OOO_STRING_SVTOOLS_RTF_AUTHOR, xDocProps->getModifiedBy());
517  OutDateTime(OOO_STRING_SVTOOLS_RTF_REVTIM, xDocProps->getModificationDate());
518 
519  OutDateTime(OOO_STRING_SVTOOLS_RTF_PRINTIM, xDocProps->getPrintDate());
520  }
521 
522  Strm().WriteChar('}');
523 }
524 
526 {
528  OutULong(nType);
529 }
530 
531 void RtfExport::WriteUserPropValue(const OUString& rValue)
532 {
535  Strm().WriteChar('}');
536 }
537 
539 {
540  Strm().WriteChar('{').WriteCharPtr(
542 
543  SwDocShell* pDocShell(m_pDoc->GetDocShell());
544  uno::Reference<document::XDocumentProperties> xDocProps;
545  if (pDocShell)
546  {
547  uno::Reference<document::XDocumentPropertiesSupplier> xDPS(pDocShell->GetModel(),
548  uno::UNO_QUERY);
549  xDocProps.set(xDPS->getDocumentProperties());
550  }
551  else
552  {
553  // Clipboard document, read metadata from the meta field manager.
555  xDocProps.set(rManager.getDocumentProperties());
556  }
557 
558  if (xDocProps.is())
559  {
560  // Handle user-defined properties.
561  uno::Reference<beans::XPropertyContainer> xUserDefinedProperties
562  = xDocProps->getUserDefinedProperties();
563  if (xUserDefinedProperties.is())
564  {
565  uno::Reference<beans::XPropertySet> xPropertySet(xUserDefinedProperties,
566  uno::UNO_QUERY);
567  const uno::Sequence<beans::Property> aProperties
568  = xPropertySet->getPropertySetInfo()->getProperties();
569 
570  for (const beans::Property& rProperty : aProperties)
571  {
572  if (rProperty.Name.startsWith("Company"))
573  // We have explicit markup in RTF for this property.
574  continue;
575 
576  // Property name.
578  Strm().WriteCharPtr(
579  msfilter::rtfutil::OutString(rProperty.Name, m_eDefaultEncoding).getStr());
580  Strm().WriteChar('}');
581 
582  // Property value.
583  OUString aValue;
584  double fValue;
585  bool bValue;
586  util::DateTime aDate;
587  uno::Any aAny = xPropertySet->getPropertyValue(rProperty.Name);
588  if (aAny >>= bValue)
589  {
590  WriteUserPropType(11);
591  WriteUserPropValue(OUString::number(static_cast<int>(bValue)));
592  }
593  else if (aAny >>= aValue)
594  {
595  WriteUserPropType(30);
596  WriteUserPropValue(aValue);
597  }
598  else if (aAny >>= fValue)
599  {
600  aValue = OUString::number(fValue);
601  if (aValue.indexOf('.') == -1)
602  {
603  // Integer.
605  WriteUserPropValue(aValue);
606  }
607  else
608  {
609  // Real number.
611  WriteUserPropValue(aValue);
612  }
613  }
614  else if (aAny >>= aDate)
615  {
616  WriteUserPropType(64);
617  // Format is 'YYYY. MM. DD.'.
618  aValue += OUString::number(aDate.Year);
619  aValue += ". ";
620  if (aDate.Month < 10)
621  aValue += "0";
622  aValue += OUString::number(aDate.Month);
623  aValue += ". ";
624  if (aDate.Day < 10)
625  aValue += "0";
626  aValue += OUString::number(aDate.Day);
627  aValue += ".";
628  WriteUserPropValue(aValue);
629  }
630  }
631  }
632  }
633 
634  Strm().WriteChar('}');
635 }
636 
638 {
639  // Write page descriptions (page styles)
640  std::size_t nSize = m_pDoc->GetPageDescCnt();
641  if (!nSize)
642  return;
643 
645  m_bOutPageDescs = true;
646  Strm()
647  .WriteChar('{')
650  for (std::size_t n = 0; n < nSize; ++n)
651  {
652  const SwPageDesc& rPageDesc = m_pDoc->GetPageDesc(n);
653 
654  Strm()
656  .WriteChar('{')
659  OutULong(static_cast<sal_uLong>(rPageDesc.ReadUseOn()));
660 
661  OutPageDescription(rPageDesc, false);
662 
663  // search for the next page description
664  std::size_t i = nSize;
665  while (i)
666  if (rPageDesc.GetFollow() == &m_pDoc->GetPageDesc(--i))
667  break;
669  OutULong(i).WriteChar(' ');
670  Strm()
671  .WriteCharPtr(
673  .WriteCharPtr(";}");
674  }
676  m_bOutPageDescs = false;
677 
678  // reset table infos, otherwise the depth of the cells will be incorrect,
679  // in case the page style (header or footer) had tables
680  m_pTableInfo = std::make_shared<ww8::WW8TableInfo>();
681 }
682 
684 {
685  // Make the header
686  Strm()
687  .WriteChar('{')
689  .WriteChar('1')
693  // If this not exist, MS don't understand our ansi characters (0x80-0xff).
694  Strm().WriteCharPtr("\\adeflang1025");
695 
696  // Font table
697  WriteFonts();
698 
699  m_pStyles = std::make_unique<MSWordStyles>(*this);
700  // Color and stylesheet table
701  WriteStyles();
702 
703  // List table
704  BuildNumbering();
705  WriteNumbering();
706 
707  WriteRevTab();
708 
709  WriteInfo();
710  WriteUserProps();
711  // Default TabSize
712  Strm()
713  .WriteCharPtr(m_pAttrOutput->GetTabStop().makeStringAndClear().getStr())
714  .WriteCharPtr(SAL_NEWLINE_STRING);
715 
716  // Automatic hyphenation: it's a global setting in Word, it's a paragraph setting in Writer.
717  // Use the setting from the default style.
719  RES_POOLCOLL_STANDARD, /*bRegardLanguage=*/false);
720  const SfxPoolItem* pItem;
721  if (pTextFormatColl
722  && pTextFormatColl->GetItemState(RES_PARATR_HYPHENZONE, false, &pItem) == SfxItemState::SET)
723  {
725  OutULong(int(static_cast<const SvxHyphenZoneItem*>(pItem)->IsHyphen()));
726  }
727 
728  // Zoom
730  if (pViewShell && pViewShell->GetViewOptions()->GetZoomType() == SvxZoomType::PERCENT)
731  {
733  OutULong(pViewShell->GetViewOptions()->GetZoom());
734  }
735  // Record changes?
738  // Mirror margins?
741  // Init sections
742  m_pSections = new MSWordSections(*this);
743 
744  // Page description
746 
747  // Enable form protection by default if needed, as there is no switch to
748  // enable it on a per-section basis. OTOH don't always enable it as it
749  // breaks moving of drawings - so write it only in case there is really a
750  // protected section in the document.
751  {
752  const SfxItemPool& rPool = m_pDoc->GetAttrPool();
753  for (const SfxPoolItem* pItem2 : rPool.GetItemSurrogates(RES_PROTECT))
754  {
755  auto pProtect = dynamic_cast<const SvxProtectItem*>(pItem2);
756  if (pProtect && pProtect->IsContentProtected())
757  {
759  break;
760  }
761  }
762  }
763 
764  // enable form field shading
766 
767  // size and empty margins of the page
768  if (m_pDoc->GetPageDescCnt())
769  {
770  // Seeking the first SwFormatPageDesc. If no set, the default is valid
771  const SwFormatPageDesc* pSttPgDsc = nullptr;
772  {
773  const SwNode& rSttNd
775  const SfxItemSet* pSet = nullptr;
776 
777  if (rSttNd.IsContentNode())
778  pSet = &rSttNd.GetContentNode()->GetSwAttrSet();
779  else if (rSttNd.IsTableNode())
780  pSet = &rSttNd.GetTableNode()->GetTable().GetFrameFormat()->GetAttrSet();
781 
782  else if (rSttNd.IsSectionNode())
783  pSet = &rSttNd.GetSectionNode()->GetSection().GetFormat()->GetAttrSet();
784 
785  if (pSet)
786  {
787  std::size_t nPosInDoc;
788  pSttPgDsc = &pSet->Get(RES_PAGEDESC);
789  if (!pSttPgDsc->GetPageDesc())
790  pSttPgDsc = nullptr;
791  else if (m_pDoc->FindPageDesc(pSttPgDsc->GetPageDesc()->GetName(), &nPosInDoc))
792  {
793  Strm()
794  .WriteChar('{')
797  OutULong(nPosInDoc).WriteChar('}');
798  }
799  }
800  }
801  const SwPageDesc& rPageDesc
802  = pSttPgDsc ? *pSttPgDsc->GetPageDesc() : m_pDoc->GetPageDesc(0);
803  const SwFrameFormat& rFormatPage = rPageDesc.GetMaster();
804 
805  {
806  if (rPageDesc.GetLandscape())
808 
809  const SwFormatFrameSize& rSz = rFormatPage.GetFrameSize();
810  // Clipboard document is always created without a printer, then
811  // the size will be always LONG_MAX! Solution then is to use A4
812  if (LONG_MAX == rSz.GetHeight() || LONG_MAX == rSz.GetWidth())
813  {
816  OutULong(a4.Height()).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_PAPERW);
817  OutULong(a4.Width());
818  }
819  else
820  {
822  OutULong(rSz.GetHeight()).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_PAPERW);
823  OutULong(rSz.GetWidth());
824  }
825  }
826 
827  {
828  const SvxLRSpaceItem& rLR = rFormatPage.GetLRSpace();
830  OutLong(rLR.GetLeft()).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_MARGR);
831  OutLong(rLR.GetRight());
832  }
833 
834  {
835  const SvxULSpaceItem& rUL = rFormatPage.GetULSpace();
837  OutLong(rUL.GetUpper()).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_MARGB);
838  OutLong(rUL.GetLower());
839  }
840 
841  Strm()
844  // All sections are unlocked by default
846  OutLong(1);
847  OutPageDescription(rPageDesc, true); // Changed bCheckForFirstPage to true so headers
848  // following title page are correctly added - i13107
849  if (pSttPgDsc)
850  {
851  m_pCurrentPageDesc = &rPageDesc;
852  }
853  }
854 
855  // line numbering
856  const SwLineNumberInfo& rLnNumInfo = m_pDoc->GetLineNumberInfo();
857  if (rLnNumInfo.IsPaintLineNumbers())
858  {
859  sal_uLong nLnNumRestartNo = 0;
860  if (const WW8_SepInfo* pSectionInfo = m_pSections->CurrentSectionInfo())
861  nLnNumRestartNo = pSectionInfo->nLnNumRestartNo;
862 
863  AttrOutput().SectionLineNumbering(nLnNumRestartNo, rLnNumInfo);
864  }
865 
866  {
867  // write the footnotes and endnotes-out Info
868  const SwFootnoteInfo& rFootnoteInfo = m_pDoc->GetFootnoteInfo();
869 
870  const char* pOut = FTNPOS_CHAPTER == rFootnoteInfo.ePos ? OOO_STRING_SVTOOLS_RTF_ENDDOC
873  OutLong(rFootnoteInfo.nFootnoteOffset + 1);
874 
875  switch (rFootnoteInfo.eNum)
876  {
877  case FTNNUM_PAGE:
879  break;
880  case FTNNUM_DOC:
882  break;
883  default:
885  break;
886  }
887  Strm().WriteCharPtr(pOut);
888 
889  switch (rFootnoteInfo.aFormat.GetNumberingType())
890  {
894  break;
898  break;
899  case SVX_NUM_ROMAN_LOWER:
901  break;
902  case SVX_NUM_ROMAN_UPPER:
904  break;
907  break;
908  default:
910  break;
911  }
912  Strm().WriteCharPtr(pOut);
913 
914  const SwEndNoteInfo& rEndNoteInfo = m_pDoc->GetEndNoteInfo();
915 
916  Strm()
920  OutLong(rEndNoteInfo.nFootnoteOffset + 1);
921 
922  switch (rEndNoteInfo.aFormat.GetNumberingType())
923  {
927  break;
931  break;
932  case SVX_NUM_ROMAN_LOWER:
934  break;
935  case SVX_NUM_ROMAN_UPPER:
937  break;
940  break;
941  default:
943  break;
944  }
945  Strm().WriteCharPtr(pOut);
946  }
947 
949  // RTF default is true, so write compat flag if this should be false.
951 
953 
955 
956  WriteMainText();
957 
958  Strm().WriteChar('}');
959 
960  return ERRCODE_NONE;
961 }
962 
963 void RtfExport::PrepareNewPageDesc(const SfxItemSet* pSet, const SwNode& rNd,
964  const SwFormatPageDesc* pNewPgDescFormat,
965  const SwPageDesc* pNewPgDesc)
966 {
967  const SwSectionFormat* pFormat = GetSectionFormat(rNd);
968  const sal_uLong nLnNm = GetSectionLineNo(pSet, rNd);
969 
970  OSL_ENSURE(pNewPgDescFormat || pNewPgDesc, "Neither page desc format nor page desc provided.");
971 
972  if (pNewPgDescFormat)
973  m_pSections->AppendSection(*pNewPgDescFormat, rNd, pFormat, nLnNm);
974  else if (pNewPgDesc)
975  m_pSections->AppendSection(pNewPgDesc, rNd, pFormat, nLnNm);
976 
977  // Don't insert a page break, when we're changing page style just because the next page has to be a different one.
978  if (!m_pAttrOutput->GetPrevPageDesc()
979  || m_pAttrOutput->GetPrevPageDesc()->GetFollow() != pNewPgDesc)
981 }
982 
984 {
985  bool bRet(false);
986 
987  if (SfxItemState::SET != rFormat.GetItemState(RES_PARATR_NUMRULE, false))
988  {
989  if (const SwFormat* pParent = rFormat.DerivedFrom())
990  {
991  if (static_cast<const SwTextFormatColl*>(pParent)
992  ->IsAssignedToListLevelOfOutlineStyle())
993  {
994  // Level 9 disables the outline
996 
997  bRet = true;
998  }
999  }
1000  }
1001 
1002  return bRet;
1003 }
1004 
1006 {
1007  if (TXT_MAINTEXT == m_nTextTyp && rEndNode.StartOfSectionNode()->IsTableNode())
1008  // End node of a table: see if a section break should be written after the table.
1009  AttrOutput().SectionBreaks(rEndNode);
1010 }
1011 
1012 void RtfExport::OutputGrfNode(const SwGrfNode& /*rGrfNode*/)
1013 {
1014  /* noop, see RtfAttributeOutput::FlyFrameGraphic */
1015 }
1016 
1017 void RtfExport::OutputOLENode(const SwOLENode& /*rOLENode*/)
1018 {
1019  /* noop, see RtfAttributeOutput::FlyFrameOLE */
1020 }
1021 
1022 void RtfExport::OutputLinkedOLE(const OUString& /*rLinked*/) {}
1023 
1025 {
1026  m_nCurrentNodeIndex = rNode.GetIndex();
1027  if (!m_bOutOutlineOnly || rNode.IsOutline())
1029  m_nCurrentNodeIndex = 0;
1030 }
1031 
1032 void RtfExport::AppendSection(const SwPageDesc* pPageDesc, const SwSectionFormat* pFormat,
1033  sal_uLong nLnNum)
1034 {
1035  m_pSections->AppendSection(pPageDesc, pFormat, nLnNum);
1037 }
1038 
1040  std::shared_ptr<SwUnoCursor>& pCurrentPam, SwPaM* pOriginalPam,
1041  Writer* pWriter, bool bOutOutlineOnly)
1042  : MSWordExportBase(pDocument, pCurrentPam, pOriginalPam)
1043  , m_pFilter(pFilter)
1044  , m_pWriter(pWriter)
1045  , m_pSections(nullptr)
1046  , m_bOutOutlineOnly(bOutOutlineOnly)
1047  , m_eDefaultEncoding(
1048  rtl_getTextEncodingFromWindowsCharset(sw::ms::rtl_TextEncodingToWinCharset(DEF_ENCODING)))
1049  , m_eCurrentEncoding(m_eDefaultEncoding)
1050  , m_bRTFFlySyntax(false)
1051  , m_nCurrentNodeIndex(0)
1052 {
1053  m_bExportModeRTF = true;
1054  // the attribute output for the document
1055  m_pAttrOutput = std::make_unique<RtfAttributeOutput>(*this);
1056  // that just causes problems for RTF
1057  m_bSubstituteBullets = false;
1058  // needed to have a complete font table
1060  // the related SdrExport
1061  m_pSdrExport = std::make_unique<RtfSdrExport>(*this);
1062 
1063  if (!m_pWriter)
1065 }
1066 
1067 RtfExport::~RtfExport() = default;
1068 
1070 {
1071  if (m_pStream)
1072  return *m_pStream;
1073 
1074  return m_pWriter->Strm();
1075 }
1076 
1077 void RtfExport::setStream() { m_pStream = std::make_unique<SvMemoryStream>(); }
1078 
1080 {
1081  OString aRet;
1082 
1083  if (m_pStream)
1084  aRet = OString(static_cast<const sal_Char*>(m_pStream->GetData()), m_pStream->Tell());
1085 
1086  return aRet;
1087 }
1088 
1090 
1092 
1093 SvStream& RtfExport::OutLong(long nVal) { return Writer::OutLong(Strm(), nVal); }
1094 
1095 void RtfExport::OutUnicode(const sal_Char* pToken, const OUString& rContent, bool bUpr)
1096 {
1097  if (!rContent.isEmpty())
1098  {
1099  if (!bUpr)
1100  {
1101  Strm().WriteChar('{').WriteCharPtr(pToken).WriteChar(' ');
1102  Strm().WriteCharPtr(
1103  msfilter::rtfutil::OutString(rContent, m_eCurrentEncoding).getStr());
1104  Strm().WriteChar('}');
1105  }
1106  else
1107  Strm().WriteCharPtr(
1108  msfilter::rtfutil::OutStringUpr(pToken, rContent, m_eCurrentEncoding).getStr());
1109  }
1110 }
1111 
1112 void RtfExport::OutDateTime(const sal_Char* pStr, const util::DateTime& rDT)
1113 {
1119  OutULong(rDT.Minutes).WriteChar('}');
1120 }
1121 
1122 sal_uInt16 RtfExport::GetColor(const Color& rColor) const
1123 {
1124  for (const auto& rEntry : m_aColTable)
1125  if (rEntry.second == rColor)
1126  {
1127  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " returning " << rEntry.first << " ("
1128  << rColor.GetRed() << "," << rColor.GetGreen() << ","
1129  << rColor.GetBlue() << ")");
1130  return rEntry.first;
1131  }
1132  OSL_FAIL("No such Color in m_aColTable!");
1133  return 0;
1134 }
1135 
1136 void RtfExport::InsColor(const Color& rCol)
1137 {
1138  sal_uInt16 n;
1139  bool bAutoColorInTable = false;
1140  for (const auto& rEntry : m_aColTable)
1141  {
1142  if (rEntry.second == rCol)
1143  return; // Already in the table
1144  if (rEntry.second == COL_AUTO)
1145  bAutoColorInTable = true;
1146  }
1147  if (rCol == COL_AUTO)
1148  // COL_AUTO gets value 0
1149  n = 0;
1150  else
1151  {
1152  // other colors get values >0
1153  n = m_aColTable.size();
1154  if (!bAutoColorInTable)
1155  // reserve value "0" for COL_AUTO (if COL_AUTO wasn't inserted until now)
1156  n++;
1157  }
1158  m_aColTable.insert(std::pair<sal_uInt16, Color>(n, rCol));
1159 }
1160 
1162 {
1163  const editeng::SvxBorderLine* pLine = nullptr;
1164 
1165  if (rBox.GetTop())
1166  {
1167  pLine = rBox.GetTop();
1168  InsColor(pLine->GetColor());
1169  }
1170  if (rBox.GetBottom() && pLine != rBox.GetBottom())
1171  {
1172  pLine = rBox.GetBottom();
1173  InsColor(pLine->GetColor());
1174  }
1175  if (rBox.GetLeft() && pLine != rBox.GetLeft())
1176  {
1177  pLine = rBox.GetLeft();
1178  InsColor(pLine->GetColor());
1179  }
1180  if (rBox.GetRight() && pLine != rBox.GetRight())
1181  InsColor(rBox.GetRight()->GetColor());
1182 }
1183 
1185 {
1186  // Build the table from rPool since the colors provided to
1187  // RtfAttributeOutput callbacks are too late.
1188  const SfxItemPool& rPool = m_pDoc->GetAttrPool();
1189 
1190  // MSO Word uses a default color table with 16 colors (which is used e.g. for highlighting)
1199  InsColor(COL_BLUE);
1200  InsColor(COL_CYAN);
1203  InsColor(COL_RED);
1205  InsColor(COL_GRAY);
1207 
1208  // char color
1209  {
1210  auto pCol = GetDfltAttr(RES_CHRATR_COLOR);
1211  InsColor(pCol->GetValue());
1212  if ((pCol = rPool.GetPoolDefaultItem(RES_CHRATR_COLOR)))
1213  InsColor(pCol->GetValue());
1214  for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_CHRATR_COLOR))
1215  {
1216  if ((pCol = dynamic_cast<const SvxColorItem*>(pItem)))
1217  InsColor(pCol->GetValue());
1218  }
1219 
1220  auto pUnder = GetDfltAttr(RES_CHRATR_UNDERLINE);
1221  InsColor(pUnder->GetColor());
1222  for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_CHRATR_UNDERLINE))
1223  {
1224  if ((pUnder = dynamic_cast<const SvxUnderlineItem*>(pItem)))
1225  InsColor(pUnder->GetColor());
1226  }
1227 
1228  auto pOver = GetDfltAttr(RES_CHRATR_OVERLINE);
1229  InsColor(pOver->GetColor());
1230  for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_CHRATR_OVERLINE))
1231  {
1232  if ((pOver = dynamic_cast<const SvxOverlineItem*>(pItem)))
1233  InsColor(pOver->GetColor());
1234  }
1235  }
1236 
1237  // background color
1238  static const sal_uInt16 aBrushIds[] = { RES_BACKGROUND, RES_CHRATR_BACKGROUND, 0 };
1239 
1240  for (const sal_uInt16* pIds = aBrushIds; *pIds; ++pIds)
1241  {
1242  auto pBackground = static_cast<const SvxBrushItem*>(GetDfltAttr(*pIds));
1243  InsColor(pBackground->GetColor());
1244  if ((pBackground = static_cast<const SvxBrushItem*>(rPool.GetPoolDefaultItem(*pIds))))
1245  {
1246  InsColor(pBackground->GetColor());
1247  }
1248  for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(*pIds))
1249  {
1250  if ((pBackground = static_cast<const SvxBrushItem*>(pItem)))
1251  {
1252  InsColor(pBackground->GetColor());
1253  }
1254  }
1255  }
1256 
1257  // shadow color
1258  {
1259  auto pShadow = GetDfltAttr(RES_SHADOW);
1260  InsColor(pShadow->GetColor());
1261  if (nullptr != (pShadow = rPool.GetPoolDefaultItem(RES_SHADOW)))
1262  {
1263  InsColor(pShadow->GetColor());
1264  }
1265  for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_SHADOW))
1266  {
1267  if ((pShadow = dynamic_cast<const SvxShadowItem*>(pItem)))
1268  {
1269  InsColor(pShadow->GetColor());
1270  }
1271  }
1272  }
1273 
1274  // frame border color
1275  {
1276  const SvxBoxItem* pBox;
1277  if (nullptr != (pBox = rPool.GetPoolDefaultItem(RES_BOX)))
1278  InsColorLine(*pBox);
1279  for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_BOX))
1280  {
1281  if ((pBox = dynamic_cast<const SvxBoxItem*>(pItem)))
1282  InsColorLine(*pBox);
1283  }
1284  }
1285 
1286  {
1287  const SvxBoxItem* pCharBox;
1288  if ((pCharBox = rPool.GetPoolDefaultItem(RES_CHRATR_BOX)))
1289  InsColorLine(*pCharBox);
1290  for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_CHRATR_BOX))
1291  {
1292  if ((pCharBox = dynamic_cast<const SvxBoxItem*>(pItem)))
1293  InsColorLine(*pCharBox);
1294  }
1295  }
1296 
1297  // TextFrame or paragraph background solid fill.
1298  for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(XATTR_FILLCOLOR))
1299  {
1300  if (auto pColorItem = dynamic_cast<const XFillColorItem*>(pItem))
1301  InsColor(pColorItem->GetColorValue());
1302  }
1303 
1304  for (std::size_t n = 0; n < m_aColTable.size(); ++n)
1305  {
1306  const Color& rCol = m_aColTable[n];
1307  if (n || COL_AUTO != rCol)
1308  {
1310  OutULong(rCol.GetRed()).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_GREEN);
1311  OutULong(rCol.GetGreen()).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_BLUE);
1312  OutULong(rCol.GetBlue());
1313  }
1314  Strm().WriteChar(';');
1315  }
1316 }
1317 
1318 void RtfExport::InsStyle(sal_uInt16 nId, const OString& rStyle)
1319 {
1320  m_aStyTable.insert(std::pair<sal_uInt16, OString>(nId, rStyle));
1321 }
1322 
1323 OString* RtfExport::GetStyle(sal_uInt16 nId)
1324 {
1325  auto it = m_aStyTable.find(nId);
1326  if (it != m_aStyTable.end())
1327  return &it->second;
1328  return nullptr;
1329 }
1330 
1331 sal_uInt16 RtfExport::GetRedline(const OUString& rAuthor)
1332 {
1333  auto it = m_aRedlineTable.find(rAuthor);
1334  if (it != m_aRedlineTable.end())
1335  return it->second;
1336 
1337  const sal_uInt16 nId = m_aRedlineTable.size();
1338  m_aRedlineTable.insert(std::pair<OUString, sal_uInt16>(rAuthor, nId));
1339  return nId;
1340 }
1341 
1342 const OUString* RtfExport::GetRedline(sal_uInt16 nId)
1343 {
1344  for (const auto& rEntry : m_aRedlineTable)
1345  if (rEntry.second == nId)
1346  return &rEntry.first;
1347  return nullptr;
1348 }
1349 
1350 void RtfExport::OutPageDescription(const SwPageDesc& rPgDsc, bool bCheckForFirstPage)
1351 {
1352  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start");
1353  const SwPageDesc* pSave = m_pCurrentPageDesc;
1354 
1355  m_pCurrentPageDesc = &rPgDsc;
1356  if (bCheckForFirstPage && m_pCurrentPageDesc->GetFollow()
1359 
1362 
1363  const SwFormat* pFormat = &m_pCurrentPageDesc->GetMaster(); //GetLeft();
1364  m_bOutPageDescs = true;
1365  if (m_pCurrentPageDesc != &rPgDsc)
1367  OutputFormat(*pFormat, true, false);
1368  m_pFirstPageItemSet = nullptr;
1369  m_bOutPageDescs = false;
1370 
1371  // normal header / footer (without a style)
1372  const SfxPoolItem* pItem;
1374  == SfxItemState::SET)
1375  WriteHeaderFooter(*pItem, true);
1377  == SfxItemState::SET)
1378  WriteHeaderFooter(*pItem, false);
1379 
1380  // title page
1381  if (m_pCurrentPageDesc != &rPgDsc)
1382  {
1384  m_pCurrentPageDesc = &rPgDsc;
1386  == SfxItemState::SET)
1387  WriteHeaderFooter(*pItem, true);
1389  == SfxItemState::SET)
1390  WriteHeaderFooter(*pItem, false);
1391  }
1392 
1393  // numbering type
1395  boost::none);
1396 
1397  m_pCurrentPageDesc = pSave;
1398  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end");
1399 }
1400 
1401 void RtfExport::WriteHeaderFooter(const SfxPoolItem& rItem, bool bHeader)
1402 {
1403  if (bHeader)
1404  {
1405  const auto& rHeader = static_cast<const SwFormatHeader&>(rItem);
1406  if (!rHeader.IsActive())
1407  return;
1408  }
1409  else
1410  {
1411  const auto& rFooter = static_cast<const SwFormatFooter&>(rItem);
1412  if (!rFooter.IsActive())
1413  return;
1414  }
1415 
1416  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start");
1417 
1418  const sal_Char* pStr
1420  /* is this a title page? */
1422  {
1425  }
1426  Strm().WriteChar('{').WriteCharPtr(pStr);
1428  Strm().WriteChar('}');
1429 
1430  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end");
1431 }
1432 
1433 void RtfExport::WriteHeaderFooter(const SwFrameFormat& rFormat, bool bHeader, const sal_Char* pStr,
1434  bool bTitlepg)
1435 {
1436  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start");
1437 
1438  m_pAttrOutput->WriteHeaderFooter_Impl(rFormat, bHeader, pStr, bTitlepg);
1439 
1440  SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end");
1441 }
1442 
1444 class SwRTFWriter : public Writer
1445 {
1446 private:
1448 
1449 public:
1450  SwRTFWriter(const OUString& rFilterName, const OUString& rBaseURL);
1451 
1452  ErrCode WriteStream() override;
1453 };
1454 
1455 SwRTFWriter::SwRTFWriter(const OUString& rFilterName, const OUString& rBaseURL)
1456 {
1457  SetBaseURL(rBaseURL);
1458  // export outline nodes, only (send outline to clipboard/presentation)
1459  m_bOutOutlineOnly = rFilterName.startsWith("O");
1460 }
1461 
1463 {
1464  std::shared_ptr<SwUnoCursor> pCurPam(m_pDoc->CreateUnoCursor(*m_pCurrentPam->End(), false));
1465  pCurPam->SetMark();
1466  *pCurPam->GetPoint() = *m_pCurrentPam->Start();
1467  RtfExport aExport(nullptr, m_pDoc, pCurPam, m_pCurrentPam.get(), this, m_bOutOutlineOnly);
1468  aExport.ExportDocument(true);
1469  return ERRCODE_NONE;
1470 }
1471 
1472 extern "C" SAL_DLLPUBLIC_EXPORT void ExportRTF(const OUString& rFltName, const OUString& rBaseURL,
1473  WriterRef& xRet)
1474 {
1475  xRet = new SwRTFWriter(rFltName, rBaseURL);
1476 }
1477 
1478 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const css::uno::Reference< css::document::XDocumentProperties > & getDocumentProperties()
Definition: fmtatr2.cxx:838
long GetLeft() const
bool IsHyphen(sal_Unicode cChar)
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 tream, instead of m_pWriter's stream.
Definition: rtfexport.hxx:230
SvStream & OutULong(sal_uLong nVal)
Definition: rtfexport.cxx:1091
#define OOO_STRING_SVTOOLS_RTF_FOOTERL
std::shared_ptr< SwUnoCursor > CreateUnoCursor(const SwPosition &rPos, bool bTableCursor=false)
Definition: doc.cxx:1807
RedlineFlags m_nOrigRedlineFlags
Remember the original redline mode.
Definition: wrtww8.hxx:486
#define RES_CHRATR_WEIGHT
Definition: hintids.hxx:83
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:1594
Class to collect and output the sections/headers/footers.
Definition: wrtww8.hxx:198
constexpr::Color COL_BROWN(0x80, 0x80, 0x00)
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
void WriteMainText()
Definition: rtfexport.cxx:421
#define LO_STRING_SVTOOLS_RTF_LISTPICTURE
constexpr::Color COL_BLACK(0x00, 0x00, 0x00)
OString * GetStyle(sal_uInt16 nId)
Definition: rtfexport.cxx:1323
sal_uInt8 GetRed() const
bool IsSectionNode() const
Definition: node.hxx:644
void WriteHeaderFooter(const SfxPoolItem &rItem, bool bHeader)
Definition: rtfexport.cxx:1401
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:1005
#define OOO_STRING_SVTOOLS_RTF_SN
rtl_TextEncoding m_eCurrentEncoding
Definition: rtfexport.hxx:165
#define RES_HEADER
Definition: hintids.hxx:201
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:35
SwFrameFormat & GetLeft()
Definition: pagedesc.hxx:217
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:331
#define RES_CHRATR_FONTSIZE
Definition: hintids.hxx:76
SwPageDesc * GetPageDesc()
Definition: fmtpdsc.hxx:62
const SwLineNumberInfo & GetLineNumberInfo() const
Definition: lineinfo.cxx:50
#define OOO_STRING_SVTOOLS_RTF_PAPERW
#define OOO_STRING_SVTOOLS_RTF_COMPANY
bool m_bSubstituteBullets
Definition: wrtww8.hxx:563
bool IsOutline() const
Returns if this text node is an outline.
Definition: ndtxt.cxx:4001
static SvStream & OutLong(SvStream &rStrm, long nVal)
Definition: writer.cxx:229
SvStream & WriteInt32(sal_Int32 nInt32)
SwDocShell * GetDocShell()
Definition: doc.hxx:1341
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:93
const SfxPoolItem * GetPoolDefaultItem(sal_uInt16 nWhich) const
#define RES_CHRATR_CJK_POSTURE
Definition: hintids.hxx:93
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:621
void OutputGrfNode(const SwGrfNode &rGrfNode) override
Output SwGrfNode.
Definition: rtfexport.cxx:1012
#define RES_SHADOW
Definition: hintids.hxx:212
#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:78
sal_uIntPtr sal_uLong
void WriteFontTable(SvStream *pTableStream, WW8Fib &pFib)
Definition: wrtw8sty.cxx:908
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:1039
Base class of all fields.
Definition: fldbas.hxx:279
void WriteNumbering() override
Write the numbering table.
Definition: rtfexport.cxx:225
#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
Glue class to call RtfExport as an internal filter, needed by copy&paste support. ...
Definition: rtfexport.cxx:1444
SvStream & Strm()
Definition: rtfexport.cxx:1069
bool m_bOutPageDescs
PageDescs (section properties) are being written.
Definition: wrtww8.hxx:551
Definition: doc.hxx:185
void DoFormText(const SwInputField *pField) override
Definition: rtfexport.cxx:338
#define OOO_STRING_SVTOOLS_RTF_FFNAME
#define OOO_STRING_SVTOOLS_RTF_FTNNALC
sal_Int16 nId
#define RES_CHRATR_CJK_WEIGHT
Definition: hintids.hxx:94
#define RES_CHRATR_FONT
Definition: hintids.hxx:75
#define OOO_STRING_SVTOOLS_RTF_ANSI
constexpr::Color COL_GRAY(0x80, 0x80, 0x80)
virtual void SectionBreak(sal_uInt8 nC, const WW8_SepInfo *pSectionInfo=nullptr)=0
Write a section break msword::ColumnBreak or msword::PageBreak.
#define OOO_STRING_SVTOOLS_RTF_FIELD
constexpr::Color COL_LIGHTRED(0xFF, 0x00, 0x00)
SwSectionFormat * GetFormat()
Definition: section.hxx:337
Dialog to specify the properties of date form field.
Definition: accfrmobj.cxx:38
#define OOO_STRING_SVTOOLS_RTF_FLDRSLT
constexpr::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
#define RES_CHRATR_CJK_FONTSIZE
Definition: hintids.hxx:91
#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
#define RES_PROTECT
Definition: hintids.hxx:205
rtl_TextEncoding m_eDefaultEncoding
Definition: rtfexport.hxx:164
#define OOO_STRING_SVTOOLS_RTF_REVTIM
SvStream & WriteCharPtr(const char *pBuf)
#define OOO_STRING_SVTOOLS_RTF_MARGT
SwTableFormat * GetFrameFormat()
Definition: swtable.hxx:201
const OUString & GetHelp() const
Definition: expfld.cxx:1416
#define OOO_STRING_SVTOOLS_RTF_AUTHOR
#define XATTR_FILLCOLOR
const OUString & GetName() const
Definition: pagedesc.hxx:186
sal_uInt16 GetRedline(const OUString &rAuthor)
Definition: rtfexport.cxx:1331
bool m_bOutOutlineOnly
Definition: rtfexport.cxx:1447
size_type size() const
Definition: docary.hxx:368
#define OOO_STRING_SVTOOLS_RTF_AFTNSTART
constexpr::Color COL_MAGENTA(0x80, 0x00, 0x80)
const SwSection & GetSection() const
Definition: node.hxx:541
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:315
#define OOO_STRING_SVTOOLS_RTF_AFTNNAR
constexpr::Color COL_AUTO(0xFF, 0xFF, 0xFF, 0xFF)
const SwPageFootnoteInfo & GetFootnoteInfo() const
Definition: pagedesc.hxx:195
void WriteText()
Iterate through the nodes and call the appropriate OutputNode() on them.
Definition: wrtww8.cxx:2710
sal_uInt16 sal_Unicode
void AppendBookmarks(const SwTextNode &rNode, sal_Int32 nCurrentPos, sal_Int32 nLen) override
Definition: rtfexport.cxx:118
FieldFlags
Definition: wrtww8.hxx:146
SwTableNode * GetTableNode()
Definition: node.hxx:599
bool m_bWriteOnlyFirstTable
Definition: shellio.hxx:409
#define OOO_STRING_SVTOOLS_RTF_FTNNAR
void InsStyle(sal_uInt16 nId, const OString &rStyle)
Definition: rtfexport.cxx:1318
The class that does all the actual RTF export-related work.
Definition: rtfexport.hxx:36
bool m_bExportModeRTF
Definition: wrtww8.hxx:567
void InsColorLine(const SvxBoxItem &rBox)
Definition: rtfexport.cxx:1161
#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:525
void OutputFormat(const SwFormat &rFormat, bool bPapFormat, bool bChpFormat, bool bFlyFormat=false)
Output attributes.
Definition: ww8atr.cxx:756
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:458
#define OOO_STRING_SVTOOLS_RTF_FTNNRLC
constexpr::Color COL_CYAN(0x00, 0x80, 0x80)
char sal_Char
void OutputTextNode(SwTextNode &rNode) override
Output SwTextNode is depending on outline export mode.
Definition: rtfexport.cxx:1024
Footer, for pageformats Client of FrameFormat describing the footer.
Definition: fmthdft.hxx:64
#define DEF_ENCODING
Definition: rtfexport.cxx:76
#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:1022
std::shared_ptr< SwUnoCursor > & m_pCurPam
Definition: wrtww8.hxx:574
PAPER_A4
eField
Definition: fields.hxx:26
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
SvxNumberType aFormat
Definition: ftninfo.hxx:46
SVX_NUM_ROMAN_UPPER
sal_uInt32 RGBToBGR(::Color nColour)
Definition: ww8struc.hxx:1084
bool DisallowInheritingOutlineNumbering(const SwFormat &rFormat) override
Return value indicates if an inherited outline numbering is suppressed.
Definition: rtfexport.cxx:983
const SwTable & GetTable() const
Definition: node.hxx:497
const HdFtFlags WW8_FOOTER_EVEN
Definition: ww8scan.hxx:1591
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 RES_PARATR_NUMRULE
Definition: hintids.hxx:170
#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:84
ww8::WW8TableInfo::Pointer_t m_pTableInfo
Definition: wrtww8.hxx:476
#define OOO_STRING_SVTOOLS_RTF_PAPERH
SAL_DLLPUBLIC_EXPORT void ExportRTF(const OUString &rFltName, const OUString &rBaseURL, WriterRef &xRet)
Definition: rtfexport.cxx:1472
const OUString & GetSuffix() const
#define OOO_STRING_SVTOOLS_RTF_YR
sal_uInt8 GetBlue() const
#define OOO_STRING_SVTOOLS_RTF_SP
RtfExportFilter * m_pFilter
Pointer to the filter that owns us.
Definition: rtfexport.hxx:39
#define OOO_STRING_SVTOOLS_RTF_FFOWNHELP
const HdFtFlags WW8_HEADER_ODD
Definition: ww8scan.hxx:1590
SwPageDesc * FindPageDesc(const OUString &rName, size_t *pPos=nullptr) const
Definition: docdesc.cxx:829
void SetBaseURL(const OUString &rURL)
Definition: shellio.hxx:394
Base class for various Writer styles.
Definition: format.hxx:43
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:164
#define OOO_STRING_SVTOOLS_RTF_FFTYPETXT
#define OOO_STRING_SVTOOLS_RTF_MARGB
#define RES_BACKGROUND
Definition: hintids.hxx:210
#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:1544
SVX_NUM_CHAR_SPECIAL
void InsColor(const Color &rCol)
Definition: rtfexport.cxx:1136
#define RES_CHRATR_COLOR
Definition: hintids.hxx:71
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
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:57
#define OOO_STRING_SVTOOLS_RTF_HEADERL
#define RES_CHRATR_OVERLINE
Definition: hintids.hxx:106
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:290
SVX_NUM_CHARS_LOWER_LETTER
#define SW_MOD()
Definition: swmodule.hxx:256
#define OOO_STRING_SVTOOLS_RTF_BLUE
#define RES_CHRATR_BACKGROUND
Definition: hintids.hxx:89
#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
const SwStartNode * StartOfSectionNode() const
Definition: node.hxx:131
#define RES_CHRATR_BOX
Definition: hintids.hxx:108
void WriteUserProps()
Writes the userprops group: user defined document properties.
Definition: rtfexport.cxx:538
#define OOO_STRING_SVTOOLS_RTF_AENDDOC
const SwPageDesc & GetPageDesc(const size_t i) const
Definition: doc.hxx:876
void setStream()
From now on, let Strm() return a memory stream, not a real one.
Definition: rtfexport.cxx:1077
#define OOO_STRING_SVTOOLS_RTF_LANDSCAPE
const Color & GetColor() const
bool GetLandscape() const
Definition: pagedesc.hxx:189
#define OOO_STRING_SVTOOLS_RTF_MARGL
#define OOO_STRING_SVTOOLS_RTF_BACKGROUND
void AppendBookmark(const OUString &rName) override
Definition: rtfexport.cxx:142
virtual void OutputTextNode(SwTextNode &)
Output SwTextNode.
Definition: wrtw8nds.cxx:2106
OUString sName
int i
SwContentNode * GetContentNode()
Definition: node.hxx:615
#define OOO_STRING_SVTOOLS_RTF_PGDSC
#define RES_PARATR_HYPHENZONE
Definition: hintids.hxx:167
UseOnPage ReadUseOn() const
Definition: pagedesc.hxx:214
const WW8_SepInfo * CurrentSectionInfo()
The most recent WW8_SepInfo.
Definition: wrtw8sty.cxx:1080
size_t GetPageDescCnt() const
Definition: doc.hxx:875
size_t size() const
Definition: docary.hxx:91
void WriteRevTab()
Write the revision table.
Definition: rtfexport.cxx:257
#define OOO_STRING_SVTOOLS_RTF_SECTD
#define RES_CHRATR_UNDERLINE
Definition: hintids.hxx:82
#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:399
void OutUnicode(const sal_Char *pToken, const OUString &rContent, bool bUpr=false)
Definition: rtfexport.cxx:1095
#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:1350
#define OOO_STRING_SVTOOLS_RTF_HYPHAUTO
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
void WriteChar(sal_Unicode c) override
Definition: rtfexport.cxx:184
SVX_NUM_CHARS_LOWER_LETTER_N
MSWordSections & Sections() const override
Access to the sections/headers/footres.
Definition: rtfexport.cxx:80
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:437
Handles export of drawings using RTF markup.
#define OOO_STRING_SVTOOLS_RTF_USERPROPS
const long LONG_MAX
SwRTFWriter(const OUString &rFilterName, const OUString &rBaseURL)
Definition: rtfexport.cxx:1455
#define OOO_STRING_SVTOOLS_RTF_SHPINST
< purpose of derivation from SwClient: character style for displaying the numbers.
Definition: lineinfo.hxx:37
virtual void SectionPageNumbering(sal_uInt16 nNumType, const ::boost::optional< sal_uInt16 > &oPageRestartNumber)=0
The style of the page numbers.
std::shared_ptr< SvxBrushItem > getBackground()
Get background color of the document, if there is one.
Definition: wrtww8.cxx:1527
#define OOO_STRING_SVTOOLS_RTF_MO
SvStream & OutLong(long nVal)
Definition: rtfexport.cxx:1093
const SwPageDesc * GetFollow() const
Definition: pagedesc.hxx:245
#define OOO_STRING_SVTOOLS_RTF_FFSTATTEXT
void AppendSection(const SwPageDesc *pPageDesc, const SwSectionFormat *pFormat, sal_uLong nLnNum) override
Definition: rtfexport.cxx:1032
#define RES_FOOTER
Definition: hintids.hxx:202
void WriteHeaderFooterText(const SwFormat &rFormat, bool bHeader)
Write header/footer text.
Definition: wrtw8sty.cxx:1880
OString OUStringToOString(const OUString &str, ConnectionSettings const *settings)
sal_uInt8 GetGreen() const
void AppendSection(const SwPageDesc *pPd, const SwSectionFormat *pSectionFormat, sal_uLong nLnNumRestartNo, bool bIsFirstParagraph=false)
Definition: wrtw8sty.cxx:1088
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:83
void WriteFonts()
Definition: rtfexport.cxx:389
#define OOO_STRING_SVTOOLS_RTF_FTNRESTART
sal_uInt16 GetNumberingId(const SwNumRule &rNumRule)
Return the numeric id of the numbering rule.
Definition: wrtw8num.cxx:100
void WriteFootnoteSettings()
Definition: rtfexport.cxx:406
void OutDateTime(const sal_Char *pStr, const css::util::DateTime &rDT)
Definition: rtfexport.cxx:1112
SwFormat * DerivedFrom() const
Definition: format.hxx:108
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:216
#define OOO_STRING_SVTOOLS_RTF_LISTOVERRIDETABLE
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
OString OutStringUpr(const sal_Char *pToken, const OUString &rStr, rtl_TextEncoding eDestEnc)
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:1079
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
Definition: fldbas.cxx:412
OString OutString(const OUString &rStr, rtl_TextEncoding eDestEnc, bool bUnicode=true)
void resetStream()
Return back to the real stream.
Definition: rtfexport.cxx:1089
Footnote information.
Definition: pagedesc.hxx:47
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:367
#define OOO_STRING_SVTOOLS_RTF_HEADER
#define OOO_STRING_SVTOOLS_RTF_KEYWORDS
const SwPageDesc * m_pCurrentPageDesc
Definition: wrtww8.hxx:493
const Fraction & GetWidth() const
Definition: pagedesc.hxx:64
#define OOO_STRING_SVTOOLS_RTF_FTNBJ
std::unique_ptr< SwNumRuleTable > m_pUsedNumTable
Definition: wrtww8.hxx:462
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:81
#define OOO_STRING_SVTOOLS_RTF_LNDSCPSXN
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
unsigned char sal_uInt8
#define RES_CHRATR_POSTURE
Definition: hintids.hxx:79
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:206
#define OOO_STRING_SVTOOLS_RTF_CREATIM
void OutputOLENode(const SwOLENode &rOLENode) override
Output SwOLENode.
Definition: rtfexport.cxx:1017
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:1056
#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:1593
bool IsUsed(const SwModify &) const
Definition: poolfmt.cxx:122
static SvStream & OutULong(SvStream &rStrm, sal_uLong nVal)
Definition: writer.cxx:238
SwFootnoteNum eNum
Definition: ftninfo.hxx:97
void OutColorTable()
Definition: rtfexport.cxx:1184
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:208
SwNodes & GetNodes()
Definition: doc.hxx:402
#define OOO_STRING_SVTOOLS_RTF_FOOTERF
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
#define OOO_STRING_SVTOOLS_RTF_AFTNNCHI
sal_uInt16 nFootnoteOffset
Definition: ftninfo.hxx:47
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:545
void NumberingDefinitions()
Write static data of SwNumRule - LSTF.
Definition: wrtw8num.cxx:199
::sw::MetaFieldManager & GetMetaFieldManager()
Definition: doc.cxx:160
#define LO_STRING_SVTOOLS_RTF_VIEWBKSP
sal_uInt16 GetId(const SvxFontItem &rFont)
Definition: wrtw8sty.cxx:891
ErrCode ExportDocument_Impl() override
Format-dependent part of the actual export.
Definition: rtfexport.cxx:683
void ExportGrfBullet(const SwTextNode &rNd) override
Definition: rtfexport.cxx:179
#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:1858
#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:381
Header, for PageFormats Client of FrameFormat describing the header.
Definition: fmthdft.hxx:33
#define OOO_STRING_SVTOOLS_RTF_SUBJECT
void AppendAnnotationMarks(const SwWW8AttrIter &rAttrs, sal_Int32 nCurrentPos, sal_Int32 nLen) override
Definition: rtfexport.cxx:153
bool GetAnnotationMarks(const SwWW8AttrIter &rAttrs, sal_Int32 nStt, sal_Int32 nEnd, IMarkVector &rArr)
Definition: wrtw8nds.cxx:1894
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
std::shared_ptr< SwUnoCursor > m_pCurrentPam
Definition: shellio.hxx:405
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:326
#define OOO_STRING_SVTOOLS_RTF_ENDDOC
const OUString & GetToolTip() const
Definition: expfld.cxx:1426
SvStream & Strm()
Definition: writer.cxx:218
RtfSdrExport & SdrExporter() const
Access to the Rtf Sdr exporter.
Definition: rtfexport.cxx:82
#define RES_BOX
Definition: hintids.hxx:211
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:1588
SwFootnotePos ePos
Definition: ftninfo.hxx:96
#define OOO_STRING_SVTOOLS_RTF_SV
Base class for WW8Export and DocxExport.
Definition: wrtww8.hxx:453
sal_uInt16 GetColor(const Color &rColor) const
Definition: rtfexport.cxx:1122
#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
#define LO_STRING_SVTOOLS_RTF_HTMAUTSP
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:116
bool const m_bOutOutlineOnly
Definition: rtfexport.hxx:49
#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:581
void PrepareNewPageDesc(const SfxItemSet *pSet, const SwNode &rNd, const SwFormatPageDesc *pNewPgDescFormat, const SwPageDesc *pNewPgDesc) override
Get ready for a new section.
Definition: rtfexport.cxx:963
#define RES_PAGEDESC
Definition: hintids.hxx:198
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
Definition: ndarr.hxx:162
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:637
std::map< OUString, sal_uInt16 > m_aRedlineTable
Definition: rtfexport.hxx:228
#define OOO_STRING_SVTOOLS_RTF_FTNRSTPG
ErrCode WriteStream() override
Definition: rtfexport.cxx:1462
const editeng::SvxBorderLine * GetBottom() const
sal_uLong m_nCurrentNodeIndex
Index of the current SwTextNode, if any.
Definition: rtfexport.hxx:169
virtual OUString GetPar2() const override
aPromptText
Definition: expfld.cxx:1406
const SwFootnoteInfo & GetFootnoteInfo() const
Definition: doc.hxx:623
OUString convertCommaSeparated(uno::Sequence< OUString > const &i_rSeq)
wwFontHelper m_aFontHelper
Definition: wrtww8.hxx:456
#define OOO_STRING_SVTOOLS_RTF_HR
SwDoc * m_pDoc
Definition: wrtww8.hxx:572
const SwEndNoteInfo & GetEndNoteInfo() const
Definition: doc.hxx:625
#define SAL_NEWLINE_STRING
The physical access to the RTF document (for writing).
SwDoc * m_pDoc
Definition: shellio.hxx:403
const HdFtFlags WW8_FOOTER_ODD
Definition: ww8scan.hxx:1592
std::vector< const Graphic * > m_vecBulletPic
Vector to record all the graphics of bullets.
Definition: wrtww8.hxx:904
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1308
static const SwSectionFormat * GetSectionFormat(const SwNode &rNd)
Format of the section.
Definition: ww8atr.cxx:608
#define OOO_STRING_SVTOOLS_RTF_VIEWSCALE
void AbstractNumberingDefinitions()
Write all Levels for all SwNumRules - LVLF.
Definition: wrtw8num.cxx:385
void WriteInfo()
Definition: rtfexport.cxx:467
SwNumRule * GetOutlineNumRule() const
Definition: doc.hxx:1014
void WriteUserPropValue(const OUString &rValue)
Writes a single user property value.
Definition: rtfexport.cxx:531
sal_uInt16 GetUpper() const
std::unique_ptr< MSWordStyles > m_pStyles
Definition: wrtww8.hxx:499
ErrCode ExportDocument(bool bWriteAll)
The main function to export the document.
Definition: wrtww8.cxx:3155
const HdFtFlags WW8_HEADER_EVEN
Definition: ww8scan.hxx:1589
#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:186
#define OOO_STRING_SVTOOLS_RTF_AFTNNRLC
const SvxNumberType & GetNumType() const
Definition: pagedesc.hxx:192