summaryrefslogtreecommitdiff
path: root/sc/inc/chartpos.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-26 11:18:06 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-28 09:04:07 +0200
commitb1f9aa5f58ea322097998839e00d95fc40be8b22 (patch)
tree935830193d8050981f736c3439d57b7d9bc7e9e9 /sc/inc/chartpos.hxx
parent4ffb89466ff9e70678e807b7d29d94aa34d52bfe (diff)
loplugin:useuniqueptr in ScChartPositionMap
Change-Id: I7c3209dff1c09c40d7a3bb57db0f0b26254318f2 Reviewed-on: https://gerrit.libreoffice.org/60996 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/inc/chartpos.hxx')
-rw-r--r--sc/inc/chartpos.hxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/sc/inc/chartpos.hxx b/sc/inc/chartpos.hxx
index 275c4da1dafd..0069b1a80c50 100644
--- a/sc/inc/chartpos.hxx
+++ b/sc/inc/chartpos.hxx
@@ -26,17 +26,17 @@
#include <map>
// map of row number to ScAddress*
-typedef std::map<sal_uLong, ScAddress*> RowMap;
-// map of column number to RowMap*
-typedef std::map<sal_uLong, RowMap*> ColumnMap;
+typedef std::map<sal_uLong, std::unique_ptr<ScAddress>> RowMap;
+// map of column number to RowMap
+typedef std::map<sal_uLong, RowMap> ColumnMap;
class ScChartPositionMap
{
friend class ScChartPositioner;
- std::unique_ptr<ScAddress*[]> ppData;
- std::unique_ptr<ScAddress*[]> ppColHeader;
- std::unique_ptr<ScAddress*[]> ppRowHeader;
+ std::unique_ptr<std::unique_ptr<ScAddress>[]> ppData;
+ std::unique_ptr<std::unique_ptr<ScAddress>[]> ppColHeader;
+ std::unique_ptr<std::unique_ptr<ScAddress>[]> ppRowHeader;
sal_uLong nCount;
SCCOL nColCount;
SCROW nRowCount;
@@ -65,7 +65,7 @@ public:
const ScAddress* GetPosition( sal_uLong nIndex ) const
{
if ( nIndex < nCount )
- return ppData[ nIndex ];
+ return ppData[ nIndex ].get();
return nullptr;
}
@@ -73,19 +73,19 @@ public:
const ScAddress* GetPosition( SCCOL nChartCol, SCROW nChartRow ) const
{
if ( IsValid( nChartCol, nChartRow ) )
- return ppData[ GetIndex( nChartCol, nChartRow ) ];
+ return ppData[ GetIndex( nChartCol, nChartRow ) ].get();
return nullptr;
}
const ScAddress* GetColHeaderPosition( SCCOL nChartCol ) const
{
if ( nChartCol < nColCount )
- return ppColHeader[ nChartCol ];
+ return ppColHeader[ nChartCol ].get();
return nullptr;
}
const ScAddress* GetRowHeaderPosition( SCROW nChartRow ) const
{
if ( nChartRow < nRowCount )
- return ppRowHeader[ nChartRow ];
+ return ppRowHeader[ nChartRow ].get();
return nullptr;
}
};