Kaydet (Commit) e6f57421 authored tarafından Noel Grandin's avatar Noel Grandin

sc: boost::ptr_vector->std::vector<std::unique_ptr>

Change-Id: Ic362e3aa55f5ae2e9a789922257ce9db99ef0a34
üst 3d85664f
......@@ -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);
}
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment