LibreOffice Module sw (master)  1
htmlfldw.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 <com/sun/star/i18n/XBreakIterator.hpp>
21 #include <comphelper/string.hxx>
22 #include <svtools/htmlkywd.hxx>
23 #include <svtools/htmlout.hxx>
24 #include <osl/diagnose.h>
25 #include <o3tl/string_view.hxx>
26 #include <fmtfld.hxx>
27 #include <doc.hxx>
28 #include <breakit.hxx>
29 #include <ndtxt.hxx>
30 #include <txtfld.hxx>
31 #include <fldbas.hxx>
32 #include <docufld.hxx>
33 #include <flddat.hxx>
34 #include <viewopt.hxx>
35 #include "htmlfld.hxx"
36 #include "wrthtml.hxx"
37 #include <rtl/strbuf.hxx>
38 #include "css1atr.hxx"
39 #include "css1kywd.hxx"
40 
41 using namespace nsSwDocInfoSubType;
42 
43 const char *SwHTMLWriter::GetNumFormat( sal_uInt16 nFormat )
44 {
45  const char *pFormatStr = nullptr;
46 
47  switch( static_cast<SvxNumType>(nFormat) )
48  {
51  case SVX_NUM_ROMAN_UPPER: pFormatStr = OOO_STRING_SW_HTML_FF_uroman; break;
52  case SVX_NUM_ROMAN_LOWER: pFormatStr = OOO_STRING_SW_HTML_FF_lroman; break;
53  case SVX_NUM_ARABIC: pFormatStr = OOO_STRING_SW_HTML_FF_arabic; break;
54  case SVX_NUM_NUMBER_NONE: pFormatStr = OOO_STRING_SW_HTML_FF_none; break;
55  case SVX_NUM_CHAR_SPECIAL: pFormatStr = OOO_STRING_SW_HTML_FF_char; break;
56  case SVX_NUM_PAGEDESC: pFormatStr = OOO_STRING_SW_HTML_FF_page; break;
59  default:
60  ;
61  }
62 
63  return pFormatStr;
64 }
65 
66 static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pField,
67  const SwTextNode& rTextNd, sal_Int32 nFieldPos )
68 {
69  SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
70 
71  const SwFieldType* pFieldTyp = pField->GetTyp();
72  SwFieldIds nField = pFieldTyp->Which();
73  sal_uLong nFormat = pField->GetFormat();
74 
75  const char *pTypeStr=nullptr, // TYPE
76  *pSubStr=nullptr, // SUBTYPE
77  *pFormatStr=nullptr; // FORMAT (SW)
78  OUString aValue; // VALUE (SW)
79  bool bNumFormat=false; // SDNUM (Number-Formatter-Format)
80  bool bNumValue=false; // SDVAL (Number-Formatter-Value)
81  double dNumValue = 0.0; // SDVAL (Number-Formatter-Value)
82  bool bFixed=false; // SDFIXED
83  OUString aName; // NAME (CUSTOM)
84 
85  switch( nField )
86  {
89  switch( static_cast<SwExtUserSubType>(pField->GetSubType()) )
90  {
91  case EU_COMPANY: pSubStr = OOO_STRING_SW_HTML_FS_company; break;
92  case EU_FIRSTNAME: pSubStr = OOO_STRING_SW_HTML_FS_firstname; break;
93  case EU_NAME: pSubStr = OOO_STRING_SW_HTML_FS_name; break;
94  case EU_SHORTCUT: pSubStr = OOO_STRING_SW_HTML_FS_shortcut; break;
95  case EU_STREET: pSubStr = OOO_STRING_SW_HTML_FS_street; break;
96  case EU_COUNTRY: pSubStr = OOO_STRING_SW_HTML_FS_country; break;
97  case EU_ZIP: pSubStr = OOO_STRING_SW_HTML_FS_zip; break;
98  case EU_CITY: pSubStr = OOO_STRING_SW_HTML_FS_city; break;
99  case EU_TITLE: pSubStr = OOO_STRING_SW_HTML_FS_title; break;
100  case EU_POSITION: pSubStr = OOO_STRING_SW_HTML_FS_position; break;
101  case EU_PHONE_PRIVATE: pSubStr = OOO_STRING_SW_HTML_FS_pphone; break;
102  case EU_PHONE_COMPANY: pSubStr = OOO_STRING_SW_HTML_FS_cphone; break;
103  case EU_FAX: pSubStr = OOO_STRING_SW_HTML_FS_fax; break;
104  case EU_EMAIL: pSubStr = OOO_STRING_SW_HTML_FS_email; break;
105  case EU_STATE: pSubStr = OOO_STRING_SW_HTML_FS_state; break;
106  default:
107  ;
108  }
109  OSL_ENSURE( pSubStr, "unknown sub type for SwExtUserField" );
110  bFixed = static_cast<const SwExtUserField*>(pField)->IsFixed();
111  break;
112 
113  case SwFieldIds::Author:
114  pTypeStr = OOO_STRING_SW_HTML_FT_author;
115  switch( static_cast<SwAuthorFormat>(nFormat) & 0xff)
116  {
117  case AF_NAME: pFormatStr = OOO_STRING_SW_HTML_FF_name; break;
118  case AF_SHORTCUT: pFormatStr = OOO_STRING_SW_HTML_FF_shortcut; break;
119  }
120  OSL_ENSURE( pFormatStr, "unknown format for SwAuthorField" );
121  bFixed = static_cast<const SwAuthorField*>(pField)->IsFixed();
122  break;
123 
126  bNumFormat = true;
127  if( static_cast<const SwDateTimeField*>(pField)->IsFixed() )
128  {
129  bNumValue = true;
130  dNumValue = static_cast<const SwDateTimeField*>(pField)->GetValue();
131  }
132  break;
133 
135  {
136  pTypeStr = OOO_STRING_SW_HTML_FT_page;
137  SwPageNumSubType eSubType = static_cast<SwPageNumSubType>(pField->GetSubType());
138  switch( eSubType )
139  {
140  case PG_RANDOM: pSubStr = OOO_STRING_SW_HTML_FS_random; break;
141  case PG_NEXT: pSubStr = OOO_STRING_SW_HTML_FS_next; break;
142  case PG_PREV: pSubStr = OOO_STRING_SW_HTML_FS_prev; break;
143  }
144  OSL_ENSURE( pSubStr, "unknown sub type for SwPageNumberField" );
145  pFormatStr = SwHTMLWriter::GetNumFormat( static_cast< sal_uInt16 >(nFormat) );
146 
147  if( static_cast<SvxNumType>(nFormat)==SVX_NUM_CHAR_SPECIAL )
148  {
149  aValue = static_cast<const SwPageNumberField *>(pField)->GetUserString();
150  }
151  else
152  {
153  const OUString& rValue = pField->GetPar2();
154  short nValue = static_cast<short>(rValue.toInt32());
155  if( (eSubType == PG_NEXT && nValue!=1) ||
156  (eSubType == PG_PREV && nValue!=-1) ||
157  (eSubType == PG_RANDOM && nValue!=0) )
158  {
159  aValue = rValue;
160  }
161  }
162  }
163  break;
164  case SwFieldIds::DocInfo:
165  {
166  sal_uInt16 nSubType = pField->GetSubType();
168  sal_uInt16 nExtSubType = nSubType & 0x0f00;
169  nSubType &= 0x00ff;
170 
171  switch( nSubType )
172  {
173  case DI_TITLE: pSubStr = OOO_STRING_SW_HTML_FS_title; break;
174  case DI_SUBJECT: pSubStr = OOO_STRING_SW_HTML_FS_theme; break;
175  case DI_KEYS: pSubStr = OOO_STRING_SW_HTML_FS_keys; break;
176  case DI_COMMENT: pSubStr = OOO_STRING_SW_HTML_FS_comment; break;
177  case DI_CREATE: pSubStr = OOO_STRING_SW_HTML_FS_create; break;
178  case DI_CHANGE: pSubStr = OOO_STRING_SW_HTML_FS_change; break;
179  case DI_CUSTOM: pSubStr = OOO_STRING_SW_HTML_FS_custom; break;
180  default: pTypeStr = nullptr; break;
181  }
182 
183  if( DI_CUSTOM == nSubType ) {
184  aName = static_cast<const SwDocInfoField*>(pField)->GetName();
185  }
186 
187  if( DI_CREATE == nSubType || DI_CHANGE == nSubType )
188  {
189  switch( nExtSubType )
190  {
191  case DI_SUB_AUTHOR:
192  pFormatStr = OOO_STRING_SW_HTML_FF_author;
193  break;
194  case DI_SUB_TIME:
195  pFormatStr = OOO_STRING_SW_HTML_FF_time;
196  bNumFormat = true;
197  break;
198  case DI_SUB_DATE:
199  pFormatStr = OOO_STRING_SW_HTML_FF_date;
200  bNumFormat = true;
201  break;
202  }
203  }
204  bFixed = static_cast<const SwDocInfoField*>(pField)->IsFixed();
205  if( bNumFormat )
206  {
207  if( bFixed )
208  {
209  // For a fixed field output the num value too.
210  // Fixed fields without number format shouldn't
211  // exist. See below for OSL_ENSURE().
212  dNumValue = static_cast<const SwDocInfoField*>(pField)->GetValue();
213  bNumValue = true;
214  }
215  else if( !nFormat )
216  {
217  // Non-fixed fields may not have a number format, when
218  // they come from a 4.0-document.
219  bNumFormat = false;
220  }
221  }
222  }
223  break;
224 
225  case SwFieldIds::DocStat:
226  {
228  sal_uInt16 nSubType = pField->GetSubType();
229  switch( nSubType )
230  {
231  case DS_PAGE: pSubStr = OOO_STRING_SW_HTML_FS_page; break;
232  case DS_PARA: pSubStr = OOO_STRING_SW_HTML_FS_para; break;
233  case DS_WORD: pSubStr = OOO_STRING_SW_HTML_FS_word; break;
234  case DS_CHAR: pSubStr = OOO_STRING_SW_HTML_FS_char; break;
235  case DS_TBL: pSubStr = OOO_STRING_SW_HTML_FS_tbl; break;
236  case DS_GRF: pSubStr = OOO_STRING_SW_HTML_FS_grf; break;
237  case DS_OLE: pSubStr = OOO_STRING_SW_HTML_FS_ole; break;
238  default: pTypeStr = nullptr; break;
239  }
240  pFormatStr = SwHTMLWriter::GetNumFormat( static_cast< sal_uInt16 >(nFormat) );
241  }
242  break;
243 
246  switch( static_cast<SwFileNameFormat>(nFormat & ~FF_FIXED) )
247  {
248  case FF_NAME: pFormatStr = OOO_STRING_SW_HTML_FF_name; break;
249  case FF_PATHNAME: pFormatStr = OOO_STRING_SW_HTML_FF_pathname; break;
250  case FF_PATH: pFormatStr = OOO_STRING_SW_HTML_FF_path; break;
251  case FF_NAME_NOEXT: pFormatStr = OOO_STRING_SW_HTML_FF_name_noext; break;
252  default:
253  ;
254  }
255  bFixed = static_cast<const SwFileNameField*>(pField)->IsFixed();
256  OSL_ENSURE( pFormatStr, "unknown format for SwFileNameField" );
257  break;
258  default: break;
259  }
260 
261  // ReqIF-XHTML doesn't allow <sdfield>.
262  if (rHTMLWrt.mbReqIF && pTypeStr)
263  {
264  pTypeStr = nullptr;
265  }
266 
267  // Output the <sdfield> tag.
268  if( pTypeStr )
269  {
270  OStringBuffer sOut;
271  sOut.append('<');
272  sOut.append(rHTMLWrt.GetNamespace());
273  sOut.append(OOO_STRING_SVTOOLS_HTML_sdfield).append(' ').
274  append(OOO_STRING_SVTOOLS_HTML_O_type).append('=').
275  append(pTypeStr);
276  if( pSubStr )
277  {
278  sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_subtype).
279  append('=').append(pSubStr);
280  }
281  if( pFormatStr )
282  {
283  sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_format).
284  append('=').append(pFormatStr);
285  }
286  if( !aName.isEmpty() )
287  {
288  sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_name "=\"");
289  rWrt.Strm().WriteOString( sOut.makeStringAndClear() );
290  HTMLOutFuncs::Out_String( rWrt.Strm(), aName );
291  sOut.append('\"');
292  }
293  if( !aValue.isEmpty() )
294  {
295  sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_value "=\"");
296  rWrt.Strm().WriteOString( sOut.makeStringAndClear() );
297  HTMLOutFuncs::Out_String( rWrt.Strm(), aValue );
298  sOut.append('\"');
299  }
300  if( bNumFormat )
301  {
302  OSL_ENSURE( nFormat, "number format is 0" );
304  bNumValue, dNumValue, nFormat,
305  *rHTMLWrt.m_pDoc->GetNumberFormatter()));
306  }
307  if( bFixed )
308  {
309  sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_sdfixed);
310  }
311  sOut.append('>');
312  rWrt.Strm().WriteOString( sOut.makeStringAndClear() );
313  }
314 
315  // output content of the field
316  OUString const sExpand( pField->ExpandField(true, nullptr) );
317  bool bNeedsCJKProcessing = false;
318  if( !sExpand.isEmpty() )
319  {
320  sal_uInt16 nScriptType = g_pBreakIt->GetBreakIter()->getScriptType( sExpand, 0 );
321  sal_Int32 nPos = g_pBreakIt->GetBreakIter()->endOfScript( sExpand, 0,
322  nScriptType );
323 
324  sal_uInt16 nScript =
326  if( (nPos < sExpand.getLength() && nPos >= 0) || nScript != rHTMLWrt.m_nCSS1Script )
327  {
328  bNeedsCJKProcessing = true;
329  }
330  }
331 
332  if( bNeedsCJKProcessing )
333  {
334  //sequence of (start, end) property ranges we want to
335  //query
340  aScriptItemSet( rWrt.m_pDoc->GetAttrPool() );
341  rTextNd.GetParaAttr(aScriptItemSet, nFieldPos, nFieldPos+1);
342 
343  sal_uInt16 aWesternWhichIds[4] =
345  RES_CHRATR_POSTURE, RES_CHRATR_WEIGHT };
346  sal_uInt16 aCJKWhichIds[4] =
349  sal_uInt16 aCTLWhichIds[4] =
352 
353  sal_uInt16 *pRefWhichIds = nullptr;
354  switch( rHTMLWrt.m_nCSS1Script )
355  {
357  pRefWhichIds = aWesternWhichIds;
358  break;
359  case CSS1_OUTMODE_CJK:
360  pRefWhichIds = aCJKWhichIds;
361  break;
362  case CSS1_OUTMODE_CTL:
363  pRefWhichIds = aCTLWhichIds;
364  break;
365  }
366 
367  sal_Int32 nPos = 0;
368  do
369  {
370  sal_uInt16 nScriptType = g_pBreakIt->GetBreakIter()->getScriptType( sExpand, nPos );
371  sal_uInt16 nScript =
373  sal_Int32 nEndPos = g_pBreakIt->GetBreakIter()->endOfScript(
374  sExpand, nPos, nScriptType );
375  sal_Int32 nChunkLen = nEndPos - nPos;
376  if( nScript != CSS1_OUTMODE_ANY_SCRIPT &&
377  /* #108791# */ nScript != rHTMLWrt.m_nCSS1Script )
378  {
379  sal_uInt16 *pWhichIds = nullptr;
380  switch( nScript )
381  {
382  case CSS1_OUTMODE_WESTERN: pWhichIds = aWesternWhichIds; break;
383  case CSS1_OUTMODE_CJK: pWhichIds = aCJKWhichIds; break;
384  case CSS1_OUTMODE_CTL: pWhichIds = aCTLWhichIds; break;
385  }
386 
387  rHTMLWrt.m_bTagOn = true;
388 
389  const SfxPoolItem *aItems[5];
390  int nItems = 0;
391 
392  assert(pWhichIds && pRefWhichIds);
393  if (pWhichIds && pRefWhichIds)
394  {
395  for( int i=0; i<4; i++ )
396  {
397  const SfxPoolItem *pRefItem =
398  aScriptItemSet.GetItem( pRefWhichIds[i] );
399  const SfxPoolItem *pItem =
400  aScriptItemSet.GetItem( pWhichIds[i] );
401  if( pRefItem && pItem &&
402  !(0==i ? swhtml_css1atr_equalFontItems( *pRefItem, *pItem )
403  : *pRefItem == *pItem) )
404  {
405  Out( aHTMLAttrFnTab, *pItem, rHTMLWrt );
406  aItems[nItems++] = pItem;
407  }
408  }
409  }
410 
411  HTMLOutFuncs::Out_String( rWrt.Strm(), sExpand.copy( nPos, nChunkLen ) );
412 
413  rHTMLWrt.m_bTagOn = false;
414  while( nItems )
415  Out( aHTMLAttrFnTab, *aItems[--nItems], rHTMLWrt );
416 
417  }
418  else
419  {
420  HTMLOutFuncs::Out_String( rWrt.Strm(), sExpand.copy( nPos, nChunkLen ) );
421  }
422  nPos = nEndPos;
423  }
424  while( nPos < sExpand.getLength() );
425  }
426  else
427  {
428  HTMLOutFuncs::Out_String( rWrt.Strm(), sExpand );
429  }
430 
431  // Output the closing tag.
432  if( pTypeStr )
433  HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OStringConcatenation(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_sdfield), false );
434 
435  return rWrt;
436 }
437 
439 {
440  SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
441  const SwFormatField & rField = static_cast<const SwFormatField&>(rHt);
442  const SwField* pField = rField.GetField();
443  const SwFieldType* pFieldTyp = pField->GetTyp();
444 
445  if( SwFieldIds::SetExp == pFieldTyp->Which() &&
447  {
448  const bool bOn = pFieldTyp->GetName() == "HTML_ON";
449  if (!bOn && pFieldTyp->GetName() != "HTML_OFF")
450  return rWrt;
451 
452  OUString rText(comphelper::string::strip(pField->GetPar2(), ' '));
453  rWrt.Strm().WriteChar( '<' );
454  if( !bOn )
455  rWrt.Strm().WriteChar( '/' );
456  // TODO: HTML-Tags are written without entities, that for, characters
457  // not contained in the destination encoding are lost!
458  OString sTmp(OUStringToOString(rText,
459  RTL_TEXTENCODING_UTF8));
460  rWrt.Strm().WriteOString( sTmp ).WriteChar( '>' );
461  }
462  else if( SwFieldIds::Postit == pFieldTyp->Which() )
463  {
464  // Comments will be written in ANSI character set, but with system
465  // line breaks.
466  const OUString& rComment = pField->GetPar2();
467  bool bWritten = false;
468 
469  if( (rComment.getLength() >= 6 && rComment.startsWith("<") && rComment.endsWith(">") &&
470  o3tl::equalsIgnoreAsciiCase(rComment.subView( 1, 4 ), u"" OOO_STRING_SVTOOLS_HTML_meta) ) ||
471  (rComment.getLength() >= 7 &&
472  rComment.startsWith( "<!--" ) &&
473  rComment.endsWith( "-->" )) )
474  {
475  // directly output META tags
476  OUString sComment(convertLineEnd(rComment, GetSystemLineEnd()));
477  // TODO: HTML-Tags are written without entities, that for,
478  // characters not contained in the destination encoding are lost!
479  OString sTmp(OUStringToOString(sComment,
480  RTL_TEXTENCODING_UTF8));
481  rWrt.Strm().WriteOString( sTmp );
482  bWritten = true;
483  }
484  else if( rComment.getLength() >= 7 &&
485  rComment.endsWith(">") &&
486  rComment.startsWithIgnoreAsciiCase( "HTML:" ) )
487  {
488  OUString sComment(comphelper::string::stripStart(rComment.subView(5), ' '));
489  if( '<' == sComment[0] )
490  {
491  sComment = convertLineEnd(sComment, GetSystemLineEnd());
492  // TODO: HTML-Tags are written without entities, that for,
493  // characters not contained in the destination encoding are
494  // lost!
495  OString sTmp(OUStringToOString(sComment,
496  RTL_TEXTENCODING_UTF8));
497  rWrt.Strm().WriteOString( sTmp );
498  bWritten = true;
499  }
500 
501  }
502 
503  if( !bWritten )
504  {
505  OUString sComment(convertLineEnd(rComment, GetSystemLineEnd()));
506  // TODO: ???
507  OString sOut =
509  " " +
510  OUStringToOString(sComment, RTL_TEXTENCODING_UTF8) +
511  " -->";
512  rWrt.Strm().WriteOString( sOut );
513  }
514  }
515  else if( SwFieldIds::Script == pFieldTyp->Which() )
516  {
517  if( rHTMLWrt.m_bLFPossible )
518  rHTMLWrt.OutNewLine( true );
519 
520  bool bURL = static_cast<const SwScriptField *>(pField)->IsCodeURL();
521  const OUString& rType = pField->GetPar1();
522  OUString aContents, aURL;
523  if(bURL)
524  aURL = pField->GetPar2();
525  else
526  aContents = pField->GetPar2();
527 
528  // otherwise is the script content itself. Since only JavaScript
529  // is in fields, it must be JavaScript ...:)
530  HTMLOutFuncs::OutScript( rWrt.Strm(), rWrt.GetBaseURL(), aContents, rType, JAVASCRIPT,
531  aURL, nullptr, nullptr );
532 
533  if( rHTMLWrt.m_bLFPossible )
534  rHTMLWrt.OutNewLine( true );
535  }
536  else
537  {
538  const SwTextField *pTextField = rField.GetTextField();
539  OSL_ENSURE( pTextField, "Where is the txt fld?" );
540  if( pTextField )
541  {
542  // ReqIF-XHTML doesn't allow specifying a background color.
543  bool bFieldShadings = SwViewOption::IsFieldShadings() && !rHTMLWrt.mbReqIF;
544  if (bFieldShadings)
545  {
546  // If there is a text portion background started already, that should have priority.
547  auto it = rHTMLWrt.maStartedAttributes.find(RES_CHRATR_BACKGROUND);
548  if (it != rHTMLWrt.maStartedAttributes.end())
549  bFieldShadings = it->second <= 0;
550  }
551 
552  if (bFieldShadings)
553  {
554  OStringBuffer sOut;
555  sOut.append("<" + rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span);
556  sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_style "=\"");
557  sOut.append(sCSS1_P_background);
558  sOut.append(": ");
559 
561  sOut.append(GetCSS1_Color(rColor));
562  sOut.append("\">");
563  rWrt.Strm().WriteOString(sOut.makeStringAndClear());
564  }
565 
566  OutHTML_SwField( rWrt, pField, pTextField->GetTextNode(),
567  pTextField->GetStart() );
568 
569  if (bFieldShadings)
571  rWrt.Strm(), OStringConcatenation(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false);
572  }
573  }
574  return rWrt;
575 }
576 
577 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:241
static Writer & OutHTML_SwField(Writer &rWrt, const SwField *pField, const SwTextNode &rTextNd, sal_Int32 nFieldPos)
Definition: htmlfldw.cxx:66
const SwDocInfoSubType DI_SUB_TIME
Definition: docufld.hxx:84
#define OOO_STRING_SW_HTML_FS_title
Definition: htmlfld.hxx:38
static Color & GetFieldShadingsColor()
Definition: viewopt.cxx:461
SVX_NUM_CHARS_UPPER_LETTER_N
URL aURL
const OUString & GetBaseURL() const
Definition: shellio.hxx:444
TOOLS_DLLPUBLIC OString convertLineEnd(const OString &rIn, LineEnd eLineEnd)
#define OOO_STRING_SW_HTML_FS_email
Definition: htmlfld.hxx:43
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
const SwField * GetField() const
Definition: fmtfld.hxx:116
#define OOO_STRING_SVTOOLS_HTML_comment
#define OOO_STRING_SW_HTML_FT_filename
Definition: htmlfld.hxx:29
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
Definition: fldbas.hxx:403
std::string GetValue
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
Definition: doc.hxx:1410
#define OOO_STRING_SW_HTML_FF_shortcut
Definition: htmlfld.hxx:62
#define OOO_STRING_SW_HTML_FS_firstname
Definition: htmlfld.hxx:31
#define OOO_STRING_SVTOOLS_HTML_meta
SVX_NUM_NUMBER_NONE
sal_uIntPtr sal_uLong
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
Base class of all fields.
Definition: fldbas.hxx:291
SVX_NUM_CHARS_UPPER_LETTER
#define OOO_STRING_SW_HTML_FF_lroman
Definition: htmlfld.hxx:66
static SVT_DLLPUBLIC SvStream & OutScript(SvStream &rStrm, const OUString &rBaseURL, std::u16string_view rSource, const OUString &rLanguage, ScriptType eScriptType, const OUString &rSrc, const OUString *pSBLibrary, const OUString *pSBModule, OUString *pNonConvertableChars=nullptr)
#define OOO_STRING_SW_HTML_FS_next
Definition: htmlfld.hxx:46
#define OOO_STRING_SW_HTML_FF_llettern
Definition: htmlfld.hxx:72
const SwDocInfoSubType DI_COMMENT
Definition: docufld.hxx:74
#define OOO_STRING_SVTOOLS_HTML_O_subtype
static SVT_DLLPUBLIC SvStream & Out_AsciiTag(SvStream &, std::string_view rStr, bool bOn=true)
#define OOO_STRING_SW_HTML_FS_page
Definition: htmlfld.hxx:54
#define OOO_STRING_SW_HTML_FS_name
Definition: htmlfld.hxx:32
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CJK_POSTURE(25)
#define OOO_STRING_SW_HTML_FT_author
Definition: htmlfld.hxx:23
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
#define CSS1_OUTMODE_CJK
Definition: wrthtml.hxx:182
#define OOO_STRING_SW_HTML_FS_city
Definition: htmlfld.hxx:37
void OutNewLine(bool bCheck=false)
Definition: wrthtml.cxx:1503
virtual OUString GetPar1() const
Definition: fldbas.cxx:321
#define OOO_STRING_SW_HTML_FS_shortcut
Definition: htmlfld.hxx:33
#define OOO_STRING_SW_HTML_FS_char
Definition: htmlfld.hxx:57
bool m_bLFPossible
Definition: wrthtml.hxx:381
bool mbReqIF
If the ReqIF subset of XHTML should be written.
Definition: wrthtml.hxx:400
#define OOO_STRING_SW_HTML_FS_custom
Definition: htmlfld.hxx:51
SwAttrFnTab aHTMLAttrFnTab
Definition: htmlatr.cxx:3206
const SwTextField * GetTextField() const
Definition: fmtfld.hxx:134
#define CSS1_OUTMODE_ANY_SCRIPT
Definition: wrthtml.hxx:178
static const char * GetNumFormat(sal_uInt16 nFormat)
Definition: htmlfldw.cxx:43
SwBreakIt * g_pBreakIt
Definition: breakit.cxx:33
LineEnd GetSystemLineEnd()
#define OOO_STRING_SW_HTML_FF_name
Definition: htmlfld.hxx:61
SVX_NUM_ARABIC
const SwDocInfoSubType DI_SUBJECT
Definition: docufld.hxx:72
sal_Int32 GetStart() const
Definition: txatbase.hxx:88
#define OOO_STRING_SW_HTML_FS_word
Definition: htmlfld.hxx:56
SVX_NUM_ROMAN_UPPER
SVX_NUM_ROMAN_LOWER
virtual OUString GetName() const override
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
static SVT_DLLPUBLIC OString CreateTableDataOptionsValNum(bool bValue, double fVal, sal_uInt32 nFormat, SvNumberFormatter &rFormatter, OUString *pNonConvertableChars=nullptr)
const char *const sCSS1_P_background
Definition: css1kywd.cxx:89
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
static sal_uInt16 GetCSS1ScriptForScriptType(sal_uInt16 nScriptType)
Definition: htmlatr.cxx:168
const SwDocInfoSubType DI_CUSTOM
Definition: docufld.hxx:80
SVX_NUM_CHAR_SPECIAL
#define OOO_STRING_SW_HTML_FT_sender
Definition: htmlfld.hxx:24
#define OOO_STRING_SW_HTML_FS_state
Definition: htmlfld.hxx:44
#define OOO_STRING_SW_HTML_FF_arabic
Definition: htmlfld.hxx:67
SVX_NUM_CHARS_LOWER_LETTER
int i
#define OOO_STRING_SW_HTML_FF_path
Definition: htmlfld.hxx:77
const SwDocInfoSubType DI_KEYS
Definition: docufld.hxx:73
bool GetParaAttr(SfxItemSet &rSet, sal_Int32 nStt, sal_Int32 nEnd, const bool bOnlyTextAttr=false, const bool bGetFromChrFormat=true, const bool bMergeIndentValuesOfNumRule=false, SwRootFrame const *pLayout=nullptr) const
Query the attributes of textnode over the range.
Definition: thints.cxx:2103
const SwDocInfoSubType DI_CREATE
Definition: docufld.hxx:75
SwFieldIds
Definition: fldbas.hxx:45
#define OOO_STRING_SW_HTML_FS_cphone
Definition: htmlfld.hxx:41
#define OOO_STRING_SW_HTML_FF_page
Definition: htmlfld.hxx:70
float u
#define OOO_STRING_SW_HTML_FT_datetime
Definition: htmlfld.hxx:25
Writer & Out(const SwAttrFnTab, const SfxPoolItem &, Writer &)
Definition: wrt_fn.cxx:31
#define OOO_STRING_SVTOOLS_HTML_O_name
#define OOO_STRING_SW_HTML_FF_uroman
Definition: htmlfld.hxx:65
#define OOO_STRING_SVTOOLS_HTML_sdfield
#define OOO_STRING_SW_HTML_FS_theme
Definition: htmlfld.hxx:48
#define OOO_STRING_SW_HTML_FT_docstat
Definition: htmlfld.hxx:28
const SwDocInfoSubType DI_SUB_DATE
Definition: docufld.hxx:85
#define OOO_STRING_SW_HTML_FS_random
Definition: htmlfld.hxx:45
virtual OUString GetPar2() const
Definition: fldbas.cxx:326
static bool IsFieldShadings()
Definition: viewopt.hxx:671
#define OOO_STRING_SW_HTML_FS_country
Definition: htmlfld.hxx:35
SVX_NUM_CHARS_LOWER_LETTER_N
virtual sal_uInt16 GetSubType() const
Definition: fldbas.cxx:342
#define OOO_STRING_SW_HTML_FS_keys
Definition: htmlfld.hxx:49
#define OOO_STRING_SW_HTML_FF_char
Definition: htmlfld.hxx:69
#define OOO_STRING_SW_HTML_FS_company
Definition: htmlfld.hxx:30
#define OOO_STRING_SW_HTML_FS_fax
Definition: htmlfld.hxx:42
SwFieldType * GetTyp() const
Definition: fldbas.hxx:398
#define OOO_STRING_SW_HTML_FS_comment
Definition: htmlfld.hxx:50
#define OOO_STRING_SVTOOLS_HTML_O_format
#define OOO_STRING_SW_HTML_FF_ulettern
Definition: htmlfld.hxx:71
bool m_bTagOn
Definition: wrthtml.hxx:350
const SwDocInfoSubType DI_SUB_AUTHOR
Definition: docufld.hxx:83
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
Definition: breakit.hxx:62
#define OOO_STRING_SW_HTML_FT_docinfo
Definition: htmlfld.hxx:27
#define OOO_STRING_SW_HTML_FF_name_noext
Definition: htmlfld.hxx:78
#define OOO_STRING_SW_HTML_FF_time
Definition: htmlfld.hxx:74
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
SVX_NUM_PAGEDESC
Writer & OutHTML_SwFormatField(Writer &rWrt, const SfxPoolItem &rHt)
Definition: htmlfldw.cxx:438
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
Definition: fldbas.cxx:484
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CJK_WEIGHT(26)
#define OOO_STRING_SW_HTML_FF_uletter
Definition: htmlfld.hxx:63
static SVT_DLLPUBLIC SvStream & Out_String(SvStream &, const OUString &, OUString *pNonConvertableChars=nullptr)
virtual OUString GetName() const
Only in derived classes.
Definition: fldbas.cxx:137
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
SwPageNumSubType
Definition: docufld.hxx:90
SvStream & WriteOString(std::string_view rStr)
#define OOO_STRING_SVTOOLS_HTML_O_style
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CTL_WEIGHT(31)
#define OOO_STRING_SW_HTML_FF_author
Definition: htmlfld.hxx:73
OString GetCSS1_Color(const Color &rColor)
Definition: css1atr.cxx:217
#define CSS1_OUTMODE_WESTERN
Definition: wrthtml.hxx:180
#define OOO_STRING_SW_HTML_FS_ole
Definition: htmlfld.hxx:60
OUString aName
OString strip(const OString &rIn, char c)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CTL_POSTURE(30)
#define OOO_STRING_SW_HTML_FF_date
Definition: htmlfld.hxx:75
#define OOO_STRING_SW_HTML_FF_pathname
Definition: htmlfld.hxx:76
OString GetNamespace() const
Determines the prefix string needed to respect the requested namespace alias.
Definition: wrthtml.cxx:1552
OString stripStart(const OString &rIn, char c)
#define OOO_STRING_SW_HTML_FS_position
Definition: htmlfld.hxx:39
bool swhtml_css1atr_equalFontItems(const SfxPoolItem &r1, const SfxPoolItem &r2)
Definition: css1atr.cxx:964
SvStream & WriteChar(char nChar)
#define OOO_STRING_SW_HTML_FF_lletter
Definition: htmlfld.hxx:64
#define OOO_STRING_SW_HTML_FS_zip
Definition: htmlfld.hxx:36
#define OOO_STRING_SVTOOLS_HTML_O_value
#define OOO_STRING_SW_HTML_FS_prev
Definition: htmlfld.hxx:47
SvStream & Strm()
Definition: writer.cxx:215
#define OOO_STRING_SVTOOLS_HTML_O_type
#define OOO_STRING_SW_HTML_FS_tbl
Definition: htmlfld.hxx:58
#define OOO_STRING_SW_HTML_FT_page
Definition: htmlfld.hxx:26
#define OOO_STRING_SVTOOLS_HTML_O_sdfixed
const SwGetSetExpType GSE_STRING
String.
Definition: fldbas.hxx:203
const SwDocInfoSubType DI_CHANGE
Definition: docufld.hxx:76
SwTextNode & GetTextNode() const
Definition: txtfld.hxx:53
#define OOO_STRING_SW_HTML_FS_change
Definition: htmlfld.hxx:53
const SwDocInfoSubType DI_TITLE
Definition: docufld.hxx:71
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
#define OOO_STRING_SVTOOLS_HTML_span
#define CSS1_OUTMODE_CTL
Definition: wrthtml.hxx:184
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
SwFieldIds Which() const
Definition: fldbas.hxx:273
#define OOO_STRING_SW_HTML_FS_pphone
Definition: htmlfld.hxx:40
#define OOO_STRING_SW_HTML_FS_para
Definition: htmlfld.hxx:55
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
sal_uInt16 m_nCSS1Script
Definition: wrthtml.hxx:333
SwDoc * m_pDoc
Definition: shellio.hxx:408
sal_uInt16 nPos
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1318
sal_Int16 nValue
#define OOO_STRING_SW_HTML_FS_create
Definition: htmlfld.hxx:52
std::map< sal_uInt16, int > maStartedAttributes
Tracks which text portion attributes are currently open: a which id -> open count map...
Definition: wrthtml.hxx:408
#define OOO_STRING_SW_HTML_FS_street
Definition: htmlfld.hxx:34
#define OOO_STRING_SW_HTML_FF_none
Definition: htmlfld.hxx:68
#define OOO_STRING_SW_HTML_FS_grf
Definition: htmlfld.hxx:59