summaryrefslogtreecommitdiff
path: root/sc/source/core/data/dptabsrc.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/data/dptabsrc.cxx')
-rw-r--r--sc/source/core/data/dptabsrc.cxx17
1 files changed, 12 insertions, 5 deletions
diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
index 4d680aeedcae..bbf92170e6e2 100644
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -2583,7 +2583,8 @@ bool ScDPMember::IsNamedItem(SCROW nIndex) const
(long)::rtl::math::approxFloor( pData->GetValue() ),
nHier, nLev );
// fValue is converted from integer, so simple comparison works
- return nComp == GetItemData().GetValue();
+ const ScDPItemData* pData2 = GetItemData();
+ return pData2 && nComp == pData2->GetValue();
}
}
@@ -2619,7 +2620,8 @@ void ScDPMember::FillItemData( ScDPItemData& rData ) const
{
//! handle date hierarchy...
- rData = GetItemData() ;
+ const ScDPItemData* pData = GetItemData();
+ rData = (pData ? *pData : ScDPItemData());
}
const OUString* ScDPMember::GetLayoutName() const
@@ -2634,7 +2636,10 @@ long ScDPMember::GetDim() const
rtl::OUString ScDPMember::GetNameStr() const
{
- return pSource->GetData()->GetFormattedString(nDim, GetItemData());
+ const ScDPItemData* pData = GetItemData();
+ if (pData)
+ return pSource->GetData()->GetFormattedString(nDim, *pData);
+ return rtl::OUString();
}
::rtl::OUString SAL_CALL ScDPMember::getName() throw(uno::RuntimeException)
@@ -2729,9 +2734,11 @@ const ScDPCache* ScDPSource::GetCache()
return ( GetData()!=NULL) ? GetData()->GetCacheTable().getCache() : NULL ;
}
-const ScDPItemData& ScDPMember::GetItemData() const
+const ScDPItemData* ScDPMember::GetItemData() const
{
- return *pSource->GetItemDataById(nDim, mnDataId);
+ const ScDPItemData* pData = pSource->GetItemDataById(nDim, mnDataId);
+ SAL_WARN_IF( !pData, "sc", "ScDPMember::GetItemData: what data? nDim " << nDim << ", mnDataId " << mnDataId);
+ return pData;
}
const ScDPItemData* ScDPSource::GetItemDataById(long nDim, long nId)