From 6e5e307f7cdd9e05d9c4e9d2cda71152dd75021c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 26 Jul 2011 23:38:02 +0100 Subject: Related: fdo#35404 treat failed column same as non-existing column --- sw/source/ui/dbui/mmoutputpage.cxx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx index 8a6eaabfca..28c3f7be24 100644 --- a/sw/source/ui/dbui/mmoutputpage.cxx +++ b/sw/source/ui/dbui/mmoutputpage.cxx @@ -101,13 +101,19 @@ String lcl_GetExtensionForDocType(sal_uLong nDocType) ::rtl::OUString lcl_GetColumnValueOf(const ::rtl::OUString& rColumn, Reference < container::XNameAccess>& rxColAccess ) { ::rtl::OUString sRet; - if(rxColAccess->hasByName(rColumn)) + try + { + if (rxColAccess->hasByName(rColumn)) + { + Any aCol = rxColAccess->getByName(rColumn); + Reference< sdb::XColumn > xColumn; + aCol >>= xColumn; + if(xColumn.is()) + sRet = xColumn->getString(); + } + } + catch (const uno::Exception&) { - Any aCol = rxColAccess->getByName(rColumn); - Reference< sdb::XColumn > xColumn; - aCol >>= xColumn; - if(xColumn.is()) - sRet = xColumn->getString(); } return sRet; } -- cgit v1.2.3