summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-01-02 16:03:35 -0500
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-01-02 16:05:01 -0500
commitc27e334661b62897a81a450ea9188f80e053261e (patch)
tree4cf268a5b5d6a6f07a1139aacd6431f6b34e4994
parentebaaefcbf34d037aa8091ffbef3b7f8adc7a9ac5 (diff)
fdo#58539: Avoid throwing exception not specified in the signature.
This should fix the crasher with the fdo#45266 document. Change-Id: I41cf02f211e289b85c31b2d2d60e0c4d849b7e8e
-rw-r--r--sc/source/ui/unoobj/dapiuno.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index feb8b4c744fd..07c269384aa0 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -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;