summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-06-21 15:48:59 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-06-23 16:48:15 +0200
commit4809fedd7cd3443100fba1c776267e2d87eb3f95 (patch)
treeead8e748678a1fa70b9d89861119fdea805c93e4 /svl
parentc7c27b9b191291cf36e4940aef3e3e7371855797 (diff)
Clean up uses of Any::getValue() in svl
Change-Id: I2005ce59d6211181ed039eaff60ffd31084e1d40
Diffstat (limited to 'svl')
-rw-r--r--svl/source/config/cjkoptions.cxx3
-rw-r--r--svl/source/items/itemprop.cxx4
-rw-r--r--svl/source/misc/fstathelper.cxx3
-rw-r--r--svl/source/numbers/numfmuno.cxx5
4 files changed, 10 insertions, 5 deletions
diff --git a/svl/source/config/cjkoptions.cxx b/svl/source/config/cjkoptions.cxx
index e0b1b9e0dafb..c16cccf4cba5 100644
--- a/svl/source/config/cjkoptions.cxx
+++ b/svl/source/config/cjkoptions.cxx
@@ -19,6 +19,7 @@
#include <svl/cjkoptions.hxx>
+#include <o3tl/any.hxx>
#include <svl/languageoptions.hxx>
#include <i18nlangtag/lang.h>
#include <unotools/configitem.hxx>
@@ -179,7 +180,7 @@ void SvtCJKOptions_Impl::Load()
{
if( pValues[nProp].hasValue() )
{
- bool bValue = *static_cast<sal_Bool const *>(pValues[nProp].getValue());
+ bool bValue = *o3tl::doAccess<bool>(pValues[nProp]);
switch ( nProp )
{
case 0: { bCJKFont = bValue; bROCJKFont = pROStates[nProp]; } break;
diff --git a/svl/source/items/itemprop.cxx b/svl/source/items/itemprop.cxx
index 639c1f357153..69f78e5ac19f 100644
--- a/svl/source/items/itemprop.cxx
+++ b/svl/source/items/itemprop.cxx
@@ -17,7 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+#include <o3tl/any.hxx>
#include <svl/itemprop.hxx>
#include <svl/itempool.hxx>
#include <svl/itemset.hxx>
@@ -198,7 +200,7 @@ void SfxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry& rEn
if( rEntry.aType.getTypeClass() == TypeClass_ENUM &&
rAny.getValueTypeClass() == TypeClass_LONG )
{
- sal_Int32 nTmp = *static_cast<sal_Int32 const *>(rAny.getValue());
+ sal_Int32 nTmp = *o3tl::forceAccess<sal_Int32>(rAny);
rAny.setValue( &nTmp, rEntry.aType );
}
}
diff --git a/svl/source/misc/fstathelper.cxx b/svl/source/misc/fstathelper.cxx
index 6f8a1840f965..6530ff724429 100644
--- a/svl/source/misc/fstathelper.cxx
+++ b/svl/source/misc/fstathelper.cxx
@@ -19,6 +19,7 @@
#include <com/sun/star/util/DateTime.hpp>
#include <comphelper/processfactory.hxx>
+#include <o3tl/any.hxx>
#include <rtl/ustring.hxx>
#include <svl/fstathelper.hxx>
#include <tools/date.hxx>
@@ -43,7 +44,7 @@ bool FStatHelper::GetModifiedDateTimeOfFile( const OUString& rURL,
if( aAny.hasValue() )
{
bRet = true;
- const util::DateTime* pDT = static_cast<util::DateTime const *>(aAny.getValue());
+ auto pDT = o3tl::doAccess<util::DateTime>(aAny);
if( pDate )
*pDate = Date( pDT->Day, pDT->Month, pDT->Year );
if( pTime )
diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx
index 0047c3478936..3e9436fcb2a7 100644
--- a/svl/source/numbers/numfmuno.cxx
+++ b/svl/source/numbers/numfmuno.cxx
@@ -19,6 +19,7 @@
#include <tools/color.hxx>
#include <i18nlangtag/mslangid.hxx>
+#include <o3tl/any.hxx>
#include <osl/mutex.hxx>
#include <osl/diagnose.h>
#include <rtl/ustring.hxx>
@@ -952,8 +953,8 @@ void SAL_CALL SvNumberFormatSettingsObj::setPropertyValue( const OUString& aProp
if (aPropertyName == PROPERTYNAME_NOZERO)
{
// operator >>= shouldn't be used for bool (?)
- if ( aValue.getValueTypeClass() == uno::TypeClass_BOOLEAN )
- pFormatter->SetNoZero( *static_cast<sal_Bool const *>(aValue.getValue()) );
+ if ( auto b = o3tl::tryAccess<bool>(aValue) )
+ pFormatter->SetNoZero( *b );
}
else if (aPropertyName == PROPERTYNAME_NULLDATE)
{