[Libreoffice-commits] .: sc/inc sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Jul 3 11:14:02 PDT 2012


 sc/inc/dpitemdata.hxx              |    1 +
 sc/source/core/data/dpcache.cxx    |    2 ++
 sc/source/core/data/dpitemdata.cxx |    6 ++++++
 3 files changed, 9 insertions(+)

New commits:
commit f2ac4ff6600a7d20a519e9ef9e6bcd8157288f63
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Tue Jul 3 14:08:14 2012 -0400

    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

diff --git a/sc/inc/dpitemdata.hxx b/sc/inc/dpitemdata.hxx
index 67f4af2..e294de8 100644
--- a/sc/inc/dpitemdata.hxx
+++ b/sc/inc/dpitemdata.hxx
@@ -89,6 +89,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 742b6eb..9163dde 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 1bcc3a6..1641572 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<Type>(meType);
 }
 
+void ScDPItemData::SetEmpty()
+{
+    DisposeString();
+    meType = Empty;
+}
+
 void ScDPItemData::SetString(const rtl::OUString& rS)
 {
     DisposeString();


More information about the Libreoffice-commits mailing list