[Libreoffice-commits] core.git: ucb/source

Jochen Nitschke j.nitschke+logerrit at ok.de
Tue Oct 18 19:15:18 UTC 2016


 ucb/source/cacher/cachedcontentresultset.cxx |    5 ++---
 ucb/source/ucp/file/filrow.cxx               |    4 ++--
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 55bcb865ee09673af06652e507d08d13069eae86
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date:   Mon Oct 17 17:00:10 2016 +0200

    ucb: fix handling of >>= with rhs Any
    
    >>= for rhs Any is always true, check result with hasValue() instead.
    
    bool convert<uno::Any>(...) always returns false and assigns
    the 3rd parameter to the 4th.
    do the assign directly and check result with hasValue().
    
    Change-Id: I0ae985cc0837abf1108930d593edae69de2ae549
    Reviewed-on: https://gerrit.libreoffice.org/29977
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx
index c45410b..abf29aa 100644
--- a/ucb/source/cacher/cachedcontentresultset.cxx
+++ b/ucb/source/cacher/cachedcontentresultset.cxx
@@ -2118,10 +2118,9 @@ Any SAL_CALL CachedContentResultSet
     }
     //@todo: pay attention to typeMap
     const Any& rValue = m_aCache.getAny( nRow, columnIndex );
-    Any aRet;
     m_bLastReadWasFromCache = true;
-    m_bLastCachedReadWasNull = !( rValue >>= aRet );
-    return aRet;
+    m_bLastCachedReadWasNull = !rValue.hasValue();
+    return rValue;
 }
 
 //virtual
diff --git a/ucb/source/ucp/file/filrow.cxx b/ucb/source/ucp/file/filrow.cxx
index aafeca5..3709062 100644
--- a/ucb/source/ucp/file/filrow.cxx
+++ b/ucb/source/ucp/file/filrow.cxx
@@ -307,9 +307,9 @@ XRow_impl::getObject(
 {
     if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() )
         throw sdbc::SQLException( THROW_WHERE, uno::Reference< uno::XInterface >(), OUString(), 0, uno::Any() );
-    uno::Any  Value;
     osl::MutexGuard aGuard( m_aMutex );
-    m_nWasNull = ::convert<uno::Any>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value );
+    uno::Any Value = m_aValueMap[columnIndex - 1];
+    m_nWasNull = !Value.hasValue();
     return Value;
 }
 


More information about the Libreoffice-commits mailing list