summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-05-09 17:32:25 +0200
committerJan Holesovsky <kendy@collabora.com>2014-05-09 17:55:10 +0200
commite47fef4b5e46f35d18e36223b21403d624a951d3 (patch)
treeb5c8f03f311f6399cdaa7d4e034b2b0ba848f698 /sd
parenta45973a90625f4b9e0f603154194f357ff2418d4 (diff)
Kill sd::any2bool: cppu::bool2any does the same thing (extracts, or throws).
Change-Id: I477f2888fba585f41bb70309247a3e4fa9bf7517
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/unoidl/unohelp.hxx17
-rw-r--r--sd/source/ui/unoidl/unolayer.cxx16
2 files changed, 4 insertions, 29 deletions
diff --git a/sd/source/ui/unoidl/unohelp.hxx b/sd/source/ui/unoidl/unohelp.hxx
index 5afa24d9d7c9..130fd0fc41e9 100644
--- a/sd/source/ui/unoidl/unohelp.hxx
+++ b/sd/source/ui/unoidl/unohelp.hxx
@@ -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() );
diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx
index 118ec3fcb166..f674bf0f06dd 100644
--- a/sd/source/ui/unoidl/unolayer.cxx
+++ b/sd/source/ui/unoidl/unolayer.cxx
@@ -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: