From 57875110e3365988bb01cfef42d8094cb076002d Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 23 Feb 2012 15:02:28 -0500 Subject: 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. --- sc/inc/dpsave.hxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sc/inc/dpsave.hxx') 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 DupNameCountType; public: typedef boost::ptr_vector 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& rDims) const; - void AddDimension(ScDPSaveDimension* pDim) - { aDimList.push_back(pDim); } + void AddDimension(ScDPSaveDimension* pDim); /** * Get a dimension object by its name. 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 -- cgit