21 #include <libxml/xmlwriter.h>
26 #include <osl/diagnose.h>
49 if ( !pTextFormatColl )
51 OSL_FAIL(
"<TextFormatCollFunc::CheckTextFormatCollFuncForDeletionOfAssignmentToOutlineStyle> - misuse of method - it's only for instances of <SwTextFormatColl>" );
66 const OUString& sNumRuleName = pNewNumRuleItem->
GetValue();
67 if ( sNumRuleName.isEmpty() ||
84 const OUString& sNumRuleName = pNumRuleItem->
GetValue();
85 if ( !sNumRuleName.isEmpty() )
128 bool bNewParent(
false );
129 const SvxULSpaceItem *pNewULSpace =
nullptr, *pOldULSpace =
nullptr;
130 const SvxLRSpaceItem *pNewLRSpace =
nullptr, *pOldLRSpace =
nullptr;
136 const SwAttrSetChg *pNewChgSet =
nullptr, *pOldChgSet =
nullptr;
137 const auto pOld = pLegacy->m_pOld;
138 const auto pNew = pLegacy->m_pNew;
139 switch( pLegacy->GetWhich() )
146 RES_LR_SPACE,
false, reinterpret_cast<const SfxPoolItem**>(&pNewLRSpace) );
148 RES_UL_SPACE,
false, reinterpret_cast<const SfxPoolItem**>(&pNewULSpace) );
150 false, reinterpret_cast<const SfxPoolItem**>(&(aFontSizeArr[0])) );
152 false, reinterpret_cast<const SfxPoolItem**>(&(aFontSizeArr[1])) );
154 false, reinterpret_cast<const SfxPoolItem**>(&(aFontSizeArr[2])) );
157 if ( bAssignedToListLevelOfOutlineStyle &&
161 reinterpret_cast<const SfxPoolItem**>(&pNewNumRuleItem) );
197 if (bAssignedToListLevelOfOutlineStyle)
207 if ( bAssignedToListLevelOfOutlineStyle && pNewNumRuleItem )
210 this, pNewNumRuleItem );
213 bool bContinue =
true;
217 reinterpret_cast<const SfxPoolItem**>(&pOldLRSpace) ))
219 if( pOldLRSpace != pNewLRSpace )
228 bChg |= nTmp != aNew.
GetLeft();
248 bContinue =
nullptr != pOldChgSet || bNewParent;
252 else if( pNewChgSet )
258 RES_UL_SPACE,
false, reinterpret_cast<const SfxPoolItem**>(&pOldULSpace) ) &&
259 pOldULSpace != pNewULSpace )
280 bContinue =
nullptr != pOldChgSet || bNewParent;
284 else if( pNewChgSet )
292 pFSize->Which(),
false,
reinterpret_cast<const SfxPoolItem**
>(&pOldFSize) ) &&
294 pFSize != pOldFSize )
296 if( 100 == pOldFSize->GetProp() &&
297 MapUnit::MapRelative == pOldFSize->GetPropUnit() )
307 sal_uInt32 nTmp = pOldFSize->GetHeight();
310 pOldFSize->GetPropUnit() );
311 if( nTmp != aNew.GetHeight() )
314 bContinue =
nullptr != pOldChgSet || bNewParent;
318 else if( pNewChgSet )
333 if( &(pNode->GetNodes()) == &rNds )
342 if ( bIsNumRuleItem )
349 if ( bIsNumRuleItem )
359 const bool bIsNumRuleItemAffected =
361 if ( bIsNumRuleItemAffected )
368 if ( bIsNumRuleItemAffected )
378 const bool bIsNumRuleItemAffected =
379 ( nWhich2 != 0 && nWhich2 > nWhich1 )
383 if ( bIsNumRuleItemAffected )
409 if ( nAssignedOutlineStyleLevel != -1 )
421 bool bAreListLevelIndentsApplicable(
true );
426 bAreListLevelIndentsApplicable =
false;
431 bAreListLevelIndentsApplicable =
false;
437 bAreListLevelIndentsApplicable =
true;
451 bAreListLevelIndentsApplicable =
false;
459 bAreListLevelIndentsApplicable =
true;
465 "<SwTextFormatColl::AreListLevelIndentsApplicable()> - something wrong in paragraph style hierarchy. The applied list style is not found." );
469 return bAreListLevelIndentsApplicable;
474 xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwTextFormatColl"));
475 xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"name"), BAD_CAST(
GetName().toUtf8().getStr()));
477 xmlTextWriterEndElement(pWriter);
482 xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwTextFormatColls"));
483 for (
size_t i = 0;
i <
size(); ++
i)
485 xmlTextWriterEndElement(pWriter);
492 :
SwClient( pColl ), m_nCondition( nMasterCond ),
493 m_nSubCondition( nSubCond )
498 :
SwClient( const_cast<
sw::BroadcastingModify*>(static_cast<const
sw::BroadcastingModify*>(rCopy.GetRegisteredIn())) ),
499 m_nCondition( rCopy.m_nCondition ),
500 m_nSubCondition( rCopy.m_nSubCondition )
543 for (SwFormatCollConditions::size_type
n = 0;
n <
m_CondColls.size(); ++
n)
553 m_CondColls.push_back( std::make_unique<SwCollCondition> (rCond) );
558 for (SwFormatCollConditions::size_type
n = 0;
n <
m_CondColls.size(); ++
n)
572 for (
const auto &rpFnd : rCndClls)
577 std::unique_ptr<SwCollCondition> pNew;
579 rpFnd->GetSubCondition() ));
587 OSL_ENSURE( 0 <= nLevel && nLevel <=
MAXLEVEL ,
"SwTextFormatColl: Level Out Of Range" );
589 static_cast<sal_uInt16>(nLevel) ) );
600 "<SwTextFormatColl::GetAssignedOutlineStyleLevel()> - misuse of method");
612 while ( pDerivedTextFormatColl !=
nullptr )
627 pDerivedTextFormatColl = aIter.
Next();
const SwAttrSet * GetChgSet() const
What has changed.
void AddParagraphStyle(SwTextFormatColl &rTextFormatColl)
void Add(SwClient *pDepend)
int GetAssignedOutlineStyleLevel() const
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
Represents the style of a paragraph.
void dumpAsXml(xmlTextWriterPtr pWriter) const
sal_uInt16 GetLower() const
SwCollCondition(SwTextFormatColl *pColl, Master_CollCondition nMasterCond, sal_uLong nSubCond)
virtual ~SwConditionTextFormatColl() override
void CheckTextFormatCollForDeletionOfAssignmentToOutlineStyle(SwFormat *pFormat, const SwNumRuleItem *pNewNumRuleItem)
Checks, if assignment of paragraph style to list level of outline style has to be deleted...
tools::Long GetRight() const
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
SwFormatCollConditions m_CondColls
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
const wchar_t *typedef int(__stdcall *DllNativeUnregProc)(int
Master_CollCondition
Conditional styles.
void RemoveParagraphStyle(SwTextFormatColl &rTextFormatColl)
sal_uInt16 GetPropTextFirstLineOffset() const
void SetHeight(sal_uInt32 nNewHeight, const sal_uInt16 nNewProp=100, MapUnit eUnit=MapUnit::MapRelative)
bool mbStayAssignedToListLevelOfOutlineStyle
const OUString & GetName() const
Dialog to specify the properties of date form field.
virtual bool SetFormatAttr(const SfxPoolItem &rAttr) override
Override to recognize changes on the and register/unregister the paragragh style at t...
virtual sal_uInt16 ResetAllFormatAttr() override
Override to stay assigned to list level of outline style.
sal_uInt16 GetPropLower() const
bool IsAssignedToListLevelOfOutlineStyle() const
bool mbAssignedToOutlineStyle
constexpr TypedWhichId< SfxUInt16Item > RES_PARATR_OUTLINELEVEL(79)
void dumpAsXml(xmlTextWriterPtr pWriter) const
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(161)
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(160)
SwTextFormatColl * CopyTextColl(const SwTextFormatColl &rColl)
copy TextNodes
virtual ~SwTextFormatColl()
void dumpAsXml(xmlTextWriterPtr pWriter) const
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
#define SAL_N_ELEMENTS(arr)
sal_uInt16 GetPropRight() const
bool IsAtDocNodeSet() const
struct _xmlTextWriter * xmlTextWriterPtr
SwNumRule * FindNumRulePtr(const OUString &rName) const
const SfxItemSet * GetParent() const
void InsertCondition(const SwCollCondition &rCond)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
T & StaticWhichCast(TypedWhichId< T > nId)
void SetCondition(Master_CollCondition nCond, sal_uLong nSubCond)
const OUString & GetValue() const
sal_uInt16 GetPropLeft() const
tools::Long GetLeft() const
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
sal_uLong m_nSubCondition
const SwCollCondition * HasCondition(const SwCollCondition &rCond) const
short GetTextFirstLineOffset() const
void DeleteAssignmentToListLevelOfOutlineStyle()
const SwAttrSet * GetTheChgdSet() const
Where it has changed.
std::vector< std::unique_ptr< SwCollCondition >> SwFormatCollConditions
void SetConditions(const SwFormatCollConditions &)
SwFontCache * pSwFontCache
void AddToNumRule(SwTextFormatColl &rTextFormatColl)
adds the given paragraph style at the directly set list style
Master_CollCondition m_nCondition
void AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
void Delete(const void *pOwner, sal_uInt16 nIndex)
void RemoveFromNumRule(SwTextFormatColl &rTextFormatColl)
removes the given paragraph style from the directly set list style
sal_uInt32 GetHeight() const
bool AreListLevelIndentsApplicable() const
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
bool StayAssignedToListLevelOfOutlineStyle() const
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
To get UL- / LR- / FontHeight-changes.
bool operator==(const SwCollCondition &rCmp) const
void SetAttrOutlineLevel(int)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0) override
virtual ~SwCollCondition() override
void RemoveCondition(const SwCollCondition &rCond)
int GetAttrOutlineLevel() const
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
SwNumRule * GetNumRule(SwTextFormatColl &rTextFormatColl)
determines the list style, which directly set at the given paragraph style
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
void RegisterToFormat(SwFormat &)
SwNumRule * GetOutlineNumRule() const
sal_uInt16 GetUpper() const
sal_uInt16 GetPropUpper() const