summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-03-16 09:38:49 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2012-03-22 06:55:57 +0100
commit3ffdb45ae047f12480e73fdd4b28fe35f1e8d48c (patch)
tree2976f8847985639eaa09e56e4375c656a02d684f /sc
parent11ccf88eeb8e4148ca532e3a42ddca356ebde811 (diff)
simplify code - remove unnecessary and complicated allocation
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 5ff808bff4f9..1c637fb48472 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -717,7 +717,6 @@ void Chart2Positioner::createPositionMap()
bool bNoGlue = (meGlue == GLUETYPE_NONE);
SAL_WNODEPRECATED_DECLARATIONS_PUSH
auto_ptr<Table> pCols(new Table);
- auto_ptr<FormulaToken> pNewAddress;
auto_ptr<Table> pNewRowTable(new Table);
SAL_WNODEPRECATED_DECLARATIONS_POP
Table* pCol = NULL;
@@ -784,19 +783,18 @@ void Chart2Positioner::createPositionMap()
aCellData.nRow = nRow;
aCellData.nTab = nTab;
- if (bExternal)
- pNewAddress.reset(new ScExternalSingleRefToken(nFileId, aTabName, aCellData));
- else
- pNewAddress.reset(new ScSingleRefToken(aCellData));
-
- if (pCol->Insert(nInsRow, pNewAddress.get()))
- pNewAddress.release(); // To prevent the instance from being destroyed.
+ if (pCol->Get(nInsRow) == NULL)
+ {
+ if (bExternal)
+ pCol->Insert(nInsRow, new ScExternalSingleRefToken(nFileId, aTabName, aCellData));
+ else
+ pCol->Insert(nInsRow, new ScSingleRefToken(aCellData));
+ }
}
}
}
nNoGlueRow += nRow2 - nRow1 + 1;
}
- pNewAddress.reset(NULL);
pNewRowTable.reset(NULL);
bool bFillRowHeader = mbRowHeaders;