diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-06-10 15:52:05 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-06-10 15:52:05 +0200 |
commit | 8132d7f9d71d9f6418855d2d6241dae804beeb8b (patch) | |
tree | 7394f094265efdfaaa4ce02ce287da39c1a43f1a | |
parent | 285744fef87f4ca0278834b97d7f618bdba5f4c0 (diff) |
o3tl::tryGet on a temporary is dangerous
...so rename to o3tl::tryAccess to make it more obvious that the returned
proxy points into the internals of the given Any, and forbid calling
o3tl::tryAccess on a temporary
Change-Id: Ia412c6b2b06693811b9b7f0076a08bbf97142df9
32 files changed, 218 insertions, 190 deletions
diff --git a/connectivity/source/commontools/dbexception.cxx b/connectivity/source/commontools/dbexception.cxx index 38251b71eee2..d1b6baf56411 100644 --- a/connectivity/source/commontools/dbexception.cxx +++ b/connectivity/source/commontools/dbexception.cxx @@ -175,14 +175,14 @@ bool SQLExceptionInfo::isKindOf(TYPE _eType) const SQLExceptionInfo::operator const css::sdbc::SQLException*() const { OSL_ENSURE(isKindOf(TYPE::SQLException), "SQLExceptionInfo::operator SQLException* : invalid call !"); - return o3tl::doGet<css::sdbc::SQLException>(m_aContent); + return o3tl::doAccess<css::sdbc::SQLException>(m_aContent); } SQLExceptionInfo::operator const css::sdb::SQLContext*() const { OSL_ENSURE(isKindOf(TYPE::SQLContext), "SQLExceptionInfo::operator SQLException* : invalid call !"); - return o3tl::doGet<css::sdb::SQLContext>(m_aContent); + return o3tl::doAccess<css::sdb::SQLContext>(m_aContent); } @@ -213,7 +213,7 @@ void SQLExceptionInfo::append( TYPE _eType, const OUString& _rErrorMessage, cons break; } - SQLException& pAppendException = const_cast<SQLException &>(*o3tl::forceGet<SQLException>(aAppend)); + SQLException& pAppendException = const_cast<SQLException &>(*o3tl::forceAccess<SQLException>(aAppend)); pAppendException.Message = _rErrorMessage; pAppendException.SQLState = _rSQLState; pAppendException.ErrorCode = _nErrorCode; @@ -230,7 +230,7 @@ void SQLExceptionInfo::append( TYPE _eType, const OUString& _rErrorMessage, cons if ( !isAssignableFrom( aSQLExceptionType, pChainIterator->getValueType() ) ) break; - pLastException = const_cast< SQLException* >( o3tl::doGet<SQLException>( *pChainIterator ) ); + pLastException = const_cast< SQLException* >( o3tl::doAccess<SQLException>( *pChainIterator ) ); pChainIterator = &pLastException->NextException; } @@ -314,7 +314,7 @@ const css::sdbc::SQLException* SQLExceptionIteratorHelper::next() return pReturn; } - m_pCurrent = o3tl::doGet< SQLException >( m_pCurrent->NextException ); + m_pCurrent = o3tl::doAccess< SQLException >( m_pCurrent->NextException ); // no finally determine the proper type of the exception const Type aTypeContext( ::cppu::UnoType< SQLContext >::get() ); diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index b71ff9aa8cd0..701c64d7e63d 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -1156,14 +1156,14 @@ try { Any aDate( xOldProps->getPropertyValue(sPropDefaultDate) ); if (aDate.hasValue()) - aNewDefault <<= DBTypeConversion::toDouble(*o3tl::doGet<Date>(aDate)); + aNewDefault <<= DBTypeConversion::toDouble(*o3tl::doAccess<Date>(aDate)); } if (hasProperty(sPropDefaultTime, xOldProps)) { Any aTime( xOldProps->getPropertyValue(sPropDefaultTime) ); if (aTime.hasValue()) - aNewDefault <<= DBTypeConversion::toDouble(*o3tl::doGet<Time>(aTime)); + aNewDefault <<= DBTypeConversion::toDouble(*o3tl::doAccess<Time>(aTime)); } // double or OUString will be copied directly @@ -1450,29 +1450,29 @@ bool implUpdateObject(const Reference< XRowUpdate >& _rxUpdatedObject, break; case TypeClass_STRING: - _rxUpdatedObject->updateString(_nColumnIndex, *o3tl::forceGet<OUString>(_rValue)); + _rxUpdatedObject->updateString(_nColumnIndex, *o3tl::forceAccess<OUString>(_rValue)); break; case TypeClass_BOOLEAN: - _rxUpdatedObject->updateBoolean(_nColumnIndex, *o3tl::forceGet<bool>(_rValue)); + _rxUpdatedObject->updateBoolean(_nColumnIndex, *o3tl::forceAccess<bool>(_rValue)); break; case TypeClass_BYTE: - _rxUpdatedObject->updateByte(_nColumnIndex, *o3tl::forceGet<sal_Int8>(_rValue)); + _rxUpdatedObject->updateByte(_nColumnIndex, *o3tl::forceAccess<sal_Int8>(_rValue)); break; case TypeClass_UNSIGNED_SHORT: case TypeClass_SHORT: - _rxUpdatedObject->updateShort(_nColumnIndex, *o3tl::forceGet<sal_Int16>(_rValue)); + _rxUpdatedObject->updateShort(_nColumnIndex, *o3tl::forceAccess<sal_Int16>(_rValue)); break; case TypeClass_CHAR: - _rxUpdatedObject->updateString(_nColumnIndex,OUString(*o3tl::forceGet<sal_Unicode>(_rValue))); + _rxUpdatedObject->updateString(_nColumnIndex,OUString(*o3tl::forceAccess<sal_Unicode>(_rValue))); break; case TypeClass_UNSIGNED_LONG: case TypeClass_LONG: - _rxUpdatedObject->updateInt(_nColumnIndex, *o3tl::forceGet<sal_Int32>(_rValue)); + _rxUpdatedObject->updateInt(_nColumnIndex, *o3tl::forceAccess<sal_Int32>(_rValue)); break; case TypeClass_HYPER: @@ -1484,32 +1484,32 @@ bool implUpdateObject(const Reference< XRowUpdate >& _rxUpdatedObject, break; case TypeClass_FLOAT: - _rxUpdatedObject->updateFloat(_nColumnIndex, *o3tl::forceGet<float>(_rValue)); + _rxUpdatedObject->updateFloat(_nColumnIndex, *o3tl::forceAccess<float>(_rValue)); break; case TypeClass_DOUBLE: - _rxUpdatedObject->updateDouble(_nColumnIndex, *o3tl::forceGet<double>(_rValue)); + _rxUpdatedObject->updateDouble(_nColumnIndex, *o3tl::forceAccess<double>(_rValue)); break; case TypeClass_SEQUENCE: - if (auto s = o3tl::tryGet<Sequence< sal_Int8 >>(_rValue)) + if (auto s = o3tl::tryAccess<Sequence< sal_Int8 >>(_rValue)) _rxUpdatedObject->updateBytes(_nColumnIndex, *s); else bSuccessfullyReRouted = false; break; case TypeClass_STRUCT: - if (auto s1 = o3tl::tryGet<DateTime>(_rValue)) + if (auto s1 = o3tl::tryAccess<DateTime>(_rValue)) _rxUpdatedObject->updateTimestamp(_nColumnIndex, *s1); - else if (auto s2 = o3tl::tryGet<Date>(_rValue)) + else if (auto s2 = o3tl::tryAccess<Date>(_rValue)) _rxUpdatedObject->updateDate(_nColumnIndex, *s2); - else if (auto s3 = o3tl::tryGet<Time>(_rValue)) + else if (auto s3 = o3tl::tryAccess<Time>(_rValue)) _rxUpdatedObject->updateTime(_nColumnIndex, *s3); else bSuccessfullyReRouted = false; break; case TypeClass_INTERFACE: - if (auto xStream = o3tl::tryGet<Reference<XInputStream>>(_rValue)) + if (auto xStream = o3tl::tryAccess<Reference<XInputStream>>(_rValue)) { _rxUpdatedObject->updateBinaryStream(_nColumnIndex, *xStream, (*xStream)->available()); break; @@ -1558,23 +1558,23 @@ bool implSetObject( const Reference< XParameters >& _rxParameters, break; case TypeClass_STRING: - _rxParameters->setString(_nColumnIndex, *o3tl::forceGet<OUString>(_rValue)); + _rxParameters->setString(_nColumnIndex, *o3tl::forceAccess<OUString>(_rValue)); break; case TypeClass_BOOLEAN: - _rxParameters->setBoolean(_nColumnIndex, *o3tl::forceGet<bool>(_rValue)); + _rxParameters->setBoolean(_nColumnIndex, *o3tl::forceAccess<bool>(_rValue)); break; case TypeClass_BYTE: - _rxParameters->setByte(_nColumnIndex, *o3tl::forceGet<sal_Int8>(_rValue)); + _rxParameters->setByte(_nColumnIndex, *o3tl::forceAccess<sal_Int8>(_rValue)); break; case TypeClass_SHORT: - _rxParameters->setShort(_nColumnIndex, *o3tl::forceGet<sal_Int16>(_rValue)); + _rxParameters->setShort(_nColumnIndex, *o3tl::forceAccess<sal_Int16>(_rValue)); break; case TypeClass_CHAR: - _rxParameters->setString(_nColumnIndex, OUString(*o3tl::forceGet<sal_Unicode>(_rValue))); + _rxParameters->setString(_nColumnIndex, OUString(*o3tl::forceAccess<sal_Unicode>(_rValue))); break; case TypeClass_UNSIGNED_SHORT: @@ -1587,15 +1587,15 @@ bool implSetObject( const Reference< XParameters >& _rxParameters, } case TypeClass_FLOAT: - _rxParameters->setFloat(_nColumnIndex, *o3tl::forceGet<float>(_rValue)); + _rxParameters->setFloat(_nColumnIndex, *o3tl::forceAccess<float>(_rValue)); break; case TypeClass_DOUBLE: - _rxParameters->setDouble(_nColumnIndex, *o3tl::forceGet<double>(_rValue)); + _rxParameters->setDouble(_nColumnIndex, *o3tl::forceAccess<double>(_rValue)); break; case TypeClass_SEQUENCE: - if (auto s = o3tl::tryGet<Sequence< sal_Int8 >>(_rValue)) + if (auto s = o3tl::tryAccess<Sequence< sal_Int8 >>(_rValue)) { _rxParameters->setBytes(_nColumnIndex, *s); } @@ -1603,11 +1603,11 @@ bool implSetObject( const Reference< XParameters >& _rxParameters, bSuccessfullyReRouted = false; break; case TypeClass_STRUCT: - if (auto s1 = o3tl::tryGet<DateTime>(_rValue)) + if (auto s1 = o3tl::tryAccess<DateTime>(_rValue)) _rxParameters->setTimestamp(_nColumnIndex, *s1); - else if (auto s2 = o3tl::tryGet<Date>(_rValue)) + else if (auto s2 = o3tl::tryAccess<Date>(_rValue)) _rxParameters->setDate(_nColumnIndex, *s2); - else if (auto s3 = o3tl::tryGet<Time>(_rValue)) + else if (auto s3 = o3tl::tryAccess<Time>(_rValue)) _rxParameters->setTime(_nColumnIndex, *s3); else bSuccessfullyReRouted = false; diff --git a/connectivity/source/commontools/warningscontainer.cxx b/connectivity/source/commontools/warningscontainer.cxx index 787b6cf8f9e3..2e7d6244c052 100644 --- a/connectivity/source/commontools/warningscontainer.cxx +++ b/connectivity/source/commontools/warningscontainer.cxx @@ -45,7 +45,7 @@ namespace dbtools OSL_ENSURE( SQLExceptionInfo( _rChainLeft ).isValid(), "lcl_concatWarnings: invalid warnings chain (this will crash)!" ); - const SQLException* pChainTravel = o3tl::doGet<SQLException>( _rChainLeft ); + const SQLException* pChainTravel = o3tl::doAccess<SQLException>( _rChainLeft ); SQLExceptionIteratorHelper aReferenceIterHelper( *pChainTravel ); while ( aReferenceIterHelper.hasMoreElements() ) pChainTravel = aReferenceIterHelper.next(); diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx index 06898e9f82e1..4e6df8b0fdf2 100644 --- a/connectivity/source/drivers/postgresql/pq_tools.cxx +++ b/connectivity/source/drivers/postgresql/pq_tools.cxx @@ -1166,41 +1166,41 @@ bool implSetObject( const Reference< XParameters >& _rxParameters, break; case typelib_TypeClass_STRING: - _rxParameters->setString(_nColumnIndex, *o3tl::forceGet<OUString>(_rValue)); + _rxParameters->setString(_nColumnIndex, *o3tl::forceAccess<OUString>(_rValue)); break; case typelib_TypeClass_BOOLEAN: - _rxParameters->setBoolean(_nColumnIndex, *o3tl::forceGet<bool>(_rValue)); + _rxParameters->setBoolean(_nColumnIndex, *o3tl::forceAccess<bool>(_rValue)); break; case typelib_TypeClass_BYTE: - _rxParameters->setByte(_nColumnIndex, *o3tl::forceGet<sal_Int8>(_rValue)); + _rxParameters->setByte(_nColumnIndex, *o3tl::forceAccess<sal_Int8>(_rValue)); break; case typelib_TypeClass_UNSIGNED_SHORT: case typelib_TypeClass_SHORT: - _rxParameters->setShort(_nColumnIndex, *o3tl::forceGet<sal_Int16>(_rValue)); + _rxParameters->setShort(_nColumnIndex, *o3tl::forceAccess<sal_Int16>(_rValue)); break; case typelib_TypeClass_CHAR: - _rxParameters->setString(_nColumnIndex, OUString(*o3tl::forceGet<sal_Unicode>(_rValue))); + _rxParameters->setString(_nColumnIndex, OUString(*o3tl::forceAccess<sal_Unicode>(_rValue))); break; case typelib_TypeClass_UNSIGNED_LONG: case typelib_TypeClass_LONG: - _rxParameters->setInt(_nColumnIndex, *o3tl::forceGet<sal_Int32>(_rValue)); + _rxParameters->setInt(_nColumnIndex, *o3tl::forceAccess<sal_Int32>(_rValue)); break; case typelib_TypeClass_FLOAT: - _rxParameters->setFloat(_nColumnIndex, *o3tl::forceGet<float>(_rValue)); + _rxParameters->setFloat(_nColumnIndex, *o3tl::forceAccess<float>(_rValue)); break; case typelib_TypeClass_DOUBLE: - _rxParameters->setDouble(_nColumnIndex, *o3tl::forceGet<double>(_rValue)); + _rxParameters->setDouble(_nColumnIndex, *o3tl::forceAccess<double>(_rValue)); break; case typelib_TypeClass_SEQUENCE: - if (auto s = o3tl::tryGet<Sequence< sal_Int8 >>(_rValue)) + if (auto s = o3tl::tryAccess<Sequence< sal_Int8 >>(_rValue)) { _rxParameters->setBytes(_nColumnIndex, *s); } @@ -1208,11 +1208,11 @@ bool implSetObject( const Reference< XParameters >& _rxParameters, bSuccessfullyReRouted = false; break; case typelib_TypeClass_STRUCT: - if (auto s1 = o3tl::tryGet<css::util::DateTime>(_rValue)) + if (auto s1 = o3tl::tryAccess<css::util::DateTime>(_rValue)) _rxParameters->setTimestamp(_nColumnIndex, *s1); - else if (auto s2 = o3tl::tryGet<css::util::Date>(_rValue)) + else if (auto s2 = o3tl::tryAccess<css::util::Date>(_rValue)) _rxParameters->setDate(_nColumnIndex, *s2); - else if (auto s3 = o3tl::tryGet<css::util::Time>(_rValue)) + else if (auto s3 = o3tl::tryAccess<css::util::Time>(_rValue)) _rxParameters->setTime(_nColumnIndex, *s3); else bSuccessfullyReRouted = false; diff --git a/include/o3tl/any.hxx b/include/o3tl/any.hxx index 7bbfae892cb0..92627bdc7315 100644 --- a/include/o3tl/any.hxx +++ b/include/o3tl/any.hxx @@ -95,7 +95,7 @@ template<typename T> inline boost::optional<T const> tryGetConverted( } -/** Try to get the value of a specific type from an Any. +/** Try to access the value of a specific type stored in an Any. In trying to obtain a value, the same set of conversions as supported by ">>=" are considere. @@ -108,6 +108,19 @@ template<typename T> inline boost::optional<T const> tryGetConverted( boost::optional, depending on whether a plain pointer into the given Any can be returned for the specified type.) + @attention A proxy returned from this function must not outlive the + corresponding Any passed into this function (as it may constitute a pointer + into the Any's internals). That is the reason why this function is + restricted to lvalue arguments (i.e., to non-temporary Any objects), to + avoid misuses like + @code + css::uno::Any f(); + + if (auto p = o3tl::tryAccess<css::beans::NamedValue>(f())) { + return p->Name; + } + @endcode + @note Ideally this would be a public member function of css::uno::Any (at least conditional on LIBO_INTERNAL_ONLY, as it requires C++11). However, as std::optional (which would be needed to implement the proxies) is only @@ -132,14 +145,14 @@ typename std::enable_if< || detail::IsUnoSequenceType<T>::value || std::is_base_of<css::uno::XInterface, T>::value), typename detail::Optional<T>::type>::type -tryGet(css::uno::Any const & any) { +tryAccess(css::uno::Any const & any) { // CHAR, STRING, TYPE, sequence types, enum types, struct types, exception // types, and com.sun.star.uno.XInterface interface type: return cppu::UnoType<T>::get().isAssignableFrom(any.getValueType()) ? static_cast<T const *>(any.getValue()) : nullptr; } -template<> inline detail::Optional<void>::type tryGet<void>( +template<> inline detail::Optional<void>::type tryAccess<void>( css::uno::Any const & any) { return any.hasValue() @@ -147,70 +160,70 @@ template<> inline detail::Optional<void>::type tryGet<void>( : boost::optional<detail::Void const>(detail::Void()); } -template<> inline detail::Optional<bool>::type tryGet<bool>( +template<> inline detail::Optional<bool>::type tryAccess<bool>( css::uno::Any const & any) { return detail::tryGetConverted<bool>(any); } -template<> inline detail::Optional<sal_Int8>::type tryGet<sal_Int8>( +template<> inline detail::Optional<sal_Int8>::type tryAccess<sal_Int8>( css::uno::Any const & any) { return detail::tryGetConverted<sal_Int8>(any); } -template<> inline detail::Optional<sal_Int16>::type tryGet<sal_Int16>( +template<> inline detail::Optional<sal_Int16>::type tryAccess<sal_Int16>( css::uno::Any const & any) { return detail::tryGetConverted<sal_Int16>(any); } -template<> inline detail::Optional<sal_uInt16>::type tryGet<sal_uInt16>( +template<> inline detail::Optional<sal_uInt16>::type tryAccess<sal_uInt16>( css::uno::Any const & any) { return detail::tryGetConverted<sal_uInt16>(any); } -template<> inline detail::Optional<sal_Int32>::type tryGet<sal_Int32>( +template<> inline detail::Optional<sal_Int32>::type tryAccess<sal_Int32>( css::uno::Any const & any) { return detail::tryGetConverted<sal_Int32>(any); } -template<> inline detail::Optional<sal_uInt32>::type tryGet<sal_uInt32>( +template<> inline detail::Optional<sal_uInt32>::type tryAccess<sal_uInt32>( css::uno::Any const & any) { return detail::tryGetConverted<sal_uInt32>(any); } -template<> inline detail::Optional<sal_Int64>::type tryGet<sal_Int64>( +template<> inline detail::Optional<sal_Int64>::type tryAccess<sal_Int64>( css::uno::Any const & any) { return detail::tryGetConverted<sal_Int64>(any); } -template<> inline detail::Optional<sal_uInt64>::type tryGet<sal_uInt64>( +template<> inline detail::Optional<sal_uInt64>::type tryAccess<sal_uInt64>( css::uno::Any const & any) { return detail::tryGetConverted<sal_uInt64>(any); } -template<> inline detail::Optional<float>::type tryGet<float>( +template<> inline detail::Optional<float>::type tryAccess<float>( css::uno::Any const & any) { return detail::tryGetConverted<float>(any); } -template<> inline detail::Optional<double>::type tryGet<double>( +template<> inline detail::Optional<double>::type tryAccess<double>( css::uno::Any const & any) { return detail::tryGetConverted<double>(any); } -template<> detail::Optional<css::uno::Any>::type tryGet<css::uno::Any>( +template<> detail::Optional<css::uno::Any>::type tryAccess<css::uno::Any>( css::uno::Any const &) = delete; -template<> detail::Optional<sal_Bool>::type tryGet<sal_Bool>( +template<> detail::Optional<sal_Bool>::type tryAccess<sal_Bool>( css::uno::Any const &) = delete; /* @@ -218,14 +231,14 @@ template<> detail::Optional<sal_Bool>::type tryGet<sal_Bool>( // Already prevented by std::is_base_of<css::uno::XInterface, T> requiring T to // be complete: -template<> detail::Optional<cppu::UnoVoidType>::type tryGet<cppu::UnoVoidType>( - css::uno::Any const &) = delete; +template<> detail::Optional<cppu::UnoVoidType>::type +tryAccess<cppu::UnoVoidType>(css::uno::Any const &) = delete; template<> detail::Optional<cppu::UnoUnsignedShortType>::type -tryGet<cppu::UnoUnsignedShortType>(css::uno::Any const &) = delete; +tryAccess<cppu::UnoUnsignedShortType>(css::uno::Any const &) = delete; -template<> detail::Optional<cppu::UnoCharType>::type tryGet<cppu::UnoCharType>( - css::uno::Any const &) = delete; +template<> detail::Optional<cppu::UnoCharType>::type +tryAccess<cppu::UnoCharType>(css::uno::Any const &) = delete; */ @@ -233,31 +246,40 @@ template<typename T> inline typename std::enable_if< detail::IsDerivedReference<T>::value, typename detail::Optional<T>::type>::type -tryGet(css::uno::Any const & any) { +tryAccess(css::uno::Any const & any) { return detail::tryGetConverted<T>(any); } -/** Get the value of a specific type from an Any, throwing an exception on - failure. +template<typename T> typename detail::Optional<T>::type tryAccess( + css::uno::Any const volatile &&) = delete; + +/** Access the value of a specific type stored in an Any, throwing an exception + on failure. + + @attention A proxy returned from this function must not outlive the + corresponding Any passed into this function (as it may constitute a pointer + into the Any's internals). However, unlike with tryAccess, the benefit of + allowing this function to operate on temporaries appears to outweigh its + dangers. @note Ideally this would be a public member function of css::uno::Any. See - tryGet for details. + tryAccess for details. @tparam T the C++ representation of a UNO type that can be contained in a - UNO ANY. See tryGet for details. + UNO ANY. See tryAccess for details. @param any an Any value. @return a positive proxy for the value of the specfied type obtained from - the given Any. See tryGet for details. + the given Any. See tryAccess for details. @throws css::uno::RuntimeException when a value of the requested type cannot be obtained. */ -template<typename T> inline typename detail::Optional<T>::type doGet( +template<typename T> inline typename detail::Optional<T>::type doAccess( css::uno::Any const & any) { - auto opt = tryGet<T>(any); + auto opt = tryAccess<T>(any); if (!opt) { throw css::uno::RuntimeException( OUString( @@ -268,24 +290,30 @@ template<typename T> inline typename detail::Optional<T>::type doGet( return opt; } -/** Get the value of a specific type from an Any, knowing the Any contains a - value of a matching type. +/** Access the value of a specific type stored in an Any, knowing the Any + contains a value of a matching type. + + @attention A proxy returned from this function must not outlive the + corresponding Any passed into this function (as it may constitute a pointer + into the Any's internals). However, unlike with tryAccess, the benefit of + allowing this function to operate on temporaries appears to outweigh its + dangers. @note Ideally this would be a public member function of css::uno::Any. See - tryGet for details. + tryAccess for details. @tparam T the C++ representation of a UNO type that can be contained in a - UNO ANY. See tryGet for details. + UNO ANY. See tryAccess for details. @param any an Any value. @return a positive proxy for the value of the specfied type obtained from - the given Any. See tryGet for details. + the given Any. See tryAccess for details. */ -template<typename T> inline typename detail::Optional<T>::type forceGet( +template<typename T> inline typename detail::Optional<T>::type forceAccess( css::uno::Any const & any) { - auto opt = tryGet<T>(any); + auto opt = tryAccess<T>(any); assert(opt); return opt; } diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx index b7e1c984beda..0cd5d7982d8b 100644 --- a/scaddins/source/analysis/analysis.cxx +++ b/scaddins/source/analysis/analysis.cxx @@ -1151,7 +1151,7 @@ OUString SAL_CALL AnalysisAddIn::getComplex( double fR, double fI, const uno::An break; case uno::TypeClass_STRING: { - auto pSuff = o3tl::forceGet<OUString>(rSuff); + auto pSuff = o3tl::forceAccess<OUString>(rSuff); bi = *pSuff == "i" || pSuff->isEmpty(); if( !bi && *pSuff != "j" ) throw lang::IllegalArgumentException(); diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx index 8bb963e77608..46c629c74b17 100644 --- a/scaddins/source/analysis/analysishelper.cxx +++ b/scaddins/source/analysis/analysishelper.cxx @@ -1592,7 +1592,7 @@ void ScaDoubleList::Append( const uno::Any& rAny, bool bIgnoreEmpty ) throw( uno::RuntimeException, lang::IllegalArgumentException ) { - if( auto s = o3tl::tryGet< + if( auto s = o3tl::tryAccess< css::uno::Sequence<css::uno::Sequence<css::uno::Any>>>(rAny) ) Append( rAnyConv, *s, bIgnoreEmpty ); else @@ -2122,7 +2122,7 @@ void ComplexList::Append( const uno::Sequence< uno::Any >& aMultPars, ComplListA case uno::TypeClass_VOID: break; case uno::TypeClass_STRING: { - auto pStr = o3tl::forceGet<OUString>(r); + auto pStr = o3tl::forceAccess<OUString>(r); if( !pStr->isEmpty() ) Append( new Complex( *pStr ) ); @@ -2133,7 +2133,7 @@ void ComplexList::Append( const uno::Sequence< uno::Any >& aMultPars, ComplListA } break; case uno::TypeClass_DOUBLE: - Append( new Complex( *o3tl::forceGet<double>(r), 0.0 ) ); + Append( new Complex( *o3tl::forceAccess<double>(r), 0.0 ) ); break; case uno::TypeClass_SEQUENCE: { @@ -2872,7 +2872,7 @@ bool ScaAnyConverter::getDouble( break; case uno::TypeClass_STRING: { - auto pString = o3tl::forceGet< OUString >( rAny ); + auto pString = o3tl::forceAccess< OUString >( rAny ); if( !pString->isEmpty() ) rfResult = convertToDouble( *pString ); else diff --git a/xmloff/source/core/unoatrcn.cxx b/xmloff/source/core/unoatrcn.cxx index ea8446278ccb..1fae778f1f90 100644 --- a/xmloff/source/core/unoatrcn.cxx +++ b/xmloff/source/core/unoatrcn.cxx @@ -158,7 +158,7 @@ sal_Bool SAL_CALL SvUnoAttributeContainer::hasByName(const OUString& aName) thro void SAL_CALL SvUnoAttributeContainer::replaceByName(const OUString& aName, const uno::Any& aElement) throw( lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException, std::exception ) { - if( auto pData = o3tl::tryGet<xml::AttributeData>(aElement) ) + if( auto pData = o3tl::tryAccess<xml::AttributeData>(aElement) ) { sal_uInt16 nAttr = getIndexByName(aName ); if( nAttr == USHRT_MAX ) @@ -198,7 +198,7 @@ void SAL_CALL SvUnoAttributeContainer::replaceByName(const OUString& aName, cons void SAL_CALL SvUnoAttributeContainer::insertByName(const OUString& aName, const uno::Any& aElement) throw( lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException, std::exception ) { - auto pData = o3tl::tryGet<xml::AttributeData>(aElement); + auto pData = o3tl::tryAccess<xml::AttributeData>(aElement); if( !pData ) throw lang::IllegalArgumentException(); diff --git a/xmloff/source/draw/XMLImageMapExport.cxx b/xmloff/source/draw/XMLImageMapExport.cxx index 43ba08306b38..9ac61aae0996 100644 --- a/xmloff/source/draw/XMLImageMapExport.cxx +++ b/xmloff/source/draw/XMLImageMapExport.cxx @@ -200,7 +200,7 @@ void XMLImageMapExport::ExportMapEntry( // is-active aAny = rPropertySet->getPropertyValue(msIsActive); - if (! *o3tl::doGet<bool>(aAny)) + if (! *o3tl::doAccess<bool>(aAny)) { mrExport.AddAttribute(XML_NAMESPACE_DRAW, XML_NOHREF, XML_NOHREF); } diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx index 9be390ed7a5a..7c5f29f1dfdf 100644 --- a/xmloff/source/draw/animationexport.cxx +++ b/xmloff/source/draw/animationexport.cxx @@ -1442,7 +1442,7 @@ void AnimationsExporterImpl::convertValue( XMLTokenEnum eAttributeName, OUString if( !rValue.hasValue() ) return; - if( auto pValuePair = o3tl::tryGet<ValuePair>(rValue) ) + if( auto pValuePair = o3tl::tryAccess<ValuePair>(rValue) ) { OUStringBuffer sTmp2; convertValue( eAttributeName, sTmp, pValuePair->First ); @@ -1450,7 +1450,7 @@ void AnimationsExporterImpl::convertValue( XMLTokenEnum eAttributeName, OUString convertValue( eAttributeName, sTmp2, pValuePair->Second ); sTmp.append( sTmp2.makeStringAndClear() ); } - else if( auto pSequence = o3tl::tryGet<Sequence<Any>>(rValue) ) + else if( auto pSequence = o3tl::tryAccess<Sequence<Any>>(rValue) ) { const sal_Int32 nLength = pSequence->getLength(); sal_Int32 nElement; @@ -1479,11 +1479,11 @@ void AnimationsExporterImpl::convertValue( XMLTokenEnum eAttributeName, OUString case XML_ANIMATETRANSFORM: case XML_ANIMATEMOTION: { - if( auto aString = o3tl::tryGet<OUString>(rValue) ) + if( auto aString = o3tl::tryAccess<OUString>(rValue) ) { sTmp.append( *aString ); } - else if( auto x = o3tl::tryGet<double>(rValue) ) + else if( auto x = o3tl::tryAccess<double>(rValue) ) { sTmp.append( *x ); } @@ -1531,7 +1531,7 @@ void AnimationsExporterImpl::convertTiming( OUStringBuffer& sTmp, const Any& rVa if( !rValue.hasValue() ) return; - if( auto pSequence = o3tl::tryGet<Sequence<Any>>(rValue) ) + if( auto pSequence = o3tl::tryAccess<Sequence<Any>>(rValue) ) { const sal_Int32 nLength = pSequence->getLength(); sal_Int32 nElement; @@ -1547,16 +1547,16 @@ void AnimationsExporterImpl::convertTiming( OUStringBuffer& sTmp, const Any& rVa sTmp.append( sTmp2.makeStringAndClear() ); } } - else if( auto x = o3tl::tryGet<double>(rValue) ) + else if( auto x = o3tl::tryAccess<double>(rValue) ) { sTmp.append( *x ); sTmp.append( 's'); } - else if( auto pTiming = o3tl::tryGet<Timing>(rValue) ) + else if( auto pTiming = o3tl::tryAccess<Timing>(rValue) ) { sTmp.append( GetXMLToken( (*pTiming == Timing_MEDIA) ? XML_MEDIA : XML_INDEFINITE ) ); } - else if( auto pEvent = o3tl::tryGet<Event>(rValue) ) + else if( auto pEvent = o3tl::tryAccess<Event>(rValue) ) { OUStringBuffer sTmp2; @@ -1603,7 +1603,7 @@ void AnimationsExporterImpl::convertTarget( OUStringBuffer& sTmp, const Any& rTa if( !(rTarget >>= xRef) ) { - if( auto pt = o3tl::tryGet<ParagraphTarget>(rTarget) ) + if( auto pt = o3tl::tryAccess<ParagraphTarget>(rTarget) ) { xRef = getParagraphTarget( *pt ); } @@ -1623,12 +1623,12 @@ void AnimationsExporterImpl::prepareValue( const Any& rValue ) if( !rValue.hasValue() ) return; - if( auto pValuePair = o3tl::tryGet<ValuePair>(rValue) ) + if( auto pValuePair = o3tl::tryAccess<ValuePair>(rValue) ) { prepareValue( pValuePair->First ); prepareValue( pValuePair->Second ); } - else if( auto pSequence = o3tl::tryGet<Sequence<Any>>(rValue) ) + else if( auto pSequence = o3tl::tryAccess<Sequence<Any>>(rValue) ) { const sal_Int32 nLength = pSequence->getLength(); sal_Int32 nElement; @@ -1643,13 +1643,13 @@ void AnimationsExporterImpl::prepareValue( const Any& rValue ) if( xRef.is() ) mrExport.getInterfaceToIdentifierMapper().registerReference( xRef ); } - else if( auto pt = o3tl::tryGet<ParagraphTarget>(rValue) ) + else if( auto pt = o3tl::tryAccess<ParagraphTarget>(rValue) ) { Reference< XInterface> xRef( getParagraphTarget( *pt ) ); if( xRef.is() ) mrExport.getInterfaceToIdentifierMapper().registerReference( xRef ); } - else if( auto pEvent = o3tl::tryGet<Event>(rValue) ) + else if( auto pEvent = o3tl::tryAccess<Event>(rValue) ) { prepareValue( pEvent->Source ); } diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index d851046beb9d..44551b4185fe 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -1998,7 +1998,7 @@ void XMLShapeExport::ImpExportLineShape( // get the two points uno::Any aAny(xPropSet->getPropertyValue("Geometry")); if (auto pSourcePolyPolygon - = o3tl::tryGet<drawing::PointSequenceSequence>(aAny)) + = o3tl::tryAccess<drawing::PointSequenceSequence>(aAny)) { drawing::PointSequence* pOuterSequence = const_cast<css::drawing::PointSequenceSequence *>(pSourcePolyPolygon)->getArray(); if(pOuterSequence) @@ -2173,7 +2173,7 @@ void XMLShapeExport::ImpExportPolygonShape( // get PolygonBezier uno::Any aAny( xPropSet->getPropertyValue("Geometry") ); const basegfx::B2DPolyPolygon aPolyPolygon( - basegfx::tools::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(*o3tl::doGet<drawing::PolyPolygonBezierCoords>(aAny))); + basegfx::tools::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(*o3tl::doAccess<drawing::PolyPolygonBezierCoords>(aAny))); if(aPolyPolygon.count()) { @@ -2194,7 +2194,7 @@ void XMLShapeExport::ImpExportPolygonShape( // get non-bezier polygon uno::Any aAny( xPropSet->getPropertyValue("Geometry") ); const basegfx::B2DPolyPolygon aPolyPolygon( - basegfx::tools::UnoPointSequenceSequenceToB2DPolyPolygon(*o3tl::doGet<drawing::PointSequenceSequence>(aAny))); + basegfx::tools::UnoPointSequenceSequenceToB2DPolyPolygon(*o3tl::doAccess<drawing::PointSequenceSequence>(aAny))); if(!aPolyPolygon.areControlPointsUsed() && 1 == aPolyPolygon.count()) { @@ -2586,7 +2586,7 @@ void XMLShapeExport::ImpExportConnectorShape( if( xProps->getPropertyValue("PolyPolygonBezier") >>= aAny ) { // get PolygonBezier - auto pSourcePolyPolygon = o3tl::tryGet<drawing::PolyPolygonBezierCoords>(aAny); + auto pSourcePolyPolygon = o3tl::tryAccess<drawing::PolyPolygonBezierCoords>(aAny); if(pSourcePolyPolygon && pSourcePolyPolygon->Coordinates.getLength()) { diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx index bdd752417930..167376bd9c67 100644 --- a/xmloff/source/draw/ximpcustomshape.cxx +++ b/xmloff/source/draw/ximpcustomshape.cxx @@ -1220,7 +1220,7 @@ void XMLEnhancedCustomShapeContext::EndElement() case EAS_GluePoints : { uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair > const & rSeq = - *o3tl::doGet<uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair > >( + *o3tl::doAccess<uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair > >( aPathIter->Value); for ( i = 0; i < rSeq.getLength(); i++ ) { @@ -1232,7 +1232,7 @@ void XMLEnhancedCustomShapeContext::EndElement() case EAS_TextFrames : { uno::Sequence< css::drawing::EnhancedCustomShapeTextFrame > const & rSeq = - *o3tl::doGet<uno::Sequence< css::drawing::EnhancedCustomShapeTextFrame > >( + *o3tl::doAccess<uno::Sequence< css::drawing::EnhancedCustomShapeTextFrame > >( aPathIter->Value); for ( i = 0; i < rSeq.getLength(); i++ ) { @@ -1264,7 +1264,7 @@ void XMLEnhancedCustomShapeContext::EndElement() case EAS_RadiusRangeMinimum : case EAS_RadiusRangeMaximum : { - CheckAndResolveEquationParameter( const_cast<css::drawing::EnhancedCustomShapeParameter &>(*o3tl::doGet<css::drawing::EnhancedCustomShapeParameter>( + CheckAndResolveEquationParameter( const_cast<css::drawing::EnhancedCustomShapeParameter &>(*o3tl::doAccess<css::drawing::EnhancedCustomShapeParameter>( pValues->Value)), pH ); } break; @@ -1272,9 +1272,9 @@ void XMLEnhancedCustomShapeContext::EndElement() case EAS_Position : case EAS_Polar : { - CheckAndResolveEquationParameter( const_cast<css::drawing::EnhancedCustomShapeParameter &>((*o3tl::doGet<css::drawing::EnhancedCustomShapeParameterPair>( + CheckAndResolveEquationParameter( const_cast<css::drawing::EnhancedCustomShapeParameter &>((*o3tl::doAccess<css::drawing::EnhancedCustomShapeParameterPair>( pValues->Value)).First), pH ); - CheckAndResolveEquationParameter( const_cast<css::drawing::EnhancedCustomShapeParameter &>((*o3tl::doGet<css::drawing::EnhancedCustomShapeParameterPair>( + CheckAndResolveEquationParameter( const_cast<css::drawing::EnhancedCustomShapeParameter &>((*o3tl::doAccess<css::drawing::EnhancedCustomShapeParameterPair>( pValues->Value)).Second), pH ); } break; diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx index d7fc0c18073d..0eee93743e7b 100644 --- a/xmloff/source/style/XMLPageExport.cxx +++ b/xmloff/source/style/XMLPageExport.cxx @@ -93,7 +93,7 @@ bool XMLPageExport::exportStyle( if( xPropSetInfo->hasPropertyByName( sIsPhysical ) ) { Any aAny = xPropSet->getPropertyValue( sIsPhysical ); - if( !*o3tl::doGet<bool>(aAny) ) + if( !*o3tl::doAccess<bool>(aAny) ) return false; } diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx index 1092568ddb80..8d63fdcbe9ca 100644 --- a/xmloff/source/style/prstylei.cxx +++ b/xmloff/source/style/prstylei.cxx @@ -376,7 +376,7 @@ void XMLPropStyleContext::CreateAndInsert( bool bOverwrite ) if( !bNew && xPropSetInfo->hasPropertyByName( msIsPhysical ) ) { Any aAny = xPropSet->getPropertyValue( msIsPhysical ); - bNew = !*o3tl::doGet<bool>(aAny); + bNew = !*o3tl::doAccess<bool>(aAny); } SetNew( bNew ); if( rName != GetName() ) diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx index d87979d57cba..b2516406c52a 100644 --- a/xmloff/source/style/styleexp.cxx +++ b/xmloff/source/style/styleexp.cxx @@ -99,7 +99,7 @@ bool XMLStyleExport::exportStyle( if( xPropSetInfo->hasPropertyByName( sIsPhysical ) ) { aAny = xPropSet->getPropertyValue( sIsPhysical ); - if( !*o3tl::doGet<bool>(aAny) ) + if( !*o3tl::doAccess<bool>(aAny) ) return false; } @@ -167,7 +167,7 @@ bool XMLStyleExport::exportStyle( if( xPropSetInfo->hasPropertyByName( sIsAutoUpdate ) ) { aAny = xPropSet->getPropertyValue( sIsAutoUpdate ); - if( *o3tl::doGet<bool>(aAny) ) + if( *o3tl::doAccess<bool>(aAny) ) GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_AUTO_UPDATE, XML_TRUE ); } @@ -477,7 +477,7 @@ void XMLStyleExport::exportStyleFamily( if (xPropSetInfo->hasPropertyByName( sIsPhysical )) { Any aAny( xPropSet->getPropertyValue( sIsPhysical ) ); - if (!*o3tl::doGet<bool>(aAny)) + if (!*o3tl::doAccess<bool>(aAny)) continue; } diff --git a/xmloff/source/style/xmlbahdl.cxx b/xmloff/source/style/xmlbahdl.cxx index 5574ad6ddba6..7516bff70d31 100644 --- a/xmloff/source/style/xmlbahdl.cxx +++ b/xmloff/source/style/xmlbahdl.cxx @@ -694,7 +694,7 @@ bool XMLIsTransparentPropHdl::exportXML( OUString& rStrExpValue, const Any& rVal // MIB: This looks a bit strange, because bTransPropValue == bValue should // do the same, but this only applies if 'true' is represented by the same // 8 bit value in bValue and bTransPropValue. Who will ensure this? - bool bValue = *o3tl::doGet<bool>(rValue); + bool bValue = *o3tl::doAccess<bool>(rValue); bool bIsTrans = bTransPropValue ? bValue : !bValue; if( bIsTrans ) diff --git a/xmloff/source/style/xmlnume.cxx b/xmloff/source/style/xmlnume.cxx index d8470b4e4893..abd982f95900 100644 --- a/xmloff/source/style/xmlnume.cxx +++ b/xmloff/source/style/xmlnume.cxx @@ -676,7 +676,7 @@ void SvxXMLNumRuleExport::exportNumberingRule( xPropSetInfo->hasPropertyByName( sIsContinuousNumbering ) ) { Any aAny( xPropSet->getPropertyValue( sIsContinuousNumbering ) ); - bContNumbering = *o3tl::doGet<bool>(aAny); + bContNumbering = *o3tl::doAccess<bool>(aAny); } if( bContNumbering ) GetExport().AddAttribute( XML_NAMESPACE_TEXT, @@ -704,7 +704,7 @@ void SvxXMLNumRuleExport::exportStyle( const Reference< XStyle >& rStyle ) if( xPropSetInfo->hasPropertyByName( sIsPhysical ) ) { aAny = xPropSet->getPropertyValue( sIsPhysical ); - if( !*o3tl::doGet<bool>(aAny) ) + if( !*o3tl::doAccess<bool>(aAny) ) return; } diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx index a5153de126bd..5d24e0ed6a9f 100644 --- a/xmloff/source/style/xmlnumi.cxx +++ b/xmloff/source/style/xmlnumi.cxx @@ -1184,7 +1184,7 @@ void SvxXMLListStyleContext::CreateAndInsertLate( bool bOverwrite ) if( !bNew && xPropSetInfo->hasPropertyByName( sIsPhysical ) ) { Any aAny = xPropSet->getPropertyValue( sIsPhysical ); - bNew = !*o3tl::doGet<bool>(aAny); + bNew = !*o3tl::doAccess<bool>(aAny); } if ( xPropSetInfo->hasPropertyByName( "Hidden" ) ) diff --git a/xmloff/source/text/XMLIndexMarkExport.cxx b/xmloff/source/text/XMLIndexMarkExport.cxx index 14c983fe77b3..90b45b050679 100644 --- a/xmloff/source/text/XMLIndexMarkExport.cxx +++ b/xmloff/source/text/XMLIndexMarkExport.cxx @@ -92,7 +92,7 @@ void XMLIndexMarkExport::ExportIndexMark( // collapsed/alternative text entry? aAny = rPropSet->getPropertyValue(sIsCollapsed); - if (*o3tl::doGet<bool>(aAny)) + if (*o3tl::doAccess<bool>(aAny)) { // collapsed entry: needs alternative text nElementNo = 0; @@ -108,7 +108,7 @@ void XMLIndexMarkExport::ExportIndexMark( { // start and end entries: has ID aAny = rPropSet->getPropertyValue(sIsStart); - nElementNo = *o3tl::doGet<bool>(aAny) ? 1 : 2; + nElementNo = *o3tl::doAccess<bool>(aAny) ? 1 : 2; // generate ID OUStringBuffer sBuf; diff --git a/xmloff/source/text/XMLLineNumberingExport.cxx b/xmloff/source/text/XMLLineNumberingExport.cxx index 6394f81cd03c..95c826ac4ab3 100644 --- a/xmloff/source/text/XMLLineNumberingExport.cxx +++ b/xmloff/source/text/XMLLineNumberingExport.cxx @@ -90,7 +90,7 @@ void XMLLineNumberingExport::Export() // enable aAny = xLineNumbering->getPropertyValue(sIsOn); - if (! *o3tl::doGet<bool>(aAny)) + if (! *o3tl::doAccess<bool>(aAny)) { rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_NUMBER_LINES, XML_FALSE); @@ -98,7 +98,7 @@ void XMLLineNumberingExport::Export() // count empty lines aAny = xLineNumbering->getPropertyValue(sCountEmptyLines); - if (! *o3tl::doGet<bool>(aAny)) + if (! *o3tl::doAccess<bool>(aAny)) { rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_COUNT_EMPTY_LINES, XML_FALSE); @@ -106,7 +106,7 @@ void XMLLineNumberingExport::Export() // count in frames aAny = xLineNumbering->getPropertyValue(sCountLinesInFrames); - if (*o3tl::doGet<bool>(aAny)) + if (*o3tl::doAccess<bool>(aAny)) { rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_COUNT_IN_TEXT_BOXES, XML_TRUE); @@ -114,7 +114,7 @@ void XMLLineNumberingExport::Export() // restart numbering aAny = xLineNumbering->getPropertyValue(sRestartAtEachPage); - if (*o3tl::doGet<bool>(aAny)) + if (*o3tl::doAccess<bool>(aAny)) { rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_RESTART_ON_PAGE, XML_TRUE); diff --git a/xmloff/source/text/XMLRedlineExport.cxx b/xmloff/source/text/XMLRedlineExport.cxx index ce9bfa37f1b6..0806958ca875 100644 --- a/xmloff/source/text/XMLRedlineExport.cxx +++ b/xmloff/source/text/XMLRedlineExport.cxx @@ -214,7 +214,7 @@ void XMLRedlineExport::ExportChangesListElements() Reference<XPropertySet> aDocPropertySet( rExport.GetModel(), uno::UNO_QUERY ); // redlining enabled? - bool bEnabled = *o3tl::doGet<bool>(aDocPropertySet->getPropertyValue( + bool bEnabled = *o3tl::doAccess<bool>(aDocPropertySet->getPropertyValue( sRecordChanges )); // only export if we have redlines or attributes @@ -249,7 +249,7 @@ void XMLRedlineExport::ExportChangesListElements() // export only if not in header or footer // (those must be exported with their XText) aAny = xPropSet->getPropertyValue(sIsInHeaderFooter); - if (! *o3tl::doGet<bool>(aAny)) + if (! *o3tl::doAccess<bool>(aAny)) { // and finally, export change ExportChangedRegion(xPropSet); @@ -273,8 +273,8 @@ void XMLRedlineExport::ExportChangeAutoStyle( Any aIsStart = rPropSet->getPropertyValue(sIsStart); Any aIsCollapsed = rPropSet->getPropertyValue(sIsCollapsed); - if ( *o3tl::doGet<bool>(aIsStart) || - *o3tl::doGet<bool>(aIsCollapsed) ) + if ( *o3tl::doAccess<bool>(aIsStart) || + *o3tl::doAccess<bool>(aIsCollapsed) ) pCurrentChangesList->push_back(rPropSet); } @@ -316,7 +316,7 @@ void XMLRedlineExport::ExportChangesListAutoStyles() // export only if not in header or footer // (those must be exported with their XText) aAny = xPropSet->getPropertyValue(sIsInHeaderFooter); - if (! *o3tl::doGet<bool>(aAny)) + if (! *o3tl::doAccess<bool>(aAny)) { ExportChangeAutoStyle(xPropSet); } @@ -332,7 +332,7 @@ void XMLRedlineExport::ExportChangeInline( // determine element name (depending on collapsed, start/end) enum XMLTokenEnum eElement = XML_TOKEN_INVALID; Any aAny = rPropSet->getPropertyValue(sIsCollapsed); - bool bCollapsed = *o3tl::doGet<bool>(aAny); + bool bCollapsed = *o3tl::doAccess<bool>(aAny); if (bCollapsed) { eElement = XML_CHANGE; @@ -340,7 +340,7 @@ void XMLRedlineExport::ExportChangeInline( else { aAny = rPropSet->getPropertyValue(sIsStart); - const bool bStart = *o3tl::doGet<bool>(aAny); + const bool bStart = *o3tl::doAccess<bool>(aAny); eElement = bStart ? XML_CHANGE_START : XML_CHANGE_END; } @@ -365,7 +365,7 @@ void XMLRedlineExport::ExportChangedRegion( // merge-last-paragraph Any aAny = rPropSet->getPropertyValue(sMergeLastPara); - if( ! *o3tl::doGet<bool>(aAny) ) + if( ! *o3tl::doAccess<bool>(aAny) ) rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_MERGE_LAST_PARAGRAPH, XML_FALSE); @@ -582,11 +582,11 @@ void XMLRedlineExport::ExportStartOrEndRedline( } else if (sIsCollapsed.equals(pValues[i].Name)) { - bIsCollapsed = *o3tl::doGet<bool>(pValues[i].Value); + bIsCollapsed = *o3tl::doAccess<bool>(pValues[i].Value); } else if (sIsStart.equals(pValues[i].Name)) { - bIsStart = *o3tl::doGet<bool>(pValues[i].Value); + bIsStart = *o3tl::doAccess<bool>(pValues[i].Value); } } diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx index 825e6a0191a5..30fb71e531e9 100644 --- a/xmloff/source/text/XMLSectionExport.cxx +++ b/xmloff/source/text/XMLSectionExport.cxx @@ -430,7 +430,7 @@ void XMLSectionExport::ExportRegularSectionStart( // #97450# store hidden-status (of conditional sections only) aAny = xPropSet->getPropertyValue(sIsCurrentlyVisible); - if (! *o3tl::doGet<bool>(aAny)) + if (! *o3tl::doAccess<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_IS_HIDDEN, XML_TRUE); @@ -441,14 +441,14 @@ void XMLSectionExport::ExportRegularSectionStart( eDisplay = XML_NONE; } aAny = xPropSet->getPropertyValue(sIsVisible); - if (! *o3tl::doGet<bool>(aAny)) + if (! *o3tl::doAccess<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_DISPLAY, eDisplay); } // protect + protection key aAny = xPropSet->getPropertyValue(sIsProtected); - if (*o3tl::doGet<bool>(aAny)) + if (*o3tl::doAccess<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_PROTECTED, XML_TRUE); } @@ -532,7 +532,7 @@ void XMLSectionExport::ExportRegularSectionStart( sItem); aAny = xPropSet->getPropertyValue(sIsAutomaticUpdate); - if (*o3tl::doGet<bool>(aAny)) + if (*o3tl::doAccess<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_OFFICE, XML_AUTOMATIC_UPDATE, XML_TRUE); @@ -766,7 +766,7 @@ void XMLSectionExport::ExportBaseIndexStart( { // protect + protection key Any aAny = rPropertySet->getPropertyValue(sIsProtected); - if (*o3tl::doGet<bool>(aAny)) + if (*o3tl::doAccess<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_PROTECTED, XML_TRUE); } @@ -810,7 +810,7 @@ void XMLSectionExport::ExportBaseIndexSource( { // document or chapter index? aAny = rPropertySet->getPropertyValue(sCreateFromChapter); - if (*o3tl::doGet<bool>(aAny)) + if (*o3tl::doAccess<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_INDEX_SCOPE, XML_CHAPTER); @@ -818,7 +818,7 @@ void XMLSectionExport::ExportBaseIndexSource( // tab-stops relative to margin? aAny = rPropertySet->getPropertyValue(sIsRelativeTabstops); - if (! *o3tl::doGet<bool>(aAny)) + if (! *o3tl::doAccess<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_RELATIVE_TAB_STOP_POSITION, @@ -915,7 +915,7 @@ void XMLSectionExport::ExportTableAndIllustrationIndexSourceAttributes( { // use caption Any aAny = rPropertySet->getPropertyValue(sCreateFromLabels); - if (! *o3tl::doGet<bool>(aAny)) + if (! *o3tl::doAccess<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_USE_CAPTION, XML_FALSE); @@ -1285,7 +1285,7 @@ void XMLSectionExport::ExportIndexTemplateElement( case TOK_TPARAM_TAB_RIGHT_ALIGNED: bRightAligned = - *o3tl::doGet<bool>(rValues[i].Value); + *o3tl::doAccess<bool>(rValues[i].Value); break; case TOK_TPARAM_TAB_POSITION: @@ -1295,7 +1295,7 @@ void XMLSectionExport::ExportIndexTemplateElement( // #i21237# case TOK_TPARAM_TAB_WITH_TAB: - bWithTabStop = *o3tl::doGet<bool>(rValues[i].Value); + bWithTabStop = *o3tl::doAccess<bool>(rValues[i].Value); bWithTabStopOK = true; break; @@ -1592,7 +1592,7 @@ void XMLSectionExport::ExportBoolean( OSL_ENSURE(eAttributeName != XML_TOKEN_INVALID, "Need attribute name"); Any aAny = rPropSet->getPropertyValue(sPropertyName); - bool bTmp = *o3tl::doGet<bool>(aAny); + bool bTmp = *o3tl::doAccess<bool>(aAny); // value = value ^ bInvert // omit if value == default @@ -1648,14 +1648,14 @@ void XMLSectionExport::ExportBibliographyConfiguration(SvXMLExport& rExport) rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_SUFFIX, sTmp); aAny = xPropSet->getPropertyValue(sIsNumberEntries); - if (*o3tl::doGet<bool>(aAny)) + if (*o3tl::doAccess<bool>(aAny)) { rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_NUMBERED_ENTRIES, XML_TRUE); } aAny = xPropSet->getPropertyValue(sIsSortByPosition); - if (! *o3tl::doGet<bool>(aAny)) + if (! *o3tl::doAccess<bool>(aAny)) { rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_SORT_BY_POSITION, XML_FALSE); @@ -1710,7 +1710,7 @@ void XMLSectionExport::ExportBibliographyConfiguration(SvXMLExport& rExport) } else if (rValue.Name == "IsSortAscending") { - bool bTmp = *o3tl::doGet<bool>(rValue.Value); + bool bTmp = *o3tl::doAccess<bool>(rValue.Value); rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_SORT_ASCENDING, bTmp ? XML_TRUE : XML_FALSE); @@ -1750,7 +1750,7 @@ bool XMLSectionExport::IsMuteSection( { Any aAny = xPropSet->getPropertyValue(sIsGlobalDocumentSection); - if ( *o3tl::doGet<bool>(aAny) ) + if ( *o3tl::doAccess<bool>(aAny) ) { Reference<XDocumentIndex> xIndex; if (! GetIndex(rSection, xIndex)) diff --git a/xmloff/source/text/XMLTextColumnsExport.cxx b/xmloff/source/text/XMLTextColumnsExport.cxx index 4d5eee50f365..607a5935caa1 100644 --- a/xmloff/source/text/XMLTextColumnsExport.cxx +++ b/xmloff/source/text/XMLTextColumnsExport.cxx @@ -75,7 +75,7 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) if( xPropSet.is() ) { Any aAny = xPropSet->getPropertyValue( sIsAutomatic ); - if ( *o3tl::doGet<bool>(aAny) ) + if ( *o3tl::doAccess<bool>(aAny) ) { aAny = xPropSet->getPropertyValue( sAutomaticDistance ); sal_Int32 nDistance = 0; @@ -95,7 +95,7 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) if( xPropSet.is() ) { Any aAny = xPropSet->getPropertyValue( sSeparatorLineIsOn ); - if( *o3tl::doGet<bool>(aAny) ) + if( *o3tl::doAccess<bool>(aAny) ) { // style:width aAny = xPropSet->getPropertyValue( sSeparatorLineWidth ); diff --git a/xmloff/source/text/XMLTextHeaderFooterContext.cxx b/xmloff/source/text/XMLTextHeaderFooterContext.cxx index 6dc6e25021eb..dd63772e4374 100644 --- a/xmloff/source/text/XMLTextHeaderFooterContext.cxx +++ b/xmloff/source/text/XMLTextHeaderFooterContext.cxx @@ -59,7 +59,7 @@ XMLTextHeaderFooterContext::XMLTextHeaderFooterContext( SvXMLImport& rImport, sa Any aAny; aAny = xPropSet->getPropertyValue( sOn ); - bool bOn = *o3tl::doGet<bool>(aAny); + bool bOn = *o3tl::doAccess<bool>(aAny); if( bOn ) { @@ -125,7 +125,7 @@ SvXMLImportContext *XMLTextHeaderFooterContext::CreateChildContext( else { aAny = xPropSet->getPropertyValue( sOn ); - bool bOn = *o3tl::doGet<bool>(aAny); + bool bOn = *o3tl::doAccess<bool>(aAny); if( !bOn ) { @@ -139,7 +139,7 @@ SvXMLImportContext *XMLTextHeaderFooterContext::CreateChildContext( // If a header or footer is not shared, share it now. aAny = xPropSet->getPropertyValue( sShareContent ); - bool bShared = *o3tl::doGet<bool>(aAny); + bool bShared = *o3tl::doAccess<bool>(aAny); if( !bShared ) { xPropSet->setPropertyValue( sShareContent, Any(true) ); diff --git a/xmloff/source/text/XMLTextMasterPageContext.cxx b/xmloff/source/text/XMLTextMasterPageContext.cxx index 8d39758498c1..29e1ab48327a 100644 --- a/xmloff/source/text/XMLTextMasterPageContext.cxx +++ b/xmloff/source/text/XMLTextMasterPageContext.cxx @@ -148,7 +148,7 @@ XMLTextMasterPageContext::XMLTextMasterPageContext( SvXMLImport& rImport, if( !bNew && xPropSetInfo->hasPropertyByName( sIsPhysical ) ) { aAny = xPropSet->getPropertyValue( sIsPhysical ); - bNew = !*o3tl::doGet<bool>(aAny); + bNew = !*o3tl::doAccess<bool>(aAny); } SetNew( bNew ); diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx index d77a548e95ed..4ebf531a4711 100644 --- a/xmloff/source/text/txtexppr.cxx +++ b/xmloff/source/text/txtexppr.cxx @@ -149,7 +149,7 @@ void XMLTextExportPropertySetMapper::handleSpecialItem( { case CTF_DROPCAPWHOLEWORD: DBG_ASSERT( !bDropWholeWord, "drop whole word is set already!" ); - pThis->bDropWholeWord = *o3tl::doGet<bool>(rProperty.maValue); + pThis->bDropWholeWord = *o3tl::doAccess<bool>(rProperty.maValue); break; case CTF_DROPCAPCHARSTYLE: DBG_ASSERT( sDropCharStyle.isEmpty(), "drop char style is set already!" ); @@ -1005,7 +1005,7 @@ void XMLTextExportPropertySetMapper::ContextFilter( } if( pWrapContourModeState && (!pWrapContourState || - !*o3tl::doGet<bool>(pWrapContourState ->maValue) ) ) + !*o3tl::doAccess<bool>(pWrapContourState ->maValue) ) ) pWrapContourModeState->mnIndex = -1; } @@ -1023,7 +1023,7 @@ void XMLTextExportPropertySetMapper::ContextFilter( if( pHoriOrientState && pHoriOrientMirroredState ) { if( pHoriOrientMirrorState && - *o3tl::doGet<bool>(pHoriOrientMirrorState->maValue) ) + *o3tl::doAccess<bool>(pHoriOrientMirrorState->maValue) ) pHoriOrientState->mnIndex = -1; else pHoriOrientMirroredState->mnIndex = -1; @@ -1099,7 +1099,7 @@ void XMLTextExportPropertySetMapper::ContextFilter( if( pShapeHoriOrientState && pShapeHoriOrientMirroredState ) { if( pShapeHoriOrientMirrorState && - *o3tl::doGet<bool>(pShapeHoriOrientMirrorState->maValue) ) + *o3tl::doAccess<bool>(pShapeHoriOrientMirrorState->maValue) ) pShapeHoriOrientState->mnIndex = -1; else pShapeHoriOrientMirroredState->mnIndex = -1; diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index b87e256af950..aee0f3a7b099 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -2951,7 +2951,7 @@ enum XMLTokenEnum XMLTextFieldExport::MapPageNumberName( enum XMLTokenEnum eName = XML_TOKEN_INVALID; PageNumberType ePage; Any aAny = xPropSet->getPropertyValue(sPropertySubType); - ePage = *o3tl::doGet<PageNumberType>(aAny); + ePage = *o3tl::doAccess<PageNumberType>(aAny); switch (ePage) { @@ -3493,7 +3493,7 @@ inline bool GetBoolProperty( const Reference<XPropertySet> & xPropSet) { Any aAny = xPropSet->getPropertyValue(sPropName); - bool bBool = *o3tl::doGet<bool>(aAny); + bool bBool = *o3tl::doAccess<bool>(aAny); return bBool; } diff --git a/xmloff/source/text/txtftne.cxx b/xmloff/source/text/txtftne.cxx index 97324420ccde..c80caa98dbc7 100644 --- a/xmloff/source/text/txtftne.cxx +++ b/xmloff/source/text/txtftne.cxx @@ -319,7 +319,7 @@ void XMLTextParagraphExport::exportTextFootnoteConfigurationHelper( aAny = rFootnoteConfig->getPropertyValue( sPositionEndOfDoc); GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_FOOTNOTES_POSITION, - ( (*o3tl::doGet<bool>(aAny)) ? + ( (*o3tl::doAccess<bool>(aAny)) ? XML_DOCUMENT : XML_PAGE ) ); aAny = rFootnoteConfig->getPropertyValue(sFootnoteCounting); diff --git a/xmloff/source/text/txtimppr.cxx b/xmloff/source/text/txtimppr.cxx index 6bc35f5f469f..6571c1a51510 100644 --- a/xmloff/source/text/txtimppr.cxx +++ b/xmloff/source/text/txtimppr.cxx @@ -674,7 +674,7 @@ void XMLTextImportPropertyMapper::finished( // #i5775# don't overwrite %transparency with binary transparency if( ( pBackTransparency != nullptr ) && ( pBackTransparent != nullptr ) ) { - if( ! *o3tl::doGet<bool>(pBackTransparent->maValue) ) + if( ! *o3tl::doAccess<bool>(pBackTransparent->maValue) ) pBackTransparent->mnIndex = -1; } diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index dfea038f50ae..340c06de9ad8 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -516,13 +516,13 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily, xNumPropSet->getPropertySetInfo() ->hasPropertyByName( "IsAutomatic" ) ) { - bAdd = *o3tl::doGet<bool>(xNumPropSet->getPropertyValue( "IsAutomatic" )); + bAdd = *o3tl::doAccess<bool>(xNumPropSet->getPropertyValue( "IsAutomatic" )); // Check on outline style (#i73361#) if ( bAdd && xNumPropSet->getPropertySetInfo() ->hasPropertyByName( "NumberingIsOutline" ) ) { - bAdd = !(*o3tl::doGet<bool>(xNumPropSet->getPropertyValue( "NumberingIsOutline" ))); + bAdd = !(*o3tl::doAccess<bool>(xNumPropSet->getPropertyValue( "NumberingIsOutline" ))); } } else @@ -622,13 +622,13 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily, xNumPropSet->getPropertySetInfo() ->hasPropertyByName( "IsAutomatic" ) ) { - bAdd = *o3tl::doGet<bool>(xNumPropSet->getPropertyValue( "IsAutomatic" )); + bAdd = *o3tl::doAccess<bool>(xNumPropSet->getPropertyValue( "IsAutomatic" )); // Check on outline style (#i73361#) if ( bAdd && xNumPropSet->getPropertySetInfo() ->hasPropertyByName( "NumberingIsOutline" ) ) { - bAdd = !(*o3tl::doGet<bool>(xNumPropSet->getPropertyValue( "NumberingIsOutline" ))); + bAdd = !(*o3tl::doAccess<bool>(xNumPropSet->getPropertyValue( "NumberingIsOutline" ))); } } else @@ -1459,13 +1459,13 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress ) } Any aAny = xAutoStyleFamilies->getByName( sName ); - Reference< XAutoStyleFamily > xAutoStyles = *o3tl::doGet<Reference<XAutoStyleFamily>>(aAny); + Reference< XAutoStyleFamily > xAutoStyles = *o3tl::doAccess<Reference<XAutoStyleFamily>>(aAny); Reference < XEnumeration > xAutoStylesEnum( xAutoStyles->createEnumeration() ); while ( xAutoStylesEnum->hasMoreElements() ) { aAny = xAutoStylesEnum->nextElement(); - Reference< XAutoStyle > xAutoStyle = *o3tl::doGet<Reference<XAutoStyle>>(aAny); + Reference< XAutoStyle > xAutoStyle = *o3tl::doAccess<Reference<XAutoStyle>>(aAny); Reference < XPropertySet > xPSet( xAutoStyle, uno::UNO_QUERY ); Add( nFamily, xPSet, nullptr, true ); } @@ -1482,7 +1482,7 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress ) while ( xTextFieldsEnum->hasMoreElements() ) { Any aAny = xTextFieldsEnum->nextElement(); - Reference< XTextField > xTextField = *o3tl::doGet<Reference<XTextField>>(aAny); + Reference< XTextField > xTextField = *o3tl::doAccess<Reference<XTextField>>(aAny); exportTextField( xTextField, bAutoStyles, bIsProgress, !xAutoStylesSupp.is() ); try @@ -1560,7 +1560,7 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress ) for( sal_Int32 i = 0; i < nCount; ++i ) { Any aAny = xSections->getByIndex( i ); - Reference< XTextSection > xSection = *o3tl::doGet<Reference<XTextSection>>(aAny); + Reference< XTextSection > xSection = *o3tl::doAccess<Reference<XTextSection>>(aAny); Reference < XPropertySet > xPSet( xSection, uno::UNO_QUERY ); Add( XML_STYLE_FAMILY_TEXT_SECTION, xPSet ); } @@ -1578,7 +1578,7 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress ) for( sal_Int32 i = 0; i < nCount; ++i ) { Any aAny = xTables->getByIndex( i ); - Reference< XTextTable > xTable = *o3tl::doGet<Reference<XTextTable>>(aAny); + Reference< XTextTable > xTable = *o3tl::doAccess<Reference<XTextTable>>(aAny); exportTable( xTable, true, true ); } } @@ -1608,13 +1608,13 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress ) xNumPropSet->getPropertySetInfo() ->hasPropertyByName( "IsAutomatic" ) ) { - bAdd = *o3tl::doGet<bool>(xNumPropSet->getPropertyValue( "IsAutomatic" )); + bAdd = *o3tl::doAccess<bool>(xNumPropSet->getPropertyValue( "IsAutomatic" )); // Check on outline style (#i73361#) if ( bAdd && xNumPropSet->getPropertySetInfo() ->hasPropertyByName( "NumberingIsOutline" ) ) { - bAdd = !(*o3tl::doGet<bool>(xNumPropSet->getPropertyValue( "NumberingIsOutline" ))); + bAdd = !(*o3tl::doAccess<bool>(xNumPropSet->getPropertyValue( "NumberingIsOutline" ))); } } else @@ -2506,13 +2506,13 @@ void XMLTextParagraphExport::exportTextMark( // start, end, or point-reference? sal_Int8 nElement; - if( *o3tl::doGet<bool>(rPropSet->getPropertyValue(sIsCollapsed)) ) + if( *o3tl::doAccess<bool>(rPropSet->getPropertyValue(sIsCollapsed)) ) { nElement = 0; } else { - nElement = *o3tl::doGet<bool>(rPropSet->getPropertyValue(sIsStart)) ? 1 : 2; + nElement = *o3tl::doAccess<bool>(rPropSet->getPropertyValue(sIsStart)) ? 1 : 2; } // bookmark, bookmark-start: xml:id and RDFa for RDF metadata @@ -2672,7 +2672,7 @@ XMLShapeExportFlags XMLTextParagraphExport::addTextFrameAttributes( bool bSyncWidth = false; if( xPropSetInfo->hasPropertyByName( sIsSyncWidthToHeight ) ) { - bSyncWidth = *o3tl::doGet<bool>(rPropSet->getPropertyValue( sIsSyncWidthToHeight )); + bSyncWidth = *o3tl::doAccess<bool>(rPropSet->getPropertyValue( sIsSyncWidthToHeight )); if( bSyncWidth ) GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_REL_WIDTH, XML_SCALE ); @@ -2700,7 +2700,7 @@ XMLShapeExportFlags XMLTextParagraphExport::addTextFrameAttributes( bool bSyncHeight = false; if( xPropSetInfo->hasPropertyByName( sIsSyncHeightToWidth ) ) { - bSyncHeight = *o3tl::doGet<bool>(rPropSet->getPropertyValue( sIsSyncHeightToWidth )); + bSyncHeight = *o3tl::doAccess<bool>(rPropSet->getPropertyValue( sIsSyncHeightToWidth )); } sal_Int16 nRelHeight = 0; if( !bSyncHeight && xPropSetInfo->hasPropertyByName( sRelativeHeight ) ) @@ -2967,7 +2967,7 @@ void XMLTextParagraphExport::exportContour( if( rPropSetInfo->hasPropertyByName( sIsPixelContour ) ) { - bPixel = *o3tl::doGet<bool>(rPropSet->getPropertyValue( sIsPixelContour )); + bPixel = *o3tl::doAccess<bool>(rPropSet->getPropertyValue( sIsPixelContour )); } // svg: width @@ -3029,7 +3029,7 @@ void XMLTextParagraphExport::exportContour( if( rPropSetInfo->hasPropertyByName( sIsAutomaticContour ) ) { - bool bTmp = *o3tl::doGet<bool>(rPropSet->getPropertyValue( + bool bTmp = *o3tl::doAccess<bool>(rPropSet->getPropertyValue( sIsAutomaticContour )); GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_RECREATE_ON_EDIT, bTmp ? XML_TRUE : XML_FALSE ); @@ -3250,7 +3250,7 @@ bool XMLTextParagraphExport::addHyperlinkAttributes( && ( !rPropState.is() || PropertyState_DIRECT_VALUE == rPropState->getPropertyState( sServerMap ) ) ) { - bServerMap = *o3tl::doGet<bool>(rPropSet->getPropertyValue( sServerMap )); + bServerMap = *o3tl::doAccess<bool>(rPropSet->getPropertyValue( sServerMap )); if ( bServerMap ) bExport = true; } @@ -3627,11 +3627,11 @@ void XMLTextParagraphExport::exportRuby( bool bAutoStyles ) { // early out: a collapsed ruby makes no sense - if (*o3tl::doGet<bool>(rPropSet->getPropertyValue(sIsCollapsed))) + if (*o3tl::doAccess<bool>(rPropSet->getPropertyValue(sIsCollapsed))) return; // start value ? - bool bStart = *o3tl::doGet<bool>(rPropSet->getPropertyValue(sIsStart)); + bool bStart = *o3tl::doAccess<bool>(rPropSet->getPropertyValue(sIsStart)); if (bAutoStyles) { diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx index 3d4d2fbfee5f..30038929c116 100644 --- a/xmloff/source/text/txtprhdl.cxx +++ b/xmloff/source/text/txtprhdl.cxx @@ -354,7 +354,7 @@ bool XMLOpaquePropHdl_Impl::exportXML( const Any& rValue, const SvXMLUnitConverter& ) const { - if( *o3tl::doGet<bool>(rValue) ) + if( *o3tl::doAccess<bool>(rValue) ) rStrExpValue = GetXMLToken( XML_FOREGROUND ); else rStrExpValue = GetXMLToken( XML_BACKGROUND ); @@ -404,7 +404,7 @@ bool XMLContourModePropHdl_Impl::exportXML( const Any& rValue, const SvXMLUnitConverter& ) const { - if( *o3tl::doGet<bool>(rValue) ) + if( *o3tl::doAccess<bool>(rValue) ) rStrExpValue = GetXMLToken( XML_OUTSIDE ); else rStrExpValue = GetXMLToken( XML_FULL ); @@ -457,7 +457,7 @@ bool XMLParagraphOnlyPropHdl_Impl::exportXML( const Any& rValue, const SvXMLUnitConverter& ) const { - if( *o3tl::doGet<bool>(rValue) ) + if( *o3tl::doAccess<bool>(rValue) ) rStrExpValue = GetXMLToken( XML_1 ); else rStrExpValue = GetXMLToken( XML_NO_LIMIT ); @@ -583,7 +583,7 @@ bool XMLFrameProtectPropHdl_Impl::exportXML( const Any& rValue, const SvXMLUnitConverter& ) const { - if( *o3tl::doGet<bool>(rValue) ) + if( *o3tl::doAccess<bool>(rValue) ) { if( rStrExpValue.isEmpty() || IsXMLToken( rStrExpValue, XML_NONE ) ) @@ -825,7 +825,7 @@ bool XMLGrfMirrorPropHdl_Impl::exportXML( const Any& rValue, const SvXMLUnitConverter& ) const { - if( *o3tl::doGet<bool>(rValue) ) + if( *o3tl::doAccess<bool>(rValue) ) { if( rStrExpValue.isEmpty() || IsXMLToken( rStrExpValue, XML_NONE ) ) @@ -1100,7 +1100,7 @@ bool XMLTextSyncWidthHeightPropHdl_Impl::exportXML( const SvXMLUnitConverter& ) const { bool bRet = false; - if( *o3tl::doGet<bool>(rValue) ) + if( *o3tl::doAccess<bool>(rValue) ) { rStrExpValue = sValue; bRet = true; diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx index ccd3a4c8a39a..a1f147d99789 100644 --- a/xmloff/source/text/txtstyli.cxx +++ b/xmloff/source/text/txtstyli.cxx @@ -484,7 +484,7 @@ void XMLTextStyleContext::FillPropertySet( if ( nIndex != -1 ) { Any& rAny = GetProperties()[nIndex].maValue; - bool bVal = *o3tl::doGet<bool>(rAny); + bool bVal = *o3tl::doAccess<bool>(rAny); bHasCombinedCharactersLetter = bVal; } |