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