summaryrefslogtreecommitdiff
path: root/sc/source/ui/miscdlgs
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-13 17:35:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-14 07:18:41 +0100
commitbb787e7b45efb5e25b4b6d57a42efa916510b5f5 (patch)
treeca6309e90850d28c810fbf92efc4711a56916e18 /sc/source/ui/miscdlgs
parentc775efffa7ddcee607bd7622a19a627545a6bc67 (diff)
modernize ScRangePairList::CreateNameSortedArray
we have this STL thingy now, pretty cool Change-Id: Id96010dda59736bd0c143312424018b6ea5621f1 Reviewed-on: https://gerrit.libreoffice.org/51230 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/miscdlgs')
-rw-r--r--sc/source/ui/miscdlgs/crnrdlg.cxx18
1 files changed, 10 insertions, 8 deletions
diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx
index 1c464898b75b..31df267e218f 100644
--- a/sc/source/ui/miscdlgs/crnrdlg.cxx
+++ b/sc/source/ui/miscdlgs/crnrdlg.cxx
@@ -391,15 +391,16 @@ void ScColRowNameRangesDlg::UpdateNames()
pLbRange->SetEntryData( nPos, reinterpret_cast<void*>(nEntryDataDelim) );
if ( (nCount = xColNameRanges->size()) > 0 )
{
- std::unique_ptr<ScRangePair*[]> ppSortArray(xColNameRanges->CreateNameSortedArray(
- nCount, pDoc ));
+ std::vector<ScRangePair*> aSortArray(xColNameRanges->CreateNameSortedArray(
+ pDoc ));
+ nCount = aSortArray.size();
for ( j=0; j < nCount; j++ )
{
- const ScRange aRange(ppSortArray[j]->GetRange(0));
+ const ScRange aRange(aSortArray[j]->GetRange(0));
aString = aRange.Format(ScRefFlags::RANGE_ABS_3D, pDoc, aDetails);
//@008 get range parameters from document
- ppSortArray[j]->GetRange(0).GetVars( nCol1, nRow1, nTab1,
+ aSortArray[j]->GetRange(0).GetVars( nCol1, nRow1, nTab1,
nCol2, nRow2, nTab2 );
SCCOL q=nCol1+3;
if(q>nCol2) q=nCol2;
@@ -434,15 +435,16 @@ void ScColRowNameRangesDlg::UpdateNames()
pLbRange->SetEntryData( nPos, reinterpret_cast<void*>(nEntryDataDelim) );
if ( (nCount = xRowNameRanges->size()) > 0 )
{
- std::unique_ptr<ScRangePair*[]> ppSortArray(xRowNameRanges->CreateNameSortedArray(
- nCount, pDoc ));
+ std::vector<ScRangePair*> aSortArray(xRowNameRanges->CreateNameSortedArray(
+ pDoc ));
+ nCount = aSortArray.size();
for ( j=0; j < nCount; j++ )
{
- const ScRange aRange(ppSortArray[j]->GetRange(0));
+ const ScRange aRange(aSortArray[j]->GetRange(0));
aString = aRange.Format(ScRefFlags::RANGE_ABS_3D, pDoc, aDetails);
//@008 Build string for rows below
- ppSortArray[j]->GetRange(0).GetVars( nCol1, nRow1, nTab1,
+ aSortArray[j]->GetRange(0).GetVars( nCol1, nRow1, nTab1,
nCol2, nRow2, nTab2 );
SCROW q=nRow1+3;
if(q>nRow2) q=nRow2;