Change if-statements to switch

The bit-values do overlap, 3rd and 4th case were never reached.

Change-Id: Iaaf39a11811c4e28c34260a7eab7fa0476165d1b
Reviewed-on: https://gerrit.libreoffice.org/1497
Reviewed-by: Tomáš Chvátal <tchvatal@suse.cz>
Tested-by: Tomáš Chvátal <tchvatal@suse.cz>
This commit is contained in:
Werner Koerner
2012-12-29 12:56:02 +01:00
committed by Tomáš Chvátal
parent 76091d814c
commit ce9deff347

View File

@@ -84,15 +84,14 @@ int SvxPageItem::operator==( const SfxPoolItem& rAttr ) const
inline XubString GetUsageText( const sal_uInt16 eU ) inline XubString GetUsageText( const sal_uInt16 eU )
{ {
if ( eU & SVX_PAGE_LEFT ) switch( eU & 0x000f )
return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_LEFT); {
if ( eU & SVX_PAGE_RIGHT ) case SVX_PAGE_LEFT : return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_LEFT);
return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_RIGHT); case SVX_PAGE_RIGHT : return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_RIGHT);
if ( eU & SVX_PAGE_ALL ) case SVX_PAGE_ALL : return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_ALL);
return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_ALL); case SVX_PAGE_MIRROR: return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_MIRROR);
if ( eU & SVX_PAGE_MIRROR ) default: return String();
return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_MIRROR); }
return String();
} }
//------------------------------------------------------------------------ //------------------------------------------------------------------------