diff options
author | Noel Grandin <noel@peralex.com> | 2014-07-24 15:43:00 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-07-29 12:26:17 +0200 |
commit | 9d140ccdb3b029b3d87ee23e87789f8a67ce8d5b (patch) | |
tree | cb8e64e248fad959b2650b45c165801f4bbd4145 /editeng | |
parent | a0b89100be8ccc2b60d08d7e3819cd247a6042b0 (diff) |
drop use of SFX_ITEM_PRESENTATION_NONE
since none of the call sites specify it
Change-Id: I9c15f0e042e21f6f78560c1962a533112d588c90
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/items/bulitem.cxx | 20 | ||||
-rw-r--r-- | editeng/source/items/charhiddenitem.cxx | 27 | ||||
-rw-r--r-- | editeng/source/items/frmitems.cxx | 232 | ||||
-rw-r--r-- | editeng/source/items/justifyitem.cxx | 48 | ||||
-rw-r--r-- | editeng/source/items/optitems.cxx | 44 | ||||
-rw-r--r-- | editeng/source/items/paraitem.cxx | 200 | ||||
-rw-r--r-- | editeng/source/items/textitem.cxx | 505 | ||||
-rw-r--r-- | editeng/source/items/writingmodeitem.cxx | 20 |
8 files changed, 267 insertions, 829 deletions
diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx index 285cfc21bdfb..28f4dfdd4e1d 100644 --- a/editeng/source/items/bulitem.cxx +++ b/editeng/source/items/bulitem.cxx @@ -380,28 +380,14 @@ OUString SvxBulletItem::GetFullText() const bool SvxBulletItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * ) const { - bool eRet = false; - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - eRet = false; - break; - - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - rText = GetFullText(); - eRet = true; - break; - default: ; //prevent warning - } - return eRet; + rText = GetFullText(); + return true; } diff --git a/editeng/source/items/charhiddenitem.cxx b/editeng/source/items/charhiddenitem.cxx index b32d41acf743..32bc856b6a4d 100644 --- a/editeng/source/items/charhiddenitem.cxx +++ b/editeng/source/items/charhiddenitem.cxx @@ -35,30 +35,19 @@ SfxPoolItem* SvxCharHiddenItem::Clone( SfxItemPool * ) const bool SvxCharHiddenItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, - OUString& rText, const IntlWrapper * /*pIntl*/ + OUString& rText, + const IntlWrapper * /*pIntl*/ ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - sal_uInt16 nId = RID_SVXITEMS_CHARHIDDEN_FALSE; + sal_uInt16 nId = RID_SVXITEMS_CHARHIDDEN_FALSE; - if ( GetValue() ) - nId = RID_SVXITEMS_CHARHIDDEN_TRUE; - rText = EE_RESSTR(nId); - return true; - } - default: ; //prevent warning - } - return false; + if ( GetValue() ) + nId = RID_SVXITEMS_CHARHIDDEN_TRUE; + rText = EE_RESSTR(nId); + return true; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index f4297b79c4fe..481e3939172d 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -189,10 +189,6 @@ bool SvxPaperBinItem::GetPresentation { switch ( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: rText = OUString::number( GetValue() ); return true; @@ -336,10 +332,6 @@ bool SvxSizeItem::GetPresentation OUString cpDelimTmp(cpDelim); switch ( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: rText = GetMetricText( aSize.Width(), eCoreUnit, ePresUnit, pIntl ) + cpDelimTmp + @@ -597,9 +589,6 @@ bool SvxLRSpaceItem::GetPresentation { switch ( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; case SFX_ITEM_PRESENTATION_NAMELESS: { if ( 100 != nPropLeftMargin ) @@ -967,9 +956,6 @@ bool SvxULSpaceItem::GetPresentation { switch ( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; case SFX_ITEM_PRESENTATION_NAMELESS: { if ( 100 != nPropUpper ) @@ -1108,31 +1094,18 @@ SfxPoolItem* SvxPrintItem::Create( SvStream& rStrm, sal_uInt16 ) const bool SvxPrintItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - sal_uInt16 nId = RID_SVXITEMS_PRINT_FALSE; + sal_uInt16 nId = RID_SVXITEMS_PRINT_FALSE; - if ( GetValue() ) - nId = RID_SVXITEMS_PRINT_TRUE; - rText = EE_RESSTR(nId); - return true; - } - default: ;//prevent warning - } - return false; + if ( GetValue() ) + nId = RID_SVXITEMS_PRINT_TRUE; + rText = EE_RESSTR(nId); + return true; } // class SvxOpaqueItem --------------------------------------------------- @@ -1163,31 +1136,18 @@ SfxPoolItem* SvxOpaqueItem::Create( SvStream& rStrm, sal_uInt16 ) const bool SvxOpaqueItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - sal_uInt16 nId = RID_SVXITEMS_OPAQUE_FALSE; + sal_uInt16 nId = RID_SVXITEMS_OPAQUE_FALSE; - if ( GetValue() ) - nId = RID_SVXITEMS_OPAQUE_TRUE; - rText = EE_RESSTR(nId); - return true; - } - default: ;//prevent warning - } - return false; + if ( GetValue() ) + nId = RID_SVXITEMS_OPAQUE_TRUE; + rText = EE_RESSTR(nId); + return true; } // class SvxProtectItem -------------------------------------------------- @@ -1246,41 +1206,28 @@ SfxPoolItem* SvxProtectItem::Clone( SfxItemPool* ) const bool SvxProtectItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; + sal_uInt16 nId = RID_SVXITEMS_PROT_CONTENT_FALSE; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - sal_uInt16 nId = RID_SVXITEMS_PROT_CONTENT_FALSE; - - if ( bCntnt ) - nId = RID_SVXITEMS_PROT_CONTENT_TRUE; - rText = EE_RESSTR(nId) + OUString(cpDelim); - nId = RID_SVXITEMS_PROT_SIZE_FALSE; + if ( bCntnt ) + nId = RID_SVXITEMS_PROT_CONTENT_TRUE; + rText = EE_RESSTR(nId) + OUString(cpDelim); + nId = RID_SVXITEMS_PROT_SIZE_FALSE; - if ( bSize ) - nId = RID_SVXITEMS_PROT_SIZE_TRUE; - rText = rText + EE_RESSTR(nId) + OUString(cpDelim); - nId = RID_SVXITEMS_PROT_POS_FALSE; + if ( bSize ) + nId = RID_SVXITEMS_PROT_SIZE_TRUE; + rText = rText + EE_RESSTR(nId) + OUString(cpDelim); + nId = RID_SVXITEMS_PROT_POS_FALSE; - if ( bPos ) - nId = RID_SVXITEMS_PROT_POS_TRUE; - rText += EE_RESSTR(nId); - return true; - } - default: ;//prevent warning - } - return false; + if ( bPos ) + nId = RID_SVXITEMS_PROT_POS_TRUE; + rText += EE_RESSTR(nId); + return true; } @@ -1488,10 +1435,6 @@ bool SvxShadowItem::GetPresentation { switch ( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: { rText = ::GetColorString( aShadowColor ) + OUString(cpDelim); @@ -2095,10 +2038,6 @@ bool SvxBoxItem::GetPresentation OUString cpDelimTmp = OUString(cpDelim); switch ( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: { rText = OUString(); @@ -2954,25 +2893,14 @@ bool SvxFmtBreakItem::operator==( const SfxPoolItem& rAttr ) const bool SvxFmtBreakItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - rText = GetValueTextByPos( GetValue() ); - return ePres; - default: ;//prevent warning - } - return false; + rText = GetValueTextByPos( GetValue() ); + return true; } @@ -3105,31 +3033,18 @@ SfxPoolItem* SvxFmtKeepItem::Create( SvStream& rStrm, sal_uInt16 ) const bool SvxFmtKeepItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; + sal_uInt16 nId = RID_SVXITEMS_FMTKEEP_FALSE; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - sal_uInt16 nId = RID_SVXITEMS_FMTKEEP_FALSE; - - if ( GetValue() ) - nId = RID_SVXITEMS_FMTKEEP_TRUE; - rText = EE_RESSTR(nId); - return true; - } - default: ;//prevent warning - } - return false; + if ( GetValue() ) + nId = RID_SVXITEMS_FMTKEEP_TRUE; + rText = EE_RESSTR(nId); + return true; } // class SvxLineItem ------------------------------------------------------ @@ -3263,21 +3178,10 @@ bool SvxLineItem::GetPresentation { rText = OUString(); - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - if ( pLine ) - rText = pLine->GetValueString( eCoreUnit, ePresUnit, pIntl, - (SFX_ITEM_PRESENTATION_COMPLETE == ePres) ); - return true; - } - default: ;//prevent warning - } - return false; + if ( pLine ) + rText = pLine->GetValueString( eCoreUnit, ePresUnit, pIntl, + (SFX_ITEM_PRESENTATION_COMPLETE == ePres) ); + return true; } @@ -3805,41 +3709,27 @@ bool SvxBrushItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) bool SvxBrushItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * ) const { - switch ( ePres ) + if ( GPOS_NONE == eGraphicPos ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - if ( GPOS_NONE == eGraphicPos ) - { - rText = ::GetColorString( aColor ) + OUString(cpDelim); - sal_uInt16 nId = RID_SVXITEMS_TRANSPARENT_FALSE; + rText = ::GetColorString( aColor ) + OUString(cpDelim); + sal_uInt16 nId = RID_SVXITEMS_TRANSPARENT_FALSE; - if ( aColor.GetTransparency() ) - nId = RID_SVXITEMS_TRANSPARENT_TRUE; - rText += EE_RESSTR(nId); - } - else - { - rText = EE_RESSTR(RID_SVXITEMS_GRAPHIC); - } - - return true; - } - default: ;//prevent warning + if ( aColor.GetTransparency() ) + nId = RID_SVXITEMS_TRANSPARENT_TRUE; + rText += EE_RESSTR(nId); + } + else + { + rText = EE_RESSTR(RID_SVXITEMS_GRAPHIC); } - return false; + return true; } @@ -4247,27 +4137,13 @@ sal_uInt16 SvxFrameDirectionItem::GetVersion( sal_uInt16 nFVer ) const } bool SvxFrameDirectionItem::GetPresentation( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper *) const { - switch( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - break; - - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - rText = EE_RESSTR( RID_SVXITEMS_FRMDIR_BEGIN + GetValue() ); - return true; - break; - - default: - return false; - } + rText = EE_RESSTR( RID_SVXITEMS_FRMDIR_BEGIN + GetValue() ); + return true; } bool SvxFrameDirectionItem::PutValue( const com::sun::star::uno::Any& rVal, diff --git a/editeng/source/items/justifyitem.cxx b/editeng/source/items/justifyitem.cxx index 289d54976c0f..7871c87bc217 100644 --- a/editeng/source/items/justifyitem.cxx +++ b/editeng/source/items/justifyitem.cxx @@ -52,23 +52,13 @@ SvxHorJustifyItem::SvxHorJustifyItem( const SvxCellHorJustify eJustify, bool SvxHorJustifyItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper *) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - rText = GetValueText( GetValue() ); - return true; - default: ; //prevent warning - } - return false; + rText = GetValueText( GetValue() ); + return true; } @@ -209,24 +199,14 @@ SvxVerJustifyItem::SvxVerJustifyItem( const SvxCellVerJustify eJustify, bool SvxVerJustifyItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - rText = GetValueText( GetValue() ); - return true; - default: ; //prevent warning - } - return false; + rText = GetValueText( GetValue() ); + return true; } @@ -350,24 +330,14 @@ SvxJustifyMethodItem::SvxJustifyMethodItem( const SvxCellJustifyMethod eJustify, bool SvxJustifyMethodItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - rText = GetValueText( GetValue() ); - return true; - default: ; //prevent warning - } - return false; + rText = GetValueText( GetValue() ); + return true; } diff --git a/editeng/source/items/optitems.cxx b/editeng/source/items/optitems.cxx index 839430be4313..cebe639ee3b6 100644 --- a/editeng/source/items/optitems.cxx +++ b/editeng/source/items/optitems.cxx @@ -60,27 +60,14 @@ SfxSpellCheckItem::SfxSpellCheckItem( const SfxSpellCheckItem& rItem ) : bool SfxSpellCheckItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation , SfxMapUnit , SfxMapUnit , - OUString& rText, + OUString& , const IntlWrapper* ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - return true; - } - default: - return false; - } + return true; } @@ -139,31 +126,18 @@ SfxPoolItem* SfxHyphenRegionItem::Clone( SfxItemPool* ) const bool SfxHyphenRegionItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit , SfxMapUnit , OUString& rText, const IntlWrapper* ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - rText = rText + - EE_RESSTR(RID_SVXITEMS_HYPHEN_MINLEAD).replaceAll("%1", OUString::number(nMinLead)) + - "," + - EE_RESSTR(RID_SVXITEMS_HYPHEN_MINTRAIL).replaceAll("%1", OUString::number(nMinTrail)); - return true; - } - default: - return false; - } + rText = rText + + EE_RESSTR(RID_SVXITEMS_HYPHEN_MINLEAD).replaceAll("%1", OUString::number(nMinLead)) + + "," + + EE_RESSTR(RID_SVXITEMS_HYPHEN_MINTRAIL).replaceAll("%1", OUString::number(nMinTrail)); + return true; } diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index 9775a2758b6c..9791c806e572 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -426,9 +426,6 @@ bool SvxAdjustItem::GetPresentation { switch ( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; case SFX_ITEM_PRESENTATION_NAMELESS: case SFX_ITEM_PRESENTATION_COMPLETE: rText = GetValueTextByPos( (sal_uInt16)GetAdjust() ); @@ -555,12 +552,6 @@ bool SvxWidowsItem::GetPresentation { switch ( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - { - rText = OUString(); - break; - } - case SFX_ITEM_PRESENTATION_NAMELESS: { rText = EE_RESSTR(RID_SVXITEMS_LINES); @@ -580,7 +571,7 @@ bool SvxWidowsItem::GetPresentation } rText = rText.replaceFirst( "%1", OUString::number( GetValue() ) ); - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } // class SvxOrphansItem -------------------------------------------------- @@ -626,12 +617,6 @@ bool SvxOrphansItem::GetPresentation { switch ( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - { - rText = OUString(); - break; - } - case SFX_ITEM_PRESENTATION_NAMELESS: { rText = EE_RESSTR(RID_SVXITEMS_LINES); @@ -651,7 +636,7 @@ bool SvxOrphansItem::GetPresentation } rText = rText.replaceFirst( "%1", OUString::number( GetValue() ) ); - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } // class SvxHyphenZoneItem ----------------------------------------------- @@ -747,9 +732,6 @@ bool SvxHyphenZoneItem::GetPresentation OUString cpDelimTmp(cpDelim); switch ( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; case SFX_ITEM_PRESENTATION_NAMELESS: { sal_uInt16 nId = RID_SVXITEMS_HYPHEN_FALSE; @@ -1101,27 +1083,24 @@ bool SvxTabStopItem::GetPresentation { rText = OUString(); - if ( ePres > SFX_ITEM_PRESENTATION_NONE ) - { - bool bComma = false; + bool bComma = false; - for ( sal_uInt16 i = 0; i < Count(); ++i ) + for ( sal_uInt16 i = 0; i < Count(); ++i ) + { + if ( SVX_TAB_ADJUST_DEFAULT != ((*this)[i]).GetAdjustment() ) { - if ( SVX_TAB_ADJUST_DEFAULT != ((*this)[i]).GetAdjustment() ) + if ( bComma ) + rText += ","; + rText += GetMetricText( + ((*this)[i]).GetTabPos(), eCoreUnit, ePresUnit, pIntl ); + if ( SFX_ITEM_PRESENTATION_COMPLETE == ePres ) { - if ( bComma ) - rText += ","; - rText += GetMetricText( - ((*this)[i]).GetTabPos(), eCoreUnit, ePresUnit, pIntl ); - if ( SFX_ITEM_PRESENTATION_COMPLETE == ePres ) - { - rText += " " + EE_RESSTR(GetMetricId(ePresUnit)); - } - bComma = true; + rText += " " + EE_RESSTR(GetMetricId(ePresUnit)); } + bComma = true; } } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } @@ -1261,30 +1240,18 @@ SfxPoolItem* SvxFmtSplitItem::Create( SvStream& rStrm, sal_uInt16 ) const bool SvxFmtSplitItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - sal_uInt16 nId = RID_SVXITEMS_FMTSPLIT_FALSE; + sal_uInt16 nId = RID_SVXITEMS_FMTSPLIT_FALSE; - if ( GetValue() ) - nId = RID_SVXITEMS_FMTSPLIT_TRUE; - rText = EE_RESSTR(nId); - return ePres; - } - default: ;//prevent warning - } - return false; + if ( GetValue() ) + nId = RID_SVXITEMS_FMTSPLIT_TRUE; + rText = EE_RESSTR(nId); + return true; } @@ -1338,9 +1305,6 @@ bool SvxPageModelItem::GetPresentation switch ( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: if ( bSet ) rText = GetValue(); @@ -1387,26 +1351,14 @@ sal_uInt16 SvxScriptSpaceItem::GetVersion( sal_uInt16 nFFVer ) const } bool SvxScriptSpaceItem::GetPresentation( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString &rText, const IntlWrapper* /*pIntl*/ ) const { - switch( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - break; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - rText = EE_RESSTR( !GetValue() - ? RID_SVXITEMS_SCRPTSPC_OFF - : RID_SVXITEMS_SCRPTSPC_ON ); - return true; - } - default: ;//prevent warning - } - return false; + rText = EE_RESSTR( !GetValue() + ? RID_SVXITEMS_SCRPTSPC_OFF + : RID_SVXITEMS_SCRPTSPC_ON ); + return true; } @@ -1440,27 +1392,14 @@ sal_uInt16 SvxHangingPunctuationItem::GetVersion( sal_uInt16 nFFVer ) const } bool SvxHangingPunctuationItem::GetPresentation( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString &rText, const IntlWrapper* /*pIntl*/ ) const { - switch( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - break; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - rText = EE_RESSTR( !GetValue() - ? RID_SVXITEMS_HNGPNCT_OFF - : RID_SVXITEMS_HNGPNCT_ON ); - return true; - } - default: ;//prevent warning - break; - } - return false; + rText = EE_RESSTR( !GetValue() + ? RID_SVXITEMS_HNGPNCT_OFF + : RID_SVXITEMS_HNGPNCT_ON ); + return true; } @@ -1493,27 +1432,14 @@ sal_uInt16 SvxForbiddenRuleItem::GetVersion( sal_uInt16 nFFVer ) const } bool SvxForbiddenRuleItem::GetPresentation( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString &rText, const IntlWrapper* /*pIntl*/ ) const { - switch( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - break; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - rText = EE_RESSTR( !GetValue() - ? RID_SVXITEMS_FORBIDDEN_RULE_OFF - : RID_SVXITEMS_FORBIDDEN_RULE_ON ); - return true; - } - default: ;//prevent warning - break; - } - return false; + rText = EE_RESSTR( !GetValue() + ? RID_SVXITEMS_FORBIDDEN_RULE_OFF + : RID_SVXITEMS_FORBIDDEN_RULE_ON ); + return true; } /************************************************************************* @@ -1550,34 +1476,21 @@ sal_uInt16 SvxParaVertAlignItem::GetVersion( sal_uInt16 nFFVer ) const } bool SvxParaVertAlignItem::GetPresentation( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString &rText, const IntlWrapper* ) const { - switch( ePres ) + sal_uInt16 nTmp; + switch( GetValue() ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - break; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - sal_uInt16 nTmp; - switch( GetValue() ) - { - case AUTOMATIC: nTmp = RID_SVXITEMS_PARAVERTALIGN_AUTO; break; - case TOP: nTmp = RID_SVXITEMS_PARAVERTALIGN_TOP; break; - case CENTER: nTmp = RID_SVXITEMS_PARAVERTALIGN_CENTER; break; - case BOTTOM: nTmp = RID_SVXITEMS_PARAVERTALIGN_BOTTOM; break; - default: nTmp = RID_SVXITEMS_PARAVERTALIGN_BASELINE; break; - } - rText = EE_RESSTR( nTmp ); - return true; - } - default: ;//prevent warning - break; + case AUTOMATIC: nTmp = RID_SVXITEMS_PARAVERTALIGN_AUTO; break; + case TOP: nTmp = RID_SVXITEMS_PARAVERTALIGN_TOP; break; + case CENTER: nTmp = RID_SVXITEMS_PARAVERTALIGN_CENTER; break; + case BOTTOM: nTmp = RID_SVXITEMS_PARAVERTALIGN_BOTTOM; break; + default: nTmp = RID_SVXITEMS_PARAVERTALIGN_BASELINE; break; } - return false; + rText = EE_RESSTR( nTmp ); + return true; } bool SvxParaVertAlignItem::QueryValue( com::sun::star::uno::Any& rVal, @@ -1635,28 +1548,15 @@ sal_uInt16 SvxParaGridItem::GetVersion( sal_uInt16 nFFVer ) const } bool SvxParaGridItem::GetPresentation( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString &rText, const IntlWrapper* /*pIntl*/ ) const { - switch( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - break; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - rText = GetValue() ? - EE_RESSTR( RID_SVXITEMS_PARASNAPTOGRID_ON ) : - EE_RESSTR( RID_SVXITEMS_PARASNAPTOGRID_OFF ); + rText = GetValue() ? + EE_RESSTR( RID_SVXITEMS_PARASNAPTOGRID_ON ) : + EE_RESSTR( RID_SVXITEMS_PARASNAPTOGRID_OFF ); - return true; - } - default: ;//prevent warning - break; - } - return false; + return true; } diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 2a8dea5ec370..3d9a744a4ba1 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -440,24 +440,14 @@ SfxPoolItem* SvxFontItem::Create(SvStream& rStrm, sal_uInt16) const bool SvxFontItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * /*pIntl*/ ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - rText = aFamilyName; - return true; - default: ; //prevent warning - } - return false; + rText = aFamilyName; + return true; } @@ -509,24 +499,14 @@ SfxPoolItem* SvxPostureItem::Create(SvStream& rStrm, sal_uInt16) const bool SvxPostureItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * /*pIntl*/ ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - rText = GetValueTextByPos( GetValue() ); - return true; - default: ;//prevent warning - } - return false; + rText = GetValueTextByPos( GetValue() ); + return true; } @@ -674,24 +654,14 @@ SfxPoolItem* SvxWeightItem::Create(SvStream& rStrm, sal_uInt16) const bool SvxWeightItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * /*pIntl*/ ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - rText = GetValueTextByPos( GetValue() ); - return true; - default: ;//prevent warning - } - return false; + rText = GetValueTextByPos( GetValue() ); + return true; } @@ -1036,40 +1006,28 @@ bool SvxFontHeightItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) bool SvxFontHeightItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit eCoreUnit, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper *pIntl ) const { - switch ( ePres ) + if( SFX_MAPUNIT_RELATIVE != ePropUnit ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - if( SFX_MAPUNIT_RELATIVE != ePropUnit ) - { - rText = OUString::number( (short)nProp ) + - " " + EE_RESSTR( GetMetricId( ePropUnit ) ); - if( 0 <= (short)nProp ) - rText = "+" + rText; - } - else if( 100 == nProp ) - { - rText = GetMetricText( (long)nHeight, - eCoreUnit, SFX_MAPUNIT_POINT, pIntl ) + - " " + EE_RESSTR(GetMetricId(SFX_MAPUNIT_POINT)); - } - else - rText = OUString::number( nProp ) + "%"; - return true; - } - default: ; //prevent warning + rText = OUString::number( (short)nProp ) + + " " + EE_RESSTR( GetMetricId( ePropUnit ) ); + if( 0 <= (short)nProp ) + rText = "+" + rText; } - return false; + else if( 100 == nProp ) + { + rText = GetMetricText( (long)nHeight, + eCoreUnit, SFX_MAPUNIT_POINT, pIntl ) + + " " + EE_RESSTR(GetMetricId(SFX_MAPUNIT_POINT)); + } + else + rText = OUString::number( nProp ) + "%"; + return true; } @@ -1235,33 +1193,21 @@ bool SvxFontWidthItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) bool SvxFontWidthItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit eCoreUnit, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper *pIntl ) const { - switch ( ePres ) + if ( 100 == nProp ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - if ( 100 == nProp ) - { - rText = GetMetricText( (long)nWidth, - eCoreUnit, SFX_MAPUNIT_POINT, pIntl ) + - " " + EE_RESSTR(GetMetricId(SFX_MAPUNIT_POINT)); - } - else - rText = OUString::number( nProp ) + "%"; - return true; - } - default: ; //prevent warning + rText = GetMetricText( (long)nWidth, + eCoreUnit, SFX_MAPUNIT_POINT, pIntl ) + + " " + EE_RESSTR(GetMetricId(SFX_MAPUNIT_POINT)); } - return false; + else + rText = OUString::number( nProp ) + "%"; + return true; } // class SvxTextLineItem ------------------------------------------------ @@ -1329,26 +1275,16 @@ SfxPoolItem* SvxTextLineItem::Create(SvStream& rStrm, sal_uInt16) const bool SvxTextLineItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * /*pIntl*/ ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - rText = GetValueTextByPos( GetValue() ); - if( !mColor.GetTransparency() ) - rText = rText + OUString(cpDelim) + ::GetColorString( mColor ); - return true; - default: ; //prevent warning - } - return false; + rText = GetValueTextByPos( GetValue() ); + if( !mColor.GetTransparency() ) + rText = rText + OUString(cpDelim) + ::GetColorString( mColor ); + return true; } @@ -1557,24 +1493,14 @@ SfxPoolItem* SvxCrossedOutItem::Create(SvStream& rStrm, sal_uInt16) const bool SvxCrossedOutItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * /*pIntl*/ ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - rText = GetValueTextByPos( GetValue() ); - return true; - default: ;//prevent warning - } - return false; + rText = GetValueTextByPos( GetValue() ); + return true; } @@ -1654,30 +1580,18 @@ SfxPoolItem* SvxShadowedItem::Create(SvStream& rStrm, sal_uInt16) const bool SvxShadowedItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * /*pIntl*/ ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - sal_uInt16 nId = RID_SVXITEMS_SHADOWED_FALSE; + sal_uInt16 nId = RID_SVXITEMS_SHADOWED_FALSE; - if ( GetValue() ) - nId = RID_SVXITEMS_SHADOWED_TRUE; - rText = EE_RESSTR(nId); - return true; - } - default: ; //prevent warning - } - return false; + if ( GetValue() ) + nId = RID_SVXITEMS_SHADOWED_TRUE; + rText = EE_RESSTR(nId); + return true; } // class SvxAutoKernItem ------------------------------------------------- @@ -1715,30 +1629,18 @@ SfxPoolItem* SvxAutoKernItem::Create(SvStream& rStrm, sal_uInt16) const bool SvxAutoKernItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * /*pIntl*/ ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - sal_uInt16 nId = RID_SVXITEMS_AUTOKERN_FALSE; + sal_uInt16 nId = RID_SVXITEMS_AUTOKERN_FALSE; - if ( GetValue() ) - nId = RID_SVXITEMS_AUTOKERN_TRUE; - rText = EE_RESSTR(nId); - return true; - } - default: ; //prevent warning - } - return false; + if ( GetValue() ) + nId = RID_SVXITEMS_AUTOKERN_TRUE; + rText = EE_RESSTR(nId); + return true; } // class SvxWordLineModeItem --------------------------------------------- @@ -1777,30 +1679,18 @@ SfxPoolItem* SvxWordLineModeItem::Create(SvStream& rStrm, sal_uInt16) const bool SvxWordLineModeItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * /*pIntl*/ ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - sal_uInt16 nId = RID_SVXITEMS_WORDLINE_FALSE; + sal_uInt16 nId = RID_SVXITEMS_WORDLINE_FALSE; - if ( GetValue() ) - nId = RID_SVXITEMS_WORDLINE_TRUE; - rText = EE_RESSTR(nId); - return true; - } - default: ; //prevent warning - } - return false; + if ( GetValue() ) + nId = RID_SVXITEMS_WORDLINE_TRUE; + rText = EE_RESSTR(nId); + return true; } // class SvxContourItem -------------------------------------------------- @@ -1838,30 +1728,18 @@ SfxPoolItem* SvxContourItem::Create(SvStream& rStrm, sal_uInt16) const bool SvxContourItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * /*pIntl*/ ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - sal_uInt16 nId = RID_SVXITEMS_CONTOUR_FALSE; + sal_uInt16 nId = RID_SVXITEMS_CONTOUR_FALSE; - if ( GetValue() ) - nId = RID_SVXITEMS_CONTOUR_TRUE; - rText = EE_RESSTR(nId); - return true; - } - default: ; //prevent warning - } - return false; + if ( GetValue() ) + nId = RID_SVXITEMS_CONTOUR_TRUE; + rText = EE_RESSTR(nId); + return true; } // class SvxPropSizeItem ------------------------------------------------- @@ -2055,24 +1933,14 @@ SfxPoolItem* SvxColorItem::Create(SvStream& rStrm, sal_uInt16 /*nVer*/ ) const bool SvxColorItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * /*pIntl*/ ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - rText = ::GetColorString( mColor ); - return true; - default: ; //prevent warning - } - return false; + rText = ::GetColorString( mColor ); + return true; } @@ -2202,9 +2070,6 @@ bool SvxKerningItem::GetPresentation { switch ( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; case SFX_ITEM_PRESENTATION_NAMELESS: rText = GetMetricText( (long)GetValue(), eCoreUnit, SFX_MAPUNIT_POINT, pIntl ) + " " + EE_RESSTR(GetMetricId(SFX_MAPUNIT_POINT)); @@ -2293,24 +2158,14 @@ SfxPoolItem* SvxCaseMapItem::Create(SvStream& rStrm, sal_uInt16) const bool SvxCaseMapItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * /*pIntl*/ ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - rText = GetValueTextByPos( GetValue() ); - return true; - default: ; //prevent warning - } - return false; + rText = GetValueTextByPos( GetValue() ); + return true; } @@ -2441,34 +2296,22 @@ sal_uInt16 SvxEscapementItem::GetValueCount() const bool SvxEscapementItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * /*pIntl*/ ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - rText = GetValueTextByPos( GetEnumValue() ); + rText = GetValueTextByPos( GetEnumValue() ); - if ( nEsc != 0 ) - { - if( DFLT_ESC_AUTO_SUPER == nEsc || DFLT_ESC_AUTO_SUB == nEsc ) - rText += EE_RESSTR(RID_SVXITEMS_ESCAPEMENT_AUTO); - else - rText = rText + OUString::number( nEsc ) + "%"; - } - return true; - } - default: ; //prevent warning + if ( nEsc != 0 ) + { + if( DFLT_ESC_AUTO_SUPER == nEsc || DFLT_ESC_AUTO_SUB == nEsc ) + rText += EE_RESSTR(RID_SVXITEMS_ESCAPEMENT_AUTO); + else + rText = rText + OUString::number( nEsc ) + "%"; } - return false; + return true; } @@ -2606,26 +2449,14 @@ SfxPoolItem* SvxLanguageItem::Create(SvStream& rStrm, sal_uInt16) const bool SvxLanguageItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * /*pIntl*/ ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - rText = SvtLanguageTable::GetLanguageString( (LanguageType)GetValue() ); - return true; - } - default: ; //prevent warning - } - return false; + rText = SvtLanguageTable::GetLanguageString( (LanguageType)GetValue() ); + return true; } bool SvxLanguageItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const @@ -2838,30 +2669,18 @@ SfxPoolItem* SvxBlinkItem::Create(SvStream& rStrm, sal_uInt16) const bool SvxBlinkItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * /*pIntl*/ ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - sal_uInt16 nId = RID_SVXITEMS_BLINK_FALSE; + sal_uInt16 nId = RID_SVXITEMS_BLINK_FALSE; - if ( GetValue() ) - nId = RID_SVXITEMS_BLINK_TRUE; - rText = EE_RESSTR(nId); - return true; - } - default: ; //prevent warning - } - return false; + if ( GetValue() ) + nId = RID_SVXITEMS_BLINK_TRUE; + rText = EE_RESSTR(nId); + return true; } // class SvxEmphaisMarkItem --------------------------------------------------- @@ -2901,36 +2720,24 @@ SfxPoolItem* SvxEmphasisMarkItem::Create( SvStream& rStrm, sal_uInt16 ) const bool SvxEmphasisMarkItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * /*pIntl*/ ) const { - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - sal_uInt16 nVal = GetValue(); - rText = EE_RESSTR( RID_SVXITEMS_EMPHASIS_BEGIN_STYLE + - ( EMPHASISMARK_STYLE & nVal )); - sal_uInt16 nId = ( EMPHASISMARK_POS_ABOVE & nVal ) - ? RID_SVXITEMS_EMPHASIS_ABOVE_POS - : ( EMPHASISMARK_POS_BELOW & nVal ) - ? RID_SVXITEMS_EMPHASIS_BELOW_POS - : 0; - if( nId ) - rText += EE_RESSTR( nId ); - return true; - } - default: ; //prevent warning - } - return false; + sal_uInt16 nVal = GetValue(); + rText = EE_RESSTR( RID_SVXITEMS_EMPHASIS_BEGIN_STYLE + + ( EMPHASISMARK_STYLE & nVal )); + sal_uInt16 nId = ( EMPHASISMARK_POS_ABOVE & nVal ) + ? RID_SVXITEMS_EMPHASIS_ABOVE_POS + : ( EMPHASISMARK_POS_BELOW & nVal ) + ? RID_SVXITEMS_EMPHASIS_BELOW_POS + : 0; + if( nId ) + rText += EE_RESSTR( nId ); + return true; } @@ -3101,33 +2908,21 @@ bool SvxTwoLinesItem::PutValue( const com::sun::star::uno::Any& rVal, return bRet; } -bool SvxTwoLinesItem::GetPresentation( SfxItemPresentation ePres, +bool SvxTwoLinesItem::GetPresentation( SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString &rText, const IntlWrapper* /*pIntl*/ ) const { - switch( ePres ) + if( !GetValue() ) + rText = EE_RESSTR( RID_SVXITEMS_TWOLINES_OFF ); + else { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - break; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - if( !GetValue() ) - rText = EE_RESSTR( RID_SVXITEMS_TWOLINES_OFF ); - else - { - rText = EE_RESSTR( RID_SVXITEMS_TWOLINES ); - if( GetStartBracket() ) - rText = OUString(GetStartBracket()) + rText; - if( GetEndBracket() ) - rText += OUString(GetEndBracket()); - } - return true; - } - default: ; //prevent warning + rText = EE_RESSTR( RID_SVXITEMS_TWOLINES ); + if( GetStartBracket() ) + rText = OUString(GetStartBracket()) + rText; + if( GetEndBracket() ) + rText += OUString(GetEndBracket()); } - return false; + return true; } @@ -3193,33 +2988,21 @@ sal_uInt16 SvxCharRotateItem::GetVersion( sal_uInt16 nFFVer ) const } bool SvxCharRotateItem::GetPresentation( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString &rText, const IntlWrapper* ) const { - switch( ePres ) + if( !GetValue() ) + rText = EE_RESSTR( RID_SVXITEMS_CHARROTATE_OFF ); + else { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - break; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - if( !GetValue() ) - rText = EE_RESSTR( RID_SVXITEMS_CHARROTATE_OFF ); - else - { - rText = EE_RESSTR( RID_SVXITEMS_CHARROTATE ); - rText = rText.replaceFirst( "$(ARG1)", - OUString::number( GetValue() / 10 )); - if( IsFitToLine() ) - rText += EE_RESSTR( RID_SVXITEMS_CHARROTATE_FITLINE ); - } - return true; - } - default: ; //prevent warning + rText = EE_RESSTR( RID_SVXITEMS_CHARROTATE ); + rText = rText.replaceFirst( "$(ARG1)", + OUString::number( GetValue() / 10 )); + if( IsFitToLine() ) + rText += EE_RESSTR( RID_SVXITEMS_CHARROTATE_FITLINE ); } - return false; + return true; } bool SvxCharRotateItem::QueryValue( com::sun::star::uno::Any& rVal, @@ -3336,31 +3119,19 @@ sal_uInt16 SvxCharScaleWidthItem::GetVersion( sal_uInt16 nFFVer ) const } bool SvxCharScaleWidthItem::GetPresentation( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString &rText, const IntlWrapper* ) const { - switch( ePres ) + if( !GetValue() ) + rText = EE_RESSTR( RID_SVXITEMS_CHARSCALE_OFF ); + else { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - break; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - if( !GetValue() ) - rText = EE_RESSTR( RID_SVXITEMS_CHARSCALE_OFF ); - else - { - rText = EE_RESSTR( RID_SVXITEMS_CHARSCALE ); - rText = rText.replaceFirst( "$(ARG1)", - OUString::number( GetValue() )); - } - return true; - } - default: ; //prevent warning + rText = EE_RESSTR( RID_SVXITEMS_CHARSCALE ); + rText = rText.replaceFirst( "$(ARG1)", + OUString::number( GetValue() )); } - return false; + return true; } bool SvxCharScaleWidthItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) @@ -3434,28 +3205,14 @@ sal_uInt16 SvxCharReliefItem::GetValueCount() const bool SvxCharReliefItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * /*pIntl*/ ) const { - SfxItemPresentation eRet = ePres; - switch( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - break; - - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - rText = GetValueTextByPos( GetValue() ); - break; - - default: - eRet = SFX_ITEM_PRESENTATION_NONE; - } - return eRet != SFX_ITEM_PRESENTATION_NONE; + rText = GetValueTextByPos( GetValue() ); + return true; } bool SvxCharReliefItem::PutValue( const com::sun::star::uno::Any& rVal, diff --git a/editeng/source/items/writingmodeitem.cxx b/editeng/source/items/writingmodeitem.cxx index 9000ecbed2d1..bebc0e6881b4 100644 --- a/editeng/source/items/writingmodeitem.cxx +++ b/editeng/source/items/writingmodeitem.cxx @@ -65,28 +65,14 @@ sal_uInt16 SvxWritingModeItem::GetVersion( sal_uInt16 /*nFVer*/ ) const return USHRT_MAX; } -bool SvxWritingModeItem::GetPresentation( SfxItemPresentation ePres, +bool SvxWritingModeItem::GetPresentation( SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, OUString &rText, const IntlWrapper * ) const { - switch( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - break; - - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - rText = EE_RESSTR(RID_SVXITEMS_FRMDIR_BEGIN + GetValue()); - return true; - break; - - default: - return false; - } + rText = EE_RESSTR(RID_SVXITEMS_FRMDIR_BEGIN + GetValue()); + return true; } bool SvxWritingModeItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) |