summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2016-03-16 15:02:01 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2016-03-17 23:54:43 +0100
commit47b6239950adef2ced7f4602acc7d6b22b9ca721 (patch)
treeab8ea30800d7f7058132c524b442432605fd5cc3
parentgetPropertyValues, getPropertyValue, setPropertyValue: formatting/whitespace (diff)
downloadcore-47b6239950adef2ced7f4602acc7d6b22b9ca721.tar.gz
core-47b6239950adef2ced7f4602acc7d6b22b9ca721.zip
GetItem/SetItem: use GetStyleSheetBase()
Change-Id: I7c3b563c6bd095ac9305a5cffdda206c5de94926
-rw-r--r--sw/source/core/unocore/unostyle.cxx32
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);
}