update dev300-m57
[ooovba.git] / applied_patches / 0155-calc-dp-custom-names-sc-win32-fix.diff
blob5953bf6c48988ff4b54c8b6baefa1827a7d11931
1 diff --git sc/inc/dpgroup.hxx sc/inc/dpgroup.hxx
2 index 0aab7c8..e98a248 100644
3 --- sc/inc/dpgroup.hxx
4 +++ sc/inc/dpgroup.hxx
5 @@ -33,6 +33,7 @@
7 #include <vector>
8 #include <hash_set>
9 +#include <boost/shared_ptr.hpp>
11 #include "dptabdat.hxx"
12 #include "scdllapi.h"
13 @@ -183,7 +183,7 @@ class ScDPGroupTableData : public ScDPTableData
15 typedef ::std::hash_set< ::rtl::OUString, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > StringHashSet;
17 - ScDPTableData* pSourceData;
18 + ::boost::shared_ptr<ScDPTableData> pSourceData;
19 long nSourceCount;
20 ScDPGroupDimensionVec aGroups;
21 ScDPNumGroupDimension* pNumGroups; // array[nSourceCount]
22 @@ -201,7 +201,7 @@ class ScDPGroupTableData : public ScDPTableData
24 public:
25 // takes ownership of pSource
26 - ScDPGroupTableData( ScDPTableData* pSource, ScDocument* pDocument );
27 + ScDPGroupTableData( const ::boost::shared_ptr<ScDPTableData>& pSource, ScDocument* pDocument );
28 virtual ~ScDPGroupTableData();
30 void AddGroupDimension( const ScDPGroupDimension& rGroup );
31 diff --git sc/inc/dpobject.hxx sc/inc/dpobject.hxx
32 index 854e1da..503c531 100644
33 --- sc/inc/dpobject.hxx
34 +++ sc/inc/dpobject.hxx
35 @@ -38,7 +38,7 @@
36 #include "dpoutput.hxx"
37 #include <com/sun/star/sheet/XDimensionsSupplier.hpp>
39 -#include <memory>
40 +#include <boost/shared_ptr.hpp>
42 //------------------------------------------------------------------
44 @@ -104,7 +104,7 @@ private:
45 ScSheetSourceDesc* pSheetDesc; // for sheet data
46 ScImportSourceDesc* pImpDesc; // for database data
47 ScDPServiceDesc* pServDesc; // for external service
48 - ::std::auto_ptr<ScDPTableData> mpTableData;
49 + ::boost::shared_ptr<ScDPTableData> mpTableData;
50 // cached data
51 com::sun::star::uno::Reference<com::sun::star::sheet::XDimensionsSupplier> xSource;
52 ScDPOutput* pOutput;
53 diff --git sc/source/core/data/dpgroup.cxx sc/source/core/data/dpgroup.cxx
54 index 8b4bb57..cbb03ba 100644
55 --- sc/source/core/data/dpgroup.cxx
56 +++ sc/source/core/data/dpgroup.cxx
57 @@ -70,6 +70,7 @@ using ::rtl::OUStringHash;
58 using ::std::vector;
59 using ::std::hash_set;
60 using ::std::hash_map;
61 +using ::boost::shared_ptr;
63 #define D_TIMEFACTOR 86400.0
65 @@ -978,7 +978,7 @@ String lcl_GetNumGroupForValue( double fValue, const ScDPNumGroupInfo& rInfo, bo
66 return lcl_GetNumGroupName( fGroupStart, rInfo, bHasNonInteger, cDecSeparator, pFormatter );
69 -ScDPGroupTableData::ScDPGroupTableData( ScDPTableData* pSource, ScDocument* pDocument ) :
70 +ScDPGroupTableData::ScDPGroupTableData( const shared_ptr<ScDPTableData>& pSource, ScDocument* pDocument ) :
71 ScDPTableData(pDocument),
72 pSourceData( pSource ),
73 pDoc( pDocument )
74 @@ -993,7 +993,6 @@ ScDPGroupTableData::ScDPGroupTableData( ScDPTableData* pSource, ScDocument* pDoc
75 ScDPGroupTableData::~ScDPGroupTableData()
77 delete[] pNumGroups;
78 - delete pSourceData;
81 void ScDPGroupTableData::AddGroupDimension( const ScDPGroupDimension& rGroup )
82 diff --git sc/source/core/data/dpobject.cxx sc/source/core/data/dpobject.cxx
83 index 7e977f0..cd4dcd1 100644
84 --- sc/source/core/data/dpobject.cxx
85 +++ sc/source/core/data/dpobject.cxx
86 @@ -78,7 +78,7 @@
88 using namespace com::sun::star;
89 using ::std::vector;
90 -using ::std::auto_ptr;
91 +using ::boost::shared_ptr;
92 using ::com::sun::star::uno::Sequence;
93 using ::com::sun::star::uno::Reference;
94 using ::com::sun::star::uno::UNO_QUERY;
95 @@ -163,7 +163,7 @@ ScDPObject::ScDPObject( ScDocument* pD ) :
96 pSheetDesc( NULL ),
97 pImpDesc( NULL ),
98 pServDesc( NULL ),
99 - mpTableData(NULL),
100 + mpTableData(static_cast<ScDPTableData*>(NULL)),
101 pOutput( NULL ),
102 nAutoFormatIndex( 65535 ),
103 bSettingsChanged( FALSE ),
104 @@ -186,7 +186,7 @@ ScDPObject::ScDPObject(const ScDPObject& r) :
105 pSheetDesc( NULL ),
106 pImpDesc( NULL ),
107 pServDesc( NULL ),
108 - mpTableData(NULL),
109 + mpTableData(static_cast<ScDPTableData*>(NULL)),
110 pOutput( NULL ),
111 bSettingsChanged( FALSE ),
112 bAlive( FALSE ),
113 @@ -414,7 +414,7 @@ void ScDPObject::CreateOutput()
115 ScDPTableData* ScDPObject::GetTableData()
117 - if (!mpTableData.get())
118 + if (!mpTableData)
120 if ( pImpDesc )
122 @@ -435,7 +435,7 @@ ScDPTableData* ScDPObject::GetTableData()
123 // grouping (for cell or database data)
124 if ( pSaveData && pSaveData->GetExistingDimensionData() )
126 - auto_ptr<ScDPGroupTableData> pGroupData(new ScDPGroupTableData(mpTableData.release(), pDoc));
127 + shared_ptr<ScDPGroupTableData> pGroupData(new ScDPGroupTableData(mpTableData, pDoc));
128 pSaveData->GetExistingDimensionData()->WriteToData(*pGroupData);
129 mpTableData = pGroupData;