LibreOffice Module sw (master)
1
|
#include <svxcss1.hxx>
Public Member Functions | |
SvxCSS1Parser (SfxItemPool &rPool, const OUString &rBaseURL, sal_uInt16 const *pWhichIds, sal_uInt16 nWhichIds) | |
virtual | ~SvxCSS1Parser () override |
bool | IsIgnoreFontFamily () const |
void | SetIgnoreFontFamily (bool bSet) |
virtual bool | ParseStyleSheet (const OUString &rIn) |
void | ParseStyleOption (const OUString &rIn, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo) |
virtual sal_uInt32 | GetFontHeight (sal_uInt16 nSize) const |
virtual const FontList * | GetFontList () const |
const sal_uInt16 * | GetWhichMap () const |
void | InsertId (const OUString &rId, const SfxItemSet &rItemSet, const SvxCSS1PropertyInfo &rProp) |
const SvxCSS1MapEntry * | GetId (const OUString &rId) const |
void | InsertClass (const OUString &rClass, const SfxItemSet &rItemSet, const SvxCSS1PropertyInfo &rProp) |
const SvxCSS1MapEntry * | GetClass (const OUString &rClass) const |
void | InsertPage (const OUString &rPage, bool bPseudo, const SfxItemSet &rItemSet, const SvxCSS1PropertyInfo &rProp) |
SvxCSS1MapEntry * | GetPage (const OUString &rPage, bool bPseudo) |
void | InsertTag (const OUString &rTag, const SfxItemSet &rItemSet, const SvxCSS1PropertyInfo &rProp) |
SvxCSS1MapEntry * | GetTag (const OUString &rTag) |
virtual void | SetDfltEncoding (rtl_TextEncoding eEnc) |
rtl_TextEncoding | GetDfltEncoding () const |
const OUString & | GetBaseURL () const |
![]() | |
CSS1Parser () | |
virtual | ~CSS1Parser () |
Static Public Member Functions | |
static bool | GetEnum (const CSS1PropertyEnum *pPropTable, const OUString &rValue, sal_uInt16 &rEnum) |
static void | PixelToTwip (tools::Long &nWidth, tools::Long &nHeight) |
static void | InsertMapEntry (const OUString &rKey, const SfxItemSet &rItemSet, const SvxCSS1PropertyInfo &rProp, CSS1Map &rMap) |
static void | MergeStyles (const SfxItemSet &rSrcSet, const SvxCSS1PropertyInfo &rSrcInfo, SfxItemSet &rTargetSet, SvxCSS1PropertyInfo &rTargetInfo, bool bSmart) |
static sal_uInt16 | GetMinFixLineSpace () |
Protected Member Functions | |
virtual void | StyleParsed (const CSS1Selector *pSelector, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo) |
virtual void | SelectorParsed (std::unique_ptr< CSS1Selector > pSelector, bool bFirst) override |
Will be called when a Selector is parsed. More... | |
virtual void | DeclarationParsed (const OUString &rProperty, std::unique_ptr< CSS1Expression > pExpr) override |
Will be called for every parsed Property. More... | |
![]() | |
void | ParseStyleSheet () |
void | ParseStyleSheet (const OUString &rIn) |
parse the content of a HTML style element More... | |
void | ParseStyleOption (const OUString &rIn) |
parse the content of a HTML style option More... | |
Private Types | |
typedef std::vector< std::unique_ptr< CSS1Selector > > | CSS1Selectors |
typedef std::map< OUString, std::unique_ptr< SvxCSS1MapEntry > > | CSS1Map |
Private Attributes | |
CSS1Selectors | m_Selectors |
CSS1Map | m_Ids |
CSS1Map | m_Classes |
CSS1Map | m_Pages |
CSS1Map | m_Tags |
OUString | sBaseURL |
std::unique_ptr< SfxItemSet > | pSheetItemSet |
SfxItemSet * | pItemSet |
std::unique_ptr< SvxCSS1PropertyInfo > | pSheetPropInfo |
SvxCSS1PropertyInfo * | pPropInfo |
rtl_TextEncoding | eDfltEnc |
bool | bIgnoreFontFamily |
std::vector< sal_uInt16 > | aWhichMap |
Static Private Attributes | |
static constexpr sal_uInt16 | gnMinFixLineSpace = MM50/2 |
Definition at line 186 of file svxcss1.hxx.
|
private |
Definition at line 189 of file svxcss1.hxx.
|
private |
Definition at line 188 of file svxcss1.hxx.
SvxCSS1Parser::SvxCSS1Parser | ( | SfxItemPool & | rPool, |
const OUString & | rBaseURL, | ||
sal_uInt16 const * | pWhichIds, | ||
sal_uInt16 | nWhichIds | ||
) |
Definition at line 697 of file svxcss1.cxx.
References aWhichMap, BuildWhichTable(), SfxItemPool::GetTrueWhich(), pSheetItemSet, and pSheetPropInfo.
|
overridevirtual |
Definition at line 753 of file svxcss1.cxx.
References pSheetItemSet, and pSheetPropInfo.
|
overrideprotectedvirtual |
Will be called for every parsed Property.
Adds the item to the pItemSet. Derived classes should not override this method!
Reimplemented from CSS1Parser.
Definition at line 3160 of file svxcss1.cxx.
References assert(), CSS1PropEntryCompare(), CSS1PropEntryFindCompare(), pItemSet, and pPropInfo.
|
inline |
Definition at line 304 of file svxcss1.hxx.
References sBaseURL.
Referenced by ParseCSS1_background().
const SvxCSS1MapEntry * SvxCSS1Parser::GetClass | ( | const OUString & | rClass | ) | const |
Definition at line 779 of file svxcss1.cxx.
References m_Classes.
Referenced by SwCSS1Parser::GetChrFormat(), and SwCSS1Parser::GetTextFormatColl().
|
inline |
Definition at line 302 of file svxcss1.hxx.
References eDfltEnc.
Referenced by SwCSS1Parser::GetCharFormatFromPool(), SwCSS1Parser::GetTextCollFromPool(), SwCSS1Parser::GetTextFormatColl(), ParseCSS1_font_family(), and SwCSS1Parser::SetDfltEncoding().
|
static |
Definition at line 856 of file svxcss1.cxx.
References CSS1PropertyEnum::nEnum, and CSS1PropertyEnum::pName.
Referenced by ParseCSS1_background(), ParseCSS1_border_style(), ParseCSS1_border_xxx(), ParseCSS1_border_xxx_width(), ParseCSS1_direction(), ParseCSS1_float(), ParseCSS1_font(), ParseCSS1_font_size(), ParseCSS1_font_style(), ParseCSS1_font_variant(), ParseCSS1_font_weight(), ParseCSS1_list_style_type(), ParseCSS1_page_break_xxx(), ParseCSS1_position(), ParseCSS1_size(), ParseCSS1_text_align(), and ParseCSS1_text_transform().
|
virtual |
Reimplemented in SwCSS1Parser.
Definition at line 886 of file svxcss1.cxx.
Referenced by ParseCSS1_font_size().
|
virtual |
Reimplemented in SwCSS1Parser.
Definition at line 905 of file svxcss1.cxx.
Referenced by ParseCSS1_font_family().
const SvxCSS1MapEntry * SvxCSS1Parser::GetId | ( | const OUString & | rId | ) | const |
Definition at line 766 of file svxcss1.cxx.
References m_Ids.
|
inlinestatic |
Definition at line 299 of file svxcss1.hxx.
References gnMinFixLineSpace.
Referenced by ParseCSS1_line_height().
SvxCSS1MapEntry * SvxCSS1Parser::GetPage | ( | const OUString & | rPage, |
bool | bPseudo | ||
) |
Definition at line 796 of file svxcss1.cxx.
References m_Pages.
Referenced by SwCSS1Parser::ParseStyleSheet().
SvxCSS1MapEntry * SvxCSS1Parser::GetTag | ( | const OUString & | rTag | ) |
Definition at line 813 of file svxcss1.cxx.
References m_Tags.
Referenced by SwCSS1Parser::SetLinkCharFormats(), and SwCSS1Parser::SetTableTextColl().
|
inline |
Definition at line 267 of file svxcss1.hxx.
void SvxCSS1Parser::InsertClass | ( | const OUString & | rClass, |
const SfxItemSet & | rItemSet, | ||
const SvxCSS1PropertyInfo & | rProp | ||
) |
Definition at line 772 of file svxcss1.cxx.
References InsertMapEntry(), and m_Classes.
Referenced by SwCSS1Parser::StyleParsed().
void SvxCSS1Parser::InsertId | ( | const OUString & | rId, |
const SfxItemSet & | rItemSet, | ||
const SvxCSS1PropertyInfo & | rProp | ||
) |
Definition at line 759 of file svxcss1.cxx.
References InsertMapEntry(), and m_Ids.
Referenced by SwCSS1Parser::StyleParsed().
|
static |
Definition at line 910 of file svxcss1.cxx.
References SvxCSS1MapEntry::GetItemSet(), SvxCSS1MapEntry::GetPropertyInfo(), MergeStyles(), and p.
Referenced by InsertClass(), InsertId(), InsertPage(), and InsertTag().
void SvxCSS1Parser::InsertPage | ( | const OUString & | rPage, |
bool | bPseudo, | ||
const SfxItemSet & | rItemSet, | ||
const SvxCSS1PropertyInfo & | rProp | ||
) |
Definition at line 785 of file svxcss1.cxx.
References InsertMapEntry(), and m_Pages.
Referenced by SwCSS1Parser::StyleParsed().
void SvxCSS1Parser::InsertTag | ( | const OUString & | rTag, |
const SfxItemSet & | rItemSet, | ||
const SvxCSS1PropertyInfo & | rProp | ||
) |
Definition at line 806 of file svxcss1.cxx.
References InsertMapEntry(), and m_Tags.
Referenced by SwCSS1Parser::StyleParsed().
|
inline |
Definition at line 245 of file svxcss1.hxx.
References bIgnoreFontFamily.
Referenced by ParseCSS1_font_family().
|
static |
Definition at line 928 of file svxcss1.cxx.
References SfxItemSet::Get(), SvxLRSpaceItem::GetLeft(), SvxULSpaceItem::GetLower(), SvxLRSpaceItem::GetRight(), SvxLRSpaceItem::GetTextFirstLineOffset(), SvxULSpaceItem::GetUpper(), SvxCSS1PropertyInfo::m_bBottomMargin, SvxCSS1PropertyInfo::m_bLeftMargin, SvxCSS1PropertyInfo::m_bRightMargin, SvxCSS1PropertyInfo::m_bTextIndent, SvxCSS1PropertyInfo::m_bTopMargin, SvxCSS1PropertyInfo::Merge(), SfxItemSet::Put(), SvxLRSpaceItem::SetLeft(), SvxULSpaceItem::SetLower(), SvxLRSpaceItem::SetRight(), SvxLRSpaceItem::SetTextFirstLineOffset(), and SvxULSpaceItem::SetUpper().
Referenced by InsertMapEntry(), and SwHTMLParser::ParseStyleOptions().
void SvxCSS1Parser::ParseStyleOption | ( | const OUString & | rIn, |
SfxItemSet & | rItemSet, | ||
SvxCSS1PropertyInfo & | rPropInfo | ||
) |
Definition at line 842 of file svxcss1.cxx.
References SfxItemSet::ClearItem(), CSS1Parser::ParseStyleOption(), pItemSet, and pPropInfo.
|
virtual |
Reimplemented in SwCSS1Parser.
Definition at line 819 of file svxcss1.cxx.
References m_Selectors, CSS1Parser::ParseStyleSheet(), pItemSet, pPropInfo, pSheetItemSet, pSheetPropInfo, and StyleParsed().
|
static |
Definition at line 873 of file svxcss1.cxx.
References Application::GetDefaultDevice(), Size::Height(), OutputDevice::PixelToLogic(), and Size::Width().
Referenced by HTMLTable::InitCtor(), SwHTMLParser::InsertHorzRule(), SwHTMLParser::InsertImage(), ParseCSS1_border_xxx(), ParseCSS1_border_xxx_width(), ParseCSS1_font_size(), ParseCSS1_length(), ParseCSS1_letter_spacing(), ParseCSS1_line_height(), ParseCSS1_margin(), ParseCSS1_margin_bottom(), ParseCSS1_margin_left(), ParseCSS1_margin_right(), ParseCSS1_margin_top(), ParseCSS1_padding_xxx(), ParseCSS1_size(), and ParseCSS1_text_indent().
|
overrideprotectedvirtual |
Will be called when a Selector is parsed.
If bFirst is true, the content of the aItemSet will be copied into all recently created Styles. Derived classes should not override this method!
Reimplemented from CSS1Parser.
Definition at line 677 of file svxcss1.cxx.
References m_Selectors, pSheetItemSet, pSheetPropInfo, and StyleParsed().
|
virtual |
Reimplemented in SwCSS1Parser.
Definition at line 978 of file svxcss1.cxx.
References eDfltEnc.
Referenced by SwCSS1Parser::SetDfltEncoding().
|
inline |
Definition at line 246 of file svxcss1.hxx.
|
protectedvirtual |
Reimplemented in SwCSS1Parser.
Definition at line 670 of file svxcss1.cxx.
Referenced by ParseStyleSheet(), and SelectorParsed().
|
private |
Definition at line 209 of file svxcss1.hxx.
Referenced by SvxCSS1Parser().
|
private |
Definition at line 208 of file svxcss1.hxx.
Referenced by IsIgnoreFontFamily().
|
private |
Definition at line 207 of file svxcss1.hxx.
Referenced by GetDfltEncoding(), and SetDfltEncoding().
|
staticprivate |
Definition at line 205 of file svxcss1.hxx.
Referenced by GetMinFixLineSpace().
|
private |
Definition at line 193 of file svxcss1.hxx.
Referenced by GetClass(), and InsertClass().
|
private |
Definition at line 192 of file svxcss1.hxx.
Referenced by GetId(), and InsertId().
|
private |
Definition at line 194 of file svxcss1.hxx.
Referenced by GetPage(), and InsertPage().
|
private |
Definition at line 190 of file svxcss1.hxx.
Referenced by ParseStyleSheet(), and SelectorParsed().
|
private |
Definition at line 195 of file svxcss1.hxx.
Referenced by GetTag(), and InsertTag().
|
private |
Definition at line 200 of file svxcss1.hxx.
Referenced by DeclarationParsed(), ParseStyleOption(), and ParseStyleSheet().
|
private |
Definition at line 203 of file svxcss1.hxx.
Referenced by DeclarationParsed(), ParseStyleOption(), and ParseStyleSheet().
|
private |
Definition at line 199 of file svxcss1.hxx.
Referenced by ParseStyleSheet(), SelectorParsed(), SvxCSS1Parser(), and ~SvxCSS1Parser().
|
private |
Definition at line 202 of file svxcss1.hxx.
Referenced by ParseStyleSheet(), SelectorParsed(), SvxCSS1Parser(), and ~SvxCSS1Parser().
|
private |
Definition at line 197 of file svxcss1.hxx.
Referenced by GetBaseURL().