20#include <com/sun/star/i18n/XBreakIterator.hpp>
25#include <osl/diagnose.h>
41#include <rtl/strbuf.hxx>
49 const char *pFormatStr =
nullptr;
71 const SwTextNode& rTextNd, sal_Int32 nFieldPos )
77 const char *pTypeStr=
nullptr,
81 bool bNumFormat=
false;
83 double dNumValue = 0.0;
111 OSL_ENSURE( pSubStr,
"unknown sub type for SwExtUserField" );
122 OSL_ENSURE( pFormatStr,
"unknown format for SwAuthorField" );
123 bFixed =
static_cast<const SwAuthorField*
>(pField)->IsFixed();
146 OSL_ENSURE( pSubStr,
"unknown sub type for SwPageNumberField" );
155 const OUString& rValue = pField->
GetPar2();
156 short nValue =
static_cast<short>(rValue.toInt32());
170 sal_uInt16 nExtSubType = nSubType & 0x0f00;
182 default: pTypeStr =
nullptr;
break;
191 switch( nExtSubType )
240 default: pTypeStr =
nullptr;
break;
258 OSL_ENSURE( pFormatStr,
"unknown format for SwFileNameField" );
272 OStringBuffer sOut(
"<"
289 if( !
aName.isEmpty() )
297 if( !aValue.isEmpty() )
307 OSL_ENSURE( nFormat,
"number format is 0" );
309 bNumValue, dNumValue, nFormat,
322 OUString
const sExpand( pField->
ExpandField(
true,
nullptr) );
323 bool bNeedsCJKProcessing =
false;
324 if( !sExpand.isEmpty() )
334 bNeedsCJKProcessing =
true;
338 if( bNeedsCJKProcessing )
347 rTextNd.
GetParaAttr(aScriptItemSet, nFieldPos, nFieldPos+1);
349 sal_uInt16 aWesternWhichIds[4] =
352 sal_uInt16 aCJKWhichIds[4] =
355 sal_uInt16 aCTLWhichIds[4] =
359 sal_uInt16 *pRefWhichIds =
nullptr;
363 pRefWhichIds = aWesternWhichIds;
366 pRefWhichIds = aCJKWhichIds;
369 pRefWhichIds = aCTLWhichIds;
380 sExpand,
nPos, nScriptType );
381 sal_Int32 nChunkLen = nEndPos -
nPos;
385 sal_uInt16 *pWhichIds =
nullptr;
398 assert(pWhichIds && pRefWhichIds);
399 if (pWhichIds && pRefWhichIds)
401 for(
int i=0;
i<4;
i++ )
404 aScriptItemSet.GetItem( pRefWhichIds[
i] );
406 aScriptItemSet.GetItem( pWhichIds[
i] );
407 if( pRefItem && pItem &&
409 : *pRefItem == *pItem) )
412 aItems[nItems++] = pItem;
430 while(
nPos < sExpand.getLength() );
453 const bool bOn = pFieldTyp->
GetName() ==
"HTML_ON";
454 if (!bOn && pFieldTyp->
GetName() !=
"HTML_OFF")
464 RTL_TEXTENCODING_UTF8));
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 RTL_TEXTENCODING_UTF8));
489 else if( rComment.getLength() >= 7 &&
490 rComment.endsWith(
">") &&
491 rComment.startsWithIgnoreAsciiCase(
"HTML:" ) )
494 if(
'<' == sComment[0] )
501 RTL_TEXTENCODING_UTF8));
525 bool bURL =
static_cast<const SwScriptField *
>(pField)->IsCodeURL();
526 const OUString& rType = pField->
GetPar1();
527 OUString aContents,
aURL;
536 aURL,
nullptr,
nullptr );
544 OSL_ENSURE( pTextField,
"Where is the txt fld?" );
555 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)
OUString encodeForXml(std::u16string_view rStr)
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