summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/inc/conditio.hxx7
-rw-r--r--sc/source/core/data/conditio.cxx4
2 files changed, 3 insertions, 8 deletions
diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index af571fd7c982..6d23033b0ddd 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -382,12 +382,7 @@ public:
private:
condformat::ScCondFormatDateType meType;
- struct ScCondDateFormatCache
- {
- Date aCachedDate;
- };
-
- boost::scoped_ptr<ScCondDateFormatCache> mpCache;
+ mutable boost::scoped_ptr<Date> mpCache;
rtl::OUString maStyleName;
};
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 987e75ecaa1c..28d585fcf4c7 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1663,9 +1663,9 @@ bool ScCondDateFormatEntry::IsValid( const ScAddress& rPos ) const
return false;
if( !mpCache )
- mpCache->aCachedDate = Date( Date::SYSTEM );
+ mpCache.reset( new Date( Date::SYSTEM ) );
- const Date& rActDate = mpCache->aCachedDate;
+ const Date& rActDate = *mpCache;
SvNumberFormatter* pFormatter = mpDoc->GetFormatTable();
long nCurrentDate = rActDate - *(pFormatter->GetNullDate());