diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-07-26 23:38:02 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-07-27 09:23:46 +0100 |
commit | 6e5e307f7cdd9e05d9c4e9d2cda71152dd75021c (patch) | |
tree | bd9979113603f7d03c9c8e53c9aa60200321c403 | |
parent | 09e5f1e25ff00e35b02bbb41b20c8eb1a145b60d (diff) |
Related: fdo#35404 treat failed column same as non-existing column
-rw-r--r-- | sw/source/ui/dbui/mmoutputpage.cxx | 18 |
1 files 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; } |