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

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

Change-Id: Ie5d21180d49a7d82d4cc1f5b9a71152bb86d0555
üst 9265f9bd
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
#include "rangelst.hxx" #include "rangelst.hxx"
#include <memory> #include <memory>
#include <vector>
#include <boost/ptr_container/ptr_vector.hpp>
class ScColorScaleFormat; class ScColorScaleFormat;
class ScDataBarFormat; class ScDataBarFormat;
...@@ -293,7 +292,7 @@ public: ...@@ -293,7 +292,7 @@ public:
/** Imports settings from the CONDFORMATTING record. */ /** Imports settings from the CONDFORMATTING record. */
CondFormatRef importCondFormatting( SequenceInputStream& rStrm ); CondFormatRef importCondFormatting( SequenceInputStream& rStrm );
ExtCfDataBarRuleRef createExtCfDataBarRule(ScDataBarFormatData* pTarget); ExtCfDataBarRuleRef createExtCfDataBarRule(ScDataBarFormatData* pTarget);
boost::ptr_vector<ExtCfCondFormat>& importExtCondFormat(); std::vector< std::unique_ptr<ExtCfCondFormat> >& importExtCondFormat();
/** Converts an OOXML condition operator token to the API constant. */ /** Converts an OOXML condition operator token to the API constant. */
static sal_Int32 convertToApiOperator( sal_Int32 nToken ); static sal_Int32 convertToApiOperator( sal_Int32 nToken );
...@@ -307,7 +306,7 @@ private: ...@@ -307,7 +306,7 @@ private:
typedef RefVector< ExtCfDataBarRule > ExtCfDataBarRuleVec; typedef RefVector< ExtCfDataBarRule > ExtCfDataBarRuleVec;
CondFormatVec maCondFormats; /// All conditional formatting in a sheet. CondFormatVec maCondFormats; /// All conditional formatting in a sheet.
ExtCfDataBarRuleVec maCfRules; /// All external conditional formatting rules in a sheet. ExtCfDataBarRuleVec maCfRules; /// All external conditional formatting rules in a sheet.
boost::ptr_vector<ExtCfCondFormat> maExtCondFormats; std::vector< std::unique_ptr<ExtCfCondFormat> > maExtCondFormats;
}; };
} // namespace xls } // namespace xls
......
...@@ -1147,7 +1147,7 @@ void CondFormatBuffer::finalizeImport() ...@@ -1147,7 +1147,7 @@ void CondFormatBuffer::finalizeImport()
{ {
ScDocument* pDoc = &getScDocument(); ScDocument* pDoc = &getScDocument();
const ScRangeList& rRange = itr->getRange(); const ScRangeList& rRange = (*itr)->getRange();
SCTAB nTab = rRange.front()->aStart.Tab(); SCTAB nTab = rRange.front()->aStart.Tab();
ScConditionalFormat* pFormat = findFormatByRange(rRange, pDoc, nTab); ScConditionalFormat* pFormat = findFormatByRange(rRange, pDoc, nTab);
if (!pFormat) if (!pFormat)
...@@ -1159,7 +1159,7 @@ void CondFormatBuffer::finalizeImport() ...@@ -1159,7 +1159,7 @@ void CondFormatBuffer::finalizeImport()
pDoc->AddCondFormatData(rRange, nTab, nKey); pDoc->AddCondFormatData(rRange, nTab, nKey);
} }
const std::vector< std::unique_ptr<ScFormatEntry> >& rEntries = itr->getEntries(); const std::vector< std::unique_ptr<ScFormatEntry> >& rEntries = (*itr)->getEntries();
for (auto i = rEntries.begin(); i != rEntries.end(); ++i) for (auto i = rEntries.begin(); i != rEntries.end(); ++i)
{ {
pFormat->AddEntry((*i)->Clone(pDoc)); pFormat->AddEntry((*i)->Clone(pDoc));
...@@ -1181,7 +1181,7 @@ ExtCfDataBarRuleRef CondFormatBuffer::createExtCfDataBarRule(ScDataBarFormatData ...@@ -1181,7 +1181,7 @@ ExtCfDataBarRuleRef CondFormatBuffer::createExtCfDataBarRule(ScDataBarFormatData
return extRule; return extRule;
} }
boost::ptr_vector<ExtCfCondFormat>& CondFormatBuffer::importExtCondFormat() std::vector< std::unique_ptr<ExtCfCondFormat> >& CondFormatBuffer::importExtCondFormat()
{ {
return maExtCondFormats; return maExtCondFormats;
} }
......
...@@ -163,8 +163,8 @@ void ExtConditionalFormattingContext::onEndElement() ...@@ -163,8 +163,8 @@ void ExtConditionalFormattingContext::onEndElement()
aRange[i]->aEnd.SetTab(nTab); aRange[i]->aEnd.SetTab(nTab);
} }
boost::ptr_vector<ExtCfCondFormat>& rExtFormats = getCondFormats().importExtCondFormat(); std::vector< std::unique_ptr<ExtCfCondFormat> >& rExtFormats = getCondFormats().importExtCondFormat();
rExtFormats.push_back(new ExtCfCondFormat(aRange, maEntries)); rExtFormats.push_back(o3tl::make_unique<ExtCfCondFormat>(aRange, maEntries));
} }
break; break;
case XLS14_TOKEN(cfRule): case XLS14_TOKEN(cfRule):
......
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