diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-02-27 17:14:56 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-02-27 23:47:00 -0500 |
commit | df0aab7f66ba227eda91a8a3568665036556bac0 (patch) | |
tree | f8cb653e0be9c1e629380cff19cdcc53da402da5 /sc | |
parent | be76f5d701c9e229e31fb77b606358e7488020d0 (diff) |
Fix exporting pivot tables to xls esp wrt exporting duplicate data fields.
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/dputil.hxx | 3 | ||||
-rw-r--r-- | sc/source/filter/excel/xepivot.cxx | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sc/inc/dputil.hxx b/sc/inc/dputil.hxx index 46ffa6b24cfe..cf574c1e056e 100644 --- a/sc/inc/dputil.hxx +++ b/sc/inc/dputil.hxx @@ -30,13 +30,14 @@ #define __SC_DPUTIL_HXX__ #include "rtl/ustring.hxx" +#include "scdllapi.h" class ScDPUtil { public: static bool isDuplicateDimension(const rtl::OUString& rName); - static rtl::OUString getSourceDimensionName(const rtl::OUString& rName); + SC_DLLPUBLIC static rtl::OUString getSourceDimensionName(const rtl::OUString& rName); static rtl::OUString createDuplicateDimensionName(const rtl::OUString& rOriginal, size_t nDupCount); }; diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx index 60e2166b4189..e1a9ad15d46c 100644 --- a/sc/source/filter/excel/xepivot.cxx +++ b/sc/source/filter/excel/xepivot.cxx @@ -49,6 +49,7 @@ #include "fapihelper.hxx" #include "xestring.hxx" #include "xelink.hxx" +#include "dputil.hxx" using namespace ::oox; @@ -1294,7 +1295,7 @@ XclExpPivotTable::XclExpPivotTable( const XclExpRoot& rRoot, const ScDPObject& r maFieldList.AppendNewRecord( new XclExpPTField( *this, nFieldIdx ) ); boost::ptr_vector<ScDPSaveDimension>::const_iterator iter; - const boost::ptr_vector<ScDPSaveDimension>& rDimList = pSaveData->GetDimensions(); + const ScDPSaveData::DimsType& rDimList = pSaveData->GetDimensions(); /* 2) First process all data dimensions, they are needed for extended settings of row/column/page fields (sorting/auto show). */ @@ -1524,8 +1525,8 @@ XclExpPTField* XclExpPivotTable::GetFieldAcc( const ScDPSaveDimension& rSaveDim return &maDataOrientField; // a real dimension - String aFieldName( rSaveDim.GetName() ); - return aFieldName.Len() ? GetFieldAcc( aFieldName ) : 0; + rtl::OUString aFieldName = ScDPUtil::getSourceDimensionName(rSaveDim.GetName()); + return aFieldName.isEmpty() ? NULL : GetFieldAcc(aFieldName); } // fill data -------------------------------------------------------------- |