diff options
author | Marc Mondesir <timepilot3000@gmail.com> | 2024-11-25 13:43:09 -0800 |
---|---|---|
committer | Stephan Bergmann <stephan.bergmann@allotropia.de> | 2025-01-22 08:14:40 +0100 |
commit | b3d5a3d7a79715464cc221f5b0e5489b3c2b250e (patch) | |
tree | 6879d49728aebe473092f86f20a7994cf5fcae19 | |
parent | 35a61e79b2515f4a4b41215b643f0b3d2a873d50 (diff) |
tdf#75280: Convert sal_uIntPtr use to operator >>= Color.
Replace casts to sal_uIntPtr, then to other types with operator >>= Color.
Change-Id: Ib30370da83f3f653f8c5816e4d88cc5381ae648b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177303
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
-rw-r--r-- | editeng/source/accessibility/AccessibleEditableTextPara.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/access/accpara.cxx | 23 |
2 files changed, 17 insertions, 12 deletions
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<sal_uInt32>( reinterpret_cast<sal_uIntPtr>(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<sal_uInt32>( reinterpret_cast<sal_uIntPtr>( 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<sal_uInt32>( reinterpret_cast<sal_uIntPtr>(anyChar.pReserved)); - if (COL_AUTO == Color(ColorTransparency, crBack)) + Color backColor; + anyChar >>= backColor; + if (COL_AUTO == backColor) { uno::Reference<XAccessibleComponent> xComponent(this); if (xComponent.is()) { - crBack = static_cast<sal_uInt32>(xComponent->getBackground()); + sal_uInt32 crBack = static_cast<sal_uInt32>(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<sal_uInt32>( reinterpret_cast<sal_uIntPtr>(anyChar.pReserved)); + Color charColor; + anyChar >>= charColor; - if( COL_AUTO == Color(ColorTransparency, crChar) ) + if( COL_AUTO == charColor ) { uno::Reference<XAccessibleComponent> 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<sal_uInt32>( reinterpret_cast<sal_uIntPtr>(anyChar.pReserved)); - if ( COL_AUTO == Color(ColorTransparency, crUnderline) ) + Color underlineColor; + anyChar >>= underlineColor; + if ( COL_AUTO == underlineColor ) { uno::Reference<XAccessibleComponent> 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; } } |