LibreOffice Module sw (master)  1
htmlfld.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/document/XDocumentPropertiesSupplier.hpp>
21 #include <com/sun/star/document/XDocumentProperties.hpp>
22 #include <com/sun/star/frame/XModel.hpp>
23 #include <osl/diagnose.h>
24 #include <docsh.hxx>
26 #include <svtools/htmltokn.h>
27 #include <svl/numformat.hxx>
28 #include <svl/zforlist.hxx>
29 #include <unotools/useroptions.hxx>
30 #include <fmtfld.hxx>
31 #include <ndtxt.hxx>
32 #include <doc.hxx>
33 #include <fldbas.hxx>
34 #include <docufld.hxx>
35 #include <flddat.hxx>
36 #include "htmlfld.hxx"
37 #include "swhtml.hxx"
38 
39 using namespace nsSwDocInfoSubType;
40 using namespace ::com::sun::star;
41 
42 namespace {
43 
44 struct HTMLNumFormatTableEntry
45 {
46  const char *pName;
47  NfIndexTableOffset eFormat;
48 };
49 
50 }
51 
53 {
56  { "DATE", SwFieldIds::Date },
57  { "TIME", SwFieldIds::Time },
63  { nullptr, SwFieldIds(0) }
64 };
65 
66 HTMLNumFormatTableEntry const aHTMLDateFieldFormatTable[] =
67 {
68  { "SSYS", NF_DATE_SYSTEM_SHORT },
69  { "LSYS", NF_DATE_SYSTEM_LONG },
70  { "DMY", NF_DATE_SYS_DDMMYY, },
71  { "DMYY", NF_DATE_SYS_DDMMYYYY, },
72  { "DMMY", NF_DATE_SYS_DMMMYY, },
73  { "DMMYY", NF_DATE_SYS_DMMMYYYY, },
74  { "DMMMY", NF_DATE_DIN_DMMMMYYYY },
75  { "DMMMYY", NF_DATE_DIN_DMMMMYYYY },
76  { "DDMMY", NF_DATE_SYS_NNDMMMYY },
77  { "DDMMMY", NF_DATE_SYS_NNDMMMMYYYY },
78  { "DDMMMYY", NF_DATE_SYS_NNDMMMMYYYY },
79  { "DDDMMMY", NF_DATE_SYS_NNNNDMMMMYYYY },
80  { "DDDMMMYY", NF_DATE_SYS_NNNNDMMMMYYYY },
81  { "MY", NF_DATE_SYS_MMYY },
82  { "MD", NF_DATE_DIN_MMDD },
83  { "YMD", NF_DATE_DIN_YYMMDD },
84  { "YYMD", NF_DATE_DIN_YYYYMMDD },
85  { nullptr, NF_NUMERIC_START }
86 };
87 
88 HTMLNumFormatTableEntry const aHTMLTimeFieldFormatTable[] =
89 {
90  { "SYS", NF_TIME_HHMMSS },
91  { "SSMM24", NF_TIME_HHMM },
92  { "SSMM12", NF_TIME_HHMMAMPM },
93  { nullptr, NF_NUMERIC_START }
94 };
95 
97 {
108  { nullptr, SvxNumType(0) }
109 };
110 
112 {
128  { nullptr, SwExtUserSubType(0) }
129 };
130 
132 {
135  { nullptr, SwAuthorFormat(0) }
136 };
137 
139 {
143  { nullptr, SwPageNumSubType(0) }
144 };
145 
146 // UGLY: these are extensions of nsSwDocInfoSubType (in inc/docufld.hxx)
147 // these are necessary for importing document info fields written by
148 // older versions of OOo (< 3.0) which did not have DI_CUSTOM fields
153 
155 {
160  { "INFO1", DI_INFO1 },
161  { "INFO2", DI_INFO2 },
162  { "INFO3", DI_INFO3 },
163  { "INFO4", DI_INFO4 },
167  { nullptr, 0 }
168 };
169 
171 {
175  { nullptr, 0 }
176 };
177 
179 {
187  { nullptr, SwDocStatSubType(0) }
188 };
189 
191 {
196  { nullptr, SwFileNameFormat(0) }
197 };
198 
199 SvxNumType SwHTMLParser::GetNumType( const OUString& rStr, SvxNumType nDfltType )
200 {
202  while( pOptEnums->pName )
203  {
204  if( rStr.equalsIgnoreAsciiCaseAscii( pOptEnums->pName ) )
205  return pOptEnums->nValue;
206  pOptEnums++;
207  }
208  return nDfltType;
209 }
210 
212 {
213  bool bKnownType = false, bFixed = false,
214  bHasNumFormat = false, bHasNumValue = false;
216  OUString aValue, aNumFormat, aNumValue, aName;
217  const HTMLOption *pSubOption=nullptr, *pFormatOption=nullptr;
218 
219  const HTMLOptions& rHTMLOptions = GetOptions();
220  size_t i;
221 
222  for ( i = rHTMLOptions.size(); i; )
223  {
224  const HTMLOption& rOption = rHTMLOptions[--i];
225  switch( rOption.GetToken() )
226  {
227  case HtmlOptionId::TYPE:
228  bKnownType = rOption.GetEnum( nType, aHTMLFieldTypeTable );
229  break;
230  case HtmlOptionId::SUBTYPE:
231  pSubOption = &rOption;
232  break;
233  case HtmlOptionId::FORMAT:
234  pFormatOption = &rOption;
235  break;
236  case HtmlOptionId::NAME:
237  aName = rOption.GetString();
238  break;
239  case HtmlOptionId::VALUE:
240  aValue = rOption.GetString();
241  break;
242  case HtmlOptionId::SDNUM:
243  aNumFormat = rOption.GetString();
244  bHasNumFormat = true;
245  break;
246  case HtmlOptionId::SDVAL:
247  aNumValue = rOption.GetString();
248  bHasNumValue = true;
249  break;
250  case HtmlOptionId::SDFIXED:
251  bFixed = true;
252  break;
253  default: break;
254  }
255  }
256 
257  if( !bKnownType )
258  return;
259 
260  // Author and sender are only inserted as a variable field if the document
261  // was last changed by ourself or nobody changed it and it was created
262  // by ourself. Otherwise it will be a fixed field.
263  if( !bFixed &&
264  (SwFieldIds::ExtUser == nType ||
265  SwFieldIds::Author == nType) )
266  {
267  SvtUserOptions aOpt;
268  const OUString& rUser = aOpt.GetFullName();
269  SwDocShell *pDocShell(m_xDoc->GetDocShell());
270  OSL_ENSURE(pDocShell, "no SwDocShell");
271  if (pDocShell) {
272  uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
273  pDocShell->GetModel(), uno::UNO_QUERY_THROW);
274  uno::Reference<document::XDocumentProperties> xDocProps(
275  xDPS->getDocumentProperties());
276  OSL_ENSURE(xDocProps.is(), "Doc has no DocumentProperties");
277  const OUString& rChanged = xDocProps->getModifiedBy();
278  const OUString& rCreated = xDocProps->getAuthor();
279  if( rUser.isEmpty() ||
280  (!rChanged.isEmpty() ? rUser != rChanged : rUser != rCreated) )
281  bFixed = true;
282  }
283  }
284 
285  SwFieldIds nWhich = nType;
286  if( SwFieldIds::Date==nType || SwFieldIds::Time==nType )
287  nWhich = SwFieldIds::DateTime;
288 
289  SwFieldType* pType = m_xDoc->getIDocumentFieldsAccess().GetSysFieldType( nWhich );
290  std::unique_ptr<SwField> xNewField;
291  bool bInsOnEndTag = false;
292 
293  switch( nType )
294  {
295  case SwFieldIds::ExtUser:
296  if( pSubOption )
297  {
298  SwExtUserSubType nSub;
299  sal_uLong nFormat = 0;
300  if( bFixed )
301  {
302  nFormat |= AF_FIXED;
303  bInsOnEndTag = true;
304  }
305  if( pSubOption->GetEnum( nSub, aHTMLExtUsrFieldSubTable ) )
306  xNewField.reset(new SwExtUserField(static_cast<SwExtUserFieldType*>(pType), nSub, nFormat));
307  }
308  break;
309 
310  case SwFieldIds::Author:
311  {
312  SwAuthorFormat nFormat = AF_NAME;
313  if( pFormatOption )
314  pFormatOption->GetEnum( nFormat, aHTMLAuthorFieldFormatTable );
315  if( bFixed )
316  {
317  nFormat = static_cast<SwAuthorFormat>(static_cast<int>(nFormat) | AF_FIXED);
318  bInsOnEndTag = true;
319  }
320 
321  xNewField.reset(new SwAuthorField(static_cast<SwAuthorFieldType*>(pType), nFormat));
322  }
323  break;
324 
325  case SwFieldIds::Date:
326  case SwFieldIds::Time:
327  {
328  sal_uInt32 nNumFormat = 0;
329  DateTime aDateTime( DateTime::SYSTEM );
330  sal_Int64 nTime = aDateTime.GetTime();
331  sal_Int32 nDate = aDateTime.GetDate();
332  sal_uInt16 nSub = 0;
333  bool bValidFormat = false;
334  HTMLNumFormatTableEntry const * pFormatTable;
335 
336  if( SwFieldIds::Date==nType )
337  {
338  nSub = DATEFLD;
339  pFormatTable = aHTMLDateFieldFormatTable;
340  if( !aValue.isEmpty() )
341  nDate = aValue.toInt32();
342  }
343  else
344  {
345  nSub = TIMEFLD;
346  pFormatTable = aHTMLTimeFieldFormatTable;
347  if( !aValue.isEmpty() )
348  nTime = static_cast<sal_uLong>(aValue.toInt32());
349  }
350  if( !aValue.isEmpty() )
351  nSub |= FIXEDFLD;
352 
353  SvNumberFormatter *pFormatter = m_xDoc->GetNumberFormatter();
354  if( pFormatOption )
355  {
356  const OUString& rFormat = pFormatOption->GetString();
357  for( int k = 0; pFormatTable[k].pName; ++k )
358  {
359  if( rFormat.equalsIgnoreAsciiCaseAscii( pFormatTable[k].pName ) )
360  {
361  nNumFormat = pFormatter->GetFormatIndex(
362  pFormatTable[k].eFormat, LANGUAGE_SYSTEM);
363  bValidFormat = true;
364  break;
365  }
366  }
367  }
368  if( !bValidFormat )
369  nNumFormat = pFormatter->GetFormatIndex( pFormatTable[i].eFormat,
371 
372  xNewField.reset(new SwDateTimeField(static_cast<SwDateTimeFieldType *>(pType), nSub, nNumFormat));
373 
374  if (nSub & FIXEDFLD)
375  static_cast<SwDateTimeField *>(xNewField.get())->SetDateTime(DateTime(Date(nDate), tools::Time(nTime)));
376  }
377  break;
378 
380  if( bHasNumFormat )
381  {
382  sal_uInt16 nSub = 0;
383 
384  SvNumberFormatter *pFormatter = m_xDoc->GetNumberFormatter();
385  sal_uInt32 nNumFormat;
386  LanguageType eLang;
387  double dValue = GetTableDataOptionsValNum(
388  nNumFormat, eLang, aNumValue, aNumFormat,
389  *m_xDoc->GetNumberFormatter() );
390  SvNumFormatType nFormatType = pFormatter->GetType( nNumFormat );
391  switch( nFormatType )
392  {
393  case SvNumFormatType::DATE: nSub = DATEFLD; break;
394  case SvNumFormatType::TIME: nSub = TIMEFLD; break;
395  default: break;
396  }
397 
398  if( nSub )
399  {
400  if( bHasNumValue )
401  nSub |= FIXEDFLD;
402 
403  xNewField.reset(new SwDateTimeField(static_cast<SwDateTimeFieldType *>(pType), nSub, nNumFormat));
404  if (bHasNumValue)
405  static_cast<SwDateTimeField*>(xNewField.get())->SetValue(dValue);
406  }
407  }
408  break;
409 
411  if( pSubOption )
412  {
413  SwPageNumSubType nSub;
414  if( pSubOption->GetEnum( nSub, aHTMLPageNumFieldSubTable ) )
415  {
416  SvxNumType nFormat = SVX_NUM_PAGEDESC;
417  if( pFormatOption )
418  pFormatOption->GetEnum( nFormat, aHTMLPageNumFieldFormatTable );
419 
420  short nOff = 0;
421 
422  if( nFormat!=SVX_NUM_CHAR_SPECIAL && !aValue.isEmpty() )
423  nOff = static_cast<short>(aValue.toInt32());
424  else if( nSub == PG_NEXT )
425  nOff = 1;
426  else if( nSub == PG_PREV )
427  nOff = -1;
428 
429  if( nFormat==SVX_NUM_CHAR_SPECIAL &&
430  nSub==PG_RANDOM )
431  nFormat = SVX_NUM_PAGEDESC;
432 
433  xNewField.reset(new SwPageNumberField(static_cast<SwPageNumberFieldType*>(pType), nSub, nFormat, nOff));
434  if (nFormat == SVX_NUM_CHAR_SPECIAL)
435  static_cast<SwPageNumberField*>(xNewField.get())->SetUserString(aValue);
436  }
437  }
438  break;
439 
440  case SwFieldIds::DocInfo:
441  if( pSubOption )
442  {
443  sal_uInt16 nSub;
444  if( pSubOption->GetEnum( nSub, aHTMLDocInfoFieldSubTable ) )
445  {
446  sal_uInt16 nExtSub = 0;
447  if( DI_CREATE==static_cast<SwDocInfoSubType>(nSub) ||
448  DI_CHANGE==static_cast<SwDocInfoSubType>(nSub) )
449  {
450  nExtSub = DI_SUB_AUTHOR;
451  if( pFormatOption )
452  pFormatOption->GetEnum( nExtSub, aHTMLDocInfoFieldFormatTable );
453  nSub |= nExtSub;
454  }
455 
456  sal_uInt32 nNumFormat = 0;
457  double dValue = 0;
458  if( bHasNumFormat && (DI_SUB_DATE==nExtSub || DI_SUB_TIME==nExtSub) )
459  {
460  LanguageType eLang;
461  dValue = GetTableDataOptionsValNum(
462  nNumFormat, eLang, aNumValue, aNumFormat,
463  *m_xDoc->GetNumberFormatter() );
464  bFixed &= bHasNumValue;
465  }
466  else
467  bHasNumValue = false;
468 
469  if( nSub >= DI_INFO1 && nSub <= DI_INFO4 && aName.isEmpty() )
470  {
471  // backward compatibility for OOo 2:
472  // map to names stored in AddMetaUserDefined
473  aName = m_InfoNames[nSub - DI_INFO1];
474  nSub = DI_CUSTOM;
475  }
476 
477  if( bFixed )
478  {
479  nSub |= DI_SUB_FIXED;
480  bInsOnEndTag = true;
481  }
482 
483  xNewField.reset(new SwDocInfoField(static_cast<SwDocInfoFieldType *>(pType), nSub, aName, nNumFormat));
484  if (bHasNumValue)
485  static_cast<SwDocInfoField*>(xNewField.get())->SetValue(dValue);
486  }
487  }
488  break;
489 
490  case SwFieldIds::DocStat:
491  if( pSubOption )
492  {
493  SwDocStatSubType nSub;
494  if( pSubOption->GetEnum( nSub, aHTMLDocStatFieldSubTable ) )
495  {
496  SvxNumType nFormat = SVX_NUM_ARABIC;
497  if( pFormatOption )
498  pFormatOption->GetEnum( nFormat, aHTMLPageNumFieldFormatTable );
499  xNewField.reset(new SwDocStatField(static_cast<SwDocStatFieldType*>(pType), nSub, nFormat));
500  m_bUpdateDocStat |= (DS_PAGE != nSub);
501  }
502  }
503  break;
504 
506  {
507  SwFileNameFormat nFormat = FF_NAME;
508  if( pFormatOption )
509  pFormatOption->GetEnum( nFormat, aHTMLFileNameFieldFormatTable );
510  if( bFixed )
511  {
512  nFormat = static_cast<SwFileNameFormat>(static_cast<int>(nFormat) | FF_FIXED);
513  bInsOnEndTag = true;
514  }
515 
516  xNewField.reset(new SwFileNameField(static_cast<SwFileNameFieldType*>(pType), nFormat));
517  }
518  break;
519  default:
520  ;
521  }
522 
523  if (!xNewField)
524  return;
525 
526  if (bInsOnEndTag)
527  {
528  m_xField = std::move(xNewField);
529  }
530  else
531  {
532  m_xDoc->getIDocumentContentOperations().InsertPoolItem(*m_pPam, SwFormatField(*xNewField));
533  xNewField.reset();
534  }
535  m_bInField = true;
536 }
537 
539 {
540  if (m_xField)
541  {
542  switch (m_xField->Which())
543  {
544  case SwFieldIds::DocInfo:
545  OSL_ENSURE( static_cast<SwDocInfoField*>(m_xField.get())->IsFixed(),
546  "Field DocInfo should not have been saved" );
547  static_cast<SwDocInfoField*>(m_xField.get())->SetExpansion( m_aContents );
548  break;
549 
550  case SwFieldIds::ExtUser:
551  OSL_ENSURE( static_cast<SwExtUserField*>(m_xField.get())->IsFixed(),
552  "Field ExtUser should not have been saved" );
553  static_cast<SwExtUserField*>(m_xField.get())->SetExpansion( m_aContents );
554  break;
555 
556  case SwFieldIds::Author:
557  OSL_ENSURE( static_cast<SwAuthorField*>(m_xField.get())->IsFixed(),
558  "Field Author should not have been saved" );
559  static_cast<SwAuthorField*>(m_xField.get())->SetExpansion( m_aContents );
560  break;
561 
563  OSL_ENSURE( static_cast<SwFileNameField*>(m_xField.get())->IsFixed(),
564  "Field FileName should not have been saved" );
565  static_cast<SwFileNameField*>(m_xField.get())->SetExpansion( m_aContents );
566  break;
567  default: break;
568  }
569 
570  m_xDoc->getIDocumentContentOperations().InsertPoolItem( *m_pPam, SwFormatField(*m_xField) );
571  m_xField.reset();
572  }
573 
574  m_bInField = false;
575  m_aContents.clear();
576 }
577 
579 {
580  if (m_xField)
581  {
582  // append the current text part to the text
583  m_aContents += aToken;
584  }
585 }
586 
587 void SwHTMLParser::InsertCommentText( const char *pTag )
588 {
589  bool bEmpty = m_aContents.isEmpty();
590  if( !bEmpty )
591  m_aContents += "\n";
592 
593  m_aContents += aToken;
594  if( bEmpty && pTag )
595  {
596  m_aContents = OUString::Concat("HTML: <") + OUStringChar(*pTag) + ">" + m_aContents;
597  }
598 }
599 
600 void SwHTMLParser::InsertComment( const OUString& rComment, const char *pTag )
601 {
602  OUString aComment( rComment );
603  if( pTag )
604  {
605  aComment += "</" +
606  OUString::createFromAscii(pTag) +
607  ">";
608  }
609 
610  // MIB 24.06.97: If a PostIt should be insert after a space, we
611  // will insert before the space. Then there are less problems
612  // during formatting. (bug #40483#)
613  const sal_Int32 nPos = m_pPam->GetPoint()->nContent.GetIndex();
614  SwTextNode *pTextNd = m_pPam->GetNode().GetTextNode();
615  bool bMoveFwd = false;
616  if (nPos>0 && pTextNd && (' ' == pTextNd->GetText()[nPos-1]))
617  {
618  bMoveFwd = true;
619 
620  sal_uLong nNodeIdx = m_pPam->GetPoint()->nNode.GetIndex();
621  const sal_Int32 nIdx = m_pPam->GetPoint()->nContent.GetIndex();
622  for( auto i = m_aSetAttrTab.size(); i > 0; )
623  {
624  HTMLAttr *pAttr = m_aSetAttrTab[--i];
625  if( pAttr->GetStartParagraphIdx() != nNodeIdx ||
626  pAttr->GetStartContent() != nIdx )
627  break;
628 
629  if( RES_TXTATR_FIELD == pAttr->m_pItem->Which() &&
630  SwFieldIds::Script == static_cast<const SwFormatField *>(pAttr->m_pItem.get())->GetField()->GetTyp()->Which() )
631  {
632  bMoveFwd = false;
633  break;
634  }
635  }
636 
637  if( bMoveFwd )
638  m_pPam->Move( fnMoveBackward );
639  }
640 
641  SwPostItField aPostItField(
642  static_cast<SwPostItFieldType*>(m_xDoc->getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::Postit )),
643  OUString(), aComment, OUString(), OUString(), DateTime(DateTime::SYSTEM));
644  InsertAttr( SwFormatField( aPostItField ), false );
645 
646  if( bMoveFwd )
647  m_pPam->Move( fnMoveForward );
648 }
649 
650 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:240
HTMLNumFormatTableEntry const aHTMLTimeFieldFormatTable[]
Definition: htmlfld.cxx:88
const SwDocInfoSubType DI_SUB_TIME
Definition: docufld.hxx:84
#define OOO_STRING_SW_HTML_FS_title
Definition: htmlfld.hxx:38
SVX_NUM_CHARS_UPPER_LETTER_N
sal_uLong GetIndex() const
Definition: node.hxx:291
EnumT GetEnum(const HTMLOptionEnum< EnumT > *pOptEnums, EnumT nDflt=static_cast< EnumT >(0)) const
HtmlOptionId GetToken() const
HTMLOptionEnum< SwFieldIds > const aHTMLFieldTypeTable[]
Definition: htmlfld.cxx:52
#define OOO_STRING_SW_HTML_FS_email
Definition: htmlfld.hxx:43
HTMLNumFormatTableEntry const aHTMLDateFieldFormatTable[]
Definition: htmlfld.cxx:66
const SwDocInfoSubType DI_SUBTYPE_END
Definition: docufld.hxx:81
const OUString & GetText() const
Definition: ndtxt.hxx:215
#define OOO_STRING_SW_HTML_FT_filename
Definition: htmlfld.hxx:29
SwExtUserSubType
Definition: docufld.hxx:101
NF_DATE_DIN_YYYYMMDD
#define OOO_STRING_SW_HTML_FF_shortcut
Definition: htmlfld.hxx:62
NF_DATE_SYS_NNDMMMMYYYY
sal_uInt32 GetFormatIndex(NfIndexTableOffset, LanguageType eLnge=LANGUAGE_DONTKNOW)
HTMLOptionEnum< SvxNumType > const aHTMLPageNumFieldFormatTable[]
Definition: htmlfld.cxx:96
#define OOO_STRING_SW_HTML_FS_firstname
Definition: htmlfld.hxx:31
SVX_NUM_NUMBER_NONE
sal_uIntPtr sal_uLong
SVX_NUM_CHARS_UPPER_LETTER
#define OOO_STRING_SW_HTML_FF_lroman
Definition: htmlfld.hxx:66
const OUString & GetString() const
const SwDocInfoSubType DI_INFO1
Definition: htmlfld.cxx:149
SvNumFormatType GetType(sal_uInt32 nFIndex) const
#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
sal_uInt32 GetStartParagraphIdx() const
Definition: swhtml.hxx:160
#define OOO_STRING_SW_HTML_FS_page
Definition: htmlfld.hxx:54
#define OOO_STRING_SW_HTML_FS_name
Definition: htmlfld.hxx:32
NF_TIME_HHMM
void NewField()
Definition: htmlfld.cxx:211
void InsertComment(const OUString &rName, const char *pTag=nullptr)
Definition: htmlfld.cxx:600
For old documents the Field-Which IDs must be preserved !!!
#define OOO_STRING_SW_HTML_FT_author
Definition: htmlfld.hxx:23
const SwDocInfoSubType DI_INFO3
Definition: htmlfld.cxx:151
void InsertFieldText()
Definition: htmlfld.cxx:578
NF_DATE_SYS_DDMMYY
SvxNumType
#define OOO_STRING_SW_HTML_FS_city
Definition: htmlfld.hxx:37
Reference< css::datatransfer::XTransferable > m_aContents
#define OOO_STRING_SW_HTML_FS_shortcut
Definition: htmlfld.hxx:33
#define OOO_STRING_SW_HTML_FS_char
Definition: htmlfld.hxx:57
#define OOO_STRING_SW_HTML_FS_custom
Definition: htmlfld.hxx:51
sal_Int32 GetStartContent() const
Definition: swhtml.hxx:166
NF_DATE_DIN_YYMMDD
#define OOO_STRING_SW_HTML_FF_name
Definition: htmlfld.hxx:61
SwDocStatSubType
Definition: docufld.hxx:51
SVX_NUM_ARABIC
const SwDocInfoSubType DI_SUBJECT
Definition: docufld.hxx:72
#define OOO_STRING_SW_HTML_FS_word
Definition: htmlfld.hxx:56
SVX_NUM_ROMAN_UPPER
NfIndexTableOffset
const char * pName
SVX_NUM_ROMAN_LOWER
sal_Int32 GetDate() const
NF_TIME_HHMMSS
void EndField()
Definition: htmlfld.cxx:538
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
sal_uInt16 char * pName
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
#define OOO_STRING_SW_HTML_FF_arabic
Definition: htmlfld.hxx:67
SVX_NUM_CHARS_LOWER_LETTER
HTMLOptionEnum< SwExtUserSubType > const aHTMLExtUsrFieldSubTable[]
Definition: htmlfld.cxx:111
NF_DATE_SYS_DMMMYYYY
int i
SwFileNameFormat
Definition: fldbas.hxx:152
#define OOO_STRING_SW_HTML_FF_path
Definition: htmlfld.hxx:77
#define LANGUAGE_SYSTEM
const SwDocInfoSubType DI_KEYS
Definition: docufld.hxx:73
const SwDocInfoSubType DI_CREATE
Definition: docufld.hxx:75
SwFieldIds
Definition: fldbas.hxx:44
#define OOO_STRING_SW_HTML_FS_cphone
Definition: htmlfld.hxx:41
#define OOO_STRING_SW_HTML_FF_page
Definition: htmlfld.hxx:70
#define OOO_STRING_SW_HTML_FT_datetime
Definition: htmlfld.hxx:25
#define OOO_STRING_SW_HTML_FF_uroman
Definition: htmlfld.hxx:65
SvNumFormatType
#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
NF_DATE_SYS_DDMMYYYY
#define OOO_STRING_SW_HTML_FS_random
Definition: htmlfld.hxx:45
sal_uInt16 SwDocInfoSubType
Definition: docufld.hxx:63
#define OOO_STRING_SW_HTML_FS_country
Definition: htmlfld.hxx:35
SVX_NUM_CHARS_LOWER_LETTER_N
#define OOO_STRING_SW_HTML_FS_keys
Definition: htmlfld.hxx:49
#define OOO_STRING_SW_HTML_FF_char
Definition: htmlfld.hxx:69
void InsertCommentText(const char *pTag)
Definition: htmlfld.cxx:587
#define OOO_STRING_SW_HTML_FS_company
Definition: htmlfld.hxx:30
#define OOO_STRING_SW_HTML_FS_fax
Definition: htmlfld.hxx:42
#define OOO_STRING_SW_HTML_FS_comment
Definition: htmlfld.hxx:50
NF_DATE_DIN_DMMMMYYYY
#define OOO_STRING_SW_HTML_FF_ulettern
Definition: htmlfld.hxx:71
const SwDocInfoSubType DI_SUB_AUTHOR
Definition: docufld.hxx:83
#define OOO_STRING_SW_HTML_FT_docinfo
Definition: htmlfld.hxx:27
NF_TIME_HHMMAMPM
#define OOO_STRING_SW_HTML_FF_name_noext
Definition: htmlfld.hxx:78
#define OOO_STRING_SW_HTML_FF_time
Definition: htmlfld.hxx:74
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
SVX_NUM_PAGEDESC
#define OOO_STRING_SW_HTML_FF_uletter
Definition: htmlfld.hxx:63
HTMLOptionEnum< SwPageNumSubType > const aHTMLPageNumFieldSubTable[]
Definition: htmlfld.cxx:138
NF_DATE_SYSTEM_LONG
SwPageNumSubType
Definition: docufld.hxx:90
static SvxNumType GetNumType(const OUString &rStr, SvxNumType eDfltType)
Definition: htmlfld.cxx:199
NF_DATE_SYS_NNNNDMMMMYYYY
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Definition: paminit.cxx:59
#define OOO_STRING_SW_HTML_FF_author
Definition: htmlfld.hxx:73
::std::vector< HTMLOption > HTMLOptions
HTMLOptionEnum< sal_uInt16 > const aHTMLDocInfoFieldFormatTable[]
Definition: htmlfld.cxx:170
#define OOO_STRING_SW_HTML_FS_ole
Definition: htmlfld.hxx:60
OUString aName
NF_DATE_SYS_DMMMYY
NF_DATE_SYSTEM_SHORT
#define OOO_STRING_SW_HTML_FF_date
Definition: htmlfld.hxx:75
NF_DATE_SYS_MMYY
HTMLOptionEnum< sal_uInt16 > const aHTMLDocInfoFieldSubTable[]
Definition: htmlfld.cxx:154
sal_Int64 GetTime() const
QPRO_FUNC_TYPE nType
#define OOO_STRING_SW_HTML_FF_pathname
Definition: htmlfld.hxx:76
HTMLOptionEnum< SwAuthorFormat > const aHTMLAuthorFieldFormatTable[]
Definition: htmlfld.cxx:131
NF_DATE_DIN_MMDD
#define OOO_STRING_SW_HTML_FS_position
Definition: htmlfld.hxx:39
HTMLOptionEnum< SwDocStatSubType > const aHTMLDocStatFieldSubTable[]
Definition: htmlfld.cxx:178
#define OOO_STRING_SW_HTML_FF_lletter
Definition: htmlfld.hxx:64
NF_DATE_SYS_NNDMMMYY
SwMoveFnCollection const & fnMoveBackward
Definition: paminit.cxx:58
#define OOO_STRING_SW_HTML_FS_zip
Definition: htmlfld.hxx:36
#define OOO_STRING_SW_HTML_FS_prev
Definition: htmlfld.hxx:47
#define OOO_STRING_SW_HTML_FS_tbl
Definition: htmlfld.hxx:58
#define OOO_STRING_SW_HTML_FT_page
Definition: htmlfld.hxx:26
OUString GetFullName() const
const SwDocInfoSubType DI_INFO4
Definition: htmlfld.cxx:152
const SwDocInfoSubType DI_SUB_FIXED
Definition: docufld.hxx:86
const SwDocInfoSubType DI_CHANGE
Definition: docufld.hxx:76
#define OOO_STRING_SW_HTML_FS_change
Definition: htmlfld.hxx:53
const SwDocInfoSubType DI_TITLE
Definition: docufld.hxx:71
NF_NUMERIC_START
#define OOO_STRING_SW_HTML_FS_pphone
Definition: htmlfld.hxx:40
#define OOO_STRING_SW_HTML_FS_para
Definition: htmlfld.hxx:55
std::unique_ptr< SfxPoolItem > m_pItem
Definition: swhtml.hxx:139
sal_uInt16 Which() const
HTMLOptionEnum< SwFileNameFormat > const aHTMLFileNameFieldFormatTable[]
Definition: htmlfld.cxx:190
sal_uInt16 nPos
SwAuthorFormat
Definition: docufld.hxx:42
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:850
#define OOO_STRING_SW_HTML_FS_create
Definition: htmlfld.hxx:52
#define OOO_STRING_SW_HTML_FS_street
Definition: htmlfld.hxx:34
#define OOO_STRING_SW_HTML_FF_none
Definition: htmlfld.hxx:68
const SwDocInfoSubType DI_INFO2
Definition: htmlfld.cxx:150
#define OOO_STRING_SW_HTML_FS_grf
Definition: htmlfld.hxx:59