ooo-build r13925 - in trunk: . patches/dev300
- From: kyoshida svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r13925 - in trunk: . patches/dev300
- Date: Wed, 17 Sep 2008 19:52:58 +0000 (UTC)
Author: kyoshida
Date: Wed Sep 17 19:52:58 2008
New Revision: 13925
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13925&view=rev
Log:
2008-09-17 Kohei Yoshida <kyoshida novell com>
* patches/dev300/calc-dp-drilldown-hidden-items.diff: correctly
evaluate the visibilities of dimension members & reduce memory
footprint of the datapilot cache tables (n#403151, i#93918, i#93998).
* patches/dev300/apply: apply the new patch.
* patches/dev300/unused-methods-removal-sc.diff: adjusted to make it
apply again.
Added:
trunk/patches/dev300/calc-dp-drilldown-hidden-items.diff
Modified:
trunk/ChangeLog
trunk/patches/dev300/apply
trunk/patches/dev300/unused-methods-removal-sc.diff
Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply (original)
+++ trunk/patches/dev300/apply Wed Sep 17 19:52:58 2008
@@ -773,6 +773,10 @@
# fixed change track export to xls files wrt cell change records.
calc-change-track-xls-export-fix.diff, n#416045, i#93839, kohei
+# correctly evaluate the visibility of dimension members when generating a
+# drill-down sheet & also reduce memory use on cache tables.
+calc-dp-drilldown-hidden-items.diff i#93918, i#93998, kohei
+
[ CalcFixes < ooo300-m3 ]
# Fix a regression on filtering by page field.
calc-fix-datapilot-date-filter.diff, i#90022, kohei
Added: trunk/patches/dev300/calc-dp-drilldown-hidden-items.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/calc-dp-drilldown-hidden-items.diff Wed Sep 17 19:52:58 2008
@@ -0,0 +1,1603 @@
+diff --git sc/inc/dpcachetable.hxx sc/inc/dpcachetable.hxx
+index e894eed..deaa0f2 100644
+--- sc/inc/dpcachetable.hxx
++++ sc/inc/dpcachetable.hxx
+@@ -38,8 +38,8 @@
+ #include "collect.hxx"
+
+ #include <vector>
+-#include <set>
+ #include <hash_map>
++#include <hash_set>
+ #include <boost/shared_ptr.hpp>
+ #include <com/sun/star/uno/Reference.hxx>
+
+@@ -57,62 +57,24 @@ class Date;
+ class ScDocument;
+ class ScRange;
+ class ScDPDimension;
++class ScDPCollection;
++class ScDPCacheCell;
+ struct ScDPItemData;
+ class Date;
+
+ // ----------------------------------------------------------------------------
+
+-/** public interface for string-sharing */
+-class ScSharedString
+-{
+-public:
+- static const sal_Int32 EMPTY = 0;
+-
+- static const String* getString(sal_Int32 nId);
+- static sal_Int32 getStringId(const String& aStr);
+- static sal_Int32 insertString(const String& aStr);
+-
+-private:
+-
+- /** internal shared string table implementation */
+- class StringTable
+- {
+- public:
+- sal_Int32 insertString(const String& aStr);
+- sal_Int32 getStringId(const String& aStr);
+- const String* getString(sal_Int32 nId) const;
+-
+- StringTable();
+- ~StringTable();
+-
+- private:
+- typedef ::std::hash_map< String, sal_Int32, ScStringHashCode, ::std::equal_to< String > > SharedStrMap;
+-
+- ::std::vector<String> maSharedStrings;
+- SharedStrMap maSharedStringIds;
+- sal_Int32 mnStrCount;
+- };
+-
+- static ::osl::Mutex maStrMutex;
+- static StringTable maStringTable;
+-};
+-
+-// ----------------------------------------------------------------------------
+-
+ class ScDPCacheTable
+ {
+ public:
+
+- /** individual cell within table. */
+ struct Cell
+ {
+- SCROW mnCategoryRef;
+- sal_Int32 mnStrId;
+- sal_uInt8 mnType;
+- double mfValue;
+- bool mbNumeric;
++ SCROW mnCategoryRef;
++ ScDPCacheCell* mpContent;
+
+ Cell();
++ ~Cell();
+ };
+
+ /** individual filter item used in SingleFilter and GroupFilter. */
+@@ -131,38 +93,47 @@ public:
+ public:
+ /** returns true if the matching condition is met for a single cell
+ value, or false otherwise. */
+- virtual bool match(const Cell& rCell) const = 0;
++ virtual bool match(const ScDPCacheCell& rCell) const = 0;
+ };
+
+ /** ordinary single-item filter. */
+ class SingleFilter : public FilterBase
+ {
+ public:
+- explicit SingleFilter();
+- explicit SingleFilter(sal_Int32 nMatchStrId, double fValue, bool bHasValue);
++ explicit SingleFilter(ScSimpleSharedString& rSharedString,
++ sal_Int32 nMatchStrId, double fValue, bool bHasValue);
+
+- virtual bool match(const Cell& rCell) const;
++ virtual bool match(const ScDPCacheCell& rCell) const;
+
+- const String getMatchString() const;
++ const String getMatchString();
+ double getMatchValue() const;
+ bool hasValue() const;
+
+ private:
++ explicit SingleFilter();
++
+ FilterItem maItem;
++ ScSimpleSharedString mrSharedString;
+ };
+
+ /** multi-item (group) filter. */
+ class GroupFilter : public FilterBase
+ {
+ public:
+- GroupFilter();
++ GroupFilter(ScSimpleSharedString& rSharedString);
+ virtual ~GroupFilter(){}
+- virtual bool match(const Cell& rCell) const;
++ virtual bool match(const ScDPCacheCell& rCell) const;
+
++ void setMatchIfFound(bool b);
+ void addMatchItem(const String& rStr, double fVal, bool bHasValue);
++ size_t getMatchItemCount() const;
+
+ private:
++ GroupFilter();
++
+ ::std::vector<FilterItem> maItems;
++ ScSimpleSharedString mrSharedString;
++ bool mbMatchIfFound;
+ };
+
+ /** single filtering criterion. */
+@@ -174,7 +145,7 @@ public:
+ Criterion();
+ };
+
+- ScDPCacheTable();
++ ScDPCacheTable(ScDPCollection* pCollection);
+ ~ScDPCacheTable();
+
+ sal_Int32 getHeaderSize() const;
+@@ -203,7 +174,7 @@ public:
+ /** Get the cell instance at specified location within the data grid. Note
+ that the data grid doesn't include the header row. Don't delete the
+ returned object! */
+- const ::ScDPCacheTable::Cell* getCell(SCCOL nCol, SCROW nRow, bool bRepeatIfEmpty = false) const;
++ const ScDPCacheCell* getCell(SCCOL nCol, SCROW nRow, bool bRepeatIfEmpty = false) const;
+
+ const String* getFieldName(sal_Int32 nIndex) const;
+
+@@ -229,12 +200,14 @@ public:
+ bool empty() const;
+
+ private:
++ ScDPCacheTable();
++ ScDPCacheTable(const ScDPCacheTable&);
++
+ /**
+ * Check if a given row meets all specified criteria.
+ */
+ bool isRowQualified(sal_Int32 nRow, const ::std::vector<Criterion>& rCriteria, bool bRepeatIfEmpty) const;
+- void getValueData(ScDocument* pDoc, const ScAddress& rPos, Cell& rCell);
+- ScDPCacheTable::Cell getSelectedDimension(ScDPDimension* pDim) const;
++ void getValueData(ScDocument* pDoc, const ScAddress& rPos, ScDPCacheCell& rCell);
+
+ private:
+ typedef ::boost::shared_ptr<TypedStrCollection> TypedStrCollectionPtr;
+@@ -251,6 +224,9 @@ private:
+ /** used to track visibility of rows. The first row below the header row
+ has the index of 0. */
+ ::std::vector<bool> maRowsVisible;
++
++ ScSimpleSharedString& mrSharedString;
++ ScDPCollection* mpCollection;
+ };
+
+
+diff --git sc/inc/dpgroup.hxx sc/inc/dpgroup.hxx
+index 391f5fb..1749a1a 100644
+--- sc/inc/dpgroup.hxx
++++ sc/inc/dpgroup.hxx
+@@ -196,7 +196,7 @@ class ScDPGroupTableData : public ScDPTableData
+ void GetNumGroupInfo( long nDimension, ScDPNumGroupInfo& rInfo,
+ bool& rNonInteger, sal_Unicode& rDecimal );
+
+- void ModifyFilterCriteria(::std::vector<ScDPCacheTable::Criterion>& rCriteria) const;
++ void ModifyFilterCriteria(::std::vector<ScDPCacheTable::Criterion>& rCriteria);
+
+ public:
+ // takes ownership of pSource
+diff --git sc/inc/dpobject.hxx sc/inc/dpobject.hxx
+index 42ca145..42719c0 100644
+--- sc/inc/dpobject.hxx
++++ sc/inc/dpobject.hxx
+@@ -250,11 +250,39 @@ public:
+ PivotField* pRefPageFields = NULL, SCSIZE nRefPageCount = 0 );
+ };
+
++// ============================================================================
++
++struct ScDPCacheCell
++{
++ sal_Int32 mnStrId;
++ sal_uInt8 mnType;
++ double mfValue;
++ bool mbNumeric;
++
++ ScDPCacheCell();
++ ScDPCacheCell(const ScDPCacheCell& r);
++ ~ScDPCacheCell();
++};
++
++// ============================================================================
+
+ class ScDPCollection : public Collection
+ {
+ private:
+ ScDocument* pDoc;
++ ScSimpleSharedString maSharedString;
++
++ struct CacheCellHash
++ {
++ size_t operator()(const ScDPCacheCell* pCell) const;
++ };
++ struct CacheCellEqual
++ {
++ bool operator()(const ScDPCacheCell* p1, const ScDPCacheCell* p2) const;
++ };
++ typedef ::std::hash_set<ScDPCacheCell*, CacheCellHash, CacheCellEqual> CacheCellPoolType;
++
++ CacheCellPoolType maCacheCellPool;
+
+ public:
+ ScDPCollection(ScDocument* pDocument);
+@@ -279,7 +307,12 @@ public:
+ void WriteRefsTo( ScDPCollection& r ) const;
+
+ String CreateNewName( USHORT nMin = 1 ) const;
+- void EnsureNames();
++ void EnsureNames();
++
++ ScSimpleSharedString& GetSharedString();
++
++ ScDPCacheCell* getCacheCellFromPool(const ScDPCacheCell& rCell);
++ void clearCacheCellPool();
+ };
+
+
+diff --git sc/inc/dpsdbtab.hxx sc/inc/dpsdbtab.hxx
+index c007658..788ad86 100644
+--- sc/inc/dpsdbtab.hxx
++++ sc/inc/dpsdbtab.hxx
+@@ -44,6 +44,7 @@ namespace com { namespace sun { namespace star {
+ #include <set>
+
+ class ScDPCacheTable;
++class ScDocument;
+
+ // --------------------------------------------------------------------
+ //
+@@ -75,6 +76,7 @@ private:
+
+ public:
+ ScDatabaseDPData(
++ ScDocument* pDoc,
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::lang::XMultiServiceFactory > xSMgr,
+ const ScImportSourceDesc& rImport );
+diff --git sc/inc/dptabdat.hxx sc/inc/dptabdat.hxx
+index acb8ce0..4946df3 100644
+--- sc/inc/dptabdat.hxx
++++ sc/inc/dptabdat.hxx
+@@ -46,6 +46,7 @@ namespace com { namespace sun { namespace star { namespace sheet {
+ }}}}
+
+ class TypedStrCollection;
++class ScSimpleSharedString;
+
+ // -----------------------------------------------------------------------
+
+@@ -112,6 +113,7 @@ class ScDPDimension;
+ class ScDPLevel;
+ class ScDPInitState;
+ class ScDPResultMember;
++class ScDocument;
+
+ class ScDPTableData
+ {
+@@ -120,6 +122,7 @@ class ScDPTableData
+ long nLastHier;
+ long nLastLevel;
+ long nLastRet;
++ ScSimpleSharedString& mrSharedString;
+
+ public:
+
+@@ -146,7 +149,7 @@ public:
+ CalcInfo();
+ };
+
+- ScDPTableData();
++ ScDPTableData(ScDocument* pDoc);
+ virtual ~ScDPTableData();
+
+ long GetDatePart( long nDateVal, long nHierarchy, long nLevel );
+@@ -165,11 +168,11 @@ public:
+
+ virtual bool IsRepeatIfEmpty();
+
+- virtual void CreateCacheTable();
+- virtual void FilterCacheTable(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria);
++ virtual void CreateCacheTable() = 0;
++ virtual void FilterCacheTable(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria) = 0;
+ virtual void GetDrillDownData(const ::std::vector<ScDPCacheTable::Criterion>& rCriteria,
+- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& rData);
+- virtual void CalcResults(CalcInfo& rInfo, bool bAutoShow);
++ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& rData) = 0;
++ virtual void CalcResults(CalcInfo& rInfo, bool bAutoShow) = 0;
+ virtual const ScDPCacheTable& GetCacheTable() const = 0;
+
+ // overloaded in ScDPGroupTableData:
+@@ -181,6 +184,8 @@ public:
+ virtual BOOL HasCommonElement( const ScDPItemData& rFirstData, long nFirstIndex,
+ const ScDPItemData& rSecondData, long nSecondIndex ) const;
+
++ ScSimpleSharedString& GetSharedString();
++
+ protected:
+ /** This structure stores vector arrays that hold intermediate data for
+ each row during cache table iteration. */
+diff --git sc/inc/dptabres.hxx sc/inc/dptabres.hxx
+index dbe1b35..3fb5ef8 100644
+--- sc/inc/dptabres.hxx
++++ sc/inc/dptabres.hxx
+@@ -31,14 +31,15 @@
+ #ifndef SC_DPTABRES_HXX
+ #define SC_DPTABRES_HXX
+
+-#include <vector>
+ #include <svtools/svarray.hxx>
+ #include <tools/string.hxx>
+ #include <com/sun/star/sheet/MemberResult.hpp>
+ #include <com/sun/star/sheet/DataResult.hpp>
+ #include <com/sun/star/uno/Sequence.hxx>
+ #include "global.hxx" // enum ScSubTotalFunc
++#include "dpcachetable.hxx"
+ #include <hash_map>
++#include <hash_set>
+ #include <vector>
+
+ namespace com { namespace sun { namespace star { namespace sheet {
+@@ -50,10 +51,12 @@ class ScAddress;
+ class ScDocument;
+ class ScDPSource;
+ class ScDPDimension;
++class ScDPDimensions;
+ class ScDPLevel;
+ class ScDPMember;
+ class ScDPAggData;
+ class ScDPResultMember;
++class ScDPResultVisibilityData;
+
+ struct ScDPValueData;
+ struct ScDPItemData;
+@@ -370,6 +373,8 @@ public:
+ const ScDPLevel* GetParentLevel() const { return pParentLevel; } //! Ref
+
+ ScDPAggData* GetColTotal( long nMeasure ) const;
++
++ void FillVisibilityData(ScDPResultVisibilityData& rData) const;
+ };
+
+ class ScDPDataMember
+@@ -538,6 +543,8 @@ public:
+ long GetAutoCount() const { return nAutoCount; }
+
+ ScDPResultDimension* GetFirstChildDimension() const;
++
++ void FillVisibilityData(ScDPResultVisibilityData& rData) const;
+ };
+
+ class ScDPDataDimension
+@@ -580,5 +587,33 @@ public:
+ ScDPDataMember* GetMember(long n) const;
+ };
+
++// ----------------------------------------------------------------------------
++
++/**
++ * This class collects visible members of each dimension and uses that
++ * information to create filtering criteria (e.g. for drill-down data).
++ */
++class ScDPResultVisibilityData
++{
++public:
++ ScDPResultVisibilityData(ScSimpleSharedString& rSharedString, ScDPSource* pSource);
++ ~ScDPResultVisibilityData();
++
++ void addVisibleMember(const String& rDimName, const ScDPItemData& rMemberItem);
++ void fillFieldFilters(::std::vector<ScDPCacheTable::Criterion>& rFilters) const;
++
++private:
++ struct MemberHash
++ {
++ size_t operator()(const ScDPItemData& r) const;
++ };
++ typedef ::std::hash_set<ScDPItemData, MemberHash> VisibleMemberType;
++ typedef ::std::hash_map<String, VisibleMemberType, ScStringHashCode> DimMemberType;
++ DimMemberType maDimensions;
++
++ ScSimpleSharedString& mrSharedString;
++ ScDPSource* mpSource;
++};
++
+ #endif
+
+diff --git sc/inc/global.hxx sc/inc/global.hxx
+index 7cd5b8b..f239322 100644
+--- sc/inc/global.hxx
++++ sc/inc/global.hxx
+@@ -38,6 +38,8 @@
+ #include <com/sun/star/uno/Reference.hxx>
+ #include "scdllapi.h"
+
++#include <hash_map>
++
+ class ImageList;
+ class Bitmap;
+ class SfxItemSet;
+@@ -895,6 +897,46 @@ struct ScConsolidateParam
+ };
+
+ // -----------------------------------------------------------------------
++
++class ScSimpleSharedString
++{
++public:
++ static const sal_Int32 EMPTY = 0;
++
++ ScSimpleSharedString();
++ ScSimpleSharedString(const ScSimpleSharedString& r);
++ ~ScSimpleSharedString();
++
++ const String* getString(sal_Int32 nId);
++ sal_Int32 getStringId(const String& aStr);
++ sal_Int32 insertString(const String& aStr);
++
++private:
++
++ /** internal shared string table implementation */
++ class StringTable
++ {
++ public:
++ sal_Int32 insertString(const String& aStr);
++ sal_Int32 getStringId(const String& aStr);
++ const String* getString(sal_Int32 nId) const;
++
++ StringTable();
++ StringTable(const StringTable& r);
++ ~StringTable();
++
++ private:
++ typedef ::std::hash_map< String, sal_Int32, ScStringHashCode, ::std::equal_to< String > > SharedStrMap;
++
++ ::std::vector<String> maSharedStrings;
++ SharedStrMap maSharedStringIds;
++ sal_Int32 mnStrCount;
++ };
++
++ StringTable maStringTable;
++};
++
++// -----------------------------------------------------------------------
+ extern ::utl::TransliterationWrapper* GetScGlobalpTransliteration();//CHINA001
+ extern const LocaleDataWrapper* GetScGlobalpLocaleData();
+
+diff --git sc/source/core/data/dpcachetable.cxx sc/source/core/data/dpcachetable.cxx
+index 1be291c..f04cc44 100644
+--- sc/source/core/data/dpcachetable.cxx
++++ sc/source/core/data/dpcachetable.cxx
+@@ -37,8 +37,7 @@
+ #include "cell.hxx"
+ #include "dptabdat.hxx"
+ #include "dptabsrc.hxx"
+-
+-#include <stdio.h>
++#include "dpobject.hxx"
+
+ #include <com/sun/star/i18n/LocaleDataItem.hpp>
+ #include <com/sun/star/sdbc/DataType.hpp>
+@@ -56,7 +55,7 @@ using namespace ::com::sun::star;
+
+ using ::rtl::OUString;
+ using ::std::vector;
+-using ::std::set;
++using ::std::pair;
+ using ::std::hash_map;
+ using ::std::auto_ptr;
+ using ::com::sun::star::i18n::LocaleDataItem;
+@@ -76,94 +75,26 @@ static BOOL lcl_HasQueryEntry( const ScQueryParam& rParam )
+ rParam.GetEntry(0).bDoQuery;
+ }
+
+-ScSharedString::StringTable::StringTable() :
+- mnStrCount(0)
+-{
+- // empty string (ID = 0)
+- maSharedStrings.push_back(String());
+- maSharedStringIds.insert( SharedStrMap::value_type(String(), mnStrCount++) );
+-}
+-
+-ScSharedString::StringTable::~StringTable()
+-{
+-}
+-
+-sal_Int32 ScSharedString::StringTable::insertString(const String& aStr)
+-{
+- SharedStrMap::const_iterator itr = maSharedStringIds.find(aStr),
+- itrEnd = maSharedStringIds.end();
+-
+- if (itr == itrEnd)
+- {
+- // new string.
+- maSharedStrings.push_back(aStr);
+- maSharedStringIds.insert( SharedStrMap::value_type(aStr, mnStrCount) );
+- return mnStrCount++;
+- }
+-
+- // existing string.
+- return itr->second;
+-}
+-
+-sal_Int32 ScSharedString::StringTable::getStringId(const String& aStr)
+-{
+- SharedStrMap::const_iterator itr = maSharedStringIds.find(aStr),
+- itrEnd = maSharedStringIds.end();
+- if (itr == itrEnd)
+- {
+- // string not found.
+- return insertString(aStr);
+- }
+- return itr->second;
+-}
+-
+-const String* ScSharedString::StringTable::getString(sal_Int32 nId) const
+-{
+- if (nId >= mnStrCount)
+- return NULL;
+-
+- return &maSharedStrings[nId];
+-}
+-
+ // ----------------------------------------------------------------------------
+
+-// static
+-::osl::Mutex ScSharedString::maStrMutex;
+-ScSharedString::StringTable ScSharedString::maStringTable;
+-
+-sal_Int32 ScSharedString::insertString(const String& aStr)
+-{
+- ::osl::MutexGuard aGuard(maStrMutex);
+- return maStringTable.insertString(aStr);
+-}
+-
+-const String* ScSharedString::getString(sal_Int32 nId)
+-{
+- ::osl::MutexGuard aGuard(maStrMutex);
+- return maStringTable.getString(nId);
+-}
+-
+-sal_Int32 ScSharedString::getStringId(const String& aStr)
+-{
+- ::osl::MutexGuard aGuard(maStrMutex);
+- return maStringTable.getStringId(aStr);
+-}
++static ScDPCacheCell EmptyCellContent = ScDPCacheCell();
+
+ // ----------------------------------------------------------------------------
+
+ ScDPCacheTable::Cell::Cell() :
+ mnCategoryRef(0),
+- mnStrId(ScSharedString::EMPTY),
+- mnType(SC_VALTYPE_EMPTY),
+- mfValue(0.0),
+- mbNumeric(false)
++ mpContent(NULL)
++{
++}
++
++ScDPCacheTable::Cell::~Cell()
+ {
+ }
+
+ // ----------------------------------------------------------------------------
+
+ ScDPCacheTable::FilterItem::FilterItem() :
+- mnMatchStrId(ScSharedString::EMPTY),
++ mnMatchStrId(ScSimpleSharedString::EMPTY),
+ mfValue(0.0),
+ mbHasValue(false)
+ {
+@@ -171,18 +102,16 @@ ScDPCacheTable::FilterItem::FilterItem() :
+
+ // ----------------------------------------------------------------------------
+
+-ScDPCacheTable::SingleFilter::SingleFilter()
+-{
+-}
+-
+-ScDPCacheTable::SingleFilter::SingleFilter(sal_Int32 nMatchStrId, double fValue, bool bHasValue)
++ScDPCacheTable::SingleFilter::SingleFilter(ScSimpleSharedString& rSharedString,
++ sal_Int32 nMatchStrId, double fValue, bool bHasValue) :
++ mrSharedString(rSharedString)
+ {
+ maItem.mnMatchStrId = nMatchStrId;
+ maItem.mfValue = fValue;
+ maItem.mbHasValue = bHasValue;
+ }
+
+-bool ScDPCacheTable::SingleFilter::match(const Cell& rCell) const
++bool ScDPCacheTable::SingleFilter::match(const ScDPCacheCell& rCell) const
+ {
+ if (rCell.mnStrId != maItem.mnMatchStrId &&
+ (!rCell.mbNumeric || rCell.mfValue != maItem.mfValue))
+@@ -191,9 +120,9 @@ bool ScDPCacheTable::SingleFilter::match(const Cell& rCell) const
+ return true;
+ }
+
+-const String ScDPCacheTable::SingleFilter::getMatchString() const
++const String ScDPCacheTable::SingleFilter::getMatchString()
+ {
+- const String* pStr = ScSharedString::getString(maItem.mnMatchStrId);
++ const String* pStr = mrSharedString.getString(maItem.mnMatchStrId);
+ if (pStr)
+ return *pStr;
+
+@@ -212,11 +141,13 @@ bool ScDPCacheTable::SingleFilter::hasValue() const
+
+ // ----------------------------------------------------------------------------
+
+-ScDPCacheTable::GroupFilter::GroupFilter()
++ScDPCacheTable::GroupFilter::GroupFilter(ScSimpleSharedString& rSharedString) :
++ mrSharedString(rSharedString),
++ mbMatchIfFound(true)
+ {
+ }
+
+-bool ScDPCacheTable::GroupFilter::match(const Cell& rCell) const
++bool ScDPCacheTable::GroupFilter::match(const ScDPCacheCell& rCell) const
+ {
+ vector<FilterItem>::const_iterator itrEnd = maItems.end();
+ for (vector<FilterItem>::const_iterator itr = maItems.begin(); itr != itrEnd; ++itr)
+@@ -228,14 +159,19 @@ bool ScDPCacheTable::GroupFilter::match(const Cell& rCell) const
+ bMatch = (itr->mnMatchStrId == rCell.mnStrId);
+
+ if (bMatch)
+- return true;
++ return mbMatchIfFound ? true : false;
+ }
+- return false;
++ return mbMatchIfFound ? false : true;
++}
++
++void ScDPCacheTable::GroupFilter::setMatchIfFound(bool b)
++{
++ mbMatchIfFound = b;
+ }
+
+ void ScDPCacheTable::GroupFilter::addMatchItem(const String& rStr, double fVal, bool bHasValue)
+ {
+- sal_Int32 nStrId = ScSharedString::getStringId(rStr);
++ sal_Int32 nStrId = mrSharedString.getStringId(rStr);
+ FilterItem aItem;
+ aItem.mnMatchStrId = nStrId;
+ aItem.mfValue = fVal;
+@@ -243,6 +179,11 @@ void ScDPCacheTable::GroupFilter::addMatchItem(const String& rStr, double fVal,
+ maItems.push_back(aItem);
+ }
+
++size_t ScDPCacheTable::GroupFilter::getMatchItemCount() const
++{
++ return maItems.size();
++}
++
+ // ----------------------------------------------------------------------------
+
+ ScDPCacheTable::Criterion::Criterion() :
+@@ -253,7 +194,9 @@ ScDPCacheTable::Criterion::Criterion() :
+
+ // ----------------------------------------------------------------------------
+
+-ScDPCacheTable::ScDPCacheTable()
++ScDPCacheTable::ScDPCacheTable(ScDPCollection* pCollection) :
++ mrSharedString(pCollection->GetSharedString()),
++ mpCollection(pCollection)
+ {
+ }
+
+@@ -300,7 +243,7 @@ void ScDPCacheTable::fillTable(ScDocument* pDoc, const ScRange& rRange, const Sc
+ {
+ String aStr;
+ pDoc->GetString(nCol + nStartCol, nStartRow, nTab, aStr);
+- sal_Int32 nStrId = ScSharedString::insertString(aStr);
++ sal_Int32 nStrId = mrSharedString.insertString(aStr);
+ maHeader.push_back(nStrId);
+ }
+
+@@ -339,24 +282,28 @@ void ScDPCacheTable::fillTable(ScDocument* pDoc, const ScRange& rRange, const Sc
+ Cell& rCell = maTable.back().back();
+ rCell.mnCategoryRef = maTable.size()-1;
+
+- if (nRow == 0 || pDoc->HasData(nStartCol + nCol, nStartRow + nRow, nTab))
++ String aCellStr;
++ bool bReadCell = nRow == 0 || pDoc->HasData(nStartCol + nCol, nStartRow + nRow, nTab);
++ if (bReadCell)
++ {
+ aLastNonEmptyRows[nCol] = maTable.size()-1;
++ ScDPCacheCell aCell;
++ pDoc->GetString(nStartCol + nCol, nStartRow + nRow, nTab, aCellStr);
++ aCell.mnStrId = mrSharedString.insertString(aCellStr);
++ aCell.mnType = SC_VALTYPE_STRING;
++ aCell.mbNumeric = false;
++ ScAddress aPos(nStartCol + nCol, nStartRow + nRow, nTab);
++ getValueData(pDoc, aPos, aCell);
++ rCell.mpContent = mpCollection->getCacheCellFromPool(aCell);
++ }
+ else
+ rCell.mnCategoryRef = aLastNonEmptyRows[nCol];
+
+- String aStr;
+- pDoc->GetString(nStartCol + nCol, nStartRow + nRow, nTab, aStr);
+- rCell.mnStrId = ScSharedString::insertString(aStr);
+- rCell.mnType = SC_VALTYPE_STRING;
+- rCell.mbNumeric = false;
+- ScAddress aPos(nStartCol + nCol, nStartRow + nRow, nTab);
+- getValueData(pDoc, aPos, rCell);
+-
+ TypedStrData* pNew;
+- if (rCell.mbNumeric)
+- pNew = new TypedStrData(aStr, rCell.mfValue, SC_STRTYPE_VALUE);
++ if (rCell.mpContent && rCell.mpContent->mbNumeric)
++ pNew = new TypedStrData(aCellStr, rCell.mpContent->mfValue, SC_STRTYPE_VALUE);
+ else
+- pNew = new TypedStrData(aStr);
++ pNew = new TypedStrData(aCellStr);
+
+ if (!maFieldEntries[nCol]->Insert(pNew))
+ delete pNew;
+@@ -365,14 +312,15 @@ void ScDPCacheTable::fillTable(ScDocument* pDoc, const ScRange& rRange, const Sc
+ }
+
+ void lcl_GetCellValue(const Reference<sdbc::XRow>& xRow, sal_Int32 nType, long nCol,
+- const Date& rNullDate, ScDPCacheTable::Cell& rCell, String& rStr)
++ const Date& rNullDate, ScDPCacheCell& rCell, String& rStr,
++ ScSimpleSharedString& rSharedString)
+ {
+ short nNumType = NUMBERFORMAT_NUMBER;
+ BOOL bEmptyFlag = FALSE;
+ try
+ {
+ rStr = xRow->getString(nCol);
+- rCell.mnStrId = ScSharedString::getStringId(rStr);
++ rCell.mnStrId = rSharedString.getStringId(rStr);
+ rCell.mnType = SC_VALTYPE_STRING;
+
+ switch (nType)
+@@ -487,7 +435,7 @@ void ScDPCacheTable::fillTable(const Reference<sdbc::XRowSet>& xRowSet, const Da
+ {
+ String aColTitle = xMeta->getColumnLabel(nCol+1);
+ aColTypes[nCol] = xMeta->getColumnType(nCol+1);
+- maHeader.push_back( ScSharedString::getStringId(aColTitle) );
++ maHeader.push_back( mrSharedString.getStringId(aColTitle) );
+ }
+
+ // Initialize field entries container.
+@@ -513,12 +461,13 @@ void ScDPCacheTable::fillTable(const Reference<sdbc::XRowSet>& xRowSet, const Da
+ {
+ maTable.back().push_back( Cell() );
+ Cell& rCell = maTable.back().back();
++ rCell.mpContent = new ScDPCacheCell;
+ String aStr;
+- lcl_GetCellValue(xRow, aColTypes[nCol], nCol+1, rNullDate, rCell, aStr);
++ lcl_GetCellValue(xRow, aColTypes[nCol], nCol+1, rNullDate, *rCell.mpContent, aStr, mrSharedString);
+
+ TypedStrData* pNew;
+- if (rCell.mbNumeric)
+- pNew = new TypedStrData(aStr, rCell.mfValue, SC_STRTYPE_VALUE);
++ if (rCell.mpContent->mbNumeric)
++ pNew = new TypedStrData(aStr, rCell.mpContent->mfValue, SC_STRTYPE_VALUE);
+ else
+ pNew = new TypedStrData(aStr);
+
+@@ -557,20 +506,21 @@ void ScDPCacheTable::filterByPageDimension(const vector<Criterion>& rCriteria, b
+ maRowsVisible[nRow] = isRowQualified(nRow, rCriteria, bRepeatIfEmpty);
+ }
+
+-const ::ScDPCacheTable::Cell* ScDPCacheTable::getCell(SCCOL nCol, SCROW nRow, bool bRepeatIfEmpty) const
++const ScDPCacheCell* ScDPCacheTable::getCell(SCCOL nCol, SCROW nRow, bool bRepeatIfEmpty) const
+ {
+ if ( nRow >= static_cast<SCROW>(maTable.size()) )
+ return NULL;
+
+- const vector<Cell>& rRow = maTable.at(nRow);
++ const vector<Cell>& rRow = maTable[nRow];
+ if ( nCol < 0 || static_cast<size_t>(nCol) >= rRow.size() )
+ return NULL;
+
+- const Cell* pCell = &rRow.at(nCol);
+- if (bRepeatIfEmpty && pCell && pCell->mnType == SC_VALTYPE_EMPTY)
+- pCell = getCell(nCol, pCell->mnCategoryRef, false);
++ const Cell& rCell = rRow[nCol];
++ const ScDPCacheCell* pCell = rCell.mpContent;
++ if (bRepeatIfEmpty && !pCell)
++ pCell = getCell(nCol, rCell.mnCategoryRef, false);
+
+- return pCell;
++ return pCell ? pCell : &EmptyCellContent;
+ }
+
+ const String* ScDPCacheTable::getFieldName(sal_Int32 nIndex) const
+@@ -578,12 +528,12 @@ const String* ScDPCacheTable::getFieldName(sal_Int32 nIndex) const
+ if (nIndex >= static_cast<sal_Int32>(maHeader.size()))
+ return NULL;
+
+- return ScSharedString::getString(maHeader[nIndex]);
++ return mrSharedString.getString(maHeader[nIndex]);
+ }
+
+ sal_Int32 ScDPCacheTable::getFieldIndex(const String& rStr) const
+ {
+- sal_Int32 nStrId = ScSharedString::getStringId(rStr);
++ sal_Int32 nStrId = mrSharedString.getStringId(rStr);
+ if (nStrId < 0)
+ // string not found.
+ return nStrId;
+@@ -628,7 +578,7 @@ void ScDPCacheTable::filterTable(const vector<Criterion>& rCriteria, Sequence< S
+ for (sal_Int32 nCol = 0; nCol < nColSize; ++nCol)
+ {
+ OUString str;
+- const String* pStr = ScSharedString::getString(maHeader[nCol]);
++ const String* pStr = mrSharedString.getString(maHeader[nCol]);
+ if (pStr)
+ str = *pStr;
+
+@@ -654,7 +604,7 @@ void ScDPCacheTable::filterTable(const vector<Criterion>& rCriteria, Sequence< S
+ for (SCCOL nCol = 0; nCol < nColSize; ++nCol)
+ {
+ Any any;
+- const Cell* pCell = getCell(nCol, nRow, bRepeatIfEmpty);
++ const ScDPCacheCell* pCell = getCell(nCol, nRow, bRepeatIfEmpty);
+ if (!pCell)
+ {
+ // This should never happen, but in case this happens, just
+@@ -670,7 +620,7 @@ void ScDPCacheTable::filterTable(const vector<Criterion>& rCriteria, Sequence< S
+ else
+ {
+ OUString str;
+- const String* pStr = ScSharedString::getString(pCell->mnStrId);
++ const String* pStr = mrSharedString.getString(pCell->mnStrId);
+ if (pStr)
+ str = *pStr;
+ any <<= str;
+@@ -719,7 +669,7 @@ bool ScDPCacheTable::isRowQualified(sal_Int32 nRow, const vector<Criterion>& rCr
+ // use this criterion.
+ continue;
+
+- const Cell* pCell = getCell(static_cast<SCCOL>(itr->mnFieldIndex), nRow, bRepeatIfEmpty);
++ const ScDPCacheCell* pCell = getCell(static_cast<SCCOL>(itr->mnFieldIndex), nRow, bRepeatIfEmpty);
+ if (!pCell)
+ // This should never happen, but just in case...
+ return false;
+@@ -730,7 +680,7 @@ bool ScDPCacheTable::isRowQualified(sal_Int32 nRow, const vector<Criterion>& rCr
+ return true;
+ }
+
+-void ScDPCacheTable::getValueData(ScDocument* pDoc, const ScAddress& rPos, Cell& rCell)
++void ScDPCacheTable::getValueData(ScDocument* pDoc, const ScAddress& rPos, ScDPCacheCell& rCell)
+ {
+ ScBaseCell* pCell = pDoc->GetCell(rPos);
+ if (!pCell)
+@@ -768,12 +718,3 @@ void ScDPCacheTable::getValueData(ScDocument* pDoc, const ScAddress& rPos, Cell&
+ }
+ }
+
+-ScDPCacheTable::Cell ScDPCacheTable::getSelectedDimension(ScDPDimension* pDim) const
+-{
+- const ScDPItemData& rData = pDim->GetSelectedData();
+- Cell aCell;
+- aCell.mfValue = rData.fValue;
+- aCell.mbNumeric = rData.bHasValue;
+- aCell.mnStrId = ScSharedString::getStringId(rData.aString);
+- return aCell;
+-}
+diff --git sc/source/core/data/dpgroup.cxx sc/source/core/data/dpgroup.cxx
+index 5cc1893..2c60d1b 100644
+--- sc/source/core/data/dpgroup.cxx
++++ sc/source/core/data/dpgroup.cxx
+@@ -49,6 +49,7 @@
+ #include "dpcachetable.hxx"
+ #include "dptabsrc.hxx"
+ #include "dptabres.hxx"
++#include "dpobject.hxx"
+
+ #include <com/sun/star/sheet/DataPilotFieldGroupBy.hpp>
+ #include <com/sun/star/sheet/DataPilotFieldFilter.hpp>
+@@ -86,7 +87,7 @@ public:
+ ScDPGroupDateFilter(double fMatchValue, sal_Int32 nDatePart,
+ const Date* pNullDate, const ScDPNumGroupInfo* pNumInfo);
+
+- virtual bool match(const ScDPCacheTable::Cell &rCell) const;
++ virtual bool match(const ScDPCacheCell &rCell) const;
+
+ private:
+ ScDPGroupDateFilter(); // disabled
+@@ -110,7 +111,7 @@ ScDPGroupDateFilter::ScDPGroupDateFilter(double fMatchValue, sal_Int32 nDatePart
+ // mfMatchValue, mnDatePart);
+ }
+
+-bool ScDPGroupDateFilter::match(const ScDPCacheTable::Cell& rCell) const
++bool ScDPGroupDateFilter::match(const ScDPCacheCell& rCell) const
+ {
+ using namespace ::com::sun::star::sheet;
+ using ::rtl::math::approxFloor;
+@@ -977,6 +978,7 @@ String lcl_GetNumGroupForValue( double fValue, const ScDPNumGroupInfo& rInfo, bo
+ }
+
+ ScDPGroupTableData::ScDPGroupTableData( ScDPTableData* pSource, ScDocument* pDocument ) :
++ ScDPTableData(pDocument),
+ pSourceData( pSource ),
+ pDoc( pDocument )
+ {
+@@ -1136,7 +1138,7 @@ void ScDPGroupTableData::CreateCacheTable()
+ pSourceData->CreateCacheTable();
+ }
+
+-void ScDPGroupTableData::ModifyFilterCriteria(vector<ScDPCacheTable::Criterion>& rCriteria) const
++void ScDPGroupTableData::ModifyFilterCriteria(vector<ScDPCacheTable::Criterion>& rCriteria)
+ {
+ typedef hash_map<long, const ScDPGroupDimension*> GroupFieldMapType;
+ GroupFieldMapType aGroupFieldIds;
+@@ -1225,7 +1227,7 @@ void ScDPGroupTableData::ModifyFilterCriteria(vector<ScDPCacheTable::Criterion>&
+
+ ScDPCacheTable::Criterion aCri;
+ aCri.mnFieldIndex = nSrcDim;
+- aCri.mpFilter.reset(new ScDPCacheTable::GroupFilter);
++ aCri.mpFilter.reset(new ScDPCacheTable::GroupFilter(GetSharedString()));
+ ScDPCacheTable::GroupFilter* pGrpFilter =
+ static_cast<ScDPCacheTable::GroupFilter*>(aCri.mpFilter.get());
+
+diff --git sc/source/core/data/dpobject.cxx sc/source/core/data/dpobject.cxx
+index b6ae4f6..0bd6924 100644
+--- sc/source/core/data/dpobject.cxx
++++ sc/source/core/data/dpobject.cxx
+@@ -408,7 +408,7 @@ void ScDPObject::CreateObjects()
+ if ( pImpDesc )
+ {
+ // database data
+- pData = new ScDatabaseDPData( pDoc->GetServiceManager(), *pImpDesc );
++ pData = new ScDatabaseDPData( pDoc, pDoc->GetServiceManager(), *pImpDesc );
+ }
+ else
+ {
+@@ -2514,7 +2514,49 @@ uno::Reference<sheet::XDimensionsSupplier> ScDPObject::CreateSource( const ScDPS
+ return xRet;
+ }
+
+-// -----------------------------------------------------------------------
++// ============================================================================
++
++ScDPCacheCell::ScDPCacheCell() :
++ mnStrId(ScSimpleSharedString::EMPTY),
++ mnType(SC_VALTYPE_EMPTY),
++ mfValue(0.0),
++ mbNumeric(false)
++{
++}
++
++ScDPCacheCell::ScDPCacheCell(const ScDPCacheCell& r) :
++ mnStrId(r.mnStrId),
++ mnType(r.mnType),
++ mfValue(r.mfValue),
++ mbNumeric(r.mbNumeric)
++{
++}
++
++ScDPCacheCell::~ScDPCacheCell()
++{
++}
++
++// ============================================================================
++
++size_t ScDPCollection::CacheCellHash::operator()(const ScDPCacheCell* pCell) const
++{
++ return pCell->mnStrId + static_cast<size_t>(pCell->mnType) +
++ static_cast<size_t>(pCell->mfValue) + static_cast<size_t>(pCell->mbNumeric);
++}
++
++bool ScDPCollection::CacheCellEqual::operator()(const ScDPCacheCell* p1, const ScDPCacheCell* p2) const
++{
++ if (!p1 && !p2)
++ return true;
++
++ if ((!p1 && p2) || (p1 && !p2))
++ return false;
++
++ return p1->mnStrId == p2->mnStrId && p1->mfValue == p2->mfValue &&
++ p1->mbNumeric == p2->mbNumeric && p1->mnType == p2->mnType;
++}
++
++// ----------------------------------------------------------------------------
+
+ ScDPCollection::ScDPCollection(ScDocument* pDocument) :
+ pDoc( pDocument )
+@@ -2523,12 +2565,15 @@ ScDPCollection::ScDPCollection(ScDocument* pDocument) :
+
+ ScDPCollection::ScDPCollection(const ScDPCollection& r) :
+ Collection(r),
+- pDoc(r.pDoc)
++ pDoc(r.pDoc),
++ maSharedString(r.maSharedString),
++ maCacheCellPool(r.maCacheCellPool)
+ {
+ }
+
+ ScDPCollection::~ScDPCollection()
+ {
++ clearCacheCellPool();
+ }
+
+ DataObject* ScDPCollection::Clone() const
+@@ -2716,9 +2761,66 @@ void ScDPCollection::EnsureNames()
+ ((ScDPObject*)At(i))->SetName( CreateNewName() );
+ }
+
++ScSimpleSharedString& ScDPCollection::GetSharedString()
++{
++ return maSharedString;
++}
++
++ScDPCacheCell* ScDPCollection::getCacheCellFromPool(const ScDPCacheCell& rCell)
++{
++ ScDPCacheCell aCell(rCell);
++ CacheCellPoolType::iterator itr = maCacheCellPool.find(&aCell);
++ if (itr == maCacheCellPool.end())
++ {
++ // Insert a new instance.
++ ScDPCacheCell* p = new ScDPCacheCell(rCell);
++ ::std::pair<CacheCellPoolType::iterator, bool> r =
++ maCacheCellPool.insert(p);
++ if (!r.second)
++ delete p;
++
++ ScDPCacheCell* p2 = r.second ? *r.first : NULL;
++ DBG_ASSERT(p == p2, "ScDPCollection::getCacheCellFromPool: pointer addresses differ");
++ return p2;
++ }
++ return *itr;
++}
++
++namespace {
++
++class DeleteCacheCells : public ::std::unary_function<ScDPCacheCell*, void>
++{
++public:
++ void operator()(ScDPCacheCell* p) const
++ {
++ delete p;
++ }
++};
++
++}
++
++void ScDPCollection::clearCacheCellPool()
++{
++ // Transferring all the pointers to a vector first. For some reason,
++ // deleting the cell content instances directly by iterating through
++ // pointers stored in the hash set caused the iteration to return an
++ // identical pointer value twice, causing a double-delete. I have no idea
++ // why.
++
++ using ::std::copy;
++ using ::std::back_inserter;
++
++ vector<ScDPCacheCell*> ps;
++ ps.reserve(maCacheCellPool.size());
++ copy(maCacheCellPool.begin(), maCacheCellPool.end(), back_inserter(ps));
++ for_each(ps.begin(), ps.end(), DeleteCacheCells());
++ maCacheCellPool.clear();
++}
++
+ //------------------------------------------------------------------------
+ // convert old pivot tables into new datapilot tables
+
++#if OLD_PIVOT_IMPLEMENTATION
+ void ScDPCollection::ConvertOldTables( ScPivotCollection& rOldColl )
+ {
+ // convert old pivot tables into new datapilot tables
+diff --git sc/source/core/data/dpsdbtab.cxx sc/source/core/data/dpsdbtab.cxx
+index 5ac8d6d..e8d0509 100644
+--- sc/source/core/data/dpsdbtab.cxx
++++ sc/source/core/data/dpsdbtab.cxx
+@@ -58,6 +58,8 @@
+ #include "globstr.hrc"
+ #include "dpcachetable.hxx"
+ #include "dptabres.hxx"
++#include "document.hxx"
++#include "dpobject.hxx"
+
+ using namespace com::sun::star;
+
+@@ -91,16 +93,21 @@ public:
+
+ ScDPCacheTable aCacheTable;
+
+- ScDatabaseDPData_Impl() {}
++ ScDatabaseDPData_Impl(ScDPCollection* p) :
++ aCacheTable(p)
++ {
++ }
+ };
+
+ // -----------------------------------------------------------------------
+
+ ScDatabaseDPData::ScDatabaseDPData(
++ ScDocument* pDoc,
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr,
+- const ScImportSourceDesc& rImport )
++ const ScImportSourceDesc& rImport ) :
++ ScDPTableData(pDoc)
+ {
+- pImpl = new ScDatabaseDPData_Impl;
++ pImpl = new ScDatabaseDPData_Impl(pDoc->GetDPCollection());
+ pImpl->xServiceManager = xSMgr;
+ pImpl->aDesc = rImport;
+ pImpl->nColCount = 0;
+diff --git sc/source/core/data/dpshttab.cxx sc/source/core/data/dpshttab.cxx
+index 9dab27c..76410c6 100644
+--- sc/source/core/data/dpshttab.cxx
++++ sc/source/core/data/dpshttab.cxx
+@@ -44,6 +44,7 @@
+ #include "collect.hxx"
+ #include "cell.hxx"
+ #include "dpcachetable.hxx"
++#include "dpobject.hxx"
+ #include "globstr.hrc"
+
+ #include <com/sun/star/sheet/DataPilotFieldFilter.hpp>
+@@ -74,17 +75,19 @@ public:
+
+ ScDPCacheTable aCacheTable;
+
+- ScSheetDPData_Impl() :
+- pSpecial(NULL)
++ ScSheetDPData_Impl(ScDPCollection* p) :
++ pSpecial(NULL),
++ aCacheTable(p)
+ {
+ }
+ };
+
+ // -----------------------------------------------------------------------
+
+-ScSheetDPData::ScSheetDPData( ScDocument* pD, const ScSheetSourceDesc& rDesc )
++ScSheetDPData::ScSheetDPData( ScDocument* pD, const ScSheetSourceDesc& rDesc ) :
++ ScDPTableData(pD)
+ {
+- pImpl = new ScSheetDPData_Impl;
++ pImpl = new ScSheetDPData_Impl(pD->GetDPCollection());
+ pImpl->pDoc = pD;
+ pImpl->aRange = rDesc.aSourceRange;
+ pImpl->aQuery = rDesc.aQueryParam;
+diff --git sc/source/core/data/dptabdat.cxx sc/source/core/data/dptabdat.cxx
+index dc42601..77521a6 100644
+--- sc/source/core/data/dptabdat.cxx
++++ sc/source/core/data/dptabdat.cxx
+@@ -48,6 +48,8 @@
+ #include "global.hxx"
+ #include "dpcachetable.hxx"
+ #include "dptabres.hxx"
++#include "document.hxx"
++#include "dpobject.hxx"
+
+ using namespace ::com::sun::star;
+ using ::com::sun::star::uno::Sequence;
+@@ -125,7 +127,8 @@ ScDPTableData::CalcInfo::CalcInfo() :
+
+ // ---------------------------------------------------------------------------
+
+-ScDPTableData::ScDPTableData()
++ScDPTableData::ScDPTableData(ScDocument* pDoc) :
++ mrSharedString(pDoc->GetDPCollection()->GetSharedString())
+ {
+ nLastDateVal = nLastHier = nLastLevel = nLastRet = -1; // invalid
+
+@@ -186,26 +189,6 @@ bool ScDPTableData::IsRepeatIfEmpty()
+ return false;
+ }
+
+-void ScDPTableData::CreateCacheTable()
+-{
+- fprintf(stdout, "ScDPTableData::CreateCacheTable: un-implemented...\n");fflush(stdout);
+-}
+-
+-void ScDPTableData::FilterCacheTable(const vector<ScDPCacheTable::Criterion>&)
+-{
+- fprintf(stdout, "ScDPTableData::FilterCacheTable: un-implemented...\n");
+-}
+-
+-void ScDPTableData::GetDrillDownData(const vector<ScDPCacheTable::Criterion>&, Sequence< Sequence<Any> >&)
+-{
+- fprintf(stdout, "ScDPTableData::GetDrillDownData: un-implemented...\n");fflush(stdout);
+-}
+-
+-void ScDPTableData::CalcResults(CalcInfo&, bool)
+-{
+- fprintf(stdout, "ScDPTableData::CalcResults: un-implemented...\n");fflush(stdout);
+-}
+-
+ UINT32 ScDPTableData::GetNumberFormat(long)
+ {
+ return 0; // default format
+@@ -240,6 +223,11 @@ BOOL ScDPTableData::HasCommonElement( const ScDPItemData&, long,
+ return FALSE;
+ }
+
++ScSimpleSharedString& ScDPTableData::GetSharedString()
++{
++ return mrSharedString;
++}
++
+ void ScDPTableData::FillRowDataFromCacheTable(sal_Int32 nRow, const ScDPCacheTable& rCacheTable,
+ const CalcInfo& rInfo, CalcRowData& rData)
+ {
+@@ -258,7 +246,8 @@ void ScDPTableData::FillRowDataFromCacheTable(sal_Int32 nRow, const ScDPCacheTab
+ long nDim = rInfo.aDataSrcCols[i];
+ rData.aValues.push_back( ScDPValueData() );
+ ScDPValueData& rVal = rData.aValues.back();
+- const ScDPCacheTable::Cell* pCell = rCacheTable.getCell(static_cast<SCCOL>(nDim), static_cast<SCROW>(nRow));
++ const ScDPCacheCell* pCell = rCacheTable.getCell(
++ static_cast<SCCOL>(nDim), static_cast<SCROW>(nRow));
+ if (pCell)
+ {
+ rVal.fValue = pCell->mbNumeric ? pCell->mfValue : 0.0;
+@@ -321,11 +310,12 @@ void ScDPTableData::GetItemData(const ScDPCacheTable& rCacheTable, sal_Int32 nRo
+ continue;
+ }
+
+- const ScDPCacheTable::Cell* pCell = rCacheTable.getCell(static_cast<SCCOL>(nDim), static_cast<SCROW>(nRow), IsRepeatIfEmpty());
++ const ScDPCacheCell* pCell = rCacheTable.getCell(
++ static_cast<SCCOL>(nDim), static_cast<SCROW>(nRow), IsRepeatIfEmpty());
+ if (!pCell || pCell->mnType == SC_VALTYPE_EMPTY)
+ continue;
+
+- const String* pString = ScSharedString::getString(pCell->mnStrId);
++ const String* pString = GetSharedString().getString(pCell->mnStrId);
+ if (!pString)
+ continue;
+
+diff --git sc/source/core/data/dptabres.cxx sc/source/core/data/dptabres.cxx
+index bfbe34b..c52139c 100644
+--- sc/source/core/data/dptabres.cxx
++++ sc/source/core/data/dptabres.cxx
+@@ -41,6 +41,7 @@
+ #include <float.h> //! Test !!!
+
+ #include <algorithm>
++#include <hash_map>
+
+ #include "dptabdat.hxx"
+ #include "dptabres.hxx"
+@@ -59,9 +60,13 @@
+ #include <com/sun/star/sheet/DataPilotFieldReferenceItemType.hpp>
+ #include <com/sun/star/sheet/DataPilotFieldShowItemsMode.hpp>
+ #include <com/sun/star/sheet/DataPilotFieldSortMode.hpp>
++#include <com/sun/star/sheet/DataPilotFieldFilter.hpp>
+
+ using namespace com::sun::star;
+ using ::std::vector;
++using ::std::pair;
++using ::std::hash_map;
++using ::com::sun::star::uno::Sequence;
+
+ // -----------------------------------------------------------------------
+
+@@ -1577,6 +1582,12 @@ ScDPAggData* ScDPResultMember::GetColTotal( long nMeasure ) const
+ return lcl_GetChildTotal( const_cast<ScDPAggData*>(&aColTotal), nMeasure );
+ }
+
++void ScDPResultMember::FillVisibilityData(ScDPResultVisibilityData& rData) const
++{
++ if (pChildDimension)
++ pChildDimension->FillVisibilityData(rData);
++}
++
+ // -----------------------------------------------------------------------
+
+ ScDPDataMember::ScDPDataMember( const ScDPResultData* pData, const ScDPResultMember* pRes ) :
+@@ -3231,6 +3242,26 @@ ScDPResultDimension* ScDPResultDimension::GetFirstChildDimension() const
+ return NULL;
+ }
+
++void ScDPResultDimension::FillVisibilityData(ScDPResultVisibilityData& rData) const
++{
++ if (IsDataLayout())
++ return;
++
++ MemberArray::const_iterator itr = maMemberArray.begin(), itrEnd = maMemberArray.end();
++
++ for (;itr != itrEnd; ++itr)
++ {
++ ScDPResultMember* pMember = *itr;
++ if (pMember->IsValid())
++ {
++ ScDPItemData aItem;
++ pMember->FillItemData(aItem);
++ rData.addVisibleMember(GetName(), aItem);
++ pMember->FillVisibilityData(rData);
++ }
++ }
++}
++
+ // -----------------------------------------------------------------------
+
+ ScDPDataDimension::ScDPDataDimension( const ScDPResultData* pData ) :
+@@ -3559,3 +3590,88 @@ ScDPDataMember* ScDPDataDimension::GetMember(long n) const
+ return aMembers[(USHORT)n];
+ }
+
++// ----------------------------------------------------------------------------
++
++ScDPResultVisibilityData::ScDPResultVisibilityData(
++ ScSimpleSharedString& rSharedString, ScDPSource* pSource) :
++ mrSharedString(rSharedString),
++ mpSource(pSource)
++{
++}
++
++ScDPResultVisibilityData::~ScDPResultVisibilityData()
++{
++}
++
++void ScDPResultVisibilityData::addVisibleMember(const String& rDimName, const ScDPItemData& rMemberItem)
++{
++ DimMemberType::iterator itr = maDimensions.find(rDimName);
++ if (itr == maDimensions.end())
++ {
++ pair<DimMemberType::iterator, bool> r = maDimensions.insert(
++ DimMemberType::value_type(rDimName, VisibleMemberType()));
++
++ if (!r.second)
++ // insertion failed.
++ return;
++
++ itr = r.first;
++ }
++ VisibleMemberType& rMem = itr->second;
++ VisibleMemberType::iterator itrMem = rMem.find(rMemberItem);
++ if (itrMem == rMem.end())
++ rMem.insert(rMemberItem);
++}
++
++void ScDPResultVisibilityData::fillFieldFilters(vector<ScDPCacheTable::Criterion>& rFilters) const
++{
++ typedef hash_map<String, long, ScStringHashCode> FieldNameMapType;
++ FieldNameMapType aFieldNames;
++ ScDPTableData* pData = mpSource->GetData();
++ long nColumnCount = pData->GetColumnCount();
++ for (long i = 0; i < nColumnCount; ++i)
++ {
++ aFieldNames.insert(
++ FieldNameMapType::value_type(pData->getDimensionName(i), i));
++ }
++
++ const ScDPDimensions* pDims = mpSource->GetDimensionsObject();
++ for (DimMemberType::const_iterator itr = maDimensions.begin(), itrEnd = maDimensions.end();
++ itr != itrEnd; ++itr)
++ {
++ const String& rDimName = itr->first;
++ ScDPCacheTable::Criterion aCri;
++ FieldNameMapType::const_iterator itrField = aFieldNames.find(rDimName);
++ if (itrField == aFieldNames.end())
++ // This should never happen!
++ continue;
++
++ long nDimIndex = itrField->second;
++ aCri.mnFieldIndex = static_cast<sal_Int32>(nDimIndex);
++ aCri.mpFilter.reset(new ScDPCacheTable::GroupFilter(mrSharedString));
++ ScDPCacheTable::GroupFilter* pGrpFilter =
++ static_cast<ScDPCacheTable::GroupFilter*>(aCri.mpFilter.get());
++
++ const VisibleMemberType& rMem = itr->second;
++ for (VisibleMemberType::const_iterator itrMem = rMem.begin(), itrMemEnd = rMem.end();
++ itrMem != itrMemEnd; ++itrMem)
++ {
++ const ScDPItemData& rMemItem = *itrMem;
++ pGrpFilter->addMatchItem(rMemItem.aString, rMemItem.fValue, rMemItem.bHasValue);
++ }
++
++ ScDPDimension* pDim = pDims->getByIndex(nDimIndex);
++ ScDPMembers* pMembers = pDim->GetHierarchiesObject()->getByIndex(0)->
++ GetLevelsObject()->getByIndex(0)->GetMembersObject();
++ if (pGrpFilter->getMatchItemCount() < static_cast<size_t>(pMembers->getCount()))
++ rFilters.push_back(aCri);
++ }
++}
++
++size_t ScDPResultVisibilityData::MemberHash::operator() (const ScDPItemData& r) const
++{
++ if (r.bHasValue)
++ return static_cast<size_t>(::rtl::math::approxFloor(r.fValue));
++ else
++ return rtl_ustr_hashCode_WithLength(r.aString.GetBuffer(), r.aString.Len());
++}
+diff --git sc/source/core/data/dptabsrc.cxx sc/source/core/data/dptabsrc.cxx
+index 6881c70..600eb7b 100644
+--- sc/source/core/data/dptabsrc.cxx
++++ sc/source/core/data/dptabsrc.cxx
+@@ -31,7 +31,7 @@
+ // MARKER(update_precomp.py): autogen include statement, do not remove
+ #include "precompiled_sc.hxx"
+
+-#include <stdio.h>
++
+
+
+ // INCLUDE ---------------------------------------------------------------
+@@ -68,6 +68,7 @@
+ #include <com/sun/star/sheet/DataPilotFieldFilter.hpp>
+ #include <com/sun/star/sheet/DataPilotFieldReferenceType.hpp>
+ #include <com/sun/star/sheet/DataPilotFieldSortMode.hpp>
++#include <com/sun/star/sheet/DataPilotFieldAutoShowInfo.hpp>
+ #include <com/sun/star/table/CellAddress.hpp>
+
+ #include <unotools/collatorwrapper.hxx>
+@@ -81,6 +82,7 @@ using ::std::hash_map;
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Any;
++using ::com::sun::star::sheet::DataPilotFieldAutoShowInfo;
+
+ // -----------------------------------------------------------------------
+
+@@ -422,6 +424,15 @@ Sequence< Sequence<Any> > SAL_CALL ScDPSource::getDrillDownData(const Sequence<s
+ throw (uno::RuntimeException)
+ {
+ long nColumnCount = GetData()->GetColumnCount();
++ ScSimpleSharedString& rSharedString = GetData()->GetSharedString();
++
++ typedef hash_map<String, long, ScStringHashCode> FieldNameMapType;
++ FieldNameMapType aFieldNames;
++ for (long i = 0; i < nColumnCount; ++i)
++ {
++ aFieldNames.insert(
++ FieldNameMapType::value_type(GetData()->getDimensionName(i), i));
++ }
+
+ // collect ScDPItemData for each filtered column
+ vector<ScDPCacheTable::Criterion> aFilterCriteria;
+@@ -443,15 +454,21 @@ Sequence< Sequence<Any> > SAL_CALL ScDPSource::getDrillDownData(const Sequence<s
+ ScDPItemData aItem;
+ pMembers->getByIndex(nIndex)->FillItemData( aItem );
+ aFilterCriteria.push_back( ScDPCacheTable::Criterion() );
+- sal_Int32 nMatchStrId = ScSharedString::getStringId(aItem.aString);
++ sal_Int32 nMatchStrId = rSharedString.getStringId(aItem.aString);
+ aFilterCriteria.back().mnFieldIndex = nCol;
+ aFilterCriteria.back().mpFilter.reset(
+- new ScDPCacheTable::SingleFilter(nMatchStrId, aItem.fValue, aItem.bHasValue) );
++ new ScDPCacheTable::SingleFilter(rSharedString, nMatchStrId, aItem.fValue, aItem.bHasValue) );
+ }
+ }
+ }
+ }
+
++ // Take into account the visibilities of field members.
++ ScDPResultVisibilityData aResVisData(rSharedString, this);
++ pRowResRoot->FillVisibilityData(aResVisData);
++ pColResRoot->FillVisibilityData(aResVisData);
++ aResVisData.fillFieldFilters(aFilterCriteria);
++
+ Sequence< Sequence<Any> > aTabData;
+ pData->GetDrillDownData(aFilterCriteria, aTabData);
+ return aTabData;
+@@ -834,6 +851,8 @@ void ScDPSource::CreateRes_Impl()
+ else
+ {
+ {
++ ScSimpleSharedString& rSharedString = GetData()->GetSharedString();
++
+ // filter table by page dimensions.
+ vector<ScDPCacheTable::Criterion> aCriteria;
+ for (i = 0; i < nPageDimCount; ++i)
+@@ -847,9 +866,9 @@ void ScDPSource::CreateRes_Impl()
+ aCriteria.push_back(ScDPCacheTable::Criterion());
+ ScDPCacheTable::Criterion& r = aCriteria.back();
+ r.mnFieldIndex = static_cast<sal_Int32>(nField);
+- sal_Int32 nStrId = ScSharedString::getStringId(rData.aString);
++ sal_Int32 nStrId = rSharedString.getStringId(rData.aString);
+ r.mpFilter.reset(
+- new ScDPCacheTable::SingleFilter(nStrId, rData.fValue, rData.bHasValue));
++ new ScDPCacheTable::SingleFilter(rSharedString, nStrId, rData.fValue, rData.bHasValue));
+ }
+ if (!aCriteria.empty())
+ pData->FilterCacheTable(aCriteria);
+diff --git sc/source/core/data/global2.cxx sc/source/core/data/global2.cxx
+index 2cbda72..abfae52 100644
+--- sc/source/core/data/global2.cxx
++++ sc/source/core/data/global2.cxx
+@@ -1311,4 +1311,90 @@ String ScGlobal::GetDocTabName( const String& rFileName,
+ return aDocTab;
+ }
+
++// ============================================================================
+
++ScSimpleSharedString::StringTable::StringTable() :
++ mnStrCount(0)
++{
++ // empty string (ID = 0)
++ maSharedStrings.push_back(String());
++ maSharedStringIds.insert( SharedStrMap::value_type(String(), mnStrCount++) );
++}
++
++ScSimpleSharedString::StringTable::StringTable(const ScSimpleSharedString::StringTable& r) :
++ maSharedStrings(r.maSharedStrings),
++ maSharedStringIds(r.maSharedStringIds),
++ mnStrCount(r.mnStrCount)
++{
++}
++
++ScSimpleSharedString::StringTable::~StringTable()
++{
++}
++
++sal_Int32 ScSimpleSharedString::StringTable::insertString(const String& aStr)
++{
++ SharedStrMap::const_iterator itr = maSharedStringIds.find(aStr),
++ itrEnd = maSharedStringIds.end();
++
++ if (itr == itrEnd)
++ {
++ // new string.
++ maSharedStrings.push_back(aStr);
++ maSharedStringIds.insert( SharedStrMap::value_type(aStr, mnStrCount) );
++ return mnStrCount++;
++ }
++
++ // existing string.
++ return itr->second;
++}
++
++sal_Int32 ScSimpleSharedString::StringTable::getStringId(const String& aStr)
++{
++ SharedStrMap::const_iterator itr = maSharedStringIds.find(aStr),
++ itrEnd = maSharedStringIds.end();
++ if (itr == itrEnd)
++ {
++ // string not found.
++ return insertString(aStr);
++ }
++ return itr->second;
++}
++
++const String* ScSimpleSharedString::StringTable::getString(sal_Int32 nId) const
++{
++ if (nId >= mnStrCount)
++ return NULL;
++
++ return &maSharedStrings[nId];
++}
++
++// ----------------------------------------------------------------------------
++
++ScSimpleSharedString::ScSimpleSharedString()
++{
++}
++
++ScSimpleSharedString::ScSimpleSharedString(const ScSimpleSharedString& r) :
++ maStringTable(r.maStringTable)
++{
++}
++
++ScSimpleSharedString::~ScSimpleSharedString()
++{
++}
++
++sal_Int32 ScSimpleSharedString::insertString(const String& aStr)
++{
++ return maStringTable.insertString(aStr);
++}
++
++const String* ScSimpleSharedString::getString(sal_Int32 nId)
++{
++ return maStringTable.getString(nId);
++}
++
++sal_Int32 ScSimpleSharedString::getStringId(const String& aStr)
++{
++ return maStringTable.getStringId(aStr);
++}
Modified: trunk/patches/dev300/unused-methods-removal-sc.diff
==============================================================================
--- trunk/patches/dev300/unused-methods-removal-sc.diff (original)
+++ trunk/patches/dev300/unused-methods-removal-sc.diff Wed Sep 17 19:52:58 2008
@@ -311,7 +311,7 @@
void InvalidateGlue()
diff --git sc/inc/chgtrack.hxx sc/inc/chgtrack.hxx
-index 13436e5..fc078cf 100644
+index 3aac6b6..b607124 100644
--- sc/inc/chgtrack.hxx
+++ sc/inc/chgtrack.hxx
@@ -320,10 +320,7 @@ protected:
@@ -464,7 +464,7 @@
diff --git sc/inc/compiler.hxx sc/inc/compiler.hxx
-index bdffc05..d2bc3a6 100644
+index d901f78..384a9fe 100644
--- sc/inc/compiler.hxx
+++ sc/inc/compiler.hxx
@@ -190,16 +190,11 @@ public:
@@ -718,7 +718,7 @@
void StyleDeleted( ScStyleSheet* pStyle ); // Loeschen von Vorlagen im Organizer
virtual SfxItemPresentation GetPresentation(
diff --git sc/inc/document.hxx sc/inc/document.hxx
-index 5d4ca1f..fd8391f 100644
+index 414f0c5..35fd858 100644
--- sc/inc/document.hxx
+++ sc/inc/document.hxx
@@ -98,8 +98,10 @@ class ScFormulaCell;
@@ -1068,11 +1068,11 @@
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
diff --git sc/inc/dpcachetable.hxx sc/inc/dpcachetable.hxx
-index e894eed..7b2be7e 100644
+index deaa0f2..f06eb54 100644
--- sc/inc/dpcachetable.hxx
+++ sc/inc/dpcachetable.hxx
-@@ -177,7 +177,6 @@ public:
- ScDPCacheTable();
+@@ -148,7 +148,6 @@ public:
+ ScDPCacheTable(ScDPCollection* pCollection);
~ScDPCacheTable();
- sal_Int32 getHeaderSize() const;
@@ -1080,7 +1080,7 @@
sal_Int32 getColSize() const;
diff --git sc/inc/dpgroup.hxx sc/inc/dpgroup.hxx
-index 391f5fb..6e944c1 100644
+index 1749a1a..c8f0784 100644
--- sc/inc/dpgroup.hxx
+++ sc/inc/dpgroup.hxx
@@ -190,7 +190,6 @@ class ScDPGroupTableData : public ScDPTableData
@@ -1092,7 +1092,7 @@
bool IsNumGroupDimension( long nDimension ) const;
void GetNumGroupInfo( long nDimension, ScDPNumGroupInfo& rInfo,
diff --git sc/inc/dpobject.hxx sc/inc/dpobject.hxx
-index 42ca145..2fd2a2f 100644
+index 42719c0..b109b82 100644
--- sc/inc/dpobject.hxx
+++ sc/inc/dpobject.hxx
@@ -57,8 +57,10 @@ class ScDPSaveData;
@@ -1122,7 +1122,7 @@
BOOL GetHierarchiesNA( sal_Int32 nDim, com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >& xHiers );
BOOL GetHierarchies( sal_Int32 nDim, com::sun::star::uno::Sequence< rtl::OUString >& rHiers );
-@@ -264,13 +264,9 @@ public:
+@@ -292,13 +292,9 @@ public:
virtual DataObject* Clone() const;
ScDPObject* operator[](USHORT nIndex) const {return (ScDPObject*)At(nIndex);}
@@ -1138,13 +1138,13 @@
void DeleteOnTab( SCTAB nTab );
void UpdateReference( UpdateRefMode eUpdateRefMode,
const ScRange& r, SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
-@@ -279,7 +275,6 @@ public:
+@@ -307,7 +303,6 @@ public:
void WriteRefsTo( ScDPCollection& r ) const;
String CreateNewName( USHORT nMin = 1 ) const;
-- void EnsureNames();
- };
+- void EnsureNames();
+ ScSimpleSharedString& GetSharedString();
diff --git sc/inc/dpsave.hxx sc/inc/dpsave.hxx
index 5d794ac..8a42ead 100644
@@ -1308,10 +1308,10 @@
BOOL bBack, String* pFuncName = NULL );
diff --git sc/inc/global.hxx sc/inc/global.hxx
-index 7cd5b8b..97ff897 100644
+index f239322..6829887 100644
--- sc/inc/global.hxx
+++ sc/inc/global.hxx
-@@ -84,6 +84,12 @@ extern "C" {
+@@ -86,6 +86,12 @@ extern "C" {
#define SC_TRANSLITERATION_CASESENSE 0
#endif
@@ -1324,7 +1324,7 @@
//------------------------------------------------------------------------
struct LabelData;
-@@ -778,9 +784,6 @@ struct ScQueryEntry
+@@ -780,9 +786,6 @@ struct ScQueryEntry
void Clear();
ScQueryEntry& operator=( const ScQueryEntry& r );
BOOL operator==( const ScQueryEntry& r ) const;
@@ -1334,7 +1334,7 @@
};
struct SC_DLLPUBLIC ScQueryParam
-@@ -825,9 +828,6 @@ public:
+@@ -827,9 +830,6 @@ public:
void MoveToDest();
void FillInExcelSyntax(String& aCellStr, SCSIZE nIndex);
@@ -1344,7 +1344,7 @@
};
// -----------------------------------------------------------------------
-@@ -889,9 +889,6 @@ struct ScConsolidateParam
+@@ -891,9 +891,6 @@ struct ScConsolidateParam
void Clear (); // = ClearDataAreas()+Members
void ClearDataAreas ();
void SetAreas ( ScArea* const* ppAreas, USHORT nCount );
@@ -2862,7 +2862,7 @@
BOOL bNoListening ) const
{
diff --git sc/source/core/data/cell2.cxx sc/source/core/data/cell2.cxx
-index 2d71b6e..94c791a 100644
+index b49a9fd..f770a60 100644
--- sc/source/core/data/cell2.cxx
+++ sc/source/core/data/cell2.cxx
@@ -62,14 +62,6 @@ IMPL_FIXEDMEMPOOL_NEWDEL( ScEditCell, nMemPoolEditCell, nMemPoolEditCell )
@@ -4123,7 +4123,7 @@
void ScDocumentPool::StyleDeleted( ScStyleSheet* pStyle )
diff --git sc/source/core/data/documen2.cxx sc/source/core/data/documen2.cxx
-index d739a17..2e869e4 100644
+index 825baf5..7bd7a09 100644
--- sc/source/core/data/documen2.cxx
+++ sc/source/core/data/documen2.cxx
@@ -159,7 +159,6 @@ ScDocument::ScDocument( ScDocumentMode eMode,
@@ -4813,7 +4813,7 @@
if (pDPCollection)
pDPCollection->UpdateReference( URM_REORDER, aSourceRange, 0,0,nDz );
if (pDetOpList)
-@@ -1484,9 +856,11 @@ BOOL ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM
+@@ -1488,9 +860,11 @@ BOOL ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM
pRangeName->UpdateTabRef(nNewPos, 1);
pDBCollection->UpdateReference(
URM_INSDEL, 0,0,nNewPos, MAXCOL,MAXROW,MAXTAB, 0,0,1 );
@@ -4825,7 +4825,7 @@
if (pDPCollection)
pDPCollection->UpdateReference( URM_INSDEL, aRange, 0,0,1 );
if (pDetOpList)
-@@ -1581,7 +955,6 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos,
+@@ -1589,7 +963,6 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos,
if (VALIDTAB(nDestPos) && pTab[nDestPos])
{
pTab[nDestPos]->DeleteArea( 0,0, MAXCOL,MAXROW, IDF_ALL );
@@ -5302,10 +5302,10 @@
BOOL ScDocument::HasBackgroundDraw( SCTAB nTab, const Rectangle& rMMRect )
{
diff --git sc/source/core/data/document.cxx sc/source/core/data/document.cxx
-index 0fb382f..6d4fa93 100644
+index 6183449..a94a264 100644
--- sc/source/core/data/document.cxx
+++ sc/source/core/data/document.cxx
-@@ -326,9 +326,11 @@ BOOL ScDocument::InsertTab( SCTAB nPos, const String& rName,
+@@ -327,9 +327,11 @@ BOOL ScDocument::InsertTab( SCTAB nPos, const String& rName,
pRangeName->UpdateTabRef( nPos, 1 );
pDBCollection->UpdateReference(
URM_INSDEL, 0,0,nPos, MAXCOL,MAXROW,MAXTAB, 0,0,1 );
@@ -5317,7 +5317,7 @@
if (pDPCollection)
pDPCollection->UpdateReference( URM_INSDEL, aRange, 0,0,1 );
if (pDetOpList)
-@@ -414,9 +416,11 @@ BOOL ScDocument::DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc )
+@@ -419,9 +421,11 @@ BOOL ScDocument::DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc )
pRangeName->UpdateTabRef( nTab, 2 );
pDBCollection->UpdateReference(
URM_INSDEL, 0,0,nTab, MAXCOL,MAXROW,MAXTAB, 0,0,-1 );
@@ -5329,7 +5329,7 @@
if (pDPCollection)
pDPCollection->UpdateReference( URM_INSDEL, aRange, 0,0,-1 );
if (pDetOpList)
-@@ -2464,13 +2468,6 @@ BOOL ScDocument::HasSelectionData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const
+@@ -2475,13 +2479,6 @@ BOOL ScDocument::HasSelectionData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const
}
@@ -5343,7 +5343,7 @@
void ScDocument::SetDirty()
{
BOOL bOldAutoCalc = GetAutoCalc();
-@@ -2604,15 +2601,6 @@ void ScDocument::CalcAfterLoad()
+@@ -2615,15 +2612,6 @@ void ScDocument::CalcAfterLoad()
}
@@ -5359,7 +5359,7 @@
USHORT ScDocument::GetErrCode( const ScAddress& rPos ) const
{
SCTAB nTab = rPos.Tab();
-@@ -2945,13 +2933,6 @@ const ScBitMaskCompressedArray< SCROW, BYTE> & ScDocument::GetRowFlagsArray(
+@@ -2956,13 +2944,6 @@ const ScBitMaskCompressedArray< SCROW, BYTE> & ScDocument::GetRowFlagsArray(
}
@@ -5373,7 +5373,7 @@
SCROW ScDocument::GetLastFlaggedRow( SCTAB nTab ) const
{
if ( ValidTab(nTab) && pTab[nTab] )
-@@ -3346,21 +3327,6 @@ BOOL ScDocument::IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllSt
+@@ -3357,21 +3338,6 @@ BOOL ScDocument::IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllSt
}
@@ -5395,7 +5395,7 @@
BOOL ScDocument::ApplyFlagsTab( SCCOL nStartCol, SCROW nStartRow,
SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, INT16 nFlags )
{
-@@ -3373,20 +3339,6 @@ BOOL ScDocument::ApplyFlagsTab( SCCOL nStartCol, SCROW nStartRow,
+@@ -3384,20 +3350,6 @@ BOOL ScDocument::ApplyFlagsTab( SCCOL nStartCol, SCROW nStartRow,
}
@@ -5416,7 +5416,7 @@
BOOL ScDocument::RemoveFlagsTab( SCCOL nStartCol, SCROW nStartRow,
SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, INT16 nFlags )
{
-@@ -3596,22 +3548,6 @@ void ScDocument::FindMaxRotCol( SCTAB nTab, RowInfo* pRowInfo, SCSIZE nArrCount,
+@@ -3607,22 +3559,6 @@ void ScDocument::FindMaxRotCol( SCTAB nTab, RowInfo* pRowInfo, SCSIZE nArrCount,
}
}
@@ -5439,7 +5439,7 @@
void ScDocument::GetBorderLines( SCCOL nCol, SCROW nRow, SCTAB nTab,
const SvxBorderLine** ppLeft, const SvxBorderLine** ppTop,
const SvxBorderLine** ppRight, const SvxBorderLine** ppBottom ) const
-@@ -3723,25 +3659,6 @@ BOOL ScDocument::IsBlockEditable( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
+@@ -3734,25 +3670,6 @@ BOOL ScDocument::IsBlockEditable( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
}
@@ -5465,7 +5465,7 @@
BOOL ScDocument::IsSelectionEditable( const ScMarkData& rMark,
BOOL* pOnlyNotBecauseOfMatrix /* = NULL */ ) const
{
-@@ -3792,67 +3709,6 @@ BOOL ScDocument::IsSelectionEditable( const ScMarkData& rMark,
+@@ -3803,67 +3720,6 @@ BOOL ScDocument::IsSelectionEditable( const ScMarkData& rMark,
}
@@ -5533,7 +5533,7 @@
BOOL ScDocument::HasSelectedBlockMatrixFragment( SCCOL nStartCol, SCROW nStartRow,
SCCOL nEndCol, SCROW nEndRow,
const ScMarkData& rMark ) const
-@@ -4146,36 +4002,6 @@ BOOL ScDocument::RefreshAutoFilter( SCCOL nStartCol, SCROW nStartRow,
+@@ -4157,36 +4013,6 @@ BOOL ScDocument::RefreshAutoFilter( SCCOL nStartCol, SCROW nStartRow,
}
@@ -5570,7 +5570,7 @@
BOOL ScDocument::IsHorOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const
-@@ -4402,234 +4228,6 @@ void ScDocument::StylesToNames()
+@@ -4413,234 +4239,6 @@ void ScDocument::StylesToNames()
}
@@ -5805,7 +5805,7 @@
ULONG ScDocument::GetCellCount() const
{
ULONG nCellCount = 0L;
-@@ -4712,14 +4310,6 @@ void ScDocument::SetRepeatArea( SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol, SCRO
+@@ -4723,14 +4321,6 @@ void ScDocument::SetRepeatArea( SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol, SCRO
}
@@ -5820,7 +5820,7 @@
void ScDocument::UpdatePageBreaks( SCTAB nTab, const ScRange* pUserArea )
{
if ( ValidTab(nTab) && pTab[nTab] )
-@@ -4818,13 +4408,6 @@ void ScDocument::AddPrintRange( SCTAB nTab, const ScRange& rNew )
+@@ -4829,13 +4419,6 @@ void ScDocument::AddPrintRange( SCTAB nTab, const ScRange& rNew )
}
@@ -5835,10 +5835,10 @@
{
if (ValidTab(nTab) && pTab[nTab])
diff --git sc/source/core/data/dpcachetable.cxx sc/source/core/data/dpcachetable.cxx
-index 1be291c..707b56d 100644
+index f04cc44..d8d3214 100644
--- sc/source/core/data/dpcachetable.cxx
+++ sc/source/core/data/dpcachetable.cxx
-@@ -261,11 +261,6 @@ ScDPCacheTable::~ScDPCacheTable()
+@@ -204,11 +204,6 @@ ScDPCacheTable::~ScDPCacheTable()
{
}
@@ -5851,10 +5851,10 @@
{
return maTable.size();
diff --git sc/source/core/data/dpgroup.cxx sc/source/core/data/dpgroup.cxx
-index 5cc1893..42c1f17 100644
+index 2c60d1b..332744c 100644
--- sc/source/core/data/dpgroup.cxx
+++ sc/source/core/data/dpgroup.cxx
-@@ -1317,28 +1317,6 @@ void ScDPGroupTableData::CopyFields(const vector<long>& rFieldDims, vector<long>
+@@ -1319,28 +1319,6 @@ void ScDPGroupTableData::CopyFields(const vector<long>& rFieldDims, vector<long>
}
}
@@ -5884,7 +5884,7 @@
{
long nGroupedColumns = aGroups.size();
diff --git sc/source/core/data/dpobject.cxx sc/source/core/data/dpobject.cxx
-index b6ae4f6..8d795d8 100644
+index 0bd6924..d8b5eca 100644
--- sc/source/core/data/dpobject.cxx
+++ sc/source/core/data/dpobject.cxx
@@ -1690,226 +1690,6 @@ SCSIZE lcl_FillOldFields( PivotField* pFields,
@@ -6130,7 +6130,7 @@
// -----------------------------------------------------------------------
-@@ -2536,82 +2318,6 @@ DataObject* ScDPCollection::Clone() const
+@@ -2581,82 +2363,6 @@ DataObject* ScDPCollection::Clone() const
return new ScDPCollection(*this);
}
@@ -6213,7 +6213,7 @@
void ScDPCollection::DeleteOnTab( SCTAB nTab )
{
USHORT nPos = 0;
-@@ -2709,16 +2415,11 @@ String ScDPCollection::CreateNewName( USHORT nMin ) const
+@@ -2754,13 +2460,6 @@ String ScDPCollection::CreateNewName( USHORT nMin ) const
return String(); // should not happen
}
@@ -6223,15 +6223,11 @@
- if (!((const ScDPObject*)At(i))->GetName().Len())
- ((ScDPObject*)At(i))->SetName( CreateNewName() );
-}
-
- //------------------------------------------------------------------------
- // convert old pivot tables into new datapilot tables
-
-+#if OLD_PIVOT_IMPLEMENTATION
- void ScDPCollection::ConvertOldTables( ScPivotCollection& rOldColl )
+-
+ ScSimpleSharedString& ScDPCollection::GetSharedString()
{
- // convert old pivot tables into new datapilot tables
-@@ -2733,6 +2434,7 @@ void ScDPCollection::ConvertOldTables( ScPivotCollection& rOldColl )
+ return maSharedString;
+@@ -2835,6 +2534,7 @@ void ScDPCollection::ConvertOldTables( ScPivotCollection& rOldColl )
}
rOldColl.FreeAll();
}
@@ -6342,10 +6338,10 @@
{
long nCount = aDimList.Count();
diff --git sc/source/core/data/dpsdbtab.cxx sc/source/core/data/dpsdbtab.cxx
-index 5ac8d6d..5209200 100644
+index e8d0509..47793fe 100644
--- sc/source/core/data/dpsdbtab.cxx
+++ sc/source/core/data/dpsdbtab.cxx
-@@ -225,15 +225,6 @@ long ScDatabaseDPData::GetColumnCount()
+@@ -232,15 +232,6 @@ long ScDatabaseDPData::GetColumnCount()
return pImpl->nColCount;
}
@@ -6362,10 +6358,10 @@
{
CreateCacheTable();
diff --git sc/source/core/data/dpshttab.cxx sc/source/core/data/dpshttab.cxx
-index 9dab27c..fcdce80 100644
+index 76410c6..4c0fa8c 100644
--- sc/source/core/data/dpshttab.cxx
+++ sc/source/core/data/dpshttab.cxx
-@@ -137,12 +137,6 @@ long ScSheetDPData::GetColumnCount()
+@@ -140,12 +140,6 @@ long ScSheetDPData::GetColumnCount()
return pImpl->aCacheTable.getColSize();
}
@@ -6454,7 +6450,7 @@
BOOL bBack,
xub_StrLen& rFStart, // Ein- und Ausgabe
diff --git sc/source/core/data/global2.cxx sc/source/core/data/global2.cxx
-index 2cbda72..54dd38d 100644
+index abfae52..d6b4913 100644
--- sc/source/core/data/global2.cxx
+++ sc/source/core/data/global2.cxx
@@ -230,37 +230,6 @@ BOOL ScQueryEntry::operator==( const ScQueryEntry& r ) const
@@ -7889,7 +7885,7 @@
ScUnoAddInHelpIdGenerator::ScUnoAddInHelpIdGenerator( const ::rtl::OUString& rServiceName )
{
diff --git sc/source/core/tool/address.cxx sc/source/core/tool/address.cxx
-index 44c84c0..20bd234 100644
+index 02fdcc0..234155c 100644
--- sc/source/core/tool/address.cxx
+++ sc/source/core/tool/address.cxx
@@ -1056,25 +1056,6 @@ void ScRange::Justify()
@@ -8250,7 +8246,7 @@
{
if ( eGlue != SC_CHARTGLUE_NA )
diff --git sc/source/core/tool/chgtrack.cxx sc/source/core/tool/chgtrack.cxx
-index d572be0..7a62176 100644
+index 7f4e205..fc03ddd 100644
--- sc/source/core/tool/chgtrack.cxx
+++ sc/source/core/tool/chgtrack.cxx
@@ -377,19 +377,6 @@ void ScChangeAction::RemoveAllLinks()
@@ -8362,7 +8358,7 @@
BOOL ScChangeActionDel::StoreLinks( SvStream& rStrm ) const
{
BOOL bOk = ScChangeAction::StoreLinks( rStrm );
-@@ -3884,21 +3810,6 @@ void ScChangeTrack::DeleteGeneratedDelContent( ScChangeActionContent* pContent )
+@@ -3628,21 +3554,6 @@ void ScChangeTrack::DeleteGeneratedDelContent( ScChangeActionContent* pContent )
}
@@ -8495,10 +8491,10 @@
DataObject* TypedStrData::Clone() const
{
diff --git sc/source/core/tool/compiler.cxx sc/source/core/tool/compiler.cxx
-index 41df88b..b566f2d 100644
+index 785b909..aefd75a 100644
--- sc/source/core/tool/compiler.cxx
+++ sc/source/core/tool/compiler.cxx
-@@ -5362,16 +5362,6 @@ S lcl_adjval( S& n, T pos, T max, BOOL bRel )
+@@ -5407,16 +5407,6 @@ S lcl_adjval( S& n, T pos, T max, BOOL bRel )
return n;
}
@@ -9171,7 +9167,7 @@
//==================================================================
// Config Item containing input options
diff --git sc/source/core/tool/interpr4.cxx sc/source/core/tool/interpr4.cxx
-index e48178b..b501fa5 100644
+index a59792f..e129550 100644
--- sc/source/core/tool/interpr4.cxx
+++ sc/source/core/tool/interpr4.cxx
@@ -2872,13 +2872,6 @@ void ScInterpreter::ScErrCell()
@@ -15769,7 +15765,7 @@
ScTabViewObj::ScTabViewObj( ScTabViewShell* pViewSh ) :
ScViewPaneBase( pViewSh, SC_VIEWPANE_ACTIVE ),
diff --git sc/source/ui/vba/vbahelper.cxx sc/source/ui/vba/vbahelper.cxx
-index 19f6c94..9b34103 100644
+index 0632388..35b7ad8 100644
--- sc/source/ui/vba/vbahelper.cxx
+++ sc/source/ui/vba/vbahelper.cxx
@@ -308,22 +308,6 @@ void implnPasteSpecial(USHORT nFlags,USHORT nFunction,sal_Bool bSkipEmpty, sal_B
@@ -15808,7 +15804,7 @@
getCurrentDocument() throw (css::uno::RuntimeException);
ScTabViewShell* getBestViewShell( css::uno::Reference< css::frame::XModel>& xModel ) ;
diff --git sc/source/ui/vba/vbarange.cxx sc/source/ui/vba/vbarange.cxx
-index ef1abe4..edc2f5f 100644
+index b6d9f5e..0ee1f22 100644
--- sc/source/ui/vba/vbarange.cxx
+++ sc/source/ui/vba/vbarange.cxx
@@ -175,7 +175,6 @@ using ::std::vector;
@@ -16935,7 +16931,7 @@
ScSplitPos ScTabView::FindWindow( Window* pWindow ) const
{
diff --git sc/source/ui/view/tabview3.cxx sc/source/ui/view/tabview3.cxx
-index 5b5ac7b..18750ab 100644
+index 6475869..25bba3a 100644
--- sc/source/ui/view/tabview3.cxx
+++ sc/source/ui/view/tabview3.cxx
@@ -117,93 +117,6 @@ using namespace com::sun::star;
@@ -17052,7 +17048,7 @@
// UpdateInputHandler jetzt in CellContentChanged
-@@ -2086,20 +2005,6 @@ void ScTabView::UpdateFormulas()
+@@ -2087,20 +2006,6 @@ void ScTabView::UpdateFormulas()
UpdateEditView();
}
@@ -17073,7 +17069,7 @@
// PaintArea -Block neu zeichnen
void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
-@@ -2346,19 +2251,6 @@ void ScTabView::DoChartSelection(
+@@ -2347,19 +2252,6 @@ void ScTabView::DoChartSelection(
// DrawDragRect - Drag&Drop-Rechteck zeichnen (XOR)
@@ -17093,7 +17089,7 @@
// PaintGrid - Datenbereiche neu zeichnen
-@@ -2401,11 +2293,6 @@ void ScTabView::CreateAnchorHandles(SdrHdlList& rHdl, const ScAddress& rAddress)
+@@ -2402,11 +2294,6 @@ void ScTabView::CreateAnchorHandles(SdrHdlList& rHdl, const ScAddress& rAddress)
}
}
@@ -17105,7 +17101,7 @@
void ScTabView::PaintTopArea( SCCOL nStartCol, SCCOL nEndCol )
{
// Pixel-Position der linken Kante
-@@ -2463,11 +2350,6 @@ void ScTabView::PaintLeft()
+@@ -2464,11 +2351,6 @@ void ScTabView::PaintLeft()
}
}
@@ -17626,7 +17622,7 @@
// Pasten von FORMAT_FILE-Items
// wird nicht direkt aus Drop aufgerufen, sondern asynchron -> Dialoge sind erlaubt
diff --git sc/source/ui/view/viewfunc.cxx sc/source/ui/view/viewfunc.cxx
-index 1fee6ea..7669745 100644
+index 651f0c3..4fd5af5 100644
--- sc/source/ui/view/viewfunc.cxx
+++ sc/source/ui/view/viewfunc.cxx
@@ -99,11 +99,6 @@ ScViewFunc::ScViewFunc( Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pVi
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]