20 #include <com/sun/star/i18n/XBreakIterator.hpp>
24 #include <osl/diagnose.h>
37 #include <rtl/strbuf.hxx>
45 const char *pFormatStr =
nullptr;
47 switch( static_cast<SvxNumType>(nFormat) )
67 const SwTextNode& rTextNd, sal_Int32 nFieldPos )
75 const char *pTypeStr=
nullptr,
79 bool bNumFormat=
false;
81 double dNumValue = 0.0;
89 switch( static_cast<SwExtUserSubType>(pField->
GetSubType()) )
109 OSL_ENSURE( pSubStr,
"unknown sub type for SwExtUserField" );
115 switch( static_cast<SwAuthorFormat>(nFormat) & 0xff)
120 OSL_ENSURE( pFormatStr,
"unknown format for SwAuthorField" );
121 bFixed =
static_cast<const SwAuthorField*
>(pField)->IsFixed();
127 if( static_cast<const SwDateTimeField*>(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());
155 if( (eSubType ==
PG_NEXT && nValue!=1) ||
156 (eSubType ==
PG_PREV && nValue!=-1) ||
168 sal_uInt16 nExtSubType = nSubType & 0x0f00;
180 default: pTypeStr =
nullptr;
break;
189 switch( nExtSubType )
238 default: pTypeStr =
nullptr;
break;
246 switch( static_cast<SwFileNameFormat>(nFormat & ~
FF_FIXED) )
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() )
293 if( !aValue.isEmpty() )
302 OSL_ENSURE( nFormat,
"number format is 0" );
304 bNumValue, dNumValue, nFormat,
316 OUString
const sExpand( pField->
ExpandField(
true,
nullptr) );
317 bool bNeedsCJKProcessing =
false;
318 if( !sExpand.isEmpty() )
326 if( (nPos < sExpand.getLength() && nPos >= 0) || nScript != rHTMLWrt.
m_nCSS1Script )
328 bNeedsCJKProcessing =
true;
332 if( bNeedsCJKProcessing )
341 rTextNd.
GetParaAttr(aScriptItemSet, nFieldPos, nFieldPos+1);
343 sal_uInt16 aWesternWhichIds[4] =
346 sal_uInt16 aCJKWhichIds[4] =
349 sal_uInt16 aCTLWhichIds[4] =
353 sal_uInt16 *pRefWhichIds =
nullptr;
357 pRefWhichIds = aWesternWhichIds;
360 pRefWhichIds = aCJKWhichIds;
363 pRefWhichIds = aCTLWhichIds;
374 sExpand, nPos, nScriptType );
375 sal_Int32 nChunkLen = nEndPos - nPos;
379 sal_uInt16 *pWhichIds =
nullptr;
392 assert(pWhichIds && pRefWhichIds);
393 if (pWhichIds && pRefWhichIds)
395 for(
int i=0;
i<4;
i++ )
398 aScriptItemSet.GetItem( pRefWhichIds[
i] );
400 aScriptItemSet.GetItem( pWhichIds[i] );
401 if( pRefItem && pItem &&
403 : *pRefItem == *pItem) )
406 aItems[nItems++] = pItem;
424 while( nPos < sExpand.getLength() );
448 const bool bOn = pFieldTyp->
GetName() ==
"HTML_ON";
449 if (!bOn && pFieldTyp->
GetName() !=
"HTML_OFF")
459 RTL_TEXTENCODING_UTF8));
466 const OUString& rComment = pField->
GetPar2();
467 bool bWritten =
false;
469 if( (rComment.getLength() >= 6 && rComment.startsWith(
"<") && rComment.endsWith(
">") &&
471 (rComment.getLength() >= 7 &&
472 rComment.startsWith(
"<!--" ) &&
473 rComment.endsWith(
"-->" )) )
480 RTL_TEXTENCODING_UTF8));
484 else if( rComment.getLength() >= 7 &&
485 rComment.endsWith(
">") &&
486 rComment.startsWithIgnoreAsciiCase(
"HTML:" ) )
489 if(
'<' == sComment[0] )
496 RTL_TEXTENCODING_UTF8));
520 bool bURL =
static_cast<const SwScriptField *
>(pField)->IsCodeURL();
521 const OUString& rType = pField->
GetPar1();
522 OUString aContents,
aURL;
531 aURL,
nullptr, nullptr );
539 OSL_ENSURE( pTextField,
"Where is the txt fld?" );
549 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)
#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
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, OUString *pNonConvertableChars=nullptr)
#define OOO_STRING_SW_HTML_FS_next
#define OOO_STRING_SW_HTML_FF_llettern
const SwDocInfoSubType DI_COMMENT
#define OOO_STRING_SVTOOLS_HTML_O_subtype
static SVT_DLLPUBLIC SvStream & Out_AsciiTag(SvStream &, std::string_view rStr, bool bOn=true)
#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
#define OOO_STRING_SW_HTML_FS_char
bool mbReqIF
If the ReqIF subset of XHTML should be written.
#define OOO_STRING_SW_HTML_FS_custom
SwAttrFnTab aHTMLAttrFnTab
#define CSS1_OUTMODE_ANY_SCRIPT
static const char * GetNumFormat(sal_uInt16 nFormat)
LineEnd GetSystemLineEnd()
#define OOO_STRING_SW_HTML_FF_name
const SwDocInfoSubType DI_SUBJECT
sal_Int32 GetStart() const
#define OOO_STRING_SW_HTML_FS_word
virtual OUString GetName() const override
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
static SVT_DLLPUBLIC OString CreateTableDataOptionsValNum(bool bValue, double fVal, sal_uInt32 nFormat, SvNumberFormatter &rFormatter, OUString *pNonConvertableChars=nullptr)
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
#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
static SVT_DLLPUBLIC SvStream & Out_String(SvStream &, const OUString &, OUString *pNonConvertableChars=nullptr)
virtual OUString GetName() const
Only in derived classes.
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
SvStream & WriteOString(std::string_view rStr)
#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.
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