summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-12 12:57:34 +0200
committerNoel Grandin <noel@peralex.com>2015-11-13 10:54:17 +0200
commit33bf2449730c796a41a25f9287aa40e51c2bc464 (patch)
tree83b7c701dc10f31938e7a229c01fcc431f8e52ce
parentsc: boost::ptr_vector->std::vector<std::unique_ptr> (diff)
downloadcore-33bf2449730c796a41a25f9287aa40e51c2bc464.tar.gz
core-33bf2449730c796a41a25f9287aa40e51c2bc464.zip
sc: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: Ib53a084c16eaf0c7a44573ec8f4fabd782684b7c
-rw-r--r--sc/source/filter/inc/condformatbuffer.hxx6
-rw-r--r--sc/source/filter/inc/extlstcontext.hxx5
-rw-r--r--sc/source/filter/oox/condformatbuffer.cxx10
-rw-r--r--sc/source/filter/oox/extlstcontext.cxx6
4 files changed, 14 insertions, 13 deletions
diff --git a/sc/source/filter/inc/condformatbuffer.hxx b/sc/source/filter/inc/condformatbuffer.hxx
index d1b22e687c29..b2dd6c145a59 100644
--- a/sc/source/filter/inc/condformatbuffer.hxx
+++ b/sc/source/filter/inc/condformatbuffer.hxx
@@ -269,14 +269,14 @@ public:
class ExtCfCondFormat
{
public:
- ExtCfCondFormat(const ScRangeList& aRange, boost::ptr_vector<ScFormatEntry>& rEntries);
+ ExtCfCondFormat(const ScRangeList& aRange, std::vector< std::unique_ptr<ScFormatEntry> >& rEntries);
~ExtCfCondFormat();
const ScRangeList& getRange();
- const boost::ptr_vector<ScFormatEntry>& getEntries();
+ const std::vector< std::unique_ptr<ScFormatEntry> >& getEntries();
private:
- boost::ptr_vector<ScFormatEntry> maEntries;
+ std::vector< std::unique_ptr<ScFormatEntry> > maEntries;
ScRangeList maRange;
};
diff --git a/sc/source/filter/inc/extlstcontext.hxx b/sc/source/filter/inc/extlstcontext.hxx
index 51fd498acf1e..fc2e6af035a0 100644
--- a/sc/source/filter/inc/extlstcontext.hxx
+++ b/sc/source/filter/inc/extlstcontext.hxx
@@ -14,7 +14,8 @@
#include "worksheetfragment.hxx"
#include "workbookfragment.hxx"
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
+#include <memory>
struct ScDataBarFormatData;
class ScFormatEntry;
@@ -50,7 +51,7 @@ public:
private:
OUString aChars;
- boost::ptr_vector<ScFormatEntry> maEntries;
+ std::vector<std::unique_ptr<ScFormatEntry> > maEntries;
IconSetRule* mpCurrentRule;
};
diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx
index df133a4a4182..87d8b9723239 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -1159,10 +1159,10 @@ void CondFormatBuffer::finalizeImport()
pDoc->AddCondFormatData(rRange, nTab, nKey);
}
- const boost::ptr_vector<ScFormatEntry>& rEntries = itr->getEntries();
+ const std::vector< std::unique_ptr<ScFormatEntry> >& rEntries = itr->getEntries();
for (auto i = rEntries.begin(); i != rEntries.end(); ++i)
{
- pFormat->AddEntry(i->Clone(pDoc));
+ pFormat->AddEntry((*i)->Clone(pDoc));
}
}
}
@@ -1328,10 +1328,10 @@ void ExtCfDataBarRule::importCfvo( const AttributeList& rAttribs )
maModel.maColorScaleType = rAttribs.getString( XML_type, OUString() );
}
-ExtCfCondFormat::ExtCfCondFormat(const ScRangeList& rRange, boost::ptr_vector<ScFormatEntry>& rEntries):
+ExtCfCondFormat::ExtCfCondFormat(const ScRangeList& rRange, std::vector< std::unique_ptr<ScFormatEntry> >& rEntries):
maRange(rRange)
{
- maEntries.transfer(maEntries.begin(), rEntries.begin(), rEntries.end(), rEntries);
+ maEntries.swap(rEntries);
}
ExtCfCondFormat::~ExtCfCondFormat()
@@ -1343,7 +1343,7 @@ const ScRangeList& ExtCfCondFormat::getRange()
return maRange;
}
-const boost::ptr_vector<ScFormatEntry>& ExtCfCondFormat::getEntries()
+const std::vector< std::unique_ptr<ScFormatEntry> >& ExtCfCondFormat::getEntries()
{
return maEntries;
}
diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx
index b7ff5de9b5a6..852ba7862f81 100644
--- a/sc/source/filter/oox/extlstcontext.cxx
+++ b/sc/source/filter/oox/extlstcontext.cxx
@@ -16,6 +16,7 @@
#include "document.hxx"
#include "rangeutl.hxx"
+#include <o3tl/make_unique.hxx>
using ::oox::core::ContextHandlerRef;
@@ -79,7 +80,7 @@ ContextHandlerRef ExtConditionalFormattingContext::onCreateContext(sal_Int32 nEl
{
if (mpCurrentRule)
{
- ScFormatEntry& rFormat = *maEntries.rbegin();
+ ScFormatEntry& rFormat = *maEntries.rbegin()->get();
assert(rFormat.GetType() == condformat::ICONSET);
ScIconSetFormat& rIconSet = static_cast<ScIconSetFormat&>(rFormat);
ScDocument* pDoc = &getScDocument();
@@ -111,8 +112,7 @@ ContextHandlerRef ExtConditionalFormattingContext::onCreateContext(sal_Int32 nEl
{
ScDocument* pDoc = &getScDocument();
mpCurrentRule = new IconSetRule(*this);
- ScIconSetFormat* pIconSet = new ScIconSetFormat(pDoc);
- maEntries.push_back(pIconSet);
+ maEntries.push_back(o3tl::make_unique<ScIconSetFormat>(pDoc));
return new IconSetContext(*this, mpCurrentRule);
}
else