From ab121cf8540dc26b4877022b11e2ea50a4fd9b5e Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Fri, 25 Jan 2013 21:19:20 +0100 Subject: don't use a pointer here Change-Id: If7e7785e032d7d95764e8325870655e276cfda8f --- sc/source/filter/xml/XMLStylesExportHelper.cxx | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'sc/source/filter/xml/XMLStylesExportHelper.cxx') diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx index 6e80aa8ea951..5e5c2161ac1b 100644 --- a/sc/source/filter/xml/XMLStylesExportHelper.cxx +++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx @@ -477,12 +477,12 @@ void ScMyDefaultStyles::FillDefaultStyles(const sal_Int32 nTable, ScMyDefaultStyleList* pDefaults; if (bRow) { - pDefaults = pRowDefaults; + pDefaults = &maRowDefaults; nLast = nLastRow; } else { - pDefaults = pColDefaults; + pDefaults = &maColDefaults; nLast = nLastCol; } bool bPrevAutoStyle(false); @@ -561,22 +561,14 @@ void ScMyDefaultStyles::FillDefaultStyles(const sal_Int32 nTable, const sal_Int32 nLastRow, const sal_Int32 nLastCol, const ScFormatRangeStyles* pCellStyles, ScDocument* pDoc) { - delete pRowDefaults; - pRowDefaults = new ScMyDefaultStyleList(nLastRow + 1); + maRowDefaults.clear(); + maRowDefaults.resize(nLastRow + 1); FillDefaultStyles(nTable, nLastRow, nLastCol, pCellStyles, pDoc, true); - delete pColDefaults; - pColDefaults = new ScMyDefaultStyleList(nLastCol + 1); + maColDefaults.clear(); + maColDefaults.resize(nLastCol + 1); FillDefaultStyles(nTable, nLastRow, nLastCol, pCellStyles, pDoc, false); } -ScMyDefaultStyles::~ScMyDefaultStyles() -{ - if (pRowDefaults) - delete pRowDefaults; - if (pColDefaults) - delete pColDefaults; -} - ScMyRowFormatRange::ScMyRowFormatRange() : nStartColumn(0), nRepeatColumns(0), -- cgit