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

return unique_ptr from MakeNumberInfoItem

Change-Id: I76a90ec9799e580c50b240bc906f83d62d3099b5
Reviewed-on: https://gerrit.libreoffice.org/69803
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 3d54a104
......@@ -345,7 +345,7 @@ public:
void ForceMove() { Move(); }
static SvxNumberInfoItem* MakeNumberInfoItem( ScDocument* pDoc, const ScViewData* pViewData );
static std::unique_ptr<SvxNumberInfoItem> MakeNumberInfoItem( ScDocument* pDoc, const ScViewData* pViewData );
static void UpdateNumberFormatter( const SvxNumberInfoItem& rInfoItem );
......
......@@ -314,7 +314,7 @@ void ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
SfxViewShell::Notify( rBC, rHint );
}
SvxNumberInfoItem* ScTabViewShell::MakeNumberInfoItem( ScDocument* pDoc, const ScViewData* pViewData )
std::unique_ptr<SvxNumberInfoItem> ScTabViewShell::MakeNumberInfoItem( ScDocument* pDoc, const ScViewData* pViewData )
{
// construct NumberInfo item
......@@ -364,13 +364,13 @@ SvxNumberInfoItem* ScTabViewShell::MakeNumberInfoItem( ScDocument* pDoc, const S
switch ( eValType )
{
case SvxNumberValueType::String:
return new SvxNumberInfoItem(
return std::make_unique<SvxNumberInfoItem>(
pDoc->GetFormatTable(),
aCellString,
SID_ATTR_NUMBERFORMAT_INFO );
case SvxNumberValueType::Number:
return new SvxNumberInfoItem(
return std::make_unique<SvxNumberInfoItem>(
pDoc->GetFormatTable(),
nCellValue,
SID_ATTR_NUMBERFORMAT_INFO );
......@@ -380,7 +380,7 @@ SvxNumberInfoItem* ScTabViewShell::MakeNumberInfoItem( ScDocument* pDoc, const S
;
}
return new SvxNumberInfoItem(
return std::make_unique<SvxNumberInfoItem>(
pDoc->GetFormatTable(), static_cast<sal_uInt16>(SID_ATTR_NUMBERFORMAT_INFO));
}
......
......@@ -531,7 +531,7 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName
pOldSet->Put( SfxUInt32Item( ATTR_VALUE_FORMAT,
pOldAttrs->GetNumberFormat( pDoc->GetFormatTable() ) ) );
pNumberInfoItem.reset(MakeNumberInfoItem(pDoc, &GetViewData()));
pNumberInfoItem = MakeNumberInfoItem(pDoc, &GetViewData());
pOldSet->MergeRange( SID_ATTR_NUMBERFORMAT_INFO, SID_ATTR_NUMBERFORMAT_INFO );
pOldSet->Put(*pNumberInfoItem );
......
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