diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-03-25 04:37:24 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-03-25 04:42:28 +0200 |
commit | 300365c29b1fb3ff47d9b24cacd990f9df1c9555 (patch) | |
tree | 9f9b2f799cd1b03d322c6f72cffc9d9601bfdca1 /sc | |
parent | 473a182824c2e3413dd5b36f193bb9a586b4a0ce (diff) |
Revert "remove unnecessary use of local variable and auto_ptr"
This reverts commit 6af00cf90f4314be11ac7d8f186bb9da4f228cf1.
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/unoobj/chart2uno.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 0c86655c9fe0..1a04ce472a15 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -717,6 +717,7 @@ void Chart2Positioner::createPositionMap() bool bNoGlue = (meGlue == GLUETYPE_NONE); SAL_WNODEPRECATED_DECLARATIONS_PUSH auto_ptr<Table> pCols(new Table); + auto_ptr<Table> pNewRowTable(new Table); SAL_WNODEPRECATED_DECLARATIONS_POP Table* pCol = NULL; SCROW nNoGlueRow = 0; @@ -751,8 +752,9 @@ void Chart2Positioner::createPositionMap() pCol = static_cast<Table*>(pCols->Get(nInsCol)); if (!pCol) { - pCol = new Table; - pCols->Insert(nInsCol, pCol); + pCol = pNewRowTable.get(); + pCols->Insert(nInsCol, pNewRowTable.release()); + pNewRowTable.reset(new Table); } sal_uInt32 nInsRow = static_cast<sal_uInt32>(bNoGlue ? nNoGlueRow : nRow1); @@ -771,7 +773,7 @@ void Chart2Positioner::createPositionMap() if (pCol->Get(nInsRow) == NULL) { if (bExternal) - pCol->Insert(nInsRow, new ScExternalSingleRefToken(nFileId, aTabName, aCellData)); + pCol->Insert(nInsRow, new ScExternalSingleRefToken(nFileId, aTabName, aCellData)) else pCol->Insert(nInsRow, new ScSingleRefToken(aCellData)); } @@ -780,6 +782,7 @@ void Chart2Positioner::createPositionMap() } nNoGlueRow += nRow2 - nRow1 + 1; } + pNewRowTable.reset(NULL); bool bFillRowHeader = mbRowHeaders; bool bFillColumnHeader = mbColHeaders; |