27 #include <editeng/editeng.hxx>
38 #include <osl/diagnose.h>
67 OSL_ENSURE(
false,
"SwAttrPool already has a secondary pool (!)");
112 OSL_ENSURE(
false,
"SwAttrPool has no secondary pool, it's missing (!)");
120 OSL_ENSURE(
false,
"i don't accept additional pools");
136 :
SfxItemSet( rPool, {{nWh1, nWh2}} ), m_pOldSet(
nullptr ), m_pNewSet(
nullptr )
141 :
SfxItemSet( rPool, nWhichPairTable ), m_pOldSet( nullptr ), m_pNewSet( nullptr )
146 :
SfxItemSet( rSet ), m_pOldSet( nullptr ), m_pNewSet( nullptr )
152 if ( pToPool && pToPool !=
GetPool() )
155 std::unique_ptr<SfxItemSet> pTmpSet;
168 if ( SfxItemState::SET ==
GetItemState( nWhich,
false, &pItem ) )
169 pTmpSet->Put( *pItem );
177 return std::unique_ptr<SfxItemSet>(
216 OSL_ENSURE( nWhich1 <= nWhich2,
"no valid range" );
220 for( ; nWhich1 <= nWhich2; ++nWhich1 )
233 return pNew ? pNew->
Count() : ( pOld ? pOld->
Count() : 0 );
297 if( pCNd || pFormat )
302 std::unique_ptr<SfxStringItem> pNewListIdItem;
309 if( pSrcDoc != pDstDoc &&
325 if ( pSrcDoc != pDstDoc &&
331 const OUString& sListId = pStrItem->GetValue();
332 if ( !sListId.isEmpty() &&
337 const OUString& sDefaultListStyleName =
342 if ( !pDstDocNumRule )
364 if ( pNewListIdItem ==
nullptr &&
373 std::unique_ptr< SfxItemSet > tmpSet;
375 if( pSrcDoc != pDstDoc && SfxItemState::SET ==
GetItemState(
391 tmpSet->Put( aDesc );
405 if (pSrcDoc != pDstDoc &&
409 std::shared_ptr<SfxItemSet>
const pNewSet(
410 rAutoStyle.SfxItemSet::Clone(
true, &pDstDoc->
GetAttrPool()));
435 if ( pNewListIdItem !=
nullptr )
437 tmpSet->Put( *pNewListIdItem );
449 if ( pNewListIdItem !=
nullptr )
452 aTmpSet.
Put( *pNewListIdItem );
466 #if OSL_DEBUG_LEVEL > 0
468 OSL_FAIL(
"neither Format nor ContentNode - no Attributes copied");
473 bool IsInRange(
const sal_uInt16* pRange,
const sal_uInt16 nId )
477 if( *pRange <= nId && nId <= *(pRange+1) )
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(93)
SdrMetricItem makeSdrShadowYDistItem(tools::Long nDist)
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
SW_DLLPUBLIC const OUString & GetDefaultListStyleName() const
virtual void Changed(const SfxPoolItem &rOld, const SfxPoolItem &rNew) override
Notification callback.
SfxItemSet(const SfxItemSet &)
virtual SwList * createList(const OUString &rListId, const OUString &rDefaultListStyleName)=0
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
const OUString & GetDefaultListId() const
const OUString & GetName() const
void PutChgd(const SfxPoolItem &rI)
bool Put_BC(const SfxPoolItem &rAttr, SwAttrSet *pOld, SwAttrSet *pNew)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
const sal_uInt16 * GetFrozenIdRanges() const
constexpr TypedWhichId< SwFormatDrop > RES_PARATR_DROP(70)
constexpr sal_uInt16 POOLATTR_BEGIN(HINT_BEGIN)
void removeAndDeleteSecondaryPools()
bool IsInRange(const sal_uInt16 *pRange, const sal_uInt16 nId)
check if ID is in range of attribute set IDs
constexpr TypedWhichId< SwFormatCharFormat > RES_TXTATR_CHARFMT(52)
void Intersect(const SfxItemSet &rSet)
SwAttrPool * GetPool() const
virtual std::unique_ptr< SfxItemSet > Clone(bool bItems=true, SfxItemPool *pToPool=nullptr) const override
constexpr auto convert(N n, sal_Int64 mul, sal_Int64 div)
SwPageDesc * FindPageDesc(const OUString &rName, size_t *pPos=nullptr) const
void CopyToModify(sw::BroadcastingModify &rMod) const
SwNumRule * FindNumRulePtr(const OUString &rName) const
virtual SwList * getListByName(const OUString &rListId) const =0
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
T & StaticWhichCast(TypedWhichId< T > nId)
SwPageDesc * MakePageDesc(const OUString &rName, const SwPageDesc *pCpy=nullptr, bool bRegardLanguage=true, bool bBroadcast=false)
void createAndAddSecondaryPools()
int Intersect_BC(const SfxItemSet &rSet, SwAttrSet *pOld, SwAttrSet *pNew)
constexpr sal_uInt16 POOLATTR_END(RES_UNKNOWNATR_END)
static SfxItemPool * CreatePool()
SfxItemPool * GetSecondaryPool() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void CopyPageDesc(const SwPageDesc &rSrcDesc, SwPageDesc &rDstDesc, bool bCopyPoolIds=true)
Copy the complete PageDesc - beyond document and "deep"! Optionally copying of PoolFormatId, -HlpId can be prevented.
static void Free(SfxItemPool *pPool)
constexpr TypedWhichId< SwTableBoxFormula > RES_BOXATR_FORMULA(149)
void SetInvalidRule(bool bFlag)
virtual bool SetAttr(const SfxPoolItem &)
made virtual
virtual ~SwAttrPool() override
virtual std::unique_ptr< SfxItemSet > Clone(bool bItems=true, SfxItemPool *pToPool=nullptr) const
SdrMetricItem makeSdrShadowXDistItem(tools::Long nDist)
SwCharFormat * CopyCharFormat(const SwCharFormat &)
copy the char format
bool SetModifyAtAttr(const sw::BroadcastingModify *pModify)
special treatment for some attributes
const SwDoc * GetDoc() const
sal_uInt16 MakeNumRule(const OUString &rName, const SwNumRule *pCpy=nullptr, bool bBroadcast=false, const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode=SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
SwAttrSet(SwAttrPool &, sal_uInt16 nWhich1, sal_uInt16 nWhich2)
const sal_uInt16 * GetRanges() const
constexpr TypedWhichId< SwFormatAutoFormat > RES_PARATR_LIST_AUTOFMT(87)
void SetNumOffset(const ::std::optional< sal_uInt16 > &oNum)
IDocumentListsAccess const & getIDocumentListsAccess() const
sal_uInt16 ClearItem_BC(sal_uInt16 nWhich, SwAttrSet *pOld, SwAttrSet *pNew)
constexpr TypedWhichId< SfxStringItem > RES_PARATR_LIST_ID(RES_PARATR_LIST_BEGIN)
void SetSecondaryPool(SfxItemPool *pPool)
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
const SwAttrPool & GetAttrPool() const
void SetPoolDefaultItem(const SfxPoolItem &)