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 20:54:40 -0500
commitb060b43f093dce23222fd99375b1c6bd433703d9 (patch)
treed437d862645804d7922dbdb0e9c541779502b71f
parent30285360e5d1fbb14bb6bf54e55a3a9f9b7619e7 (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;