summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-05-03 15:26:01 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-05-03 15:26:01 +0200
commit0b1e4a306705d8c25db6e233244101ba6c4c16b6 (patch)
treee3ce34a2d884bb5469aa0e15e8d66b6aa08a876e /dbaccess
parentab3d2e568fe1595584c66c2ff07843e72f608944 (diff)
Prevent Any::setValue from reinterpreting bool* as sal_Bool*
...which only happens ot work in environments where sizeof (bool) == 1. The simpler alternative is to use the operator <<= template without passing explicit UNO type information, anyway. The std::nullptr_t overloads are needed to disambiguate calls with a nullptr argument. (Which can at least be meaningful for VOID, but for other types what it happens to do is store a default value of the given type.) As std::nullptr_t is only C++11, this all needs to be LIBO_INTERNAL_ONLY. Change-Id: Iff06a6ba94250bd4ae4afc937c2a2bfa75f0888f
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/api/RowSet.cxx4
-rw-r--r--dbaccess/source/core/api/RowSetBase.cxx2
2 files changed, 3 insertions, 3 deletions
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index 18a95db85ec2..cc248329e631 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -380,10 +380,10 @@ void SAL_CALL ORowSet::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) const
switch(nHandle)
{
case PROPERTY_ID_ISMODIFIED:
- rValue.setValue(&m_bModified,cppu::UnoType<bool>::get());
+ rValue <<= m_bModified;
break;
case PROPERTY_ID_ISNEW:
- rValue.setValue(&m_bNew,cppu::UnoType<bool>::get());
+ rValue <<= m_bNew;
break;
case PROPERTY_ID_PRIVILEGES:
rValue <<= m_pCache->m_nPrivileges;
diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx
index 42dc249bcfcd..a007159155c9 100644
--- a/dbaccess/source/core/api/RowSetBase.cxx
+++ b/dbaccess/source/core/api/RowSetBase.cxx
@@ -141,7 +141,7 @@ void SAL_CALL ORowSetBase::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) c
rValue <<= impl_getRowCount();
break;
case PROPERTY_ID_ISROWCOUNTFINAL:
- rValue.setValue(&m_pCache->m_bRowCountFinal,cppu::UnoType<bool>::get());
+ rValue <<= m_pCache->m_bRowCountFinal;
break;
default:
OPropertyStateContainer::getFastPropertyValue(rValue,nHandle);