Kaydet (Commit) c27e3346 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

fdo#58539: Avoid throwing exception not specified in the signature.

This should fix the crasher with the fdo#45266 document.

Change-Id: I41cf02f211e289b85c31b2d2d60e0c4d849b7e8e
üst ebaaefcb
......@@ -2697,8 +2697,16 @@ Reference< XDataPilotField > SAL_CALL ScDataPilotFieldObj::createNameGroup( cons
Reference< XNameAccess > xFields(mrParent.getDataPilotFields(), UNO_QUERY);
if (xFields.is())
{
xRet.set(xFields->getByName(sNewDim), UNO_QUERY);
OSL_ENSURE(xRet.is(), "there is a name, so there should be also a field");
try
{
xRet.set(xFields->getByName(sNewDim), UNO_QUERY);
OSL_ENSURE(xRet.is(), "there is a name, so there should be also a field");
}
catch (const container::NoSuchElementException&)
{
// Avoid throwing exception that's not specified in the method signature.
throw RuntimeException();
}
}
}
return xRet;
......
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