diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-05-03 15:26:01 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-05-03 15:26:01 +0200 |
commit | 0b1e4a306705d8c25db6e233244101ba6c4c16b6 (patch) | |
tree | e3ce34a2d884bb5469aa0e15e8d66b6aa08a876e /svl/source/config/ctloptions.cxx | |
parent | ab3d2e568fe1595584c66c2ff07843e72f608944 (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 'svl/source/config/ctloptions.cxx')
-rw-r--r-- | svl/source/config/ctloptions.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/svl/source/config/ctloptions.cxx b/svl/source/config/ctloptions.cxx index 7aed551e926a..d95d4c5e7723 100644 --- a/svl/source/config/ctloptions.cxx +++ b/svl/source/config/ctloptions.cxx @@ -150,8 +150,6 @@ void SvtCTLOptions_Impl::ImplCommit() Any* pValues = aValues.getArray(); sal_Int32 nRealCount = 0; - const uno::Type& rType = cppu::UnoType<bool>::get(); - for ( int nProp = 0; nProp < nOrgCount; nProp++ ) { switch ( nProp ) @@ -161,7 +159,7 @@ void SvtCTLOptions_Impl::ImplCommit() if (!m_bROCTLFontEnabled) { pNames[nRealCount] = pOrgNames[nProp]; - pValues[nRealCount].setValue( &m_bCTLFontEnabled, rType ); + pValues[nRealCount] <<= m_bCTLFontEnabled; ++nRealCount; } } @@ -172,7 +170,7 @@ void SvtCTLOptions_Impl::ImplCommit() if (!m_bROCTLSequenceChecking) { pNames[nRealCount] = pOrgNames[nProp]; - pValues[nRealCount].setValue( &m_bCTLSequenceChecking, rType ); + pValues[nRealCount] <<= m_bCTLSequenceChecking; ++nRealCount; } } @@ -205,7 +203,7 @@ void SvtCTLOptions_Impl::ImplCommit() if (!m_bROCTLRestricted) { pNames[nRealCount] = pOrgNames[nProp]; - pValues[nRealCount].setValue( &m_bCTLRestricted, rType ); + pValues[nRealCount] <<= m_bCTLRestricted; ++nRealCount; } } @@ -215,7 +213,7 @@ void SvtCTLOptions_Impl::ImplCommit() if(!m_bROCTLTypeAndReplace) { pNames[nRealCount] = pOrgNames[nProp]; - pValues[nRealCount].setValue( &m_bCTLTypeAndReplace, rType ); + pValues[nRealCount] <<= m_bCTLTypeAndReplace; ++nRealCount; } } |