20#include <com/sun/star/i18n/XBreakIterator.hpp>
24#include <osl/diagnose.h>
37#include <rtl/strbuf.hxx>
45 const char *pFormatStr =
nullptr;
67 const SwTextNode& rTextNd, sal_Int32 nFieldPos )
75 const char *pTypeStr=
nullptr,
79 bool bNumFormat=
false;
81 double dNumValue = 0.0;
109 OSL_ENSURE( pSubStr,
"unknown sub type for SwExtUserField" );
120 OSL_ENSURE( pFormatStr,
"unknown format for SwAuthorField" );
121 bFixed =
static_cast<const SwAuthorField*
>(pField)->IsFixed();
144 OSL_ENSURE( pSubStr,
"unknown sub type for SwPageNumberField" );
153 const OUString& rValue = pField->
GetPar2();
154 short nValue =
static_cast<short>(rValue.toInt32());
168 sal_uInt16 nExtSubType = nSubType & 0x0f00;
180 default: pTypeStr =
nullptr;
break;
189 switch( nExtSubType )
238 default: pTypeStr =
nullptr;
break;
256 OSL_ENSURE( pFormatStr,
"unknown format for SwFileNameField" );
262 if (rHTMLWrt.
mbReqIF && pTypeStr)
279 append(
'=').append(pSubStr);
284 append(
'=').append(pFormatStr);
286 if( !
aName.isEmpty() )
294 if( !aValue.isEmpty() )
304 OSL_ENSURE( nFormat,
"number format is 0" );
306 bNumValue, dNumValue, nFormat,
319 OUString
const sExpand( pField->
ExpandField(
true,
nullptr) );
320 bool bNeedsCJKProcessing =
false;
321 if( !sExpand.isEmpty() )
331 bNeedsCJKProcessing =
true;
335 if( bNeedsCJKProcessing )
344 rTextNd.
GetParaAttr(aScriptItemSet, nFieldPos, nFieldPos+1);
346 sal_uInt16 aWesternWhichIds[4] =
349 sal_uInt16 aCJKWhichIds[4] =
352 sal_uInt16 aCTLWhichIds[4] =
356 sal_uInt16 *pRefWhichIds =
nullptr;
360 pRefWhichIds = aWesternWhichIds;
363 pRefWhichIds = aCJKWhichIds;
366 pRefWhichIds = aCTLWhichIds;
377 sExpand,
nPos, nScriptType );
378 sal_Int32 nChunkLen = nEndPos -
nPos;
382 sal_uInt16 *pWhichIds =
nullptr;
395 assert(pWhichIds && pRefWhichIds);
396 if (pWhichIds && pRefWhichIds)
398 for(
int i=0;
i<4;
i++ )
401 aScriptItemSet.GetItem( pRefWhichIds[
i] );
403 aScriptItemSet.GetItem( pWhichIds[
i] );
404 if( pRefItem && pItem &&
406 : *pRefItem == *pItem) )
409 aItems[nItems++] = pItem;
427 while(
nPos < sExpand.getLength() );
451 const bool bOn = pFieldTyp->
GetName() ==
"HTML_ON";
452 if (!bOn && pFieldTyp->
GetName() !=
"HTML_OFF")
462 RTL_TEXTENCODING_UTF8));
469 const OUString& rComment = pField->
GetPar2();
470 bool bWritten =
false;
472 if( (rComment.getLength() >= 6 && rComment.startsWith(
"<") && rComment.endsWith(
">") &&
474 (rComment.getLength() >= 7 &&
475 rComment.startsWith(
"<!--" ) &&
476 rComment.endsWith(
"-->" )) )
483 RTL_TEXTENCODING_UTF8));
487 else if( rComment.getLength() >= 7 &&
488 rComment.endsWith(
">") &&
489 rComment.startsWithIgnoreAsciiCase(
"HTML:" ) )
492 if(
'<' == sComment[0] )
499 RTL_TEXTENCODING_UTF8));
523 bool bURL =
static_cast<const SwScriptField *
>(pField)->IsCodeURL();
524 const OUString& rType = pField->
GetPar1();
525 OUString aContents,
aURL;
534 aURL,
nullptr,
nullptr );
542 OSL_ENSURE( pTextField,
"Where is the txt fld?" );
552 bFieldShadings = it->second <= 0;
SvStream & WriteOString(std::string_view rStr)
SvStream & WriteChar(char nChar)
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
const SwAttrPool & GetAttrPool() const
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
Instances of SwFields and those derived from it occur 0 to n times.
virtual OUString GetName() const
Only in derived classes.
Base class of all fields.
virtual OUString GetPar1() const
virtual sal_uInt16 GetSubType() const
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
SwFieldType * GetTyp() const
virtual OUString GetPar2() const
static sal_uInt16 GetCSS1ScriptForScriptType(sal_uInt16 nScriptType)
static const char * GetNumFormat(sal_uInt16 nFormat)
std::map< sal_uInt16, int > maStartedAttributes
Tracks which text portion attributes are currently open: a which id -> open count map.
OString GetNamespace() const
Determines the prefix string needed to respect the requested namespace alias.
bool mbReqIF
If the ReqIF subset of XHTML should be written.
void OutNewLine(bool bCheck=false)
sal_Int32 GetStart() const
SwTextNode & GetTextNode() const
SwTextNode is a paragraph in the document model.
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.
static bool IsFieldShadings()
static Color & GetFieldShadingsColor()
const OUString & GetBaseURL() const
OString GetCSS1_Color(const Color &rColor)
bool swhtml_css1atr_equalFontItems(const SfxPoolItem &r1, const SfxPoolItem &r2)
const char *const sCSS1_P_background
virtual OUString GetName() const override
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
#define OOO_STRING_SW_HTML_FF_char
#define OOO_STRING_SW_HTML_FS_custom
#define OOO_STRING_SW_HTML_FF_lletter
#define OOO_STRING_SW_HTML_FF_arabic
#define OOO_STRING_SW_HTML_FS_company
#define OOO_STRING_SW_HTML_FS_tbl
#define OOO_STRING_SW_HTML_FS_street
#define OOO_STRING_SW_HTML_FS_zip
#define OOO_STRING_SW_HTML_FS_prev
#define OOO_STRING_SW_HTML_FS_shortcut
#define OOO_STRING_SW_HTML_FS_email
#define OOO_STRING_SW_HTML_FS_grf
#define OOO_STRING_SW_HTML_FF_uletter
#define OOO_STRING_SW_HTML_FF_page
#define OOO_STRING_SW_HTML_FS_pphone
#define OOO_STRING_SW_HTML_FS_char
#define OOO_STRING_SW_HTML_FF_date
#define OOO_STRING_SW_HTML_FF_name
#define OOO_STRING_SW_HTML_FS_title
#define OOO_STRING_SW_HTML_FS_theme
#define OOO_STRING_SW_HTML_FS_fax
#define OOO_STRING_SW_HTML_FS_change
#define OOO_STRING_SW_HTML_FF_none
#define OOO_STRING_SW_HTML_FS_word
#define OOO_STRING_SW_HTML_FS_para
#define OOO_STRING_SW_HTML_FS_random
#define OOO_STRING_SW_HTML_FF_lroman
#define OOO_STRING_SW_HTML_FS_next
#define OOO_STRING_SW_HTML_FT_author
#define OOO_STRING_SW_HTML_FF_ulettern
#define OOO_STRING_SW_HTML_FT_docstat
#define OOO_STRING_SW_HTML_FS_create
#define OOO_STRING_SW_HTML_FS_cphone
#define OOO_STRING_SW_HTML_FS_name
#define OOO_STRING_SW_HTML_FT_datetime
#define OOO_STRING_SW_HTML_FT_docinfo
#define OOO_STRING_SW_HTML_FS_position
#define OOO_STRING_SW_HTML_FF_author
#define OOO_STRING_SW_HTML_FF_time
#define OOO_STRING_SW_HTML_FT_sender
#define OOO_STRING_SW_HTML_FF_pathname
#define OOO_STRING_SW_HTML_FS_city
#define OOO_STRING_SW_HTML_FS_firstname
#define OOO_STRING_SW_HTML_FT_filename
#define OOO_STRING_SW_HTML_FF_shortcut
#define OOO_STRING_SW_HTML_FT_page
#define OOO_STRING_SW_HTML_FS_ole
#define OOO_STRING_SW_HTML_FS_comment
#define OOO_STRING_SW_HTML_FS_state
#define OOO_STRING_SW_HTML_FS_country
#define OOO_STRING_SW_HTML_FS_page
#define OOO_STRING_SW_HTML_FF_name_noext
#define OOO_STRING_SW_HTML_FF_uroman
#define OOO_STRING_SW_HTML_FF_path
#define OOO_STRING_SW_HTML_FS_keys
#define OOO_STRING_SW_HTML_FF_llettern
Writer & OutHTML_SwFormatField(Writer &rWrt, const SfxPoolItem &rHt)
static Writer & OutHTML_SwField(Writer &rWrt, const SwField *pField, const SwTextNode &rTextNd, sal_Int32 nFieldPos)
#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
LineEnd GetSystemLineEnd()
TOOLS_DLLPUBLIC OString convertLineEnd(const OString &rIn, LineEnd eLineEnd)
OString strip(const OString &rIn, char c)
OString stripStart(const OString &rIn, char c)
const SwDocInfoSubType DI_SUB_AUTHOR
const SwDocInfoSubType DI_CUSTOM
const SwDocInfoSubType DI_CHANGE
const SwDocInfoSubType DI_COMMENT
const SwDocInfoSubType DI_SUB_DATE
const SwDocInfoSubType DI_KEYS
const SwDocInfoSubType DI_SUBJECT
const SwDocInfoSubType DI_TITLE
const SwDocInfoSubType DI_SUB_TIME
const SwDocInfoSubType DI_CREATE
const SwGetSetExpType GSE_STRING
String.
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
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)
SVX_NUM_CHARS_LOWER_LETTER_N
SVX_NUM_CHARS_LOWER_LETTER
SVX_NUM_CHARS_UPPER_LETTER
SVX_NUM_CHARS_UPPER_LETTER_N
Writer & Out(const SwAttrFnTab, const SfxPoolItem &, Writer &)
#define CSS1_OUTMODE_ANY_SCRIPT
#define CSS1_OUTMODE_WESTERN