20#include <com/sun/star/i18n/XBreakIterator.hpp>
24#include <osl/diagnose.h>
40#include <rtl/strbuf.hxx>
48 const char *pFormatStr =
nullptr;
70 const SwTextNode& rTextNd, sal_Int32 nFieldPos )
76 const char *pTypeStr=
nullptr,
80 bool bNumFormat=
false;
82 double dNumValue = 0.0;
110 OSL_ENSURE( pSubStr,
"unknown sub type for SwExtUserField" );
121 OSL_ENSURE( pFormatStr,
"unknown format for SwAuthorField" );
122 bFixed =
static_cast<const SwAuthorField*
>(pField)->IsFixed();
145 OSL_ENSURE( pSubStr,
"unknown sub type for SwPageNumberField" );
154 const OUString& rValue = pField->
GetPar2();
155 short nValue =
static_cast<short>(rValue.toInt32());
169 sal_uInt16 nExtSubType = nSubType & 0x0f00;
181 default: pTypeStr =
nullptr;
break;
190 switch( nExtSubType )
239 default: pTypeStr =
nullptr;
break;
257 OSL_ENSURE( pFormatStr,
"unknown format for SwFileNameField" );
271 OStringBuffer sOut(
"<"
288 if( !
aName.isEmpty() )
296 if( !aValue.isEmpty() )
306 OSL_ENSURE( nFormat,
"number format is 0" );
308 bNumValue, dNumValue, nFormat,
321 OUString
const sExpand( pField->
ExpandField(
true,
nullptr) );
322 bool bNeedsCJKProcessing =
false;
323 if( !sExpand.isEmpty() )
333 bNeedsCJKProcessing =
true;
337 if( bNeedsCJKProcessing )
346 rTextNd.
GetParaAttr(aScriptItemSet, nFieldPos, nFieldPos+1);
348 sal_uInt16 aWesternWhichIds[4] =
351 sal_uInt16 aCJKWhichIds[4] =
354 sal_uInt16 aCTLWhichIds[4] =
358 sal_uInt16 *pRefWhichIds =
nullptr;
362 pRefWhichIds = aWesternWhichIds;
365 pRefWhichIds = aCJKWhichIds;
368 pRefWhichIds = aCTLWhichIds;
379 sExpand,
nPos, nScriptType );
380 sal_Int32 nChunkLen = nEndPos -
nPos;
384 sal_uInt16 *pWhichIds =
nullptr;
397 assert(pWhichIds && pRefWhichIds);
398 if (pWhichIds && pRefWhichIds)
400 for(
int i=0;
i<4;
i++ )
403 aScriptItemSet.GetItem( pRefWhichIds[
i] );
405 aScriptItemSet.GetItem( pWhichIds[
i] );
406 if( pRefItem && pItem &&
408 : *pRefItem == *pItem) )
411 aItems[nItems++] = pItem;
429 while(
nPos < sExpand.getLength() );
452 const bool bOn = pFieldTyp->
GetName() ==
"HTML_ON";
453 if (!bOn && pFieldTyp->
GetName() !=
"HTML_OFF")
463 RTL_TEXTENCODING_UTF8));
470 const OUString& rComment = pField->
GetPar2();
471 bool bWritten =
false;
473 if( (rComment.getLength() >= 6 && rComment.startsWith(
"<") && rComment.endsWith(
">") &&
475 (rComment.getLength() >= 7 &&
476 rComment.startsWith(
"<!--" ) &&
477 rComment.endsWith(
"-->" )) )
484 RTL_TEXTENCODING_UTF8));
488 else if( rComment.getLength() >= 7 &&
489 rComment.endsWith(
">") &&
490 rComment.startsWithIgnoreAsciiCase(
"HTML:" ) )
493 if(
'<' == sComment[0] )
500 RTL_TEXTENCODING_UTF8));
524 bool bURL =
static_cast<const SwScriptField *
>(pField)->IsCodeURL();
525 const OUString& rType = pField->
GetPar1();
526 OUString aContents,
aURL;
535 aURL,
nullptr,
nullptr );
543 OSL_ENSURE( pTextField,
"Where is the txt fld?" );
554 bFieldShadings = it->second <= 0;
SvStream & WriteOString(std::string_view rStr)
SvStream & WriteChar(char nChar)
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
const SwView * GetView() const
const SwAttrPool & GetAttrPool() const
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
SwDocShell * GetDocShell()
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.
const Color & GetFieldShadingsColor() const
bool IsFieldShadings() const
const SwViewOption * GetViewOptions() const
SwWrtShell & GetWrtShell() const
const OUString & GetBaseURL() const
OString GetCSS1_Color(const Color &rColor)
bool swhtml_css1atr_equalFontItems(const SfxPoolItem &r1, const SfxPoolItem &r2)
constexpr std::string_view 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
static SwHTMLWriter & OutHTML_SwField(SwHTMLWriter &rWrt, const SwField *pField, const SwTextNode &rTextNd, sal_Int32 nFieldPos)
SwHTMLWriter & OutHTML_SwFormatField(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
#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
SwHTMLWriter & Out(const SwAttrFnTab, const SfxPoolItem &, SwHTMLWriter &)
#define CSS1_OUTMODE_ANY_SCRIPT
#define CSS1_OUTMODE_WESTERN