20#include <com/sun/star/container/XIndexReplace.hpp>
21#include <com/sun/star/style/XStyle.hpp>
22#include <com/sun/star/beans/XPropertySet.hpp>
46 const Reference< xml::sax::XFastAttributeList > & xAttrList,
47 const bool bRestartNumberingAtSubList )
49, mrTxtImport( rTxtImp )
51, mbRestartNumbering( false )
52, mbSetDefaults( false )
54 static constexpr OUStringLiteral s_PropNameDefaultListId =
u"DefaultListId";
65 OUString sParentListStyleName;
74 bRestartNumberingAtSubList;
80 bool bIsContinueNumberingAttributePresent(
false );
83 switch( aIter.getToken() )
95 bIsContinueNumberingAttributePresent =
true;
125 OUString sListStyleDefaultListId;
127 uno::Reference< beans::XPropertySet > xNumRuleProps(
mxNumRules, UNO_QUERY );
128 if ( xNumRuleProps.is() )
130 uno::Reference< beans::XPropertySetInfo > xNumRulePropSetInfo(
131 xNumRuleProps->getPropertySetInfo());
132 if (xNumRulePropSetInfo.is() &&
133 xNumRulePropSetInfo->hasPropertyByName(
134 s_PropNameDefaultListId))
136 xNumRuleProps->getPropertyValue(s_PropNameDefaultListId)
137 >>= sListStyleDefaultListId;
138 SAL_WARN_IF( sListStyleDefaultListId.isEmpty(),
"xmloff",
139 "no default list id found at numbering rules instance. Serious defect." );
146 sal_Int32 nBuild( 0 );
149 ( bBuildIdFound && nUPD == 680 ) )
155 if ( !sListStyleDefaultListId.isEmpty() )
158 if ( !bIsContinueNumberingAttributePresent &&
184 bool bContinueNumbering = bIsContinueNumberingAttributePresent && !
mbRestartNumbering;
204 while ( !sTmpStr.isEmpty() )
219 sListStyleDefaultListId );
247 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
251 bool bHeader =
false;
259 xAttrList, bHeader );
This class deliberately does not support XWeak, to improve performance when loading large documents.
SvXMLImport & GetImport()
bool IsTextDocInOOoFileFormat() const
bool getBuildIds(sal_Int32 &rUPD, sal_Int32 &rBuild) const
returns the upd and build id (f.e.
XMLTextListsHelper & GetTextListHelper()
const css::uno::Reference< css::container::XIndexReplace > & GetNumRules() const
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
virtual ~XMLTextListBlockContext() override
rtl::Reference< XMLTextListBlockContext > mxParentListBlock
css::uno::Reference< css::container::XIndexReplace > mxNumRules
sal_Int16 GetLevel() const
const OUString & GetContinueListId() const
bool IsRestartNumbering() const
OUString msContinueListId
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
const OUString & GetListId() const
XMLTextListBlockContext(SvXMLImport &rImport, XMLTextImportHelper &rTxtImp, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, const bool bRestartNumberingAtSubList=false)
XMLTextImportHelper & mrTxtImport
void PopListContext()
pop the list context stack
const OUString & GetLastProcessedListId() const
void SetListItem(XMLTextListItemContext *pListItem)
set list item on top of the list context stack
void KeepListAsProcessed(const OUString &sListId, const OUString &sListStyleName, const OUString &sContinueListId, const OUString &sListStyleDefaultListId=OUString())
void PushListContext(XMLTextListBlockContext *i_pListBlock)
list stack for importing:
OUString GenerateNewListId() const
static css::uno::Reference< css::container::XIndexReplace > MakeNumRule(SvXMLImport &i_rImport, const css::uno::Reference< css::container::XIndexReplace > &i_xNumRule, std::u16string_view i_ParentStyleName, const OUString &i_StyleName, sal_Int16 &io_rLevel, bool *o_pRestartNumbering=nullptr, bool *io_pSetDefaults=nullptr)
Creates a NumRule from given style-name.
void ListContextTop(XMLTextListBlockContext *&o_pListBlockContext, XMLTextListItemContext *&o_pListItemContext, XMLNumberedParaContext *&o_pNumberedParagraphContext)
peek at the top of the list context stack
bool IsListProcessed(const OUString &sListId) const
OUString GetContinueListIdOfProcessedList(const OUString &sListId) const
const OUString & GetListStyleOfLastProcessedList() const
OUString GetLastIdOfStyleName(const OUString &sListStyleName) const
Looks up the last list id of a given list style, by name.
#define SAL_WARN_IF(condition, area, stream)
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Handling of tokens in XML:
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
#define XMLOFF_WARN_UNKNOWN_ELEMENT(area, token)
#define XMLOFF_WARN_UNKNOWN(area, rIter)
#define XML_ELEMENT(prefix, name)