diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index a5c4c3b3bdb3..887648433d36 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -1423,7 +1423,8 @@ namespace accessibility if (rRes.Name == "CharColor") { uno::Any &anyChar = rRes.Value; - Color crChar(ColorTransparency, static_cast( reinterpret_cast(anyChar.pReserved))); + Color crChar; + anyChar >>= crChar; if (COL_AUTO == crChar ) { uno::Reference< css::accessibility::XAccessibleComponent > xComponent(mxParent,uno::UNO_QUERY); @@ -1454,7 +1455,8 @@ namespace accessibility if (rRes.Name == "CharUnderlineColor") { uno::Any &anyCharUnderLine = rRes.Value; - Color crCharUnderLine(ColorTransparency, static_cast( reinterpret_cast( anyCharUnderLine.pReserved))); + Color crCharUnderLine; + anyCharUnderLine >>= crCharUnderLine; if (COL_AUTO == crCharUnderLine ) { uno::Reference< css::accessibility::XAccessibleComponent > xComponent(mxParent,uno::UNO_QUERY); diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index d3781432b648..7427d6fefdcd 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -1847,15 +1847,16 @@ void SwAccessibleParagraph::_correctValues( const sal_Int32 nIndex, if (rValue.Name == UNO_NAME_CHAR_BACK_COLOR) { uno::Any &anyChar = rValue.Value; - sal_uInt32 crBack = static_cast( reinterpret_cast(anyChar.pReserved)); - if (COL_AUTO == Color(ColorTransparency, crBack)) + Color backColor; + anyChar >>= backColor; + if (COL_AUTO == backColor) { uno::Reference xComponent(this); if (xComponent.is()) { - crBack = static_cast(xComponent->getBackground()); + sal_uInt32 crBack = static_cast(xComponent->getBackground()); + rValue.Value <<= crBack; } - rValue.Value <<= crBack; } continue; } @@ -1866,15 +1867,16 @@ void SwAccessibleParagraph::_correctValues( const sal_Int32 nIndex, if( GetPortionData().IsInGrayPortion( nIndex ) ) rValue.Value <<= GetCursorShell()->GetViewOptions()->GetFieldShadingsColor(); uno::Any &anyChar = rValue.Value; - sal_uInt32 crChar = static_cast( reinterpret_cast(anyChar.pReserved)); + Color charColor; + anyChar >>= charColor; - if( COL_AUTO == Color(ColorTransparency, crChar) ) + if( COL_AUTO == charColor ) { uno::Reference xComponent(this); if (xComponent.is()) { Color cr(ColorTransparency, xComponent->getBackground()); - crChar = sal_uInt32(cr.IsDark() ? COL_WHITE : COL_BLACK); + sal_uInt32 crChar = sal_uInt32(cr.IsDark() ? COL_WHITE : COL_BLACK); rValue.Value <<= crChar; } } @@ -1885,14 +1887,15 @@ void SwAccessibleParagraph::_correctValues( const sal_Int32 nIndex, if (rValue.Name == UNO_NAME_CHAR_UNDERLINE_COLOR) { uno::Any &anyChar = rValue.Value; - sal_uInt32 crUnderline = static_cast( reinterpret_cast(anyChar.pReserved)); - if ( COL_AUTO == Color(ColorTransparency, crUnderline) ) + Color underlineColor; + anyChar >>= underlineColor; + if ( COL_AUTO == underlineColor ) { uno::Reference xComponent(this); if (xComponent.is()) { Color cr(ColorTransparency, xComponent->getBackground()); - crUnderline = sal_uInt32(cr.IsDark() ? COL_WHITE : COL_BLACK); + sal_uInt32 crUnderline = sal_uInt32(cr.IsDark() ? COL_WHITE : COL_BLACK); rValue.Value <<= crUnderline; } }