[Libreoffice-commits] core.git: sc/inc sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Nov 8 09:04:11 UTC 2018
sc/inc/dpobject.hxx | 2 +-
sc/source/core/data/dpobject.cxx | 3 ++-
sc/source/filter/excel/xipivot.cxx | 3 +--
3 files changed, 4 insertions(+), 4 deletions(-)
New commits:
commit b3c77dd04deb9b4336e2a1bd88afdfb170b585a0
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Nov 7 21:41:32 2018 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Nov 8 10:01:24 2018 +0100
coverity#1440238 silence Wrapper object use after free
Change-Id: Iaf371360239ca07f45e76530c7d8e497b2ef697f
Reviewed-on: https://gerrit.libreoffice.org/63049
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
index eb5467d30479..9be63f26db36 100644
--- a/sc/inc/dpobject.hxx
+++ b/sc/inc/dpobject.hxx
@@ -392,7 +392,7 @@ public:
OUString CreateNewName() const;
void FreeTable(const ScDPObject* pDPObj);
- SC_DLLPUBLIC void InsertNewTable(std::unique_ptr<ScDPObject> pDPObj);
+ SC_DLLPUBLIC ScDPObject* InsertNewTable(std::unique_ptr<ScDPObject> pDPObj);
SC_DLLPUBLIC bool HasTable(const ScDPObject* pDPObj) const;
SC_DLLPUBLIC SheetCaches& GetSheetCaches();
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index ac243511b5f4..d9b6347a89d7 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -3774,7 +3774,7 @@ void ScDPCollection::FreeTable(const ScDPObject* pDPObject)
maTables.erase(std::remove_if(maTables.begin(), maTables.end(), funcRemoveCondition), maTables.end());
}
-void ScDPCollection::InsertNewTable(std::unique_ptr<ScDPObject> pDPObj)
+ScDPObject* ScDPCollection::InsertNewTable(std::unique_ptr<ScDPObject> pDPObj)
{
const ScRange& rOutRange = pDPObj->GetOutRange();
const ScAddress& s = rOutRange.aStart;
@@ -3782,6 +3782,7 @@ void ScDPCollection::InsertNewTable(std::unique_ptr<ScDPObject> pDPObj)
mpDoc->ApplyFlagsTab(s.Col(), s.Row(), e.Col(), e.Row(), s.Tab(), ScMF::DpTable);
maTables.push_back(std::move(pDPObj));
+ return maTables.back().get();
}
bool ScDPCollection::HasTable(const ScDPObject* pDPObj) const
diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx
index 90d512546980..2d84290e4288 100644
--- a/sc/source/filter/excel/xipivot.cxx
+++ b/sc/source/filter/excel/xipivot.cxx
@@ -1490,8 +1490,7 @@ void XclImpPivotTable::Convert()
pDPObj->SetOutRange( aOutRange );
pDPObj->SetHeaderLayout( maPTViewEx9Info.mnGridLayout == 0 );
- mpDPObj = pDPObj.get();
- GetDoc().GetDPCollection()->InsertNewTable(std::move(pDPObj));
+ mpDPObj = GetDoc().GetDPCollection()->InsertNewTable(std::move(pDPObj));
ApplyFieldInfo();
ApplyMergeFlags(aOutRange, aSaveData);
More information about the Libreoffice-commits
mailing list