diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2016-03-16 15:02:01 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2016-03-17 23:54:43 +0100 |
commit | 47b6239950adef2ced7f4602acc7d6b22b9ca721 (patch) | |
tree | ab8ea30800d7f7058132c524b442432605fd5cc3 /sw/source | |
parent | a4d50fa571ff24fb6d842675e550539de2a9c7da (diff) |
GetItem/SetItem: use GetStyleSheetBase()
Change-Id: I7c3b563c6bd095ac9305a5cffdda206c5de94926
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index adbd801bbc96..4c5490671119 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -3183,34 +3183,22 @@ SwXFrameStyle::~SwXFrameStyle() void SwXFrameStyle::SetItem(enum RES_FRMATR eAtr, const SfxPoolItem& rItem) { - // As I was told, for some entirely unobvious reason getting an - // item from a style has to look as follows: - SfxStyleSheetBasePool* pBasePool = m_pBasePool; - if (pBasePool) - { - SfxStyleSheetBase* pBase = pBasePool->Find(GetStyleName()); - if (pBase) - { - rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *static_cast<SwDocStyleSheet*>(pBase) ) ); - SfxItemSet& rStyleSet = xStyle->GetItemSet(); - SfxItemSet aSet(*rStyleSet.GetPool(), eAtr, eAtr); - aSet.Put(rItem); - xStyle->SetItemSet(aSet); - } - } + SfxStyleSheetBase* pBase = GetStyleSheetBase(); + if(!pBase) + return; + rtl::Reference<SwDocStyleSheet> xStyle(new SwDocStyleSheet(*static_cast<SwDocStyleSheet*>(pBase))); + SfxItemSet& rStyleSet = xStyle->GetItemSet(); + SfxItemSet aSet(*rStyleSet.GetPool(), eAtr, eAtr); + aSet.Put(rItem); + xStyle->SetItemSet(aSet); } const SfxPoolItem* SwXFrameStyle::GetItem(enum RES_FRMATR eAtr) { - // As I was told, for some entirely unobvious reason getting an - // item from a style has to look as follows: - SfxStyleSheetBasePool* pBasePool = m_pBasePool; - if(!pBasePool) - return nullptr; - SfxStyleSheetBase* pBase = pBasePool->Find(GetStyleName()); + SfxStyleSheetBase* pBase = GetStyleSheetBase(); if(!pBase) return nullptr; - rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *static_cast<SwDocStyleSheet*>(pBase)) ); + rtl::Reference<SwDocStyleSheet> xStyle(new SwDocStyleSheet(*static_cast<SwDocStyleSheet*>(pBase))); return &xStyle->GetItemSet().Get(eAtr); } |