21 #include <osl/diagnose.h>
23 #include <com/sun/star/beans/XPropertySet.hpp>
24 #include <com/sun/star/beans/PropertyValue.hpp>
25 #include <com/sun/star/container/XIndexReplace.hpp>
26 #include <com/sun/star/style/NumberingType.hpp>
27 #include <com/sun/star/text/XTextContent.hpp>
28 #include <com/sun/star/container/XNamed.hpp>
43 , mnListStartValue( -1 )
45 , mbIsNumbered( false )
46 , mbIsRestart( false )
47 , mnListLevelStartValue( -1 )
48 , mbOutlineStyleAsNormalListStyle( false )
55 const css::uno::Reference < css::text::XTextContent > & xTextContent,
56 const bool bOutlineStyleAsNormalListStyle,
58 const bool bExportTextNumberElement )
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 );
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;
144 if( xPropSetInfo->hasPropertyByName(
"ContinueingPreviousSubTree" ) )
150 if( xPropSetInfo->hasPropertyByName(
"NumberingIsNumber" ) )
152 if( !(xPropSet->getPropertyValue(
"NumberingIsNumber" ) >>=
mbIsNumbered ) )
154 OSL_FAIL(
"numbered paragraph without number info" );
161 if( xPropSetInfo->hasPropertyByName(
"ParaIsNumberingRestart" ) )
163 xPropSet->getPropertyValue(
"ParaIsNumberingRestart" ) >>=
mbIsRestart;
165 if( xPropSetInfo->hasPropertyByName(
"NumberingStartValue" ) )
171 OSL_ENSURE( mnListLevel < mxNumRules->getCount(),
"wrong num rule level" );
178 Sequence<PropertyValue> aProps;
181 auto pProp = std::find_if(aProps.begin(), aProps.end(),
182 [](
const PropertyValue& rProp) {
return rProp.Name ==
"StartWith"; });
183 if (pProp != aProps.end())
189 if ( bExportTextNumberElement &&
190 xPropSetInfo->hasPropertyByName(
"ListLabelString" ) )
bool mbOutlineStyleAsNormalListStyle
bool BelongsToSameList(const XMLTextNumRuleInfo &rCmp) const
sal_Int16 mnListLevelStartValue
css::uno::Reference< css::container::XIndexReplace > mxNumRules
bool mbContinueingPreviousSubTree
information about list and list style for a certain paragraph
sal_Int16 mnListStartValue
void Set(const css::uno::Reference< css::text::XTextContent > &rTextContent, const bool bOutlineStyleAsNormalListStyle, const XMLTextListAutoStylePool &rListAutoPool, const bool bExportTextNumberElement)
#define SAL_WARN_IF(condition, area, stream)
OUString msListLabelString
#define SAL_WARN(area, stream)
SAL_DLLPRIVATE sal_uInt32 Find(const XMLTextListAutoStylePoolEntry_Impl *pEntry) const