diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-02-23 15:02:28 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-02-24 00:51:40 -0500 |
commit | 57875110e3365988bb01cfef42d8094cb076002d (patch) | |
tree | 3ba29fd9d2d4629d55ed58238b34047e0021c693 /sc/inc/dpsave.hxx | |
parent | efae4424c0f9381e6050541784358bfe1095189a (diff) |
Ensure that the save dimension and regular dimension have identical name.
This was not the case previously, for duplicated dimensions. Without this,
setting layout names (aka custom names) to data fields would not work
properly especially when the data fields are duplicated.
Diffstat (limited to 'sc/inc/dpsave.hxx')
-rw-r--r-- | sc/inc/dpsave.hxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sc/inc/dpsave.hxx b/sc/inc/dpsave.hxx index 65d04984cbac..3107da8f8985 100644 --- a/sc/inc/dpsave.hxx +++ b/sc/inc/dpsave.hxx @@ -237,10 +237,13 @@ public: class ScDPSaveData { + typedef boost::unordered_map<rtl::OUString, size_t, rtl::OUStringHash> DupNameCountType; public: typedef boost::ptr_vector<ScDPSaveDimension> DimsType; + private: DimsType aDimList; + DupNameCountType maDupNameCounts; /// keep track of number of duplicates in each name. ScDPDimensionSaveData* pDimensionData; // settings that create new dimensions sal_uInt16 nColumnGrandMode; sal_uInt16 nRowGrandMode; @@ -281,8 +284,7 @@ public: com::sun::star::sheet::DataPilotFieldOrientation eOrientation, std::vector<const ScDPSaveDimension*>& rDims) const; - void AddDimension(ScDPSaveDimension* pDim) - { aDimList.push_back(pDim); } + void AddDimension(ScDPSaveDimension* pDim); /** * Get a dimension object by its name. <i>If one doesn't exist for the @@ -351,6 +353,10 @@ public: * @param rDimName dimension name */ SC_DLLPUBLIC bool HasInvisibleMember(const ::rtl::OUString& rDimName) const; + +private: + void CheckDuplicateName(ScDPSaveDimension& rDim); + void RemoveDuplicateNameCount(const rtl::OUString& rName); }; #endif |