From 4aa72e0dee42c80667083c0b86a3d0ec5381c1ae Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 16 Mar 2012 09:41:43 +0200 Subject: restructure insert code as a precursor to further simplification --- sc/source/ui/unoobj/chart2uno.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sc') diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 1c637fb48472..e2f7059ac566 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -761,13 +761,13 @@ void Chart2Positioner::createPositionMap() } else { - if (pCols->Insert(nInsCol, pNewRowTable.get())) + pCol = static_cast(pCols->Get(nInsCol)); + if (!pCol) { - pCol = pNewRowTable.release(); + pCol = pNewRowTable.get(); + pCols->Insert(nInsCol, pNewRowTable.release()); pNewRowTable.reset(new Table); } - else - pCol = static_cast(pCols->Get(nInsCol)); } sal_uInt32 nInsRow = static_cast(bNoGlue ? nNoGlueRow : nRow1); @@ -786,7 +786,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)); } -- cgit