20#include <com/sun/star/text/VertOrientation.hpp>
29#include <osl/diagnose.h>
78 bool bChangeNumFormat =
false;
85 sal_uInt16 nChrFormatPoolId = 0;
86 if( HtmlTokenId::ORDERLIST_ON ==
nToken )
111 nAbsLSpace = nAbsLSpace + rPrevNumFormat.
GetAbsLSpace();
118 bChangeNumFormat =
true;
120 else if( 1 != aNumFormat.
GetStart() )
127 OUString aId, aStyle, aClass, aLang, aDir;
130 sal_uInt16 nWidth=USHRT_MAX, nHeight=USHRT_MAX;
132 for (
size_t i = rHTMLOptions.size();
i; )
137 case HtmlOptionId::ID:
140 case HtmlOptionId::TYPE:
141 if( bNewNumFormat && !rOption.
GetString().isEmpty() )
145 case HtmlTokenId::ORDERLIST_ON:
146 bChangeNumFormat =
true;
153 default: bChangeNumFormat =
false;
157 case HtmlTokenId::UNORDERLIST_ON:
160 bChangeNumFormat =
true;
166 case HtmlOptionId::START:
168 sal_uInt16 nStart = o3tl::narrowing<sal_uInt16>(rOption.
GetNumber());
172 bChangeNumFormat =
true;
180 case HtmlOptionId::STYLE:
183 case HtmlOptionId::CLASS:
186 case HtmlOptionId::LANG:
189 case HtmlOptionId::DIR:
192 case HtmlOptionId::SRC:
196 if( !InternalImgToPrivateURL(aBulletSrc) )
200 case HtmlOptionId::WIDTH:
201 nWidth = o3tl::narrowing<sal_uInt16>(rOption.
GetNumber());
203 case HtmlOptionId::HEIGHT:
204 nHeight = o3tl::narrowing<sal_uInt16>(rOption.
GetNumber());
206 case HtmlOptionId::ALIGN:
213 if( !aBulletSrc.isEmpty() )
224 Size aTwipSz( nWidth, nHeight), *pTwipSz=
nullptr;
225 if( nWidth!=USHRT_MAX && nHeight!=USHRT_MAX )
239 bChangeNumFormat =
true;
259 if(
ParseStyleOptions( aStyle, aId, aClass, aItemSet, aPropInfo, &aLang, &aDir ) )
273 nAbsLSpace = SHRT_MAX;
278 bChangeNumFormat =
true;
285 bChangeNumFormat =
true;
290 bChangeNumFormat =
true;
295 bChangeNumFormat =
true;
305 if( bChangeNumFormat )
309 bChangeNumFormat =
false;
318 if( bChangeNumFormat )
357 if( rInfo.
GetDepth()>0 && (
nToken == HtmlTokenId::NONE || xCntxt) )
364 bool bChanged =
false;
370 pRefNumFormat = pNumFormat;
372 else if( pRefNumFormat )
411 bool bSetAttrs =
false;
419 if(
nToken != HtmlTokenId::NONE )
430 OUString aId, aStyle, aClass, aLang, aDir;
431 sal_uInt16 nStart = HtmlTokenId::LISTHEADER_ON !=
nToken
434 if( USHRT_MAX != nStart )
438 for (
size_t i = rHTMLOptions.size();
i; )
443 case HtmlOptionId::VALUE:
444 nStart = o3tl::narrowing<sal_uInt16>(rOption.
GetNumber());
446 case HtmlOptionId::ID:
449 case HtmlOptionId::STYLE:
452 case HtmlOptionId::CLASS:
455 case HtmlOptionId::LANG:
458 case HtmlOptionId::DIR:
473 SAL_WARN(
"sw.html",
"No Text-Node at PaM-Position");
477 const bool bCountedInList =
nToken != HtmlTokenId::LISTHEADER_ON;
481 OUString aNumRuleName;
488 aNumRuleName =
m_xDoc->GetUniqueNumRuleName();
501 aNumRule.
Set( 0, aNumFormat );
503 m_xDoc->MakeNumRule( aNumRuleName, &aNumRule );
506 "Now an open paragraph element is lost" );
524 if ( nStart != USHRT_MAX )
539 if(
ParseStyleOptions( aStyle, aId, aClass, aItemSet, aPropInfo, &aLang, &aDir ) )
562 std::unique_ptr<HTMLAttrContext> xCntxt;
568 switch( nCntxtToken )
570 case HtmlTokenId::LI_ON:
571 case HtmlTokenId::LISTHEADER_ON:
572 if(
nToken == HtmlTokenId::NONE ||
nToken == nCntxtToken )
578 case HtmlTokenId::ORDERLIST_ON:
579 case HtmlTokenId::UNORDERLIST_ON:
580 case HtmlTokenId::MENULIST_ON:
581 case HtmlTokenId::DIRLIST_ON:
607 SAL_WARN(
"sw.html",
"No Text-Node at PaM-Position");
static OutputDevice * GetDefaultDevice()
HtmlOptionId GetToken() const
const OUString & GetString() const
EnumT GetEnum(const HTMLOptionEnum< EnumT > *pOptEnums, EnumT nDflt=static_cast< EnumT >(0)) const
sal_uInt32 GetNumber() const
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void SetGraphicPos(SvxGraphicPosition eNew)
void SetGraphicLink(const OUString &rNew)
sal_Unicode m_cBulletChar
SvxNumType m_nNumberingType
tools::Long m_nLeftMargin
void SetNumberingType(SvxNumType nSet)
SvxNumType GetNumberingType() const
sal_uInt16 GetNodeStartValue(sal_uInt8 nLvl) const
sal_uInt8 GetLevel() const
void SetNumRule(const SwNumRule *pRule)
sal_uInt16 GetDepth() const
void SetNodeStartValue(sal_uInt8 nLvl, sal_uInt16 nVal=USHRT_MAX)
void PushContext(std::unique_ptr< HTMLAttrContext > &rCntxt)
sal_uInt16 m_nDefListDeep
std::unique_ptr< HTMLAttrContext > PopContext(HtmlTokenId nToken=HtmlTokenId::NONE)
void InsertAttrs(std::deque< std::unique_ptr< HTMLAttr > > rAttrs)
HtmlTokenId m_nOpenParaToken
HTMLAttrContexts m_aContexts
void SetAttr(bool bChkEnd=true, bool bBeforeTable=false, std::deque< std::unique_ptr< HTMLAttr > > *pPostIts=nullptr)
OUString m_aBulletGrfs[MAXLEVEL]
void EndNumberBulletListItem(HtmlTokenId nToken, bool bSetColl)
bool DoPositioning(SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, HTMLAttrContext *pContext)
static bool HasStyleOptions(std::u16string_view rStyle, std::u16string_view rId, std::u16string_view rClass, const OUString *pLang=nullptr, const OUString *pDir=nullptr)
SwHTMLNumRuleInfo & GetNumInfo()
void SetTextCollAttrs(HTMLAttrContext *pContext=nullptr)
rtl::Reference< SwDoc > m_xDoc
bool ParseStyleOptions(const OUString &rStyle, const OUString &rId, const OUString &rClass, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, const OUString *pLang=nullptr, const OUString *pDir=nullptr)
std::unique_ptr< SwCSS1Parser > m_pCSS1Parser
void EndNumberBulletList(HtmlTokenId nToken=HtmlTokenId::NONE)
bool AppendTextNode(SwHTMLAppendMode eMode=AM_NORMAL, bool bUpdateNum=true)
void NewNumberBulletList(HtmlTokenId nToken)
void NewNumberBulletListItem(HtmlTokenId nToken)
void EndContext(HTMLAttrContext *pContext)
void SetNodeNum(sal_uInt8 nLevel)
bool HasCurrentParaFlys(bool bNoSurroundOnly=false, bool bSurroundOnly=false) const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
const SwNumFormat * GetNumFormat(sal_uInt16 i) const
const SwNumFormat & Get(sal_uInt16 i) const
void Set(sal_uInt16 i, const SwNumFormat *)
void SetInvalidRule(bool bFlag)
const OUString & GetName() const
SwNode & GetPointNode() const
const SwPosition * GetPoint() const
SwTextNode is a paragraph in the document model.
void SetAttrListLevel(int nLevel)
Sets the list level of this text node.
void SetListRestart(bool bRestart)
bool IsOutline() const
Returns if this text node is an outline.
bool IsCountedInList() const
void SetCountedInList(bool bCounted)
void SetAttrListRestartValue(SwNumberTree::tSwNumTreeNumber nNum)
constexpr TypedWhichId< SvxFirstLineIndentItem > RES_MARGIN_FIRSTLINE(91)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
constexpr TypedWhichId< SvxRightMarginItem > RES_MARGIN_RIGHT(93)
HTMLOptionEnum< sal_Int16 > const aHTMLImgVAlignTable[]
#define OOO_STRING_SVTOOLS_HTML_ULTYPE_disc
#define OOO_STRING_SVTOOLS_HTML_ULTYPE_square
#define OOO_STRING_SVTOOLS_HTML_ULTYPE_circle
#define HTML_BULLETCHAR_SQUARE
#define HTML_NUMBER_BULLET_MARGINLEFT
#define HTML_BULLETCHAR_CIRCLE
#define HTML_NUMBER_BULLET_INDENT
#define HTML_BULLETCHAR_DISC
HTMLOptionEnum< sal_UCS4 > const aHTMLULTypeTable[]
constexpr HtmlTokenId getOnToken(HtmlTokenId nToken)
#define SAL_WARN(area, stream)
SwNumRule * GetNumRule(SwTextFormatColl &rTextFormatColl)
determines the list style, which directly set at the given paragraph style
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
bool IsDefBulletFontUserDefined()
determine if default bullet font is user defined
const vcl::Font & GetDefBulletFont()
retrieve font used for the default bullet list characters
const sal_Unicode cBulletChar
Character for lists.
::std::vector< HTMLOption > HTMLOptions
@ RES_POOLCHR_BULLET_LEVEL
Bullets.
@ RES_POOLCHR_NUM_LEVEL
Numbering symbols.
sal_Int32 GetContentIndex() const
SVX_NUM_CHARS_LOWER_LETTER
SVX_NUM_CHARS_UPPER_LETTER
constexpr sal_uInt8 MAXLEVEL