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() ||
83 const OUString& sNumRuleName = pNumRuleItem->
GetValue();
84 if ( !sNumRuleName.isEmpty() )
119 if (rHint.
GetId() != SfxHintId::SwLegacyModify)
127 bool bNewParent(
false );
128 const SvxULSpaceItem *pNewULSpace =
nullptr, *pOldULSpace =
nullptr;
129 const SvxLRSpaceItem *pNewLRSpace =
nullptr, *pOldLRSpace =
nullptr;
135 const SwAttrSetChg *pNewChgSet =
nullptr, *pOldChgSet =
nullptr;
136 const auto pOld = pLegacy->m_pOld;
137 const auto pNew = pLegacy->m_pNew;
138 switch( pLegacy->GetWhich() )
151 if ( bAssignedToListLevelOfOutlineStyle &&
190 if (bAssignedToListLevelOfOutlineStyle)
200 if ( bAssignedToListLevelOfOutlineStyle && pNewNumRuleItem )
203 this, pNewNumRuleItem );
206 bool bContinue =
true;
211 if( pOldLRSpace != pNewLRSpace )
220 bChg |= nTmp != aNew.
GetLeft();
240 bContinue =
nullptr != pOldChgSet || bNewParent;
244 else if( pNewChgSet )
250 pOldULSpace != pNewULSpace )
271 bContinue =
nullptr != pOldChgSet || bNewParent;
275 else if( pNewChgSet )
283 pFSize->Which(),
false,
reinterpret_cast<const SfxPoolItem**
>(&pOldFSize) )) &&
285 pFSize != pOldFSize )
287 if( 100 == pOldFSize->GetProp() &&
288 MapUnit::MapRelative == pOldFSize->GetPropUnit() )
298 sal_uInt32 nTmp = pOldFSize->GetHeight();
301 pOldFSize->GetPropUnit() );
302 if( nTmp != aNew.GetHeight() )
305 bContinue =
nullptr != pOldChgSet || bNewParent;
309 else if( pNewChgSet )
328 if( &(pNode->GetNodes()) == &rNds )
337 if ( bIsNumRuleItem )
344 if ( bIsNumRuleItem )
354 const bool bIsNumRuleItemAffected =
356 if ( bIsNumRuleItemAffected )
363 if ( bIsNumRuleItemAffected )
373 const bool bIsNumRuleItemAffected =
374 ( nWhich2 != 0 && nWhich2 > nWhich1 )
378 if ( bIsNumRuleItemAffected )
404 if ( nAssignedOutlineStyleLevel != -1 )
416 bool bAreListLevelIndentsApplicable(
true );
421 bAreListLevelIndentsApplicable =
false;
426 bAreListLevelIndentsApplicable =
false;
432 bAreListLevelIndentsApplicable =
true;
446 bAreListLevelIndentsApplicable =
false;
454 bAreListLevelIndentsApplicable =
true;
460 "<SwTextFormatColl::AreListLevelIndentsApplicable()> - something wrong in paragraph style hierarchy. The applied list style is not found." );
464 return bAreListLevelIndentsApplicable;
469 (
void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwTextFormatColl"));
470 (
void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
471 (
void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"symbol"),
"%s", BAD_CAST(
typeid(*this).name()));
472 (
void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"name"), BAD_CAST(
GetName().toUtf8().getStr()));
475 (
void)xmlTextWriterWriteAttribute(
480 (
void)xmlTextWriterWriteAttribute(
484 (
void)xmlTextWriterEndElement(pWriter);
489 (
void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwTextFormatColls"));
490 for (
size_t i = 0;
i <
size(); ++
i)
492 (
void)xmlTextWriterEndElement(pWriter);
499 :
SwClient( pColl ), m_nCondition( nMasterCond ),
500 m_nSubCondition( nSubCond )
505 :
SwClient( const_cast<
sw::BroadcastingModify*>(static_cast<const
sw::BroadcastingModify*>(rCopy.GetRegisteredIn())) ),
506 m_nCondition( rCopy.m_nCondition ),
507 m_nSubCondition( rCopy.m_nSubCondition )
550 for (SwFormatCollConditions::size_type
n = 0;
n <
m_CondColls.size(); ++
n)
560 m_CondColls.push_back( std::make_unique<SwCollCondition> (rCond) );
565 for (SwFormatCollConditions::size_type
n = 0;
n <
m_CondColls.size(); ++
n)
579 for (
const auto &rpFnd : rCndClls)
584 std::unique_ptr<SwCollCondition> pNew;
586 rpFnd->GetSubCondition() ));
594 OSL_ENSURE( 0 <= nLevel && nLevel <=
MAXLEVEL ,
"SwTextFormatColl: Level Out Of Range" );
596 o3tl::narrowing<sal_uInt16>(nLevel) ) );
607 "<SwTextFormatColl::GetAssignedOutlineStyleLevel()> - misuse of method");
619 while ( pDerivedTextFormatColl !=
nullptr )
634 pDerivedTextFormatColl = aIter.
Next();
const SwAttrSet * GetChgSet() const
What has changed.
void SetLinkedCharFormat(SwCharFormat &rLink)
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.
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
void dumpAsXml(xmlTextWriterPtr pWriter) const
sal_uInt16 GetLower() const
SwCollCondition(SwTextFormatColl *pColl, Master_CollCondition nMasterCond, sal_uLong nSubCond)
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(162)
SwCharFormat * mpLinkedCharFormat
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
constexpr sal_uInt8 MAXLEVEL
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
const SwCharFormat * GetLinkedCharFormat() const
constexpr TypedWhichId< SfxUInt16Item > RES_PARATR_OUTLINELEVEL(79)
void dumpAsXml(xmlTextWriterPtr pWriter) const
SwTextFormatColl * CopyTextColl(const SwTextFormatColl &rColl)
copy TextNodes
virtual ~SwTextFormatColl()
void dumpAsXml(xmlTextWriterPtr pWriter) const
SwTextFormatColl * mpNextTextFormatColl
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
#define SAL_N_ELEMENTS(arr)
sal_uInt16 GetPropRight() const
bool IsAtDocNodeSet() const
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)
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(163)
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)
struct _xmlTextWriter * xmlTextWriterPtr
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