[Libreoffice-commits] core.git: Branch 'feature/formula-core-rework' - sc/source
Kohei Yoshida
kohei.yoshida at gmail.com
Fri May 17 10:41:18 PDT 2013
sc/source/core/data/document.cxx | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
New commits:
commit fbd16ee01bd9d69b21e1c6ba0746a2bc02028f7b
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Fri May 17 13:43:18 2013 -0400
Make it exception safe.
Change-Id: Ib9b734ac9800b1ecf005dcd3a66beac6fcfc3a4f
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 4e54630..cf2ae95 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -94,6 +94,7 @@
#include <map>
#include <limits>
+#include <boost/scoped_ptr.hpp>
using ::editeng::SvxBorderLine;
using namespace ::com::sun::star;
@@ -2869,7 +2870,7 @@ void ScDocument::FillTab( const ScRange& rSrcArea, const ScMarkData& rMark,
SCROW nStartRow = rSrcArea.aStart.Row();
SCCOL nEndCol = rSrcArea.aEnd.Col();
SCROW nEndRow = rSrcArea.aEnd.Row();
- ScDocument* pMixDoc = NULL;
+ boost::scoped_ptr<ScDocument> pMixDoc;
bool bDoMix = ( bSkipEmpty || nFunction ) && ( nFlags & IDF_CONTENTS );
bool bOldAutoCalc = GetAutoCalc();
@@ -2887,7 +2888,7 @@ void ScDocument::FillTab( const ScRange& rSrcArea, const ScMarkData& rMark,
{
if (!pMixDoc)
{
- pMixDoc = new ScDocument( SCDOCMODE_UNDO );
+ pMixDoc.reset(new ScDocument(SCDOCMODE_UNDO));
pMixDoc->InitUndo( this, i, i );
}
else
@@ -2906,8 +2907,6 @@ void ScDocument::FillTab( const ScRange& rSrcArea, const ScMarkData& rMark,
nFunction, bSkipEmpty, pMixDoc->maTabs[i] );
}
- delete pMixDoc;
-
SetAutoCalc( bOldAutoCalc );
}
else
@@ -2927,7 +2926,7 @@ void ScDocument::FillTabMarked( SCTAB nSrcTab, const ScMarkData& rMark,
if (ValidTab(nSrcTab) && nSrcTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nSrcTab])
{
- ScDocument* pMixDoc = NULL;
+ boost::scoped_ptr<ScDocument> pMixDoc;
bool bDoMix = ( bSkipEmpty || nFunction ) && ( nFlags & IDF_CONTENTS );
bool bOldAutoCalc = GetAutoCalc();
@@ -2952,7 +2951,7 @@ void ScDocument::FillTabMarked( SCTAB nSrcTab, const ScMarkData& rMark,
{
if (!pMixDoc)
{
- pMixDoc = new ScDocument( SCDOCMODE_UNDO );
+ pMixDoc.reset(new ScDocument(SCDOCMODE_UNDO));
pMixDoc->InitUndo( this, i, i );
}
else
@@ -2972,8 +2971,6 @@ void ScDocument::FillTabMarked( SCTAB nSrcTab, const ScMarkData& rMark,
maTabs[i]->MixMarked( rMark, nFunction, bSkipEmpty, pMixDoc->maTabs[i] );
}
- delete pMixDoc;
-
SetAutoCalc( bOldAutoCalc );
}
else
More information about the Libreoffice-commits
mailing list