summaryrefslogtreecommitdiff
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:33:18 +0530
commit82ed95b7554cfa3b5e98f67cc53c6219e3a09886 (patch)
tree6bd79adb6c46e468230c41e8783898047bfda22e
parentb2179939dea723ea8695018b03903b9e85121771 (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. Change-Id: If2b16bfa2c1932b0599108b989e62e200c1b3b27
-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 bc14ff0bd40a..1d9d4624a697 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -770,7 +770,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())