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

Remove unnecessary Bool2Any

(It feels better to use explicitly bool-typed css::uno::makeAny<bool>(x) rather
than implicitly typed css::uno::makeAny(x) or css::uno::Any(x), in case x is not
already of type bool.)

Change-Id: I282b3764bb207aeae9f13cc981e68e8ef2b8ab93
üst 17282387
...@@ -468,7 +468,7 @@ bool SvxLRSpaceItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const ...@@ -468,7 +468,7 @@ bool SvxLRSpaceItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
break; break;
case MID_FIRST_AUTO: case MID_FIRST_AUTO:
rVal = Bool2Any(IsAutoFirst()); rVal = css::uno::makeAny<bool>(IsAutoFirst());
break; break;
default: default:
...@@ -1206,7 +1206,7 @@ bool SvxProtectItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const ...@@ -1206,7 +1206,7 @@ bool SvxProtectItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
return false; return false;
} }
rVal = Bool2Any( bValue ); rVal = css::uno::makeAny<bool>( bValue );
return true; return true;
} }
...@@ -3600,7 +3600,7 @@ bool SvxBrushItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const ...@@ -3600,7 +3600,7 @@ bool SvxBrushItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
break; break;
case MID_GRAPHIC_TRANSPARENT: case MID_GRAPHIC_TRANSPARENT:
rVal = Bool2Any( aColor.GetTransparency() == 0xff ); rVal = css::uno::makeAny<bool>( aColor.GetTransparency() == 0xff );
break; break;
case MID_GRAPHIC_URL: case MID_GRAPHIC_URL:
......
...@@ -655,7 +655,7 @@ bool SvxHyphenZoneItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) con ...@@ -655,7 +655,7 @@ bool SvxHyphenZoneItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) con
switch(nMemberId) switch(nMemberId)
{ {
case MID_IS_HYPHEN: case MID_IS_HYPHEN:
rVal = Bool2Any(bHyphen); rVal = css::uno::makeAny<bool>(bHyphen);
break; break;
case MID_HYPHEN_MIN_LEAD: case MID_HYPHEN_MIN_LEAD:
rVal <<= (sal_Int16)nMinLead; rVal <<= (sal_Int16)nMinLead;
......
...@@ -547,7 +547,7 @@ bool SvxPostureItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const ...@@ -547,7 +547,7 @@ bool SvxPostureItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
switch( nMemberId ) switch( nMemberId )
{ {
case MID_ITALIC: case MID_ITALIC:
rVal = Bool2Any(GetBoolValue()); rVal = css::uno::makeAny<bool>(GetBoolValue());
break; break;
case MID_POSTURE: case MID_POSTURE:
rVal <<= (awt::FontSlant)GetValue(); // values from awt::FontSlant and FontItalic are equal rVal <<= (awt::FontSlant)GetValue(); // values from awt::FontSlant and FontItalic are equal
...@@ -699,7 +699,7 @@ bool SvxWeightItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const ...@@ -699,7 +699,7 @@ bool SvxWeightItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
switch( nMemberId ) switch( nMemberId )
{ {
case MID_BOLD : case MID_BOLD :
rVal = Bool2Any(GetBoolValue()); rVal = css::uno::makeAny<bool>(GetBoolValue());
break; break;
case MID_WEIGHT: case MID_WEIGHT:
{ {
...@@ -1349,7 +1349,7 @@ bool SvxTextLineItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const ...@@ -1349,7 +1349,7 @@ bool SvxTextLineItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
switch(nMemberId) switch(nMemberId)
{ {
case MID_TEXTLINED: case MID_TEXTLINED:
rVal = Bool2Any(GetBoolValue()); rVal = css::uno::makeAny<bool>(GetBoolValue());
break; break;
case MID_TL_STYLE: case MID_TL_STYLE:
rVal <<= (sal_Int16)(GetValue()); rVal <<= (sal_Int16)(GetValue());
...@@ -1358,7 +1358,7 @@ bool SvxTextLineItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const ...@@ -1358,7 +1358,7 @@ bool SvxTextLineItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
rVal <<= (sal_Int32)( mColor.GetColor() ); rVal <<= (sal_Int32)( mColor.GetColor() );
break; break;
case MID_TL_HASCOLOR: case MID_TL_HASCOLOR:
rVal = Bool2Any( !mColor.GetTransparency() ); rVal = css::uno::makeAny<bool>( !mColor.GetTransparency() );
break; break;
} }
return true; return true;
...@@ -1565,7 +1565,7 @@ bool SvxCrossedOutItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const ...@@ -1565,7 +1565,7 @@ bool SvxCrossedOutItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
switch(nMemberId) switch(nMemberId)
{ {
case MID_CROSSED_OUT: case MID_CROSSED_OUT:
rVal = Bool2Any(GetBoolValue()); rVal = css::uno::makeAny<bool>(GetBoolValue());
break; break;
case MID_CROSS_OUT: case MID_CROSS_OUT:
rVal <<= (sal_Int16)(GetValue()); rVal <<= (sal_Int16)(GetValue());
...@@ -1880,7 +1880,7 @@ bool SvxBackgroundColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) c ...@@ -1880,7 +1880,7 @@ bool SvxBackgroundColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) c
{ {
case MID_GRAPHIC_TRANSPARENT: case MID_GRAPHIC_TRANSPARENT:
{ {
rVal <<= Bool2Any (aColor.GetTransparency() == 0xff); rVal <<= css::uno::makeAny<bool>(aColor.GetTransparency() == 0xff);
break; break;
} }
default: default:
...@@ -2445,7 +2445,7 @@ bool SvxEscapementItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const ...@@ -2445,7 +2445,7 @@ bool SvxEscapementItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
rVal <<= (sal_Int8)(nProp); rVal <<= (sal_Int8)(nProp);
break; break;
case MID_AUTO_ESC: case MID_AUTO_ESC:
rVal = Bool2Any(DFLT_ESC_AUTO_SUB == nEsc || DFLT_ESC_AUTO_SUPER == nEsc); rVal = css::uno::makeAny<bool>(DFLT_ESC_AUTO_SUB == nEsc || DFLT_ESC_AUTO_SUPER == nEsc);
break; break;
} }
return true; return true;
...@@ -2946,7 +2946,7 @@ bool SvxTwoLinesItem::QueryValue( com::sun::star::uno::Any& rVal, ...@@ -2946,7 +2946,7 @@ bool SvxTwoLinesItem::QueryValue( com::sun::star::uno::Any& rVal,
switch( nMemberId ) switch( nMemberId )
{ {
case MID_TWOLINES: case MID_TWOLINES:
rVal = Bool2Any( bOn ); rVal = css::uno::makeAny<bool>( bOn );
break; break;
case MID_START_BRACKET: case MID_START_BRACKET:
{ {
...@@ -3109,7 +3109,7 @@ bool SvxCharRotateItem::QueryValue( com::sun::star::uno::Any& rVal, ...@@ -3109,7 +3109,7 @@ bool SvxCharRotateItem::QueryValue( com::sun::star::uno::Any& rVal,
rVal <<= (sal_Int16)GetValue(); rVal <<= (sal_Int16)GetValue();
break; break;
case MID_FITTOLINE: case MID_FITTOLINE:
rVal = Bool2Any( IsFitToLine() ); rVal = css::uno::makeAny<bool>( IsFitToLine() );
break; break;
default: default:
bRet = false; bRet = false;
......
...@@ -75,11 +75,6 @@ inline bool Any2Bool( const ::com::sun::star::uno::Any&rValue ) ...@@ -75,11 +75,6 @@ inline bool Any2Bool( const ::com::sun::star::uno::Any&rValue )
return nValue; return nValue;
} }
inline ::com::sun::star::uno::Any Bool2Any( bool bValue )
{
return ::com::sun::star::uno::Any( &bValue, cppu::UnoType<bool>::get() );
}
enum SfxMapUnit enum SfxMapUnit
{ {
SFX_MAPUNIT_100TH_MM, SFX_MAPUNIT_100TH_MM,
......
...@@ -152,7 +152,7 @@ bool SvxPageItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const ...@@ -152,7 +152,7 @@ bool SvxPageItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
break; break;
case MID_PAGE_ORIENTATION: case MID_PAGE_ORIENTATION:
//Landscape= sal_True //Landscape= sal_True
rVal = Bool2Any(bLandscape); rVal = css::uno::makeAny<bool>(bLandscape);
break; break;
case MID_PAGE_LAYOUT : case MID_PAGE_LAYOUT :
{ {
......
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