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