LibreOffice Module sw (master)  1
htmlftn.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <sal/config.h>
21 
22 #include <string_view>
23 
24 #include <osl/diagnose.h>
25 #include <svtools/htmlout.hxx>
26 #include <svtools/htmlkywd.hxx>
27 #include <svtools/HtmlWriter.hxx>
28 #include <rtl/strbuf.hxx>
29 #include <ndindex.hxx>
30 #include <fmtftn.hxx>
31 #include <txtftn.hxx>
32 #include <ftninfo.hxx>
33 #include <doc.hxx>
34 #include <ndtxt.hxx>
35 #include <charfmt.hxx>
36 
37 #include "swhtml.hxx"
38 #include "wrthtml.hxx"
39 
40 static sal_Int32 lcl_html_getNextPart( OUString& rPart, const OUString& rContent,
41  sal_Int32 nPos )
42 {
43  rPart.clear();
44  sal_Int32 nLen = rContent.getLength();
45  if( nPos >= nLen )
46  {
47  nPos = -1;
48  }
49  else
50  {
51  bool bQuoted = false, bDone = false;
52  for( ; nPos < nLen && !bDone; nPos++ )
53  {
54  sal_Unicode c = rContent[nPos];
55  switch( c )
56  {
57  case '\\':
58  if( bQuoted )
59  rPart += OUStringChar( c );
60  bQuoted = !bQuoted;
61  break;
62 
63  case ';':
64  if( bQuoted )
65  rPart += OUStringChar( c );
66  else
67  bDone = true;
68  bQuoted = false;
69  break;
70 
71  default:
72  rPart += OUStringChar( c );
73  bQuoted = false;
74  break;
75  }
76  }
77  }
78 
79  return nPos;
80 }
81 
82 static sal_Int32 lcl_html_getEndNoteInfo( SwEndNoteInfo& rInfo,
83  const OUString& rContent,
84  bool bEndNote )
85 {
86  sal_Int32 nStrPos = 0;
87  for( int nPart = 0; nPart < 4; ++nPart )
88  {
89  OUString aPart;
90  if( -1 != nStrPos )
91  nStrPos = lcl_html_getNextPart( aPart, rContent, nStrPos );
92 
93  switch( nPart )
94  {
95  case 0:
97  if( !aPart.isEmpty() )
99  rInfo.m_aFormat.GetNumberingType() ));
100  break;
101 
102  case 1:
103  rInfo.m_nFootnoteOffset = aPart.isEmpty() ? 0 : o3tl::narrowing<sal_uInt16>(aPart.toInt32());
104  break;
105 
106  case 2:
107  rInfo.SetPrefix( aPart );
108  break;
109 
110  case 3:
111  rInfo.SetSuffix( aPart );
112  break;
113  }
114  }
115 
116  return nStrPos;
117 }
118 
119 void SwHTMLParser::FillEndNoteInfo( const OUString& rContent )
120 {
121  SwEndNoteInfo aInfo( m_xDoc->GetEndNoteInfo() );
122  lcl_html_getEndNoteInfo( aInfo, rContent, true );
123  m_xDoc->SetEndNoteInfo( aInfo );
124 }
125 
126 void SwHTMLParser::FillFootNoteInfo( const OUString& rContent )
127 {
128  SwFootnoteInfo aInfo( m_xDoc->GetFootnoteInfo() );
129 
130  sal_Int32 nStrPos = lcl_html_getEndNoteInfo( aInfo, rContent, false );
131 
132  for( int nPart = 4; nPart < 8; ++nPart )
133  {
134  OUString aPart;
135  if( -1 != nStrPos )
136  nStrPos = lcl_html_getNextPart( aPart, rContent, nStrPos );
137 
138  switch( nPart )
139  {
140  case 4:
141  aInfo.m_eNum = FTNNUM_DOC;
142  if( !aPart.isEmpty() )
143  {
144  switch( aPart[0] )
145  {
146  case 'D': aInfo.m_eNum = FTNNUM_DOC; break;
147  case 'C': aInfo.m_eNum = FTNNUM_CHAPTER; break;
148  case 'P': aInfo.m_eNum = FTNNUM_PAGE; break;
149  }
150  }
151  break;
152 
153  case 5:
154  aInfo.m_ePos = FTNPOS_PAGE;
155  if( !aPart.isEmpty() )
156  {
157  switch( aPart[0] )
158  {
159  case 'C': aInfo.m_ePos = FTNPOS_CHAPTER; break;
160  case 'P': aInfo.m_ePos = FTNPOS_PAGE; break;
161  }
162  }
163  break;
164 
165  case 6:
166  aInfo.m_aQuoVadis = aPart;
167  break;
168 
169  case 7:
170  aInfo.m_aErgoSum = aPart;
171  break;
172  }
173  }
174 
175  m_xDoc->SetFootnoteInfo( aInfo );
176 }
177 
178 void SwHTMLParser::InsertFootEndNote( const OUString& rName, bool bEndNote,
179  bool bFixed )
180 {
181  if( !m_pFootEndNoteImpl )
183 
184  m_pFootEndNoteImpl->sName = rName;
185  if( m_pFootEndNoteImpl->sName.getLength() > 3 )
186  m_pFootEndNoteImpl->sName = m_pFootEndNoteImpl->sName.copy( 0, m_pFootEndNoteImpl->sName.getLength() - 3 );
187  m_pFootEndNoteImpl->sName = m_pFootEndNoteImpl->sName.toAsciiUpperCase();
188  m_pFootEndNoteImpl->bEndNote = bEndNote;
189  m_pFootEndNoteImpl->bFixed = bFixed;
190  m_pFootEndNoteImpl->sContent.clear();
191 }
192 
194 {
195  if( !m_pFootEndNoteImpl )
196  return;
197 
198  SwFormatFootnote aFootnote( m_pFootEndNoteImpl->bEndNote );
199  if( m_pFootEndNoteImpl->bFixed )
200  aFootnote.SetNumStr( m_pFootEndNoteImpl->sContent );
201 
202  m_xDoc->getIDocumentContentOperations().InsertPoolItem( *m_pPam, aFootnote );
203  SwTextFootnote * const pTextFootnote = static_cast<SwTextFootnote *>(
206  // In header and footer no footnotes can be inserted.
207  if (pTextFootnote)
208  m_pFootEndNoteImpl->aTextFootnotes.push_back(SwHTMLTextFootnote(m_pFootEndNoteImpl->sName,pTextFootnote));
209  m_pFootEndNoteImpl->sName.clear();
210  m_pFootEndNoteImpl->sContent.clear();
211  m_pFootEndNoteImpl->bFixed = false;
212 }
213 
215 {
216  if( m_pFootEndNoteImpl && m_pFootEndNoteImpl->bFixed )
217  m_pFootEndNoteImpl->sContent += aToken;
218 }
219 
221 {
222  SwNodeIndex *pStartNodeIdx = nullptr;
223 
224  if (m_pFootEndNoteImpl)
225  {
226  OUString aName(rName.toAsciiUpperCase());
227 
228  size_t nCount = m_pFootEndNoteImpl->aTextFootnotes.size();
229  for(size_t i = 0; i < nCount; ++i)
230  {
231  if (m_pFootEndNoteImpl->aTextFootnotes[i].sName == aName)
232  {
233  pStartNodeIdx = m_pFootEndNoteImpl->aTextFootnotes[i].pTextFootnote->GetStartNode();
234  m_pFootEndNoteImpl->aTextFootnotes.erase( m_pFootEndNoteImpl->aTextFootnotes.begin() + i );
235  if (m_pFootEndNoteImpl->aTextFootnotes.empty())
236  {
237  m_pFootEndNoteImpl.reset();
238  }
239 
240  break;
241  }
242  }
243  }
244 
245  return pStartNodeIdx;
246 }
247 
249 {
250  SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
251  const auto& rLineBreak = static_cast<const SwFormatLineBreak&>(rHt);
252 
253  HtmlWriter aWriter(rHTMLWrt.Strm(), rHTMLWrt.maNamespace);
255  switch (rLineBreak.GetValue())
256  {
258  aWriter.attribute(OOO_STRING_SVTOOLS_HTML_O_clear, "none");
259  break;
261  aWriter.attribute(OOO_STRING_SVTOOLS_HTML_O_clear, "left");
262  break;
264  aWriter.attribute(OOO_STRING_SVTOOLS_HTML_O_clear, "right");
265  break;
267  aWriter.attribute(OOO_STRING_SVTOOLS_HTML_O_clear, "all");
268  break;
269  }
270  aWriter.end();
271  return rWrt;
272 }
273 
275 {
276  SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
277 
278  SwFormatFootnote& rFormatFootnote = const_cast<SwFormatFootnote&>(static_cast<const SwFormatFootnote&>(rHt));
279  SwTextFootnote *pTextFootnote = rFormatFootnote.GetTextFootnote();
280  if( !pTextFootnote )
281  return rWrt;
282 
283  OUString sFootnoteName, sClass;
284  size_t nPos;
285  if( rFormatFootnote.IsEndNote() )
286  {
287  nPos = rHTMLWrt.m_xFootEndNotes ? rHTMLWrt.m_xFootEndNotes->size() : 0;
288  OSL_ENSURE( nPos == static_cast<size_t>(rHTMLWrt.m_nFootNote + rHTMLWrt.m_nEndNote),
289  "OutHTML_SwFormatFootnote: wrong position" );
291  sFootnoteName = OOO_STRING_SVTOOLS_HTML_sdendnote + OUString::number( static_cast<sal_Int32>(++rHTMLWrt.m_nEndNote) );
292  }
293  else
294  {
295  nPos = rHTMLWrt.m_nFootNote;
297  sFootnoteName = OOO_STRING_SVTOOLS_HTML_sdfootnote + OUString::number( static_cast<sal_Int32>(++rHTMLWrt.m_nFootNote));
298  }
299 
300  if( !rHTMLWrt.m_xFootEndNotes )
301  rHTMLWrt.m_xFootEndNotes.emplace();
302  rHTMLWrt.m_xFootEndNotes->insert( rHTMLWrt.m_xFootEndNotes->begin() + nPos, pTextFootnote );
303 
304  OStringBuffer sOut;
305  OString aTag = rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_anchor;
306  sOut.append("<" + aTag + " " OOO_STRING_SVTOOLS_HTML_O_class "=\"");
307  rWrt.Strm().WriteOString( sOut.makeStringAndClear() );
308  HTMLOutFuncs::Out_String( rWrt.Strm(), sClass );
309  sOut.append("\" " OOO_STRING_SVTOOLS_HTML_O_name "=\"");
310  rWrt.Strm().WriteOString( sOut.makeStringAndClear() );
311  HTMLOutFuncs::Out_String( rWrt.Strm(), sFootnoteName );
312  sOut.append(OOO_STRING_SVTOOLS_HTML_FTN_anchor "\" "
314  rWrt.Strm().WriteOString( sOut.makeStringAndClear() );
315  HTMLOutFuncs::Out_String( rWrt.Strm(), sFootnoteName );
316  sOut.append(OOO_STRING_SVTOOLS_HTML_FTN_symbol "\"");
317  if( !rFormatFootnote.GetNumStr().isEmpty() )
318  sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_sdfixed);
319  sOut.append(">");
320  rWrt.Strm().WriteOString( sOut.makeStringAndClear() );
321  HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OStringConcatenation(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_superscript ));
322 
323  HTMLOutFuncs::Out_String( rWrt.Strm(), rFormatFootnote.GetViewNumStr(*rWrt.m_pDoc, nullptr) );
324  HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OStringConcatenation(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_superscript), false );
325  HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OStringConcatenation(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_anchor), false );
326 
327  return rWrt;
328 }
329 
331 {
332  OSL_ENSURE( m_xFootEndNotes,
333  "SwHTMLWriter::OutFootEndNotes(): unnecessary call" );
334  if( !m_xFootEndNotes )
335  return;
336 
337 #if OSL_DEBUG_LEVEL > 0
338  sal_uInt16 nFootnote = m_nFootNote, nEn = m_nEndNote;
339 #endif
340  m_nFootNote = 0;
341  m_nEndNote = 0;
342 
343  for( auto *pTextFootnote : *m_xFootEndNotes )
344  {
345  m_pFormatFootnote = &pTextFootnote->GetFootnote();
346 
347  OUString sFootnoteName;
349  {
350  sFootnoteName = OOO_STRING_SVTOOLS_HTML_sdendnote + OUString::number(static_cast<sal_Int32>(++m_nEndNote));
351  }
352  else
353  {
354  sFootnoteName = OOO_STRING_SVTOOLS_HTML_sdfootnote + OUString::number(static_cast<sal_Int32>(++m_nFootNote));
355  }
356 
357  if( m_bLFPossible )
358  OutNewLine();
359  OString sOut =
362  Strm().WriteOString( sOut );
363  HTMLOutFuncs::Out_String( Strm(), sFootnoteName );
364  Strm().WriteCharPtr( "\">" );
365 
366  m_bLFPossible = true;
367  IncIndentLevel(); // indent content of <DIV>
368 
369  OSL_ENSURE( pTextFootnote, "SwHTMLWriter::OutFootEndNotes: SwTextFootnote is missing" );
370  SwNodeIndex *pSttNdIdx = pTextFootnote->GetStartNode();
371  OSL_ENSURE( pSttNdIdx,
372  "SwHTMLWriter::OutFootEndNotes: StartNode-Index is missing" );
373  if( pSttNdIdx )
374  {
375  HTMLSaveData aSaveData( *this, pSttNdIdx->GetIndex()+1,
376  pSttNdIdx->GetNode().EndOfSectionIndex(), false );
377  Out_SwDoc( m_pCurrentPam.get() );
378  }
379 
380  DecIndentLevel(); // indent content of <DIV>
381  if( m_bLFPossible )
382  OutNewLine();
383  HTMLOutFuncs::Out_AsciiTag( Strm(), OStringConcatenation(GetNamespace() + OOO_STRING_SVTOOLS_HTML_division), false );
384  m_bLFPossible = true;
385 
386  OSL_ENSURE( !m_pFormatFootnote,
387  "SwHTMLWriter::OutFootEndNotes: Footnote was not output" );
388  if( m_pFormatFootnote )
389  {
391  m_nEndNote++;
392  else
393  m_nFootNote++;
394 
395  m_pFormatFootnote = nullptr;
396  }
397  }
398 
399 #if OSL_DEBUG_LEVEL > 0
400  OSL_ENSURE( nFootnote == m_nFootNote,
401  "SwHTMLWriter::OutFootEndNotes: Number of footnotes does not match" );
402  OSL_ENSURE( nEn == m_nEndNote,
403  "SwHTMLWriter::OutFootEndNotes: Number of endnotes does not match" );
404 #endif
405 
406  m_xFootEndNotes.reset();
407  m_nFootNote = m_nEndNote = 0;
408 }
409 
410 OUString SwHTMLWriter::GetFootEndNoteSym( const SwFormatFootnote& rFormatFootnote )
411 {
412  const SwEndNoteInfo * pInfo = nullptr;
413  if( rFormatFootnote.GetNumStr().isEmpty() )
414  pInfo = rFormatFootnote.IsEndNote() ? &m_pDoc->GetEndNoteInfo()
415  : &m_pDoc->GetFootnoteInfo();
416 
417  OUString sRet;
418  if( pInfo )
419  sRet = pInfo->GetPrefix();
420  sRet += rFormatFootnote.GetViewNumStr(*m_pDoc, nullptr);
421  if( pInfo )
422  sRet += pInfo->GetSuffix();
423 
424  return sRet;
425 }
426 
428  const OUString& rNum,
429  sal_uInt16 nScript )
430 {
431  const SwEndNoteInfo *pInfo;
432 
433  OUString sFootnoteName, sClass;
434  if( rFormatFootnote.IsEndNote() )
435  {
437  sFootnoteName = OOO_STRING_SVTOOLS_HTML_sdendnote +
438  OUString::number(static_cast<sal_Int32>(m_nEndNote));
439  pInfo = &m_pDoc->GetEndNoteInfo();
440  }
441  else
442  {
444  sFootnoteName = OOO_STRING_SVTOOLS_HTML_sdfootnote +
445  OUString::number(static_cast<sal_Int32>(m_nFootNote));
446  pInfo = &m_pDoc->GetFootnoteInfo();
447  }
448 
449  const SwCharFormat *pSymCharFormat = pInfo->GetCharFormat( *m_pDoc );
450  if( pSymCharFormat && 0 != m_aScriptTextStyles.count( pSymCharFormat->GetName() ) )
451  {
452  switch( nScript )
453  {
455  sClass += "-western";
456  break;
457  case CSS1_OUTMODE_CJK:
458  sClass += "-cjk";
459  break;
460  case CSS1_OUTMODE_CTL:
461  sClass += "-ctl";
462  break;
463  }
464  }
465 
466  OStringBuffer sOut;
467  sOut.append("<" + GetNamespace() + OOO_STRING_SVTOOLS_HTML_anchor " "
469  Strm().WriteOString( sOut.makeStringAndClear() );
470  HTMLOutFuncs::Out_String( Strm(), sClass );
471  sOut.append("\" " OOO_STRING_SVTOOLS_HTML_O_name "=\"");
472  Strm().WriteOString( sOut.makeStringAndClear() );
473  HTMLOutFuncs::Out_String( Strm(), sFootnoteName );
474  sOut.append(OOO_STRING_SVTOOLS_HTML_FTN_symbol "\" "
476  Strm().WriteOString( sOut.makeStringAndClear() );
477  HTMLOutFuncs::Out_String( Strm(), sFootnoteName );
478  sOut.append(OOO_STRING_SVTOOLS_HTML_FTN_anchor "\">");
479  Strm().WriteOString( sOut.makeStringAndClear() );
480 
481  HTMLOutFuncs::Out_String( Strm(), rNum );
482  HTMLOutFuncs::Out_AsciiTag( Strm(), OStringConcatenation(GetNamespace() + OOO_STRING_SVTOOLS_HTML_anchor), false );
483 }
484 
485 static int lcl_html_fillEndNoteInfo( const SwEndNoteInfo& rInfo,
486  OUString *pParts,
487  bool bEndNote )
488 {
489  int nParts = 0;
490  sal_Int16 eFormat = rInfo.m_aFormat.GetNumberingType();
491  if( (bEndNote ? SVX_NUM_ROMAN_LOWER : SVX_NUM_ARABIC) != eFormat )
492  {
493  const char *pStr = SwHTMLWriter::GetNumFormat( eFormat );
494  if( pStr )
495  {
496  pParts[0] = OUString::createFromAscii( pStr );
497  nParts = 1;
498  }
499  }
500  if( rInfo.m_nFootnoteOffset > 0 )
501  {
502  pParts[1] = OUString::number(rInfo.m_nFootnoteOffset);
503  nParts = 2;
504  }
505  if( !rInfo.GetPrefix().isEmpty() )
506  {
507  pParts[2] = rInfo.GetPrefix();
508  nParts = 3;
509  }
510  if( !rInfo.GetSuffix().isEmpty() )
511  {
512  pParts[3] = rInfo.GetSuffix();
513  nParts = 4;
514  }
515 
516  return nParts;
517 }
518 
519 static void lcl_html_outFootEndNoteInfo( Writer& rWrt, OUString const *pParts,
520  int nParts, const char *pName )
521 {
522  SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
523 
524  OUStringBuffer aContent;
525  for( int i=0; i<nParts; ++i )
526  {
527  OUString aTmp( pParts[i] );
528  aTmp = aTmp.replaceAll( "\\", "\\\\" );
529  aTmp = aTmp.replaceAll( ";", "\\;" );
530  if( i > 0 )
531  aContent.append(";");
532  aContent.append(aTmp);
533  }
534 
535  rHTMLWrt.OutNewLine();
536  OString sOut =
537  "<" + rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_meta " "
538  OOO_STRING_SVTOOLS_HTML_O_name "=\"" + pName +
540  rWrt.Strm().WriteOString( sOut );
541  HTMLOutFuncs::Out_String( rWrt.Strm(), aContent.makeStringAndClear() );
542  rWrt.Strm().WriteCharPtr( "\">" );
543 }
544 
546 {
547  // Number type (1 or i)
548  // Offset (0)
549  // Before it
550  // Behind it
551  // Doc/Page/Chap (D)
552  // Position (S)
553  // Next page
554  // Beginning
555 
556  {
557  const SwFootnoteInfo& rInfo = m_pDoc->GetFootnoteInfo();
558  OUString aParts[8];
559  int nParts = lcl_html_fillEndNoteInfo( rInfo, aParts, false );
560  if( rInfo.m_eNum != FTNNUM_DOC )
561  {
562  aParts[4] = rInfo.m_eNum == FTNNUM_CHAPTER ? std::u16string_view( u"C" ) : std::u16string_view( u"P" );
563  nParts = 5;
564  }
565  if( rInfo.m_ePos != FTNPOS_PAGE)
566  {
567  aParts[5] = "C";
568  nParts = 6;
569  }
570  if( !rInfo.m_aQuoVadis.isEmpty() )
571  {
572  aParts[6] = rInfo.m_aQuoVadis;
573  nParts = 7;
574  }
575  if( !rInfo.m_aErgoSum.isEmpty() )
576  {
577  aParts[7] = rInfo.m_aErgoSum;
578  nParts = 8;
579  }
580  if( nParts > 0 )
581  lcl_html_outFootEndNoteInfo( *this, aParts, nParts,
583  }
584 
585  {
586  const SwEndNoteInfo& rInfo = m_pDoc->GetEndNoteInfo();
587  OUString aParts[4];
588  const int nParts = lcl_html_fillEndNoteInfo( rInfo, aParts, true );
589  if( nParts > 0 )
590  lcl_html_outFootEndNoteInfo( *this, aParts, nParts,
592  }
593 }
594 
595 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define OOO_STRING_SVTOOLS_HTML_FTN_anchor
SvxNumType GetNumberingType() const
SwNode & GetNode(bool bPoint=true) const
Definition: pam.hxx:224
SwNodeOffset EndOfSectionIndex() const
Definition: node.hxx:687
#define OOO_STRING_SVTOOLS_HTML_O_clear
void FinishFootEndNote()
Definition: htmlftn.cxx:193
#define OOO_STRING_SVTOOLS_HTML_sdendnote_anc
#define OOO_STRING_SVTOOLS_HTML_META_sdendnote
void FillEndNoteInfo(const OUString &rContent)
Definition: htmlftn.cxx:119
const OUString & GetSuffix() const
Definition: ftninfo.hxx:71
std::unique_ptr< SwHTMLFootEndNote_Impl > m_pFootEndNoteImpl
Definition: swhtml.hxx:404
#define OOO_STRING_SVTOOLS_HTML_meta
#define OOO_STRING_SVTOOLS_HTML_sdfootnote_anc
void SetNumStr(const OUString &rStr)
Definition: fmtftn.hxx:73
void DecIndentLevel()
Definition: wrthtml.hxx:511
SwNode & GetNode() const
Definition: ndindex.hxx:119
#define OOO_STRING_SVTOOLS_HTML_sdfootnote_sym
#define OOO_STRING_SVTOOLS_HTML_O_id
bool IsEndNote() const
Definition: fmtftn.hxx:71
static SVT_DLLPUBLIC SvStream & Out_AsciiTag(SvStream &, std::string_view rStr, bool bOn=true)
#define OOO_STRING_SVTOOLS_HTML_superscript
static sal_Int32 lcl_html_getNextPart(OUString &rPart, const OUString &rContent, sal_Int32 nPos)
Definition: htmlftn.cxx:40
SvStream & WriteCharPtr(const char *pBuf)
OString maNamespace
XML namespace, in case of XHTML.
Definition: wrthtml.hxx:398
OUString GetViewNumStr(const SwDoc &rDoc, SwRootFrame const *pLayout, bool bInclStrings=false) const
Returns string to be displayed of footnote / endnote.
Definition: atrftn.cxx:217
#define CSS1_OUTMODE_CJK
Definition: wrthtml.hxx:182
std::optional< std::vector< SwTextFootnote * > > m_xFootEndNotes
Definition: wrthtml.hxx:294
SwTextAttr * GetTextAttrForCharAt(const sal_Int32 nIndex, const sal_uInt16 nWhich=RES_TXTATR_END) const
get the text attribute at position nIndex which owns the dummy character CH_TXTATR_* at that position...
Definition: ndtxt.cxx:3068
void OutNewLine(bool bCheck=false)
Definition: wrthtml.cxx:1503
static sal_Int32 lcl_html_getEndNoteInfo(SwEndNoteInfo &rInfo, const OUString &rContent, bool bEndNote)
Definition: htmlftn.cxx:82
const SwTextFootnote * GetTextFootnote() const
Definition: fmtftn.hxx:83
sal_uInt16 sal_Unicode
bool m_bLFPossible
Definition: wrthtml.hxx:381
constexpr TypedWhichId< SwFormatFootnote > RES_TXTATR_FTN(59)
SwIndex nContent
Definition: pam.hxx:39
#define OOO_STRING_SVTOOLS_HTML_O_href
static const char * GetNumFormat(sal_uInt16 nFormat)
Definition: htmlfldw.cxx:43
const OUString & GetName() const
Definition: format.hxx:131
int nCount
SVX_NUM_ARABIC
SVX_NUM_ROMAN_LOWER
const OUString & GetNumStr() const
Definition: fmtftn.hxx:68
SwNodeOffset GetIndex() const
Definition: ndindex.hxx:152
OUString GetFootEndNoteSym(const SwFormatFootnote &rFormatFootnote)
Definition: htmlftn.cxx:410
SwPaM * m_pPam
Definition: swhtml.hxx:393
#define OOO_STRING_SVTOOLS_HTML_sdfootnote
static void lcl_html_outFootEndNoteInfo(Writer &rWrt, OUString const *pParts, int nParts, const char *pName)
Definition: htmlftn.cxx:519
std::set< OUString > m_aScriptTextStyles
Definition: wrthtml.hxx:287
#define OOO_STRING_SVTOOLS_HTML_O_class
SwNodeIndex * GetFootEndNoteSection(const OUString &rName)
Definition: htmlftn.cxx:220
SwFootnoteNum m_eNum
Definition: ftninfo.hxx:98
void InsertFootEndNote(const OUString &rName, bool bEndNote, bool bFixed)
Definition: htmlftn.cxx:178
sal_uInt16 char * pName
SfxPoolItem subclass that wraps an SwLineBreakClear.
int i
const SwPosition * GetPoint() const
Definition: pam.hxx:208
Writer & OutHTML_SwFormatFootnote(Writer &rWrt, const SfxPoolItem &rHt)
Definition: htmlftn.cxx:274
sal_uInt16 m_nFootnoteOffset
Definition: ftninfo.hxx:47
static int lcl_html_fillEndNoteInfo(const SwEndNoteInfo &rInfo, OUString *pParts, bool bEndNote)
Definition: htmlftn.cxx:485
float u
#define OOO_STRING_SVTOOLS_HTML_O_name
SvxNumberType m_aFormat
Definition: ftninfo.hxx:46
Marks a node in the document model.
Definition: ndindex.hxx:30
sal_uInt16 m_nEndNote
Definition: wrthtml.hxx:316
Represents the style of a text portion.
Definition: charfmt.hxx:26
void SetPrefix(const OUString &rSet)
Definition: ftninfo.hxx:73
void Out_SwDoc(SwPaM *)
Definition: wrthtml.cxx:885
const SwFormatFootnote * m_pFormatFootnote
Definition: wrthtml.hxx:305
const OUString & GetPrefix() const
Definition: ftninfo.hxx:70
#define OOO_STRING_SVTOOLS_HTML_division
#define OOO_STRING_SVTOOLS_HTML_linebreak
void InsertFootEndNoteText()
Definition: htmlftn.cxx:214
SwCharFormat * GetCharFormat(SwDoc &rDoc) const
Definition: docftn.cxx:140
static SVT_DLLPUBLIC SvStream & Out_String(SvStream &, const OUString &, OUString *pNonConvertableChars=nullptr)
void start(const OString &aElement)
#define OOO_STRING_SVTOOLS_HTML_sdendnote
#define OOO_STRING_SVTOOLS_HTML_sdendnote_sym
SvStream & WriteOString(std::string_view rStr)
static SvxNumType GetNumType(const OUString &rStr, SvxNumType eDfltType)
Definition: htmlfld.cxx:199
void IncIndentLevel()
Definition: wrthtml.hxx:507
#define CSS1_OUTMODE_WESTERN
Definition: wrthtml.hxx:180
void OutFootEndNotes()
Definition: htmlftn.cxx:330
OUString aName
sal_Int32 GetIndex() const
Definition: index.hxx:91
OString GetNamespace() const
Determines the prefix string needed to respect the requested namespace alias.
Definition: wrthtml.cxx:1552
#define OOO_STRING_SVTOOLS_HTML_O_content
sal_uInt16 m_nFootNote
Definition: wrthtml.hxx:317
std::shared_ptr< SwUnoCursor > m_pCurrentPam
Definition: shellio.hxx:410
void SetSuffix(const OUString &rSet)
Definition: ftninfo.hxx:74
OUString m_aQuoVadis
Definition: ftninfo.hxx:95
SvStream & Strm()
Definition: writer.cxx:215
void FillFootNoteInfo(const OUString &rContent)
Definition: htmlftn.cxx:126
SwFootnotePos m_ePos
Definition: ftninfo.hxx:97
#define OOO_STRING_SVTOOLS_HTML_O_sdfixed
#define OOO_STRING_SVTOOLS_HTML_FTN_symbol
void SetNumberingType(SvxNumType nSet)
Writer & OutHTML_SwFormatLineBreak(Writer &rWrt, const SfxPoolItem &rHt)
Definition: htmlftn.cxx:248
rtl::Reference< SwDoc > m_xDoc
Definition: swhtml.hxx:392
#define CSS1_OUTMODE_CTL
Definition: wrthtml.hxx:184
#define OOO_STRING_SVTOOLS_HTML_anchor
void OutFootEndNoteInfo()
Definition: htmlftn.cxx:545
const SwFootnoteInfo & GetFootnoteInfo() const
Definition: doc.hxx:629
void OutFootEndNoteSym(const SwFormatFootnote &rFormatFootnote, const OUString &rNum, sal_uInt16 nScript)
Definition: htmlftn.cxx:427
#define OOO_STRING_SVTOOLS_HTML_META_sdfootnote
const SwEndNoteInfo & GetEndNoteInfo() const
Definition: doc.hxx:631
OUString m_aErgoSum
Definition: ftninfo.hxx:96
SwDoc * m_pDoc
Definition: shellio.hxx:408
sal_uInt16 nPos
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:864
bool m_bDetectedRangeSegmentation false