ucb/source/cacher/cachedcontentresultset.cxx | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-)
New commits: commit 0e4ca9b0cfe015f7ab3b964d1b90de7c2cba42de Author: Stephan Bergmann <sberg...@redhat.com> Date: Mon Jun 27 13:28:08 2016 +0200 Clean up uses of Any::getValue() in ucb Change-Id: Ifeae43257ce9c2ba8513652c21b512bcffd87841 diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx index ddc0ab2..9f8b48d 100644 --- a/ucb/source/cacher/cachedcontentresultset.cxx +++ b/ucb/source/cacher/cachedcontentresultset.cxx @@ -27,6 +27,7 @@ #include <com/sun/star/sdbc/ResultSetType.hpp> #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> #include <rtl/ustring.hxx> +#include <o3tl/any.hxx> #include <osl/diagnose.h> #include <comphelper/processfactory.hxx> #include <cppuhelper/exc_hlp.hxx> @@ -286,13 +287,12 @@ const Any& SAL_CALL CachedContentResultSet::CCRS_Cache else m_xContentIdentifierMapping.clear(); } - const Sequence< Any >& rRow = - (* static_cast< const Sequence< Any > * > - (getRowAny( nRow ).getValue() )); + auto & rowAny = getRowAny(nRow); + auto rRow = o3tl::doAccess<Sequence<Any>>(rowAny); - if( nColumnIndex > rRow.getLength() ) + if( nColumnIndex > rRow->getLength() ) throw SQLException(); - return rRow[nColumnIndex-1]; + return (*rRow)[nColumnIndex-1]; } const OUString& SAL_CALL CachedContentResultSet::CCRS_Cache @@ -309,8 +309,7 @@ const OUString& SAL_CALL CachedContentResultSet::CCRS_Cache rRow <<= m_xContentIdentifierMapping->mapContentIdentifierString( aValue ); remindMapped( nRow ); } - return (* static_cast< const OUString * > - (getRowAny( nRow ).getValue() )); + return *o3tl::doAccess<OUString>(getRowAny(nRow)); } catch(const SQLException&) { @@ -332,8 +331,7 @@ const Reference< XContentIdentifier >& SAL_CALL CachedContentResultSet::CCRS_Cac rRow <<= m_xContentIdentifierMapping->mapContentIdentifier( aValue ); remindMapped( nRow ); } - return (* static_cast< const Reference< XContentIdentifier > * > - (getRowAny( nRow ).getValue() )); + return *o3tl::doAccess<Reference<XContentIdentifier>>(getRowAny(nRow)); } catch(const SQLException&) { @@ -355,8 +353,7 @@ const Reference< XContent >& SAL_CALL CachedContentResultSet::CCRS_Cache rRow <<= m_xContentIdentifierMapping->mapContent( aValue ); remindMapped( nRow ); } - return (* static_cast< const Reference< XContent > * > - (getRowAny( nRow ).getValue() )); + return *o3tl::doAccess<Reference<XContent>>(getRowAny(nRow)); } catch (const SQLException&) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits