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 /scaddins | |
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
Diffstat (limited to 'scaddins')
-rw-r--r-- | scaddins/source/analysis/analysis.cxx | 2 | ||||
-rw-r--r-- | scaddins/source/analysis/analysishelper.cxx | 8 |
2 files changed, 5 insertions, 5 deletions
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 |