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