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:
parent
76091d814c
commit
ce9deff347
1 changed files with 8 additions and 9 deletions
|
@ -84,15 +84,14 @@ int SvxPageItem::operator==( const SfxPoolItem& rAttr ) const
|
|||
|
||||
inline XubString GetUsageText( const sal_uInt16 eU )
|
||||
{
|
||||
if ( eU & SVX_PAGE_LEFT )
|
||||
return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_LEFT);
|
||||
if ( eU & SVX_PAGE_RIGHT )
|
||||
return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_RIGHT);
|
||||
if ( eU & SVX_PAGE_ALL )
|
||||
return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_ALL);
|
||||
if ( eU & SVX_PAGE_MIRROR )
|
||||
return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_MIRROR);
|
||||
return String();
|
||||
switch( eU & 0x000f )
|
||||
{
|
||||
case SVX_PAGE_LEFT : return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_LEFT);
|
||||
case SVX_PAGE_RIGHT : return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_RIGHT);
|
||||
case SVX_PAGE_ALL : return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_ALL);
|
||||
case SVX_PAGE_MIRROR: return SVX_RESSTR(RID_SVXITEMS_PAGE_USAGE_MIRROR);
|
||||
default: return String();
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue