20 #include <com/sun/star/i18n/XBreakIterator.hpp>
24 #include <osl/diagnose.h>
36 #include <rtl/strbuf.hxx>
44 const char *pFormatStr =
nullptr;
46 switch( static_cast<SvxNumType>(nFormat) )
66 const SwTextNode& rTextNd, sal_Int32 nFieldPos )
74 const char *pTypeStr=
nullptr,
78 bool bNumFormat=
false;
80 double dNumValue = 0.0;
88 switch( static_cast<SwExtUserSubType>(pField->
GetSubType()) )
108 OSL_ENSURE( pSubStr,
"unknown sub type for SwExtUserField" );
114 switch( static_cast<SwAuthorFormat>(nFormat) & 0xff)
119 OSL_ENSURE( pFormatStr,
"unknown format for SwAuthorField" );
120 bFixed =
static_cast<const SwAuthorField*
>(pField)->IsFixed();
126 if( static_cast<const SwDateTimeField*>(pField)->IsFixed() )
143 OSL_ENSURE( pSubStr,
"unknown sub type for SwPageNumberField" );
153 short nValue =
static_cast<short>(rValue.toInt32());
154 if( (eSubType ==
PG_NEXT && nValue!=1) ||
155 (eSubType ==
PG_PREV && nValue!=-1) ||
167 sal_uInt16 nExtSubType = nSubType & 0x0f00;
179 default: pTypeStr =
nullptr;
break;
188 switch( nExtSubType )
237 default: pTypeStr =
nullptr;
break;
245 switch( static_cast<SwFileNameFormat>(nFormat & ~
FF_FIXED) )
255 OSL_ENSURE( pFormatStr,
"unknown format for SwFileNameField" );
261 if (rHTMLWrt.
mbReqIF && pTypeStr)
278 append(
'=').append(pSubStr);
283 append(
'=').append(pFormatStr);
285 if( !aName.isEmpty() )
293 if( !aValue.isEmpty() )
303 OSL_ENSURE( nFormat,
"number format is 0" );
305 bNumValue, dNumValue, nFormat,
318 OUString
const sExpand( pField->
ExpandField(
true,
nullptr) );
319 bool bNeedsCJKProcessing =
false;
320 if( !sExpand.isEmpty() )
328 if( (nPos < sExpand.getLength() && nPos >= 0) || nScript != rHTMLWrt.
m_nCSS1Script )
330 bNeedsCJKProcessing =
true;
334 if( bNeedsCJKProcessing )
343 rTextNd.
GetParaAttr(aScriptItemSet, nFieldPos, nFieldPos+1);
345 sal_uInt16 aWesternWhichIds[4] =
348 sal_uInt16 aCJKWhichIds[4] =
351 sal_uInt16 aCTLWhichIds[4] =
355 sal_uInt16 *pRefWhichIds =
nullptr;
359 pRefWhichIds = aWesternWhichIds;
362 pRefWhichIds = aCJKWhichIds;
365 pRefWhichIds = aCTLWhichIds;
376 sExpand, nPos, nScriptType );
377 sal_Int32 nChunkLen = nEndPos - nPos;
381 sal_uInt16 *pWhichIds =
nullptr;
394 assert(pWhichIds && pRefWhichIds);
395 if (pWhichIds && pRefWhichIds)
397 for(
int i=0;
i<4;
i++ )
400 aScriptItemSet.GetItem( pRefWhichIds[
i] );
402 aScriptItemSet.GetItem( pWhichIds[i] );
403 if( pRefItem && pItem &&
405 : *pRefItem == *pItem) )
408 aItems[nItems++] = pItem;
428 while( nPos < sExpand.getLength() );
453 const bool bOn = pFieldTyp->
GetName() ==
"HTML_ON";
454 if (!bOn && pFieldTyp->
GetName() !=
"HTML_OFF")
464 static_cast<SwHTMLWriter&>(rWrt).m_eDestEnc));
471 const OUString& rComment = pField->
GetPar2();
472 bool bWritten =
false;
474 if( (rComment.getLength() >= 6 && rComment.startsWith(
"<") && rComment.endsWith(
">") &&
476 (rComment.getLength() >= 7 &&
477 rComment.startsWith(
"<!--" ) &&
478 rComment.endsWith(
"-->" )) )
485 static_cast<SwHTMLWriter&>(rWrt).m_eDestEnc));
489 else if( rComment.getLength() >= 7 &&
490 rComment.endsWith(
">") &&
491 rComment.startsWithIgnoreAsciiCase(
"HTML:" ) )
494 if(
'<' == sComment[0] )
501 static_cast<SwHTMLWriter&>(rWrt).m_eDestEnc));
525 bool bURL =
static_cast<const SwScriptField *
>(pField)->IsCodeURL();
526 const OUString& rType = pField->
GetPar1();
527 OUString aContents,
aURL;
544 OSL_ENSURE( pTextField,
"Where is the txt fld?" );
554 bFieldShadings = it->second <= 0;
Instances of SwFields and those derived from it occur 0 to n times.
static Writer & OutHTML_SwField(Writer &rWrt, const SwField *pField, const SwTextNode &rTextNd, sal_Int32 nFieldPos)
const SwDocInfoSubType DI_SUB_TIME
#define OOO_STRING_SW_HTML_FS_title
static Color & GetFieldShadingsColor()
SVX_NUM_CHARS_UPPER_LETTER_N
const OUString & GetBaseURL() const
TOOLS_DLLPUBLIC OString convertLineEnd(const OString &rIn, LineEnd eLineEnd)
#define OOO_STRING_SW_HTML_FS_email
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
static SVT_DLLPUBLIC SvStream & Out_String(SvStream &, const OUString &, rtl_TextEncoding eDestEnc, OUString *pNonConvertableChars=nullptr)
#define OOO_STRING_SVTOOLS_HTML_comment
#define OOO_STRING_SW_HTML_FT_filename
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
#define OOO_STRING_SW_HTML_FF_shortcut
#define OOO_STRING_SW_HTML_FS_firstname
#define OOO_STRING_SVTOOLS_HTML_meta
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
Base class of all fields.
SVX_NUM_CHARS_UPPER_LETTER
#define OOO_STRING_SW_HTML_FF_lroman
OUString m_aNonConvertableCharacters
#define OOO_STRING_SW_HTML_FS_next
#define OOO_STRING_SW_HTML_FF_llettern
const SwDocInfoSubType DI_COMMENT
SvStream & WriteOString(const OString &rStr)
#define OOO_STRING_SVTOOLS_HTML_O_subtype
#define OOO_STRING_SW_HTML_FS_page
#define OOO_STRING_SW_HTML_FS_name
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CJK_POSTURE(25)
#define OOO_STRING_SW_HTML_FT_author
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
#define OOO_STRING_SW_HTML_FS_city
void OutNewLine(bool bCheck=false)
virtual OUString GetPar1() const
#define OOO_STRING_SW_HTML_FS_shortcut
css::uno::Any const & rValue
#define OOO_STRING_SW_HTML_FS_char
static SVT_DLLPUBLIC SvStream & Out_AsciiTag(SvStream &, const OString &rStr, bool bOn=true)
bool mbReqIF
If the ReqIF subset of XHTML should be written.
#define OOO_STRING_SW_HTML_FS_custom
SwAttrFnTab aHTMLAttrFnTab
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
#define CSS1_OUTMODE_ANY_SCRIPT
static const char * GetNumFormat(sal_uInt16 nFormat)
static SVT_DLLPUBLIC OString CreateTableDataOptionsValNum(bool bValue, double fVal, sal_uLong nFormat, SvNumberFormatter &rFormatter, rtl_TextEncoding eDestEnc=RTL_TEXTENCODING_MS_1252, OUString *pNonConvertableChars=nullptr)
LineEnd GetSystemLineEnd()
#define OOO_STRING_SW_HTML_FF_name
const SwDocInfoSubType DI_SUBJECT
sal_Int32 GetStart() const
#define OOO_STRING_SW_HTML_FS_word
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
const char *const sCSS1_P_background
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
static sal_uInt16 GetCSS1ScriptForScriptType(sal_uInt16 nScriptType)
const SwDocInfoSubType DI_CUSTOM
#define OOO_STRING_SW_HTML_FT_sender
#define OOO_STRING_SW_HTML_FS_state
#define OOO_STRING_SW_HTML_FF_arabic
SVX_NUM_CHARS_LOWER_LETTER
rtl_TextEncoding m_eDestEnc
#define OOO_STRING_SW_HTML_FF_path
const SwDocInfoSubType DI_KEYS
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.
const SwDocInfoSubType DI_CREATE
#define OOO_STRING_SW_HTML_FS_cphone
#define OOO_STRING_SW_HTML_FF_page
#define OOO_STRING_SW_HTML_FT_datetime
Writer & Out(const SwAttrFnTab, const SfxPoolItem &, Writer &)
#define OOO_STRING_SVTOOLS_HTML_O_name
#define OOO_STRING_SW_HTML_FF_uroman
#define OOO_STRING_SVTOOLS_HTML_sdfield
#define OOO_STRING_SW_HTML_FS_theme
#define OOO_STRING_SW_HTML_FT_docstat
const SwDocInfoSubType DI_SUB_DATE
#define OOO_STRING_SW_HTML_FS_random
virtual OUString GetPar2() const
static bool IsFieldShadings()
#define OOO_STRING_SW_HTML_FS_country
SVX_NUM_CHARS_LOWER_LETTER_N
virtual sal_uInt16 GetSubType() const
#define OOO_STRING_SW_HTML_FS_keys
#define OOO_STRING_SW_HTML_FF_char
#define OOO_STRING_SW_HTML_FS_company
#define OOO_STRING_SW_HTML_FS_fax
SwFieldType * GetTyp() const
#define OOO_STRING_SW_HTML_FS_comment
#define OOO_STRING_SVTOOLS_HTML_O_format
#define OOO_STRING_SW_HTML_FF_ulettern
const SwDocInfoSubType DI_SUB_AUTHOR
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
#define OOO_STRING_SW_HTML_FT_docinfo
#define OOO_STRING_SW_HTML_FF_name_noext
#define OOO_STRING_SW_HTML_FF_time
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
SwTextNode is a paragraph in the document model.
Writer & OutHTML_SwFormatField(Writer &rWrt, const SfxPoolItem &rHt)
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CJK_WEIGHT(26)
#define OOO_STRING_SW_HTML_FF_uletter
virtual OUString GetName() const
Only in derived classes.
#define OOO_STRING_SVTOOLS_HTML_O_style
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CTL_WEIGHT(31)
#define OOO_STRING_SW_HTML_FF_author
OString GetCSS1_Color(const Color &rColor)
#define CSS1_OUTMODE_WESTERN
#define OOO_STRING_SW_HTML_FS_ole
OString strip(const OString &rIn, char c)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CTL_POSTURE(30)
#define OOO_STRING_SW_HTML_FF_date
#define OOO_STRING_SW_HTML_FF_pathname
OString GetNamespace() const
Determines the prefix string needed to respect the requested namespace alias.
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, rtl_TextEncoding eDestEnc=RTL_TEXTENCODING_MS_1252, OUString *pNonConvertableChars=nullptr)
OString stripStart(const OString &rIn, char c)
#define OOO_STRING_SW_HTML_FS_position
bool swhtml_css1atr_equalFontItems(const SfxPoolItem &r1, const SfxPoolItem &r2)
SvStream & WriteChar(char nChar)
#define OOO_STRING_SW_HTML_FF_lletter
#define OOO_STRING_SW_HTML_FS_zip
#define OOO_STRING_SVTOOLS_HTML_O_value
#define OOO_STRING_SW_HTML_FS_prev
#define OOO_STRING_SVTOOLS_HTML_O_type
#define OOO_STRING_SW_HTML_FS_tbl
#define OOO_STRING_SW_HTML_FT_page
#define OOO_STRING_SVTOOLS_HTML_O_sdfixed
const SwGetSetExpType GSE_STRING
String.
const SwDocInfoSubType DI_CHANGE
SwTextNode & GetTextNode() const
#define OOO_STRING_SW_HTML_FS_change
const SwDocInfoSubType DI_TITLE
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
#define OOO_STRING_SVTOOLS_HTML_span
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
#define OOO_STRING_SW_HTML_FS_pphone
#define OOO_STRING_SW_HTML_FS_para
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
const SwAttrPool & GetAttrPool() const
#define OOO_STRING_SW_HTML_FS_create
std::map< sal_uInt16, int > maStartedAttributes
Tracks which text portion attributes are currently open: a which id -> open count map...
#define OOO_STRING_SW_HTML_FS_street
#define OOO_STRING_SW_HTML_FF_none
#define OOO_STRING_SW_HTML_FS_grf