21#include <osl/diagnose.h>
23#include <com/sun/star/beans/XPropertySet.hpp>
24#include <com/sun/star/beans/XPropertyState.hpp>
25#include <com/sun/star/beans/PropertyValue.hpp>
26#include <com/sun/star/container/XIndexReplace.hpp>
27#include <com/sun/star/style/NumberingType.hpp>
28#include <com/sun/star/text/XTextContent.hpp>
29#include <com/sun/star/container/XNamed.hpp>
41 : mbListIdIsDefault(false)
42 , mnListStartValue( -1 )
44 , mbIsNumbered( false )
45 , mbIsRestart( false )
46 , mnListLevelStartValue( -1 )
47 , mbOutlineStyleAsNormalListStyle( false )
54 const css::uno::Reference < css::text::XTextContent > & xTextContent,
55 const bool bOutlineStyleAsNormalListStyle,
57 const bool bExportTextNumberElement,
58 const bool bListIdIsDefault )
64 Reference< XPropertySet > xPropSet( xTextContent, UNO_QUERY );
65 Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
68 if( !xPropSetInfo->hasPropertyByName(
"NumberingLevel" ) )
71 if( xPropSet->getPropertyValue(
"NumberingLevel" ) >>=
mnListLevel )
73 if( xPropSetInfo->hasPropertyByName(
"NumberingRules" ) )
75 xPropSet->getPropertyValue(
"NumberingRules" ) >>=
mxNumRules;
89 "<XMLTextNumRuleInfo::Set(..)> - numbering rules instance does not contain any numbering rule" );
97 "<XMLTextNumRuleInfo::Set(..)> - unexpected numbering level" );
103 bool bSuppressListStyle(
false );
108 Reference<XPropertySet> xNumRulesProps(
mxNumRules, UNO_QUERY);
109 if ( xNumRulesProps.is() &&
110 xNumRulesProps->getPropertySetInfo()->
111 hasPropertyByName(
"NumberingIsOutline" ) )
113 bool bIsOutline =
false;
114 xNumRulesProps->getPropertyValue(
"NumberingIsOutline" ) >>= bIsOutline;
115 bSuppressListStyle = bIsOutline;
127 Reference < XNamed > xNamed(
mxNumRules, UNO_QUERY );
129 "<XMLTextNumRuleInfo::Set(..)> - numbering rules instance have to be named. Serious defect." );
136 "<XMLTextNumRuleInfo::Set(..)> - no name found for numbering rules instance. Serious defect." );
138 if( xPropSetInfo->hasPropertyByName(
"ListId" ) )
140 xPropSet->getPropertyValue(
"ListId" ) >>=
msListId;
146 if( xPropSetInfo->hasPropertyByName(
"ContinueingPreviousSubTree" ) )
152 if( xPropSetInfo->hasPropertyByName(
"NumberingIsNumber" ) )
154 if( !(xPropSet->getPropertyValue(
"NumberingIsNumber" ) >>=
mbIsNumbered ) )
156 OSL_FAIL(
"numbered paragraph without number info" );
163 if( xPropSetInfo->hasPropertyByName(
"ParaIsNumberingRestart" ) )
165 xPropSet->getPropertyValue(
"ParaIsNumberingRestart" ) >>=
mbIsRestart;
167 if( xPropSetInfo->hasPropertyByName(
"NumberingStartValue" ) )
173 OSL_ENSURE( mnListLevel < mxNumRules->getCount(),
"wrong num rule level" );
180 Sequence<PropertyValue> aProps;
183 auto pProp = std::find_if(std::cbegin(aProps), std::cend(aProps),
184 [](
const PropertyValue& rProp) {
return rProp.Name ==
"StartWith"; });
185 if (pProp != std::cend(aProps))
191 if ( bExportTextNumberElement &&
192 xPropSetInfo->hasPropertyByName(
"ListLabelString" ) )
SAL_DLLPRIVATE sal_uInt32 Find(const XMLTextListAutoStylePoolEntry_Impl *pEntry) const
information about list and list style for a certain paragraph
bool mbListIdIsDefault
msListId won't be referenced by later lists.
css::uno::Reference< css::container::XIndexReplace > mxNumRules
OUString msListLabelString
sal_Int16 mnListLevelStartValue
bool mbContinueingPreviousSubTree
bool mbOutlineStyleAsNormalListStyle
void Set(const css::uno::Reference< css::text::XTextContent > &rTextContent, bool bOutlineStyleAsNormalListStyle, const XMLTextListAutoStylePool &rListAutoPool, bool bExportTextNumberElement, bool bListIdIsDefault)
sal_Int16 mnListStartValue
bool BelongsToSameList(const XMLTextNumRuleInfo &rCmp) const
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)