Kaydet (Commit) de243e8e authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Clean up uses of Any::getValue() in vcl

Change-Id: Id835d8d11abcd49320c2ea01ec0ad60402f9e759
üst 48f018ea
......@@ -21,6 +21,7 @@
#include <rtl/crc.h>
#include <rtl/strbuf.hxx>
#include <o3tl/any.hxx>
#include <tools/stream.hxx>
#include <tools/debug.hxx>
#include <tools/rc.h>
......@@ -792,7 +793,7 @@ bool BitmapEx::Create( const css::uno::Reference< css::rendering::XBitmapCanvas
{
// 0 means get BitmapEx
uno::Any aAny = xFastPropertySet->getFastPropertyValue( 0 );
std::unique_ptr<BitmapEx> xBitmapEx(reinterpret_cast<BitmapEx*>( *static_cast<const sal_Int64*>(aAny.getValue())));
std::unique_ptr<BitmapEx> xBitmapEx(reinterpret_cast<BitmapEx*>(*o3tl::doAccess<sal_Int64>(aAny)));
if( xBitmapEx )
{
*this = *xBitmapEx;
......
......@@ -24,6 +24,7 @@
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <o3tl/any.hxx>
using namespace utl;
using namespace vcl;
......@@ -111,9 +112,8 @@ void SettingsConfigItem::getValues()
const Any* pValue = aValues.getConstArray();
for( int i = 0; i < aValues.getLength(); i++, pValue++ )
{
if( pValue->getValueTypeClass() == TypeClass_STRING )
if( auto pLine = o3tl::tryAccess<OUString>(*pValue) )
{
const OUString* pLine = static_cast<const OUString*>(pValue->getValue());
if( !pLine->isEmpty() )
m_aSettings[ aKeyName ][ pFrom[i] ] = *pLine;
#if OSL_DEBUG_LEVEL > 2
......
......@@ -18,6 +18,7 @@
*/
#include <cstdio>
#include <o3tl/any.hxx>
#include <unotools/configitem.hxx>
#include "X11_selection.hxx"
......@@ -78,9 +79,8 @@ DtransX11ConfigItem::DtransX11ConfigItem() :
Any* pValue = aValues.getArray();
for( int i = 0; i < aValues.getLength(); i++, pValue++ )
{
if( pValue->getValueTypeClass() == TypeClass_STRING )
if( auto pLine = o3tl::tryAccess<OUString>(*pValue) )
{
const OUString* pLine = static_cast<const OUString*>(pValue->getValue());
if( !pLine->isEmpty() )
{
m_nSelectionTimeout = pLine->toInt32();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment