21#include <libxml/xmlwriter.h>
25#include <osl/diagnose.h>
47 if ( !pTextFormatColl )
49 OSL_FAIL(
"<TextFormatCollFunc::CheckTextFormatCollFuncForDeletionOfAssignmentToOutlineStyle> - misuse of method - it's only for instances of <SwTextFormatColl>" );
64 const OUString& sNumRuleName = pNewNumRuleItem->
GetValue();
65 if ( sNumRuleName.isEmpty() ||
81 const OUString& sNumRuleName = pNumRuleItem->
GetValue();
82 if ( !sNumRuleName.isEmpty() )
120 for (
const auto& pCharFormat : *
GetDoc()->GetCharFormats())
122 if (pCharFormat->GetLinkedParaFormat() ==
this)
124 pCharFormat->SetLinkedParaFormat(
nullptr);
130 if (rHint.
GetId() != SfxHintId::SwLegacyModify)
138 bool bNewParent(
false );
139 const SvxULSpaceItem *pNewULSpace =
nullptr, *pOldULSpace =
nullptr;
148 const SwAttrSetChg *pNewChgSet =
nullptr, *pOldChgSet =
nullptr;
149 const auto pOld = pLegacy->m_pOld;
150 const auto pNew = pLegacy->m_pNew;
151 switch( pLegacy->GetWhich() )
166 if ( bAssignedToListLevelOfOutlineStyle &&
213 if (bAssignedToListLevelOfOutlineStyle)
223 if ( bAssignedToListLevelOfOutlineStyle && pNewNumRuleItem )
226 this, pNewNumRuleItem );
229 bool bContinue =
true;
233 if (pNewFirstLineIndent && pOldFirstLineIndent)
235 if (pOldFirstLineIndent != pNewFirstLineIndent)
250 bContinue =
nullptr != pOldChgSet || bNewParent;
254 else if( pNewChgSet )
259 if (pNewTextLeftMargin && pOldTextLeftMargin)
261 if (pOldTextLeftMargin != pNewTextLeftMargin)
276 bContinue =
nullptr != pOldChgSet || bNewParent;
280 else if( pNewChgSet )
285 if (pNewRightMargin && pOldRightMargin)
287 if (pOldRightMargin != pNewRightMargin)
301 bContinue =
nullptr != pOldChgSet || bNewParent;
305 else if( pNewChgSet )
311 pOldULSpace != pNewULSpace )
332 bContinue =
nullptr != pOldChgSet || bNewParent;
336 else if( pNewChgSet )
344 pFSize->Which(),
false,
reinterpret_cast<const SfxPoolItem**
>(&pOldFSize) )) &&
346 pFSize != pOldFSize )
348 if( 100 == pOldFSize->GetProp() &&
349 MapUnit::MapRelative == pOldFSize->GetPropUnit() )
359 sal_uInt32 nTmp = pOldFSize->GetHeight();
362 pOldFSize->GetPropUnit() );
366 bContinue =
nullptr != pOldChgSet || bNewParent;
370 else if( pNewChgSet )
389 if( &(pNode->GetNodes()) == &rNds )
398 if ( bIsNumRuleItem )
405 if ( bIsNumRuleItem )
415 const bool bIsNumRuleItemAffected =
417 if ( bIsNumRuleItemAffected )
424 if ( bIsNumRuleItemAffected )
434 const bool bIsNumRuleItemAffected =
435 ( nWhich2 != 0 && nWhich2 > nWhich1 )
439 if ( bIsNumRuleItemAffected )
465 if ( nAssignedOutlineStyleLevel != -1 )
480 ret |= ::sw::ListLevelIndents::FirstLine;
491 bool bAreListLevelIndentsApplicable(
true );
496 bAreListLevelIndentsApplicable =
false;
498 else if (
GetItemState(nWhich,
false ) == SfxItemState::SET)
501 bAreListLevelIndentsApplicable =
false;
507 bAreListLevelIndentsApplicable =
true;
521 bAreListLevelIndentsApplicable =
false;
529 bAreListLevelIndentsApplicable =
true;
535 "<SwTextFormatColl::AreListLevelIndentsApplicable()> - something wrong in paragraph style hierarchy. The applied list style is not found." );
539 return bAreListLevelIndentsApplicable;
544 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwTextFormatColl"));
545 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
546 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"symbol"),
"%s", BAD_CAST(
typeid(*this).name()));
547 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"name"), BAD_CAST(
GetName().toUtf8().getStr()));
550 (void)xmlTextWriterWriteAttribute(
555 (void)xmlTextWriterWriteAttribute(
559 (void)xmlTextWriterEndElement(pWriter);
564 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwTextFormatColls"));
565 for (
size_t i = 0;
i <
size(); ++
i)
567 (void)xmlTextWriterEndElement(pWriter);
573 sal_uInt32 nSubCond )
574 :
SwClient( pColl ), m_nCondition( nMasterCond ),
575 m_nSubCondition( nSubCond )
580 :
SwClient( const_cast<
sw::BroadcastingModify*>(static_cast<const
sw::BroadcastingModify*>(rCopy.GetRegisteredIn())) ),
581 m_nCondition( rCopy.m_nCondition ),
582 m_nSubCondition( rCopy.m_nSubCondition )
625 for (SwFormatCollConditions::size_type
n = 0;
n <
m_CondColls.size(); ++
n)
635 m_CondColls.push_back( std::make_unique<SwCollCondition> (rCond) );
640 for (SwFormatCollConditions::size_type
n = 0;
n <
m_CondColls.size(); ++
n)
654 for (
const auto &rpFnd : rCndClls)
659 std::unique_ptr<SwCollCondition> pNew;
661 rpFnd->GetSubCondition() ));
668 OSL_ENSURE( 0 <= nLevel && nLevel <=
MAXLEVEL ,
"SwTextFormatColl: Level Out Of Range" );
670 o3tl::narrowing<sal_uInt16>(nLevel) ) );
681 "<SwTextFormatColl::GetAssignedOutlineStyleLevel()> - misuse of method");
693 while ( pDerivedTextFormatColl !=
nullptr )
708 pDerivedTextFormatColl = aIter.
Next();
const OUString & GetValue() const
void dumpAsXml(xmlTextWriterPtr pWriter) const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxItemSet * GetParent() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
T & StaticWhichCast(TypedWhichId< T > nId)
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
sal_uInt16 GetPropTextFirstLineOffset() const
short GetTextFirstLineOffset() const
sal_uInt32 GetHeight() const
void SetHeight(sal_uInt32 nNewHeight, const sal_uInt16 nNewProp=100, MapUnit eUnit=MapUnit::MapRelative)
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
tools::Long GetRight() const
sal_uInt16 GetPropRight() const
void SetTextLeft(const tools::Long nL, const sal_uInt16 nProp=100)
sal_uInt16 GetPropLeft() const
tools::Long GetTextLeft() const
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
sal_uInt16 GetPropLower() const
sal_uInt16 GetUpper() const
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
sal_uInt16 GetLower() const
sal_uInt16 GetPropUpper() const
const SwAttrSet * GetTheChgdSet() const
Where it has changed.
const SwAttrSet * GetChgSet() const
What has changed.
void Delete(const void *pOwner, sal_uInt16 nIndex)
void RegisterToFormat(SwFormat &)
void SetCondition(Master_CollCondition nCond, sal_uInt32 nSubCond)
Master_CollCondition m_nCondition
SwCollCondition(SwTextFormatColl *pColl, Master_CollCondition nMasterCond, sal_uInt32 nSubCond)
bool operator==(const SwCollCondition &rCmp) const
virtual ~SwCollCondition() override
sal_uInt32 m_nSubCondition
SwFormatCollConditions m_CondColls
void InsertCondition(const SwCollCondition &rCond)
void RemoveCondition(const SwCollCondition &rCond)
virtual ~SwConditionTextFormatColl() override
void SetConditions(const SwFormatCollConditions &)
const SwCollCondition * HasCondition(const SwCollCondition &rCond) const
SwTextFormatColl * CopyTextColl(const SwTextFormatColl &rColl)
copy TextNodes
SwNumRule * FindNumRulePtr(const OUString &rName) const
SwNumRule * GetOutlineNumRule() const
void AddParagraphStyle(SwTextFormatColl &rTextFormatColl)
void RemoveParagraphStyle(SwTextFormatColl &rTextFormatColl)
const OUString & GetName() const
Represents the style of a paragraph.
void SetAttrOutlineLevel(int)
SwCharFormat * mpLinkedCharFormat
bool mbAssignedToOutlineStyle
bool AreListLevelIndentsApplicableImpl(sal_uInt16 nWhich) const
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0) override
bool StayAssignedToListLevelOfOutlineStyle() const
void SetLinkedCharFormat(SwCharFormat *pLink)
bool IsAssignedToListLevelOfOutlineStyle() const
virtual ~SwTextFormatColl()
void dumpAsXml(xmlTextWriterPtr pWriter) const
void DeleteAssignmentToListLevelOfOutlineStyle()
virtual bool SetFormatAttr(const SfxPoolItem &rAttr) override
Override to recognize changes on the <SwNumRuleItem> and register/unregister the paragragh style at t...
void AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
SwTextFormatColl * mpNextTextFormatColl
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
To get UL- / LR- / FontHeight-changes.
virtual sal_uInt16 ResetAllFormatAttr() override
Override <ResetAllFormatAttr()> to stay assigned to list level of outline style.
::sw::ListLevelIndents AreListLevelIndentsApplicable() const
int GetAssignedOutlineStyleLevel() const
bool IsAtDocNodeSet() const
const SwCharFormat * GetLinkedCharFormat() const
int GetAttrOutlineLevel() const
bool mbStayAssignedToListLevelOfOutlineStyle
void dumpAsXml(xmlTextWriterPtr pWriter) const
struct _xmlTextWriter * xmlTextWriterPtr
Master_CollCondition
Conditional styles.
std::vector< std::unique_ptr< SwCollCondition > > SwFormatCollConditions
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr TypedWhichId< SvxFirstLineIndentItem > RES_MARGIN_FIRSTLINE(91)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(169)
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
constexpr TypedWhichId< SvxRightMarginItem > RES_MARGIN_RIGHT(93)
constexpr TypedWhichId< SvxTextLeftMarginItem > RES_MARGIN_TEXTLEFT(92)
constexpr TypedWhichId< SfxUInt16Item > RES_PARATR_OUTLINELEVEL(79)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(168)
#define SAL_N_ELEMENTS(arr)
SwNumRule * GetNumRule(SwTextFormatColl &rTextFormatColl)
determines the list style, which directly set at the given paragraph style
void RemoveFromNumRule(SwTextFormatColl &rTextFormatColl)
removes the given paragraph style from the directly set list style
void CheckTextFormatCollForDeletionOfAssignmentToOutlineStyle(SwFormat *pFormat, const SwNumRuleItem *pNewNumRuleItem)
Checks, if assignment of paragraph style to list level of outline style has to be deleted,...
void AddToNumRule(SwTextFormatColl &rTextFormatColl)
adds the given paragraph style at the directly set list style
Dialog to specify the properties of date form field.
const wchar_t *typedef int(__stdcall *DllNativeUnregProc)(int
SwFontCache * pSwFontCache
constexpr sal_uInt8 MAXLEVEL