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
41using namespace nsSwDocInfoSubType;
42
43const 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
66static 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
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 {
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;
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
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 );
290 sOut.setLength(0);
292 sOut.append('\"');
293 }
294 if( !aValue.isEmpty() )
295 {
296 sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_value "=\"");
297 rWrt.Strm().WriteOString( sOut );
298 sOut.setLength(0);
299 HTMLOutFuncs::Out_String( rWrt.Strm(), aValue );
300 sOut.append('\"');
301 }
302 if( bNumFormat )
303 {
304 OSL_ENSURE( nFormat, "number format is 0" );
306 bNumValue, dNumValue, nFormat,
307 *rHTMLWrt.m_pDoc->GetNumberFormatter()));
308 }
309 if( bFixed )
310 {
311 sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_sdfixed);
312 }
313 sOut.append('>');
314 rWrt.Strm().WriteOString( sOut );
315 sOut.setLength(0);
316 }
317
318 // output content of the field
319 OUString const sExpand( pField->ExpandField(true, nullptr) );
320 bool bNeedsCJKProcessing = false;
321 if( !sExpand.isEmpty() )
322 {
323 sal_uInt16 nScriptType = g_pBreakIt->GetBreakIter()->getScriptType( sExpand, 0 );
324 sal_Int32 nPos = g_pBreakIt->GetBreakIter()->endOfScript( sExpand, 0,
325 nScriptType );
326
327 sal_uInt16 nScript =
329 if( (nPos < sExpand.getLength() && nPos >= 0) || nScript != rHTMLWrt.m_nCSS1Script )
330 {
331 bNeedsCJKProcessing = true;
332 }
333 }
334
335 if( bNeedsCJKProcessing )
336 {
337 //sequence of (start, end) property ranges we want to
338 //query
343 aScriptItemSet( rWrt.m_pDoc->GetAttrPool() );
344 rTextNd.GetParaAttr(aScriptItemSet, nFieldPos, nFieldPos+1);
345
346 sal_uInt16 aWesternWhichIds[4] =
349 sal_uInt16 aCJKWhichIds[4] =
352 sal_uInt16 aCTLWhichIds[4] =
355
356 sal_uInt16 *pRefWhichIds = nullptr;
357 switch( rHTMLWrt.m_nCSS1Script )
358 {
360 pRefWhichIds = aWesternWhichIds;
361 break;
362 case CSS1_OUTMODE_CJK:
363 pRefWhichIds = aCJKWhichIds;
364 break;
365 case CSS1_OUTMODE_CTL:
366 pRefWhichIds = aCTLWhichIds;
367 break;
368 }
369
370 sal_Int32 nPos = 0;
371 do
372 {
373 sal_uInt16 nScriptType = g_pBreakIt->GetBreakIter()->getScriptType( sExpand, nPos );
374 sal_uInt16 nScript =
376 sal_Int32 nEndPos = g_pBreakIt->GetBreakIter()->endOfScript(
377 sExpand, nPos, nScriptType );
378 sal_Int32 nChunkLen = nEndPos - nPos;
379 if( nScript != CSS1_OUTMODE_ANY_SCRIPT &&
380 /* #108791# */ nScript != rHTMLWrt.m_nCSS1Script )
381 {
382 sal_uInt16 *pWhichIds = nullptr;
383 switch( nScript )
384 {
385 case CSS1_OUTMODE_WESTERN: pWhichIds = aWesternWhichIds; break;
386 case CSS1_OUTMODE_CJK: pWhichIds = aCJKWhichIds; break;
387 case CSS1_OUTMODE_CTL: pWhichIds = aCTLWhichIds; break;
388 }
389
390 rHTMLWrt.m_bTagOn = true;
391
392 const SfxPoolItem *aItems[5];
393 int nItems = 0;
394
395 assert(pWhichIds && pRefWhichIds);
396 if (pWhichIds && pRefWhichIds)
397 {
398 for( int i=0; i<4; i++ )
399 {
400 const SfxPoolItem *pRefItem =
401 aScriptItemSet.GetItem( pRefWhichIds[i] );
402 const SfxPoolItem *pItem =
403 aScriptItemSet.GetItem( pWhichIds[i] );
404 if( pRefItem && pItem &&
405 !(0==i ? swhtml_css1atr_equalFontItems( *pRefItem, *pItem )
406 : *pRefItem == *pItem) )
407 {
408 Out( aHTMLAttrFnTab, *pItem, rHTMLWrt );
409 aItems[nItems++] = pItem;
410 }
411 }
412 }
413
414 HTMLOutFuncs::Out_String( rWrt.Strm(), sExpand.copy( nPos, nChunkLen ) );
415
416 rHTMLWrt.m_bTagOn = false;
417 while( nItems )
418 Out( aHTMLAttrFnTab, *aItems[--nItems], rHTMLWrt );
419
420 }
421 else
422 {
423 HTMLOutFuncs::Out_String( rWrt.Strm(), sExpand.copy( nPos, nChunkLen ) );
424 }
425 nPos = nEndPos;
426 }
427 while( nPos < sExpand.getLength() );
428 }
429 else
430 {
431 HTMLOutFuncs::Out_String( rWrt.Strm(), sExpand );
432 }
433
434 // Output the closing tag.
435 if( pTypeStr )
436 HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), Concat2View(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_sdfield), false );
437
438 return rWrt;
439}
440
442{
443 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
444 const SwFormatField & rField = static_cast<const SwFormatField&>(rHt);
445 const SwField* pField = rField.GetField();
446 const SwFieldType* pFieldTyp = pField->GetTyp();
447
448 if( SwFieldIds::SetExp == pFieldTyp->Which() &&
450 {
451 const bool bOn = pFieldTyp->GetName() == "HTML_ON";
452 if (!bOn && pFieldTyp->GetName() != "HTML_OFF")
453 return rWrt;
454
455 OUString rText(comphelper::string::strip(pField->GetPar2(), ' '));
456 rWrt.Strm().WriteChar( '<' );
457 if( !bOn )
458 rWrt.Strm().WriteChar( '/' );
459 // TODO: HTML-Tags are written without entities, that for, characters
460 // not contained in the destination encoding are lost!
461 OString sTmp(OUStringToOString(rText,
462 RTL_TEXTENCODING_UTF8));
463 rWrt.Strm().WriteOString( sTmp ).WriteChar( '>' );
464 }
465 else if( SwFieldIds::Postit == pFieldTyp->Which() )
466 {
467 // Comments will be written in ANSI character set, but with system
468 // line breaks.
469 const OUString& rComment = pField->GetPar2();
470 bool bWritten = false;
471
472 if( (rComment.getLength() >= 6 && rComment.startsWith("<") && rComment.endsWith(">") &&
473 o3tl::equalsIgnoreAsciiCase(rComment.subView( 1, 4 ), u"" OOO_STRING_SVTOOLS_HTML_meta) ) ||
474 (rComment.getLength() >= 7 &&
475 rComment.startsWith( "<!--" ) &&
476 rComment.endsWith( "-->" )) )
477 {
478 // directly output META tags
479 OUString sComment(convertLineEnd(rComment, GetSystemLineEnd()));
480 // TODO: HTML-Tags are written without entities, that for,
481 // characters not contained in the destination encoding are lost!
482 OString sTmp(OUStringToOString(sComment,
483 RTL_TEXTENCODING_UTF8));
484 rWrt.Strm().WriteOString( sTmp );
485 bWritten = true;
486 }
487 else if( rComment.getLength() >= 7 &&
488 rComment.endsWith(">") &&
489 rComment.startsWithIgnoreAsciiCase( "HTML:" ) )
490 {
491 OUString sComment(comphelper::string::stripStart(rComment.subView(5), ' '));
492 if( '<' == sComment[0] )
493 {
494 sComment = convertLineEnd(sComment, GetSystemLineEnd());
495 // TODO: HTML-Tags are written without entities, that for,
496 // characters not contained in the destination encoding are
497 // lost!
498 OString sTmp(OUStringToOString(sComment,
499 RTL_TEXTENCODING_UTF8));
500 rWrt.Strm().WriteOString( sTmp );
501 bWritten = true;
502 }
503
504 }
505
506 if( !bWritten )
507 {
508 OUString sComment(convertLineEnd(rComment, GetSystemLineEnd()));
509 // TODO: ???
510 OString sOut =
512 " " +
513 OUStringToOString(sComment, RTL_TEXTENCODING_UTF8) +
514 " -->";
515 rWrt.Strm().WriteOString( sOut );
516 }
517 }
518 else if( SwFieldIds::Script == pFieldTyp->Which() )
519 {
520 if( rHTMLWrt.m_bLFPossible )
521 rHTMLWrt.OutNewLine( true );
522
523 bool bURL = static_cast<const SwScriptField *>(pField)->IsCodeURL();
524 const OUString& rType = pField->GetPar1();
525 OUString aContents, aURL;
526 if(bURL)
527 aURL = pField->GetPar2();
528 else
529 aContents = pField->GetPar2();
530
531 // otherwise is the script content itself. Since only JavaScript
532 // is in fields, it must be JavaScript ...:)
533 HTMLOutFuncs::OutScript( rWrt.Strm(), rWrt.GetBaseURL(), aContents, rType, JAVASCRIPT,
534 aURL, nullptr, nullptr );
535
536 if( rHTMLWrt.m_bLFPossible )
537 rHTMLWrt.OutNewLine( true );
538 }
539 else
540 {
541 const SwTextField *pTextField = rField.GetTextField();
542 OSL_ENSURE( pTextField, "Where is the txt fld?" );
543 if( pTextField )
544 {
545 // ReqIF-XHTML doesn't allow specifying a background color.
546 bool bFieldShadings = SwViewOption::IsFieldShadings() && !rHTMLWrt.mbReqIF;
547 if (bFieldShadings)
548 {
549 // If there is a text portion background started already, that should have priority.
550 auto it = rHTMLWrt.maStartedAttributes.find(RES_CHRATR_BACKGROUND);
551 if (it != rHTMLWrt.maStartedAttributes.end())
552 bFieldShadings = it->second <= 0;
553 }
554
555 if (bFieldShadings)
556 {
557 OStringBuffer sOut;
558 sOut.append("<" + rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span);
559 sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_style "=\"");
560 sOut.append(sCSS1_P_background);
561 sOut.append(": ");
562
564 sOut.append(GetCSS1_Color(rColor));
565 sOut.append("\">");
566 rWrt.Strm().WriteOString(sOut);
567 sOut.setLength(0);
568 }
569
570 OutHTML_SwField( rWrt, pField, pTextField->GetTextNode(),
571 pTextField->GetStart() );
572
573 if (bFieldShadings)
575 rWrt.Strm(), Concat2View(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false);
576 }
577 }
578 return rWrt;
579}
580
581/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwBreakIt * g_pBreakIt
Definition: breakit.cxx:34
SvStream & WriteOString(std::string_view rStr)
SvStream & WriteChar(char nChar)
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
Definition: breakit.hxx:62
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1329
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
Definition: doc.hxx:1421
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:243
virtual OUString GetName() const
Only in derived classes.
Definition: fldbas.cxx:137
SwFieldIds Which() const
Definition: fldbas.hxx:274
Base class of all fields.
Definition: fldbas.hxx:293
virtual OUString GetPar1() const
Definition: fldbas.cxx:321
virtual sal_uInt16 GetSubType() const
Definition: fldbas.cxx:342
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
Definition: fldbas.hxx:404
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
Definition: fldbas.cxx:484
SwFieldType * GetTyp() const
Definition: fldbas.hxx:399
virtual OUString GetPar2() const
Definition: fldbas.cxx:326
bool IsFixed() const
Definition: fldbas.cxx:452
const SwField * GetField() const
Definition: fmtfld.hxx:130
const SwTextField * GetTextField() const
Definition: fmtfld.hxx:148
static sal_uInt16 GetCSS1ScriptForScriptType(sal_uInt16 nScriptType)
Definition: htmlatr.cxx:168
static const char * GetNumFormat(sal_uInt16 nFormat)
Definition: htmlfldw.cxx:43
bool m_bLFPossible
Definition: wrthtml.hxx:395
std::map< sal_uInt16, int > maStartedAttributes
Tracks which text portion attributes are currently open: a which id -> open count map.
Definition: wrthtml.hxx:422
bool m_bTagOn
Definition: wrthtml.hxx:364
OString GetNamespace() const
Determines the prefix string needed to respect the requested namespace alias.
Definition: wrthtml.cxx:1570
bool mbReqIF
If the ReqIF subset of XHTML should be written.
Definition: wrthtml.hxx:414
void OutNewLine(bool bCheck=false)
Definition: wrthtml.cxx:1521
sal_uInt16 m_nCSS1Script
Definition: wrthtml.hxx:347
sal_Int32 GetStart() const
Definition: txatbase.hxx:88
SwTextNode & GetTextNode() const
Definition: txtfld.hxx:53
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:111
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:2133
static bool IsFieldShadings()
Definition: viewopt.hxx:780
static Color & GetFieldShadingsColor()
Definition: viewopt.cxx:444
SvStream & Strm()
Definition: writer.cxx:214
SwDoc * m_pDoc
Definition: shellio.hxx:399
const OUString & GetBaseURL() const
Definition: shellio.hxx:435
OString GetCSS1_Color(const Color &rColor)
Definition: css1atr.cxx:221
bool swhtml_css1atr_equalFontItems(const SfxPoolItem &r1, const SfxPoolItem &r2)
Definition: css1atr.cxx:975
const char *const sCSS1_P_background
Definition: css1kywd.cxx:89
URL aURL
virtual OUString GetName() const override
SwExtUserSubType
Definition: docufld.hxx:102
@ EU_PHONE_PRIVATE
Definition: docufld.hxx:113
@ EU_TITLE
Definition: docufld.hxx:111
@ EU_PHONE_COMPANY
Definition: docufld.hxx:114
@ EU_FIRSTNAME
Definition: docufld.hxx:104
@ EU_FAX
Definition: docufld.hxx:115
@ EU_NAME
Definition: docufld.hxx:105
@ EU_EMAIL
Definition: docufld.hxx:116
@ EU_STREET
Definition: docufld.hxx:107
@ EU_COMPANY
Definition: docufld.hxx:103
@ EU_POSITION
Definition: docufld.hxx:112
@ EU_ZIP
Definition: docufld.hxx:109
@ EU_SHORTCUT
Definition: docufld.hxx:106
@ EU_CITY
Definition: docufld.hxx:110
@ EU_COUNTRY
Definition: docufld.hxx:108
@ EU_STATE
Definition: docufld.hxx:117
SwPageNumSubType
Definition: docufld.hxx:91
@ PG_NEXT
Definition: docufld.hxx:93
@ PG_RANDOM
Definition: docufld.hxx:92
@ PG_PREV
Definition: docufld.hxx:94
@ DS_CHAR
Definition: docufld.hxx:57
@ DS_GRF
Definition: docufld.hxx:59
@ DS_TBL
Definition: docufld.hxx:58
@ DS_OLE
Definition: docufld.hxx:60
@ DS_PAGE
Definition: docufld.hxx:54
@ DS_WORD
Definition: docufld.hxx:56
@ DS_PARA
Definition: docufld.hxx:55
SwAuthorFormat
Definition: docufld.hxx:43
@ AF_SHORTCUT
Definition: docufld.hxx:46
@ AF_NAME
Definition: docufld.hxx:45
float u
SwFileNameFormat
Definition: fldbas.hxx:153
@ FF_FIXED
Definition: fldbas.hxx:162
@ FF_NAME_NOEXT
Definition: fldbas.hxx:158
@ FF_PATH
Definition: fldbas.hxx:157
@ FF_NAME
Definition: fldbas.hxx:155
@ FF_PATHNAME
Definition: fldbas.hxx:156
SwFieldIds
Definition: fldbas.hxx:45
sal_Int16 nValue
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CTL_WEIGHT(31)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CTL_POSTURE(30)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CJK_WEIGHT(26)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CJK_POSTURE(25)
SwAttrFnTab aHTMLAttrFnTab
Definition: htmlatr.cxx:3214
#define OOO_STRING_SW_HTML_FF_char
Definition: htmlfld.hxx:69
#define OOO_STRING_SW_HTML_FS_custom
Definition: htmlfld.hxx:51
#define OOO_STRING_SW_HTML_FF_lletter
Definition: htmlfld.hxx:64
#define OOO_STRING_SW_HTML_FF_arabic
Definition: htmlfld.hxx:67
#define OOO_STRING_SW_HTML_FS_company
Definition: htmlfld.hxx:30
#define OOO_STRING_SW_HTML_FS_tbl
Definition: htmlfld.hxx:58
#define OOO_STRING_SW_HTML_FS_street
Definition: htmlfld.hxx:34
#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_shortcut
Definition: htmlfld.hxx:33
#define OOO_STRING_SW_HTML_FS_email
Definition: htmlfld.hxx:43
#define OOO_STRING_SW_HTML_FS_grf
Definition: htmlfld.hxx:59
#define OOO_STRING_SW_HTML_FF_uletter
Definition: htmlfld.hxx:63
#define OOO_STRING_SW_HTML_FF_page
Definition: htmlfld.hxx:70
#define OOO_STRING_SW_HTML_FS_pphone
Definition: htmlfld.hxx:40
#define OOO_STRING_SW_HTML_FS_char
Definition: htmlfld.hxx:57
#define OOO_STRING_SW_HTML_FF_date
Definition: htmlfld.hxx:75
#define OOO_STRING_SW_HTML_FF_name
Definition: htmlfld.hxx:61
#define OOO_STRING_SW_HTML_FS_title
Definition: htmlfld.hxx:38
#define OOO_STRING_SW_HTML_FS_theme
Definition: htmlfld.hxx:48
#define OOO_STRING_SW_HTML_FS_fax
Definition: htmlfld.hxx:42
#define OOO_STRING_SW_HTML_FS_change
Definition: htmlfld.hxx:53
#define OOO_STRING_SW_HTML_FF_none
Definition: htmlfld.hxx:68
#define OOO_STRING_SW_HTML_FS_word
Definition: htmlfld.hxx:56
#define OOO_STRING_SW_HTML_FS_para
Definition: htmlfld.hxx:55
#define OOO_STRING_SW_HTML_FS_random
Definition: htmlfld.hxx:45
#define OOO_STRING_SW_HTML_FF_lroman
Definition: htmlfld.hxx:66
#define OOO_STRING_SW_HTML_FS_next
Definition: htmlfld.hxx:46
#define OOO_STRING_SW_HTML_FT_author
Definition: htmlfld.hxx:23
#define OOO_STRING_SW_HTML_FF_ulettern
Definition: htmlfld.hxx:71
#define OOO_STRING_SW_HTML_FT_docstat
Definition: htmlfld.hxx:28
#define OOO_STRING_SW_HTML_FS_create
Definition: htmlfld.hxx:52
#define OOO_STRING_SW_HTML_FS_cphone
Definition: htmlfld.hxx:41
#define OOO_STRING_SW_HTML_FS_name
Definition: htmlfld.hxx:32
#define OOO_STRING_SW_HTML_FT_datetime
Definition: htmlfld.hxx:25
#define OOO_STRING_SW_HTML_FT_docinfo
Definition: htmlfld.hxx:27
#define OOO_STRING_SW_HTML_FS_position
Definition: htmlfld.hxx:39
#define OOO_STRING_SW_HTML_FF_author
Definition: htmlfld.hxx:73
#define OOO_STRING_SW_HTML_FF_time
Definition: htmlfld.hxx:74
#define OOO_STRING_SW_HTML_FT_sender
Definition: htmlfld.hxx:24
#define OOO_STRING_SW_HTML_FF_pathname
Definition: htmlfld.hxx:76
#define OOO_STRING_SW_HTML_FS_city
Definition: htmlfld.hxx:37
#define OOO_STRING_SW_HTML_FS_firstname
Definition: htmlfld.hxx:31
#define OOO_STRING_SW_HTML_FT_filename
Definition: htmlfld.hxx:29
#define OOO_STRING_SW_HTML_FF_shortcut
Definition: htmlfld.hxx:62
#define OOO_STRING_SW_HTML_FT_page
Definition: htmlfld.hxx:26
#define OOO_STRING_SW_HTML_FS_ole
Definition: htmlfld.hxx:60
#define OOO_STRING_SW_HTML_FS_comment
Definition: htmlfld.hxx:50
#define OOO_STRING_SW_HTML_FS_state
Definition: htmlfld.hxx:44
#define OOO_STRING_SW_HTML_FS_country
Definition: htmlfld.hxx:35
#define OOO_STRING_SW_HTML_FS_page
Definition: htmlfld.hxx:54
#define OOO_STRING_SW_HTML_FF_name_noext
Definition: htmlfld.hxx:78
#define OOO_STRING_SW_HTML_FF_uroman
Definition: htmlfld.hxx:65
#define OOO_STRING_SW_HTML_FF_path
Definition: htmlfld.hxx:77
#define OOO_STRING_SW_HTML_FS_keys
Definition: htmlfld.hxx:49
#define OOO_STRING_SW_HTML_FF_llettern
Definition: htmlfld.hxx:72
Writer & OutHTML_SwFormatField(Writer &rWrt, const SfxPoolItem &rHt)
Definition: htmlfldw.cxx:441
static Writer & OutHTML_SwField(Writer &rWrt, const SwField *pField, const SwTextNode &rTextNd, sal_Int32 nFieldPos)
Definition: htmlfldw.cxx:66
#define OOO_STRING_SVTOOLS_HTML_meta
#define OOO_STRING_SVTOOLS_HTML_comment
#define OOO_STRING_SVTOOLS_HTML_O_value
#define OOO_STRING_SVTOOLS_HTML_O_subtype
#define OOO_STRING_SVTOOLS_HTML_O_format
#define OOO_STRING_SVTOOLS_HTML_O_sdfixed
#define OOO_STRING_SVTOOLS_HTML_span
#define OOO_STRING_SVTOOLS_HTML_O_type
#define OOO_STRING_SVTOOLS_HTML_sdfield
#define OOO_STRING_SVTOOLS_HTML_O_name
#define OOO_STRING_SVTOOLS_HTML_O_style
OUString aName
LineEnd GetSystemLineEnd()
TOOLS_DLLPUBLIC OString convertLineEnd(const OString &rIn, LineEnd eLineEnd)
sal_uInt16 nPos
JAVASCRIPT
OString strip(const OString &rIn, char c)
OString stripStart(const OString &rIn, char c)
int i
const SwDocInfoSubType DI_SUB_AUTHOR
Definition: docufld.hxx:83
const SwDocInfoSubType DI_CUSTOM
Definition: docufld.hxx:80
const SwDocInfoSubType DI_CHANGE
Definition: docufld.hxx:76
const SwDocInfoSubType DI_COMMENT
Definition: docufld.hxx:74
const SwDocInfoSubType DI_SUB_DATE
Definition: docufld.hxx:85
const SwDocInfoSubType DI_KEYS
Definition: docufld.hxx:73
const SwDocInfoSubType DI_SUBJECT
Definition: docufld.hxx:72
const SwDocInfoSubType DI_TITLE
Definition: docufld.hxx:71
const SwDocInfoSubType DI_SUB_TIME
Definition: docufld.hxx:84
const SwDocInfoSubType DI_CREATE
Definition: docufld.hxx:75
const SwGetSetExpType GSE_STRING
String.
Definition: fldbas.hxx:203
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
const char GetValue[]
sal_uIntPtr sal_uLong
static SVT_DLLPUBLIC SvStream & Out_AsciiTag(SvStream &, std::string_view rStr, bool bOn=true)
static SVT_DLLPUBLIC SvStream & Out_String(SvStream &, const OUString &, OUString *pNonConvertableChars=nullptr)
static SVT_DLLPUBLIC OString CreateTableDataOptionsValNum(bool bValue, double fVal, sal_uInt32 nFormat, SvNumberFormatter &rFormatter, OUString *pNonConvertableChars=nullptr)
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)
SvxNumType
SVX_NUM_NUMBER_NONE
SVX_NUM_CHARS_LOWER_LETTER_N
SVX_NUM_CHARS_LOWER_LETTER
SVX_NUM_CHARS_UPPER_LETTER
SVX_NUM_ROMAN_UPPER
SVX_NUM_ROMAN_LOWER
SVX_NUM_ARABIC
SVX_NUM_CHARS_UPPER_LETTER_N
SVX_NUM_CHAR_SPECIAL
SVX_NUM_PAGEDESC
Writer & Out(const SwAttrFnTab, const SfxPoolItem &, Writer &)
Definition: wrt_fn.cxx:31
#define CSS1_OUTMODE_CJK
Definition: wrthtml.hxx:182
#define CSS1_OUTMODE_CTL
Definition: wrthtml.hxx:184
#define CSS1_OUTMODE_ANY_SCRIPT
Definition: wrthtml.hxx:178
#define CSS1_OUTMODE_WESTERN
Definition: wrthtml.hxx:180