Kaydet (Commit) e47fef4b authored tarafından Jan Holesovsky's avatar Jan Holesovsky

Kill sd::any2bool: cppu::bool2any does the same thing (extracts, or throws).

Change-Id: I477f2888fba585f41bb70309247a3e4fa9bf7517
üst a45973a9
......@@ -19,23 +19,6 @@
namespace sd
{
inline bool any2bool( const ::com::sun::star::uno::Any& rAny, bool& rBool )
{
if( rAny.getValueType() == ::getCppuBooleanType() )
{
rBool = *(sal_Bool*)rAny.getValue();
}
else
{
sal_Int32 nValue = 0;
if(!(rAny >>= nValue))
return false;
rBool = nValue != 0;
}
return true;
}
inline void bool2any( bool bBool, ::com::sun::star::uno::Any& rAny )
{
rAny.setValue( &bBool, ::getCppuBooleanType() );
......
......@@ -22,6 +22,7 @@
#include "unolayer.hxx"
#include <osl/mutex.hxx>
#include <comphelper/extract.hxx>
#include <svx/svdpagv.hxx>
#include <svx/unoshape.hxx>
#include <svx/svdobj.hxx>
......@@ -192,26 +193,17 @@ void SAL_CALL SdLayer::setPropertyValue( const OUString& aPropertyName, const un
{
case WID_LAYER_LOCKED:
{
bool bValue = false;
if(!sd::any2bool( aValue, bValue ))
throw lang::IllegalArgumentException();
set( LOCKED, bValue );
set(LOCKED, cppu::any2bool(aValue));
break;
}
case WID_LAYER_PRINTABLE:
{
bool bValue = false;
if(!sd::any2bool( aValue, bValue ))
throw lang::IllegalArgumentException();
set( PRINTABLE, bValue );
set(PRINTABLE, cppu::any2bool(aValue));
break;
}
case WID_LAYER_VISIBLE:
{
bool bValue = false;
if(!sd::any2bool( aValue, bValue ))
throw lang::IllegalArgumentException();
set( VISIBLE, bValue );
set(VISIBLE, cppu::any2bool(aValue));
break;
}
case WID_LAYER_NAME:
......
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