summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj/docuno.cxx
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.com>2016-06-08 10:27:58 +0530
committerPranav Kant <pranavk@collabora.com>2016-06-08 10:36:59 +0530
commit4a2d6bf7ca582a063a209e6dfd59e00f5cb57bfe (patch)
tree06be8bb89f107ea7b4ba4985561d80791bcbc147 /sc/source/ui/unoobj/docuno.cxx
parent651eea40e6fa80ec0a64adaa0d6ff42bee829dd4 (diff)
sc lok: catch unhandled exception
Now, after 432b27ec73940738bb0b4f9d3d749c70a2525700, we do not export newlines when empty range is selected. Trying to get transfer data in such a case throws an exception. (cherry-picked from commit 82ed95b7554cfa3b5e98f67cc53c6219e3a09886) Change-Id: If2b16bfa2c1932b0599108b989e62e200c1b3b27
Diffstat (limited to 'sc/source/ui/unoobj/docuno.cxx')
-rw-r--r--sc/source/ui/unoobj/docuno.cxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 67bdb092a0be..13a9e2c58e71 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -771,7 +771,21 @@ OString ScModelObj::getTextSelection(const char* pMimeType, OString& rUsedMimeTy
if (!xTransferable.is() || !xTransferable->isDataFlavorSupported(aFlavor))
return OString();
- uno::Any aAny(xTransferable->getTransferData(aFlavor));
+ uno::Any aAny;
+ try
+ {
+ aAny = xTransferable->getTransferData(aFlavor);
+ }
+ catch (const datatransfer::UnsupportedFlavorException e)
+ {
+ OSL_TRACE("Caught UnsupportedFlavorException '%s'", OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
+ return OString();
+ }
+ catch (const css::uno::Exception& e)
+ {
+ OSL_TRACE("Caught UNO Exception '%s'", OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
+ return OString();
+ }
OString aRet;
if (aFlavor.DataType == cppu::UnoType<OUString>::get())