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

Clean up C-style casts from pointers to void

Change-Id: Id64d800ccebab274e5bb7ad2667c0e270e745bdf
üst 44b9b27b
...@@ -873,10 +873,10 @@ void ElementDescriptor::readFormattedFieldModel( StyleBag * all_styles ) ...@@ -873,10 +873,10 @@ void ElementDescriptor::readFormattedFieldModel( StyleBag * all_styles )
switch (a.getValueTypeClass()) switch (a.getValueTypeClass())
{ {
case TypeClass_DOUBLE: case TypeClass_DOUBLE:
addAttribute( XMLNS_DIALOGS_PREFIX ":value-default", OUString::number( *(double const *)a.getValue() ) ); addAttribute( XMLNS_DIALOGS_PREFIX ":value-default", OUString::number( *static_cast<double const *>(a.getValue()) ) );
break; break;
case TypeClass_STRING: case TypeClass_STRING:
addAttribute( XMLNS_DIALOGS_PREFIX ":value-default", *(OUString const *)a.getValue() ); addAttribute( XMLNS_DIALOGS_PREFIX ":value-default", *static_cast<OUString const *>(a.getValue()) );
break; break;
default: default:
break; break;
......
...@@ -518,7 +518,7 @@ void ElementDescriptor::readHexLongAttr( OUString const & rPropName, OUString co ...@@ -518,7 +518,7 @@ void ElementDescriptor::readHexLongAttr( OUString const & rPropName, OUString co
Any a( _xProps->getPropertyValue( rPropName ) ); Any a( _xProps->getPropertyValue( rPropName ) );
if (a.getValueTypeClass() == TypeClass_LONG) if (a.getValueTypeClass() == TypeClass_LONG)
{ {
addAttribute( rAttrName, "0x" + OUString::number((sal_Int64)(sal_uInt64)*(sal_uInt32 *)a.getValue(),16) ); addAttribute( rAttrName, "0x" + OUString::number((sal_Int64)(sal_uInt64)*static_cast<sal_uInt32 const *>(a.getValue()),16) );
} }
} }
} }
...@@ -530,7 +530,7 @@ void ElementDescriptor::readDateFormatAttr( OUString const & rPropName, OUString ...@@ -530,7 +530,7 @@ void ElementDescriptor::readDateFormatAttr( OUString const & rPropName, OUString
Any a( _xProps->getPropertyValue( rPropName ) ); Any a( _xProps->getPropertyValue( rPropName ) );
if (a.getValueTypeClass() == TypeClass_SHORT) if (a.getValueTypeClass() == TypeClass_SHORT)
{ {
switch (*(sal_Int16 const *)a.getValue()) switch (*static_cast<sal_Int16 const *>(a.getValue()))
{ {
case 0: case 0:
addAttribute( rAttrName, "system_short" ); addAttribute( rAttrName, "system_short" );
...@@ -627,7 +627,7 @@ void ElementDescriptor::readTimeFormatAttr( OUString const & rPropName, OUString ...@@ -627,7 +627,7 @@ void ElementDescriptor::readTimeFormatAttr( OUString const & rPropName, OUString
Any a( _xProps->getPropertyValue( rPropName ) ); Any a( _xProps->getPropertyValue( rPropName ) );
if (a.getValueTypeClass() == TypeClass_SHORT) if (a.getValueTypeClass() == TypeClass_SHORT)
{ {
switch (*(sal_Int16 const *)a.getValue()) switch (*static_cast<sal_Int16 const *>(a.getValue()))
{ {
case 0: case 0:
addAttribute( rAttrName, "24h_short" ); addAttribute( rAttrName, "24h_short" );
...@@ -664,7 +664,7 @@ void ElementDescriptor::readAlignAttr( OUString const & rPropName, OUString cons ...@@ -664,7 +664,7 @@ void ElementDescriptor::readAlignAttr( OUString const & rPropName, OUString cons
Any a( _xProps->getPropertyValue( rPropName ) ); Any a( _xProps->getPropertyValue( rPropName ) );
if (a.getValueTypeClass() == TypeClass_SHORT) if (a.getValueTypeClass() == TypeClass_SHORT)
{ {
switch (*(sal_Int16 const *)a.getValue()) switch (*static_cast<sal_Int16 const *>(a.getValue()))
{ {
case 0: case 0:
addAttribute( rAttrName, "left" ); addAttribute( rAttrName, "left" );
...@@ -745,7 +745,7 @@ void ElementDescriptor::readImageAlignAttr( OUString const & rPropName, OUString ...@@ -745,7 +745,7 @@ void ElementDescriptor::readImageAlignAttr( OUString const & rPropName, OUString
Any a( _xProps->getPropertyValue( rPropName ) ); Any a( _xProps->getPropertyValue( rPropName ) );
if (a.getValueTypeClass() == TypeClass_SHORT) if (a.getValueTypeClass() == TypeClass_SHORT)
{ {
switch (*(sal_Int16 const *)a.getValue()) switch (*static_cast<sal_Int16 const *>(a.getValue()))
{ {
case 0: case 0:
addAttribute( rAttrName, "left" ); addAttribute( rAttrName, "left" );
...@@ -776,7 +776,7 @@ void ElementDescriptor::readImagePositionAttr( OUString const & rPropName, OUStr ...@@ -776,7 +776,7 @@ void ElementDescriptor::readImagePositionAttr( OUString const & rPropName, OUStr
Any a( _xProps->getPropertyValue( rPropName ) ); Any a( _xProps->getPropertyValue( rPropName ) );
if (a.getValueTypeClass() == TypeClass_SHORT) if (a.getValueTypeClass() == TypeClass_SHORT)
{ {
switch (*(sal_Int16 const *)a.getValue()) switch (*static_cast<sal_Int16 const *>(a.getValue()))
{ {
case awt::ImagePosition::LeftTop: case awt::ImagePosition::LeftTop:
addAttribute( rAttrName, "left-top" ); addAttribute( rAttrName, "left-top" );
...@@ -832,7 +832,7 @@ void ElementDescriptor::readButtonTypeAttr( OUString const & rPropName, OUString ...@@ -832,7 +832,7 @@ void ElementDescriptor::readButtonTypeAttr( OUString const & rPropName, OUString
Any a( _xProps->getPropertyValue( rPropName ) ); Any a( _xProps->getPropertyValue( rPropName ) );
if (a.getValueTypeClass() == TypeClass_SHORT) if (a.getValueTypeClass() == TypeClass_SHORT)
{ {
switch (*(sal_Int16 const *)a.getValue()) switch (*static_cast<sal_Int16 const *>(a.getValue()))
{ {
case awt::PushButtonType_STANDARD: case awt::PushButtonType_STANDARD:
addAttribute( rAttrName, "standard" ); addAttribute( rAttrName, "standard" );
...@@ -861,7 +861,7 @@ void ElementDescriptor::readOrientationAttr( OUString const & rPropName, OUStrin ...@@ -861,7 +861,7 @@ void ElementDescriptor::readOrientationAttr( OUString const & rPropName, OUStrin
Any a( _xProps->getPropertyValue( rPropName ) ); Any a( _xProps->getPropertyValue( rPropName ) );
if (a.getValueTypeClass() == TypeClass_LONG) if (a.getValueTypeClass() == TypeClass_LONG)
{ {
switch (*(sal_Int32 const *)a.getValue()) switch (*static_cast<sal_Int32 const *>(a.getValue()))
{ {
case 0: case 0:
addAttribute( rAttrName, "horizontal" ); addAttribute( rAttrName, "horizontal" );
...@@ -884,7 +884,7 @@ void ElementDescriptor::readLineEndFormatAttr( OUString const & rPropName, OUStr ...@@ -884,7 +884,7 @@ void ElementDescriptor::readLineEndFormatAttr( OUString const & rPropName, OUStr
Any a( _xProps->getPropertyValue( rPropName ) ); Any a( _xProps->getPropertyValue( rPropName ) );
if (a.getValueTypeClass() == TypeClass_SHORT) if (a.getValueTypeClass() == TypeClass_SHORT)
{ {
switch (*(sal_Int16 const *)a.getValue()) switch (*static_cast<sal_Int16 const *>(a.getValue()))
{ {
case awt::LineEndFormat::CARRIAGE_RETURN: case awt::LineEndFormat::CARRIAGE_RETURN:
addAttribute( rAttrName, "carriage-return" ); addAttribute( rAttrName, "carriage-return" );
...@@ -1103,22 +1103,22 @@ void ElementDescriptor::readDefaults( bool supportPrintable, bool supportVisible ...@@ -1103,22 +1103,22 @@ void ElementDescriptor::readDefaults( bool supportPrintable, bool supportVisible
a = _xProps->getPropertyValue( "PositionX" ); a = _xProps->getPropertyValue( "PositionX" );
if (a.getValueTypeClass() == TypeClass_LONG) if (a.getValueTypeClass() == TypeClass_LONG)
{ {
addAttribute( XMLNS_DIALOGS_PREFIX ":left", OUString::number( *(sal_Int32 const *)a.getValue() ) ); addAttribute( XMLNS_DIALOGS_PREFIX ":left", OUString::number( *static_cast<sal_Int32 const *>(a.getValue()) ) );
} }
a = _xProps->getPropertyValue( "PositionY" ); a = _xProps->getPropertyValue( "PositionY" );
if (a.getValueTypeClass() == TypeClass_LONG) if (a.getValueTypeClass() == TypeClass_LONG)
{ {
addAttribute( XMLNS_DIALOGS_PREFIX ":top", OUString::number( *(sal_Int32 const *)a.getValue() ) ); addAttribute( XMLNS_DIALOGS_PREFIX ":top", OUString::number( *static_cast<sal_Int32 const *>(a.getValue()) ) );
} }
a = _xProps->getPropertyValue( "Width" ); a = _xProps->getPropertyValue( "Width" );
if (a.getValueTypeClass() == TypeClass_LONG) if (a.getValueTypeClass() == TypeClass_LONG)
{ {
addAttribute( XMLNS_DIALOGS_PREFIX ":width", OUString::number( *(sal_Int32 const *)a.getValue() ) ); addAttribute( XMLNS_DIALOGS_PREFIX ":width", OUString::number( *static_cast<sal_Int32 const *>(a.getValue()) ) );
} }
a = _xProps->getPropertyValue( "Height" ); a = _xProps->getPropertyValue( "Height" );
if (a.getValueTypeClass() == TypeClass_LONG) if (a.getValueTypeClass() == TypeClass_LONG)
{ {
addAttribute( XMLNS_DIALOGS_PREFIX ":height", OUString::number( *(sal_Int32 const *)a.getValue() ) ); addAttribute( XMLNS_DIALOGS_PREFIX ":height", OUString::number( *static_cast<sal_Int32 const *>(a.getValue()) ) );
} }
if (supportPrintable) if (supportPrintable)
......
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