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

use unique_ptr in ScViewOptions::CreateGridItem

Change-Id: I350e606b14a5a7f269fecca1d176f40c4343c344
Reviewed-on: https://gerrit.libreoffice.org/66005
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst d2313a5d
...@@ -94,7 +94,7 @@ public: ...@@ -94,7 +94,7 @@ public:
const ScGridOptions& GetGridOptions() const { return aGridOpt; } const ScGridOptions& GetGridOptions() const { return aGridOpt; }
void SetGridOptions( const ScGridOptions& rNew ) { aGridOpt = rNew; } void SetGridOptions( const ScGridOptions& rNew ) { aGridOpt = rNew; }
SvxGridItem* CreateGridItem() const; std::unique_ptr<SvxGridItem> CreateGridItem() const;
ScViewOptions& operator= ( const ScViewOptions& rCpy ); ScViewOptions& operator= ( const ScViewOptions& rCpy );
bool operator== ( const ScViewOptions& rOpt ) const; bool operator== ( const ScViewOptions& rOpt ) const;
......
...@@ -156,9 +156,9 @@ bool ScViewOptions::operator==( const ScViewOptions& rOpt ) const ...@@ -156,9 +156,9 @@ bool ScViewOptions::operator==( const ScViewOptions& rOpt ) const
return bEqual; return bEqual;
} }
SvxGridItem* ScViewOptions::CreateGridItem() const std::unique_ptr<SvxGridItem> ScViewOptions::CreateGridItem() const
{ {
SvxGridItem* pItem = new SvxGridItem( SID_ATTR_GRID_OPTIONS ); std::unique_ptr<SvxGridItem> pItem(new SvxGridItem( SID_ATTR_GRID_OPTIONS ));
pItem->SetFieldDrawX ( aGridOpt.GetFieldDrawX() ); pItem->SetFieldDrawX ( aGridOpt.GetFieldDrawX() );
pItem->SetFieldDivisionX ( aGridOpt.GetFieldDivisionX() ); pItem->SetFieldDivisionX ( aGridOpt.GetFieldDivisionX() );
......
...@@ -1965,9 +1965,9 @@ std::unique_ptr<SfxItemSet> ScModule::CreateItemSet( sal_uInt16 nId ) ...@@ -1965,9 +1965,9 @@ std::unique_ptr<SfxItemSet> ScModule::CreateItemSet( sal_uInt16 nId )
pRet->Put( ScTpPrintItem( GetPrintOptions() ) ); pRet->Put( ScTpPrintItem( GetPrintOptions() ) );
// TP_GRID // TP_GRID
SvxGridItem* pSvxGridItem = aViewOpt.CreateGridItem(); std::unique_ptr<SvxGridItem> pSvxGridItem = aViewOpt.CreateGridItem();
pRet->Put( *pSvxGridItem ); pRet->Put( *pSvxGridItem );
delete pSvxGridItem; pSvxGridItem.reset();
// TP_USERLISTS // TP_USERLISTS
if ( pUL ) if ( pUL )
......
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