diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2018-07-11 21:53:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-13 08:38:57 +0200 |
commit | ddef60b9c26b1d2990c6c49dbbda73e7831f21fb (patch) | |
tree | 011cbead2168b4620536d840a9ff983f20b1dcdd /sc | |
parent | 1a8435a23e84f3ceeee580eb9d4404a738d98888 (diff) |
pass SvxFieldData around by std::unique_ptr
Change-Id: I9c826547d348000dd6c80e45d833e048caae0ed8
Reviewed-on: https://gerrit.libreoffice.org/57308
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/xmlcelli.cxx | 16 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlcelli.hxx | 6 | ||||
-rw-r--r-- | sc/source/ui/unoobj/fielduno.cxx | 2 |
3 files changed, 12 insertions, 12 deletions
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index c279deb63993..32a0cb1e6392 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -110,7 +110,7 @@ using namespace xmloff::token; ScXMLTableRowCellContext::ParaFormat::ParaFormat(ScEditEngineDefaulter& rEditEngine) : maItemSet(rEditEngine.GetEmptyItemSet()) {} -ScXMLTableRowCellContext::Field::Field(SvxFieldData* pData) : mpData(pData) {} +ScXMLTableRowCellContext::Field::Field(std::unique_ptr<SvxFieldData> pData) : mpData(std::move(pData)) {} ScXMLTableRowCellContext::Field::~Field() { @@ -325,10 +325,10 @@ void ScXMLTableRowCellContext::PushParagraphSpan(const OUString& rSpan, const OU PushFormat(nBegin, nEnd, rStyleName); } -void ScXMLTableRowCellContext::PushParagraphField(SvxFieldData* pData, const OUString& rStyleName) +void ScXMLTableRowCellContext::PushParagraphField(std::unique_ptr<SvxFieldData> pData, const OUString& rStyleName) { mbHasFormatRuns = true; - maFields.push_back(o3tl::make_unique<Field>(pData)); + maFields.push_back(o3tl::make_unique<Field>(std::move(pData))); Field& rField = *maFields.back().get(); sal_Int32 nPos = maParagraph.getLength(); @@ -583,27 +583,27 @@ OUString ScXMLTableRowCellContext::GetFirstParagraph() const void ScXMLTableRowCellContext::PushParagraphFieldDate(const OUString& rStyleName) { - PushParagraphField(new SvxDateField, rStyleName); + PushParagraphField(o3tl::make_unique<SvxDateField>(), rStyleName); } void ScXMLTableRowCellContext::PushParagraphFieldSheetName(const OUString& rStyleName) { SCTAB nTab = GetScImport().GetTables().GetCurrentCellPos().Tab(); - PushParagraphField(new SvxTableField(nTab), rStyleName); + PushParagraphField(o3tl::make_unique<SvxTableField>(nTab), rStyleName); } void ScXMLTableRowCellContext::PushParagraphFieldDocTitle(const OUString& rStyleName) { - PushParagraphField(new SvxFileField, rStyleName); + PushParagraphField(o3tl::make_unique<SvxFileField>(), rStyleName); } void ScXMLTableRowCellContext::PushParagraphFieldURL( const OUString& rURL, const OUString& rRep, const OUString& rStyleName, const OUString& rTargetFrame) { OUString aAbsURL = GetScImport().GetAbsoluteReference(rURL); - SvxURLField* pURLField = new SvxURLField(aAbsURL, rRep, SvxURLFormat::Repr); + std::unique_ptr<SvxURLField> pURLField(new SvxURLField(aAbsURL, rRep, SvxURLFormat::Repr)); pURLField->SetTargetFrame(rTargetFrame); - PushParagraphField(pURLField, rStyleName); + PushParagraphField(std::move(pURLField), rStyleName); } void ScXMLTableRowCellContext::PushParagraphEnd() diff --git a/sc/source/filter/xml/xmlcelli.hxx b/sc/source/filter/xml/xmlcelli.hxx index 0e567e051910..00f4122cdf3a 100644 --- a/sc/source/filter/xml/xmlcelli.hxx +++ b/sc/source/filter/xml/xmlcelli.hxx @@ -48,13 +48,13 @@ class ScXMLTableRowCellContext : public ScXMLImportContext struct Field { - tools::SvRef<SvxFieldData> mpData; + std::unique_ptr<SvxFieldData> mpData; ESelection maSelection; Field(const Field&) = delete; const Field& operator=(const Field&) = delete; - explicit Field(SvxFieldData* pData); + explicit Field(std::unique_ptr<SvxFieldData> pData); ~Field(); }; @@ -121,7 +121,7 @@ class ScXMLTableRowCellContext : public ScXMLImportContext bool IsPossibleErrorString() const; - void PushParagraphField(SvxFieldData* pData, const OUString& rStyleName); + void PushParagraphField(std::unique_ptr<SvxFieldData> pData, const OUString& rStyleName); void PushFormat(sal_Int32 nBegin, sal_Int32 nEnd, const OUString& rStyleName); diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx index 77856751701d..c75f351b9641 100644 --- a/sc/source/ui/unoobj/fielduno.cxx +++ b/sc/source/ui/unoobj/fielduno.cxx @@ -167,7 +167,7 @@ class ScUnoEditEngine : public ScEditEngineDefaulter ScUnoCollectMode eMode; sal_uInt16 nFieldCount; sal_Int32 mnFieldType; - tools::SvRef<SvxFieldData> + std::unique_ptr<SvxFieldData> pFound; // local copy sal_Int32 nFieldPar; sal_Int32 nFieldPos; |