summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-13 10:30:16 +0200
committerNoel Grandin <noel@peralex.com>2015-11-13 10:54:20 +0200
commit343ec4b7234f4eb9709f09d453131100d3283ddc (patch)
treebe2bb9566746b026b2bae1a4cfc6fc69e3f21641 /sc
parent280553e30f4ddc932838f98a9efaac03a988a0df (diff)
sc: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: I21fdb9f503241c2fa38f3de059a1f674a6631c78
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/pivot.hxx9
-rw-r--r--sc/source/core/data/dpobject.cxx6
-rw-r--r--sc/source/core/data/pivot2.cxx3
-rw-r--r--sc/source/ui/dbgui/PivotLayoutDialog.cxx4
-rw-r--r--sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx2
-rw-r--r--sc/source/ui/dbgui/pvfundlg.cxx10
6 files changed, 18 insertions, 16 deletions
diff --git a/sc/inc/pivot.hxx b/sc/inc/pivot.hxx
index 35e6e6081338..073fab2f9e4d 100644
--- a/sc/inc/pivot.hxx
+++ b/sc/inc/pivot.hxx
@@ -42,20 +42,21 @@
#include "calcmacros.hxx"
#include <vector>
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <memory>
-#define PIVOT_DATA_FIELD (MAXCOLCOUNT)
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/sheet/DataPilotFieldReference.hpp>
#include <com/sun/star/sheet/DataPilotFieldSortInfo.hpp>
#include <com/sun/star/sheet/DataPilotFieldLayoutInfo.hpp>
#include <com/sun/star/sheet/DataPilotFieldAutoShowInfo.hpp>
+#define PIVOT_DATA_FIELD (MAXCOLCOUNT)
+
struct SC_DLLPUBLIC ScDPName
{
OUString maName; ///< Original name of the dimension.
OUString maLayoutName; ///< Layout name (display name)
- sal_uInt8 mnDupCount;
+ sal_uInt8 mnDupCount;
ScDPName();
explicit ScDPName(const OUString& rName, const OUString& rLayoutName, sal_uInt8 nDupCount);
@@ -108,7 +109,7 @@ struct ScDPLabelData
OUString SC_DLLPUBLIC getDisplayName() const;
};
-typedef boost::ptr_vector<ScDPLabelData> ScDPLabelDataVector;
+typedef std::vector< std::unique_ptr<ScDPLabelData> > ScDPLabelDataVector;
struct ScPivotField
{
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index c1fcdfc0c5ec..ed1c7d45b3d8 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -2385,9 +2385,9 @@ bool ScDPObject::FillLabelData(ScPivotParam& rParam)
for (sal_Int32 nDim = 0; nDim < nDimCount; ++nDim)
{
- std::unique_ptr<ScDPLabelData> pNewLabel(new ScDPLabelData);
+ ScDPLabelData* pNewLabel = new ScDPLabelData;
FillLabelDataForDimension(xDims, nDim, *pNewLabel);
- o3tl::ptr_container::push_back(rParam.maLabelArray, std::move(pNewLabel));
+ rParam.maLabelArray.push_back(std::unique_ptr<ScDPLabelData>(pNewLabel));
}
return true;
@@ -2625,7 +2625,7 @@ void ScDPObject::ConvertOrientation(
pDim->RemoveSubtotalName();
if (nDimIndex < rLabels.size())
{
- const ScDPLabelData& rLabel = rLabels[nDimIndex];
+ const ScDPLabelData& rLabel = *rLabels[nDimIndex].get();
if (!rLabel.maLayoutName.isEmpty())
pDim->SetLayoutName(rLabel.maLayoutName);
if (!rLabel.maSubtotalName.isEmpty())
diff --git a/sc/source/core/data/pivot2.cxx b/sc/source/core/data/pivot2.cxx
index d0ae6ccc2205..6b578daec482 100644
--- a/sc/source/core/data/pivot2.cxx
+++ b/sc/source/core/data/pivot2.cxx
@@ -37,6 +37,7 @@
#include "refupdat.hxx"
#include "stlpool.hxx"
#include "stlsheet.hxx"
+#include <o3tl/make_unique.hxx>
#if DEBUG_PIVOT_TABLE
using std::cout;
@@ -166,7 +167,7 @@ void ScPivotParam::SetLabelData(const ScDPLabelDataVector& rVector)
ScDPLabelDataVector::const_iterator it;
for (it = rVector.begin(); it != rVector.end(); ++it)
{
- aNewArray.push_back(new ScDPLabelData(*it));
+ aNewArray.push_back(o3tl::make_unique<ScDPLabelData>(*it->get()));
}
maLabelArray.swap(aNewArray);
}
diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
index 8ae684b5e538..531eb49dc31b 100644
--- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
@@ -560,7 +560,7 @@ void ScPivotLayoutDialog::ApplyLabelData(ScDPSaveData& rSaveData)
for (it = rLabelDataVector.begin(); it != rLabelDataVector.end(); ++it)
{
- const ScDPLabelData& pLabelData = *it;
+ const ScDPLabelData& pLabelData = *it->get();
OUString aUnoName = ScDPUtil::createDuplicateDimensionName(pLabelData.maName, pLabelData.mnDupCount);
ScDPSaveDimension* pSaveDimensions = rSaveData.GetExistingDimensionByName(aUnoName);
@@ -629,7 +629,7 @@ bool ScPivotLayoutDialog::IsDataElement(SCCOL nColumn)
ScDPLabelData& ScPivotLayoutDialog::GetLabelData(SCCOL nColumn)
{
- return maPivotParameters.maLabelArray[nColumn];
+ return *maPivotParameters.maLabelArray[nColumn].get();
}
void ScPivotLayoutDialog::PushDataFieldNames(std::vector<ScDPName>& rDataFieldNames)
diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx
index d4f98ab2b69f..3795601cde5a 100644
--- a/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx
@@ -40,7 +40,7 @@ void ScPivotLayoutTreeListLabel::FillLabelFields(ScDPLabelDataVector& rLabelVect
ScDPLabelDataVector::iterator it;
for (it = rLabelVector.begin(); it != rLabelVector.end(); ++it)
{
- const ScDPLabelData& rLabelData = *it;
+ const ScDPLabelData& rLabelData = *it->get();
ScItemValue* pValue = new ScItemValue(rLabelData.maName, rLabelData.mnCol, rLabelData.mnFuncMask);
maItemValues.push_back(std::unique_ptr<ScItemValue>(pValue));
diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx
index 0bcca91ff5ef..c60169414bfb 100644
--- a/sc/source/ui/dbgui/pvfundlg.cxx
+++ b/sc/source/ui/dbgui/pvfundlg.cxx
@@ -282,11 +282,11 @@ void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncDa
OUString aSelectedEntry;
for( ScDPLabelDataVector::const_iterator aIt = mrLabelVec.begin(), aEnd = mrLabelVec.end(); aIt != aEnd; ++aIt )
{
- mpLbBaseField->InsertEntry(aIt->getDisplayName());
+ mpLbBaseField->InsertEntry((*aIt)->getDisplayName());
maBaseFieldNameMap.insert(
- NameMapType::value_type(aIt->getDisplayName(), aIt->maName));
- if (aIt->maName == rFuncData.maFieldRef.ReferenceField)
- aSelectedEntry = aIt->getDisplayName();
+ NameMapType::value_type((*aIt)->getDisplayName(), (*aIt)->maName));
+ if ((*aIt)->maName == rFuncData.maFieldRef.ReferenceField)
+ aSelectedEntry = (*aIt)->getDisplayName();
}
// base item list box
@@ -402,7 +402,7 @@ IMPL_LINK_TYPED( ScDPFunctionDlg, SelectHdl, ListBox&, rLBox, void )
size_t nBasePos = mpLbBaseField->GetSelectEntryPos();
if( nBasePos < mrLabelVec.size() )
{
- const vector<ScDPLabelData::Member>& rMembers = mrLabelVec[nBasePos].maMembers;
+ const vector<ScDPLabelData::Member>& rMembers = mrLabelVec[nBasePos]->maMembers;
mbEmptyItem = lclFillListBox(*mpLbBaseItem, rMembers, SC_BASEITEM_USER_POS);
// build cache for base names.
NameMapType aMap;