Kaydet (Commit) 870c5443 authored tarafından Caolán McNamara's avatar Caolán McNamara

InsertNewTable always returns true

Change-Id: I28b2cd46bf40011f5f813784bd5c182f18ee103f
Reviewed-on: https://gerrit.libreoffice.org/58112
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst b45926a3
......@@ -392,7 +392,7 @@ public:
OUString CreateNewName() const;
void FreeTable(const ScDPObject* pDPObj);
SC_DLLPUBLIC bool InsertNewTable(ScDPObject* pDPObj);
SC_DLLPUBLIC void InsertNewTable(ScDPObject* pDPObj);
SC_DLLPUBLIC bool HasTable(const ScDPObject* pDPObj) const;
SC_DLLPUBLIC SheetCaches& GetSheetCaches();
......
This diff is collapsed.
......@@ -3788,7 +3788,7 @@ void ScDPCollection::FreeTable(const ScDPObject* pDPObject)
maTables.erase(std::remove_if(maTables.begin(), maTables.end(), funcRemoveCondition), maTables.end());
}
bool ScDPCollection::InsertNewTable(ScDPObject* pDPObj)
void ScDPCollection::InsertNewTable(ScDPObject* pDPObj)
{
const ScRange& rOutRange = pDPObj->GetOutRange();
const ScAddress& s = rOutRange.aStart;
......@@ -3796,7 +3796,6 @@ bool ScDPCollection::InsertNewTable(ScDPObject* pDPObj)
mpDoc->ApplyFlagsTab(s.Col(), s.Row(), e.Col(), e.Row(), s.Tab(), ScMF::DpTable);
maTables.push_back(std::unique_ptr<ScDPObject>(pDPObj));
return true;
}
bool ScDPCollection::HasTable(const ScDPObject* pDPObj) const
......
......@@ -1485,7 +1485,7 @@ void XclImpPivotTable::Convert()
pDPObj->SetOutRange( aOutRange );
pDPObj->SetHeaderLayout( maPTViewEx9Info.mnGridLayout == 0 );
(void)GetDoc().GetDPCollection()->InsertNewTable(pDPObj);
GetDoc().GetDPCollection()->InsertNewTable(pDPObj);
mpDPObj = pDPObj;
ApplyFieldInfo();
......
......@@ -540,11 +540,7 @@ void SAL_CALL ScXMLDataPilotTableContext::endFastElement( sal_Int32 /*nElement*/
if ( pDPCollection->GetByName(pDPObject->GetName()) )
pDPObject->SetName( OUString() ); // ignore the invalid name, create a new name in AfterXMLLoading
if (!pDPCollection->InsertNewTable(pDPObject))
{
OSL_FAIL("cannot insert DPObject");
DELETEZ( pDPObject );
}
pDPCollection->InsertNewTable(pDPObject);
SetButtons();
}
......
......@@ -1457,9 +1457,7 @@ bool ScDBDocFunc::CreatePivotTable(const ScDPObject& rDPObj, bool bRecord, bool
}
}
if (!rDoc.GetDPCollection()->InsertNewTable(pDestObj.release()))
// Insertion into collection failed.
return false;
rDoc.GetDPCollection()->InsertNewTable(pDestObj.release());
rDestObj.ReloadGroupTableData();
rDestObj.SyncAllDimensionMembers();
......
......@@ -1460,11 +1460,7 @@ void ScUndoDataPilot::Undo()
// re-insert deleted object
ScDPObject* pDestObj = new ScDPObject(*xOldDPObject);
if ( !rDoc.GetDPCollection()->InsertNewTable(pDestObj) )
{
OSL_FAIL("cannot insert DPObject");
DELETEZ( pDestObj );
}
rDoc.GetDPCollection()->InsertNewTable(pDestObj);
}
if (xNewUndoDoc)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment