[Libreoffice-commits] core.git: 8 commits - sc/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Sun Feb 17 10:09:10 PST 2013
sc/source/core/data/colorscale.cxx | 4 ++--
sc/source/core/data/postit.cxx | 3 ++-
sc/source/filter/dif/difimp.cxx | 2 +-
sc/source/filter/excel/xecontent.cxx | 2 +-
sc/source/filter/xml/xmldpimp.cxx | 3 +--
sc/source/filter/xml/xmldpimp.hxx | 2 +-
sc/source/ui/Accessibility/AccessibleDocument.cxx | 2 ++
sc/source/ui/docshell/docfunc.cxx | 1 +
sc/source/ui/docshell/impex.cxx | 19 +++++++------------
9 files changed, 18 insertions(+), 20 deletions(-)
New commits:
commit b3652dae4b4d3f02fc0c02d9e139391ef43d7ba5
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Feb 17 19:06:17 2013 +0100
coverity: fix memory leak
Change-Id: I2a620971d70c021c7a31dac14ce76f3428324f26
diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx
index 0d17fa6..e4183e7 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -889,8 +889,6 @@ ScIconSetInfo* ScIconSetFormat::GetIconSetInfo(const ScAddress& rAddr) const
return NULL;
}
- ScIconSetInfo* pInfo = new ScIconSetInfo;
-
// now we have for sure a value
double nVal = mpDoc->GetValue(rAddr);
@@ -919,6 +917,8 @@ ScIconSetInfo* ScIconSetFormat::GetIconSetInfo(const ScAddress& rAddr) const
if(nVal >= nValMax)
++nIndex;
+ ScIconSetInfo* pInfo = new ScIconSetInfo;
+
if(mpFormatData->mbReverse)
{
sal_Int32 nMaxIndex = mpFormatData->maEntries.size() - 1;
commit 68e10304389fee75bc069d25c5bfe4b50d0b58a4
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Feb 17 19:04:35 2013 +0100
coverity: make clear that this is safe
Change-Id: Ibcc313700862e0dcb630e98a13e451d3b5035a7f
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 5ca89b1..00ec727 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -1038,7 +1038,8 @@ ScPostIt* ScNotes::GetOrCreateNote(const ScAddress& rPos)
else
{
ScPostIt* pPostIt = new ScPostIt(*mpDoc, rPos, false);
- insert(rPos, pPostIt);
+ if(!insert(rPos, pPostIt))
+ assert(false);
return pPostIt;
}
}
commit 4254672d6a4adccedeaf899faf86f7763afb2bed
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Feb 17 18:59:48 2013 +0100
coverity: fix memory leak
Change-Id: Ib471de0977614996cda1e58ccb17d7cd6cadda7f
diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx
index e03a9a8..b4f4508 100644
--- a/sc/source/filter/dif/difimp.cxx
+++ b/sc/source/filter/dif/difimp.cxx
@@ -930,7 +930,7 @@ DifAttrCache::~DifAttrCache()
delete ppCols[ nCnt ];
}
- delete ppCols;
+ delete[] ppCols;
}
void DifAttrCache::SetLogical( const SCCOL nCol, const SCROW nRow )
commit db62ad5984d19f5af57f38d21aa98b709030a2cf
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Feb 17 18:57:15 2013 +0100
coverity: fix memory leak
Change-Id: Ice50e9b84a6666b4ce0d02072c5fb40ed313692b
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 3f35f5e..9a7b96e 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -911,7 +911,7 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm )
// we need to write the text without quotes
// we have to actually get the string from
// the token array for that
- ScTokenArray* pTokenArray = mrFormatEntry.CreateTokenArry(0);
+ boost::scoped_ptr<ScTokenArray> pTokenArray(mrFormatEntry.CreateTokenArry(0));
if(pTokenArray->GetLen())
aText = XclXmlUtils::ToOString(pTokenArray->First()->GetString());
}
commit a62303c13161b5fbe620d69aa82f02997fe41bee
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Feb 17 18:50:43 2013 +0100
coverity: fix memory leak
Change-Id: I57937130d6ef40743c1b13d107888883a6810a8d
diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx
index ac42282..8b269af 100644
--- a/sc/source/filter/xml/xmldpimp.cxx
+++ b/sc/source/filter/xml/xmldpimp.cxx
@@ -112,7 +112,6 @@ ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport,
SvXMLImportContext( rImport, nPrfx, rLName ),
pDoc(GetScImport().GetDocument()),
pDPObject(NULL),
- pDPSave(NULL),
pDPDimSaveData(NULL),
sDataPilotTableName(),
sApplicationData(),
@@ -216,7 +215,7 @@ ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport,
}
pDPObject = new ScDPObject(pDoc);
- pDPSave = new ScDPSaveData();
+ pDPSave.reset(new ScDPSaveData());
}
ScXMLDataPilotTableContext::~ScXMLDataPilotTableContext()
diff --git a/sc/source/filter/xml/xmldpimp.hxx b/sc/source/filter/xml/xmldpimp.hxx
index b37b266..0f722dd 100644
--- a/sc/source/filter/xml/xmldpimp.hxx
+++ b/sc/source/filter/xml/xmldpimp.hxx
@@ -79,7 +79,7 @@ class ScXMLDataPilotTableContext : public SvXMLImportContext
};
ScDocument* pDoc;
ScDPObject* pDPObject;
- ScDPSaveData* pDPSave;
+ boost::scoped_ptr<ScDPSaveData> pDPSave;
ScDPDimensionSaveData* pDPDimSaveData;
GrandTotalItem maRowGrandTotal;
GrandTotalItem maColGrandTotal;
commit d86f114259cfaf3d3f9e02da5d3699926b5ec5bd
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Feb 17 18:50:27 2013 +0100
coverity: fix memory leak
Change-Id: Idf97e7150617e53ce37ef5a98a7c4582ccc64271
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 3d44175..e0d17a6 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -1022,6 +1022,8 @@ void ScChildrenShapes::SetAnchor(const uno::Reference<drawing::XShape>& xShape,
if (pData->pAccShape)
pData->pAccShape->SetRelationSet(GetRelationSet(pData));
}
+ else
+ delete pAddress;
}
}
commit 5c7f0e9de5ed799b38d749c0625857658cc1ed61
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Feb 17 18:49:56 2013 +0100
coverity: fix memory leak
Change-Id: I2e0b97285edf1544091402c05d3880f560a352e9
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 7f8254f..cc73064 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1696,6 +1696,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
if (!bApi)
rDocShell.ErrorMessage(STR_MSSG_INSERTCELLS_0);
rDocShell.GetUndoManager()->LeaveListAction();
+ delete pUndoData;
return false;
}
commit 9aa5ad4156a1ea1e8f73f88d3236218c6f37dea2
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Feb 17 18:48:33 2013 +0100
coverity: fix memory leak
Change-Id: I60d1845dbef9d53545db4bb743764bcb0b6a57cc
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index e0186a8..6e7e16c 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1289,14 +1289,14 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
CalendarWrapper aCalendar( comphelper::getComponentContext(pDoc->GetServiceManager()) );
aCalendar.loadDefaultCalendar(
LanguageTag( eDocLang ).getLocale() );
- ::utl::TransliterationWrapper* pEnglishTransliteration = NULL;
- CalendarWrapper* pEnglishCalendar = NULL;
+ boost::scoped_ptr< ::utl::TransliterationWrapper > pEnglishTransliteration;
+ boost::scoped_ptr< CalendarWrapper > pEnglishCalendar;
if ( eDocLang != LANGUAGE_ENGLISH_US )
{
- pEnglishTransliteration = new ::utl::TransliterationWrapper (
- comphelper::getComponentContext(pDoc->GetServiceManager()), SC_TRANSLITERATION_IGNORECASE );
+ pEnglishTransliteration.reset(new ::utl::TransliterationWrapper (
+ comphelper::getComponentContext(pDoc->GetServiceManager()), SC_TRANSLITERATION_IGNORECASE ));
aTransliteration.loadModuleIfNeeded( LANGUAGE_ENGLISH_US );
- pEnglishCalendar = new CalendarWrapper ( comphelper::getComponentContext(pDoc->GetServiceManager()) );
+ pEnglishCalendar.reset(new CalendarWrapper ( comphelper::getComponentContext(pDoc->GetServiceManager()) ));
pEnglishCalendar->loadDefaultCalendar(
LanguageTag( LANGUAGE_ENGLISH_US ).getLocale() );
}
@@ -1363,7 +1363,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
bMultiLine |= lcl_PutString(
pDoc, nCol, nRow, nTab, aCell, nFmt,
&aNumFormatter, bDetectNumFormat, aTransliteration, aCalendar,
- pEnglishTransliteration, pEnglishCalendar);
+ pEnglishTransliteration.get(), pEnglishCalendar.get());
}
++nCol;
}
@@ -1406,7 +1406,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
bMultiLine |= lcl_PutString(
pDoc, nCol, nRow, nTab, aCell, nFmt,
&aNumFormatter, bDetectNumFormat, aTransliteration,
- aCalendar, pEnglishTransliteration, pEnglishCalendar);
+ aCalendar, pEnglishTransliteration.get(), pEnglishCalendar.get());
}
++nCol;
}
@@ -1447,8 +1447,6 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
ScReplaceWarnBox aBox( pDocSh->GetActiveDialogParent() );
if ( aBox.Execute() != RET_YES )
{
- delete pEnglishTransliteration;
- delete pEnglishCalendar;
return false;
}
}
@@ -1467,9 +1465,6 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
pDoc->DoColResize( nTab, nStartCol, nEndCol, 0 );
- delete pEnglishTransliteration;
- delete pEnglishCalendar;
-
xProgress.reset(); // make room for AdjustRowHeight progress
if (bRangeIsDetermined)
EndPaste();
More information about the Libreoffice-commits
mailing list