From 6d91eaaf8695da3f0da767f2669fcc650e9a76a5 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 3 Jul 2012 14:08:14 -0400 Subject: fdo#51266: Properly set pivot item 'empty' on empty cells. Or else it would re-use the last non-empty cell value which is wrong. Change-Id: I3feab09a54e93150a7b6a9e9b4b540327f2ab5c5 --- sc/inc/dpitemdata.hxx | 1 + sc/source/core/data/dpcache.cxx | 2 ++ sc/source/core/data/dpitemdata.cxx | 6 ++++++ 3 files changed, 9 insertions(+) diff --git a/sc/inc/dpitemdata.hxx b/sc/inc/dpitemdata.hxx index 46642a95af13..c58584638f9f 100644 --- a/sc/inc/dpitemdata.hxx +++ b/sc/inc/dpitemdata.hxx @@ -91,6 +91,7 @@ public: ~ScDPItemData(); Type GetType() const; + void SetEmpty(); void SetString(const rtl::OUString& rS); void SetString(const rtl::OUString* pS); void SetValue(double fVal); diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx index 6908163a215f..2d2a0a3ddbe7 100644 --- a/sc/source/core/data/dpcache.cxx +++ b/sc/source/core/data/dpcache.cxx @@ -161,6 +161,8 @@ void initFromCell( { rData.SetString(rCache.InternString(aDocStr)); } + else + rData.SetEmpty(); } void getItemValue( diff --git a/sc/source/core/data/dpitemdata.cxx b/sc/source/core/data/dpitemdata.cxx index 1bcc3a6ecb9a..1641572f087e 100644 --- a/sc/source/core/data/dpitemdata.cxx +++ b/sc/source/core/data/dpitemdata.cxx @@ -138,6 +138,12 @@ ScDPItemData::Type ScDPItemData::GetType() const return static_cast(meType); } +void ScDPItemData::SetEmpty() +{ + DisposeString(); + meType = Empty; +} + void ScDPItemData::SetString(const rtl::OUString& rS) { DisposeString(); -- cgit v1.2.3