summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-12 09:54:28 +0200
committerNoel Grandin <noel@peralex.com>2015-11-12 10:45:04 +0200
commite6f574211cba9687fefd3efddf732edefc72da31 (patch)
treedaa5fefa46adf0f3616b9d2f71848c3733cf50cb
parent3d85664ffc00122f421d80ef417c09d0a8bd2eac (diff)
sc: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: Ic362e3aa55f5ae2e9a789922257ce9db99ef0a34
-rw-r--r--sc/source/filter/xml/XMLStylesExportHelper.cxx9
-rw-r--r--sc/source/filter/xml/XMLStylesExportHelper.hxx4
2 files changed, 7 insertions, 6 deletions
diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx
index 979024ae0e76..4805ccc342ec 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.cxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx
@@ -34,6 +34,7 @@
#include <com/sun/star/sheet/TableValidationVisibility.hpp>
#include <comphelper/extract.hxx>
#include <sfx2/app.hxx>
+#include <o3tl/make_unique.hxx>
#include <algorithm>
@@ -1118,7 +1119,7 @@ void ScRowStyles::AddNewTable(const sal_Int32 nTable, const sal_Int32 nFields)
if (nTable > nSize)
for (sal_Int32 i = nSize; i < nTable; ++i)
{
- aTables.push_back(new StylesType(0, nFields+1, -1));
+ aTables.push_back(o3tl::make_unique<StylesType>(0, nFields+1, -1));
}
}
@@ -1132,7 +1133,7 @@ sal_Int32 ScRowStyles::GetStyleNameIndex(const sal_Int32 nTable, const sal_Int32
// Cache hit !
return maCache.mnStyle;
- StylesType& r = aTables[nTable];
+ StylesType& r = *aTables[nTable].get();
if (!r.is_tree_valid())
r.build_tree();
sal_Int32 nStyle(0);
@@ -1154,7 +1155,7 @@ void ScRowStyles::AddFieldStyleName(const sal_Int32 nTable, const sal_Int32 nFie
const sal_Int32 nStringIndex)
{
OSL_ENSURE(static_cast<size_t>(nTable) < aTables.size(), "wrong table");
- StylesType& r = aTables[nTable];
+ StylesType& r = *aTables[nTable].get();
r.insert_back(nField, nField+1, nStringIndex);
}
@@ -1163,7 +1164,7 @@ void ScRowStyles::AddFieldStyleName(const sal_Int32 nTable, const sal_Int32 nSta
{
OSL_ENSURE( nStartField <= nEndField, "bad field range");
OSL_ENSURE(static_cast<size_t>(nTable) < aTables.size(), "wrong table");
- StylesType& r = aTables[nTable];
+ StylesType& r = *aTables[nTable].get();
r.insert_back(nStartField, nEndField+1, nStringIndex);
}
diff --git a/sc/source/filter/xml/XMLStylesExportHelper.hxx b/sc/source/filter/xml/XMLStylesExportHelper.hxx
index 86825c320ad8..673dedb75bb5 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.hxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SC_SOURCE_FILTER_XML_XMLSTYLESEXPORTHELPER_HXX
#include <vector>
+#include <memory>
#include <list>
#include <com/sun/star/uno/Any.h>
#include <com/sun/star/table/CellRangeAddress.hpp>
@@ -29,7 +30,6 @@
#include <com/sun/star/sheet/ValidationAlertStyle.hpp>
#include <com/sun/star/sheet/ValidationType.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
#include <mdds/flat_segment_tree.hpp>
class ScDocument;
@@ -251,7 +251,7 @@ public:
class ScRowStyles : public ScColumnRowStylesBase
{
typedef ::mdds::flat_segment_tree<sal_Int32, sal_Int32> StylesType;
- ::boost::ptr_vector<StylesType> aTables;
+ std::vector<std::unique_ptr<StylesType> > aTables;
struct Cache
{
sal_Int32 mnTable;