cid#1636669 Dereference after null check
Change-Id: I56e9669058a79750f83bb99e682e25c3fea2a0bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178170 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
parent
47b4b1633a
commit
b012d20635
1 changed files with 28 additions and 26 deletions
|
@ -5261,16 +5261,19 @@ void ScXMLExport::GetChangeTrackViewSettings(ScDocument& rDoc, uno::Sequence<bea
|
|||
|
||||
void ScXMLExport::GetViewSettings(uno::Sequence<beans::PropertyValue>& rProps)
|
||||
{
|
||||
if (GetModel().is())
|
||||
{
|
||||
rProps.realloc(4);
|
||||
beans::PropertyValue* pProps(rProps.getArray());
|
||||
if (!GetModel().is())
|
||||
return;
|
||||
|
||||
ScModelObj* pDocObj(comphelper::getFromUnoTunnel<ScModelObj>( GetModel() ));
|
||||
if (pDocObj)
|
||||
{
|
||||
if (!pDocObj)
|
||||
return;
|
||||
|
||||
SfxObjectShell* pEmbeddedObj = pDocObj->GetEmbeddedObject();
|
||||
if (pEmbeddedObj)
|
||||
{
|
||||
rProps.realloc(4);
|
||||
beans::PropertyValue* pProps(rProps.getArray());
|
||||
|
||||
tools::Rectangle aRect(pEmbeddedObj->GetVisArea());
|
||||
sal_uInt16 i(0);
|
||||
pProps[i].Name = "VisibleAreaTop";
|
||||
|
@ -5282,7 +5285,7 @@ void ScXMLExport::GetViewSettings(uno::Sequence<beans::PropertyValue>& rProps)
|
|||
pProps[++i].Name = "VisibleAreaHeight";
|
||||
pProps[i].Value <<= static_cast<sal_Int32>(aRect.getOpenHeight());
|
||||
}
|
||||
}
|
||||
|
||||
ScDocument* pDoc = pDocObj->GetDocument();
|
||||
if (!pDoc)
|
||||
{
|
||||
|
@ -5291,7 +5294,6 @@ void ScXMLExport::GetViewSettings(uno::Sequence<beans::PropertyValue>& rProps)
|
|||
}
|
||||
GetChangeTrackViewSettings(*pDoc, rProps);
|
||||
}
|
||||
}
|
||||
|
||||
void ScXMLExport::GetConfigurationSettings(uno::Sequence<beans::PropertyValue>& rProps)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue