diff options
-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 | ||||
-rw-r--r-- | include/svl/poolitem.hxx | 1 | ||||
-rw-r--r-- | sc/source/core/data/attrib.cxx | 21 | ||||
-rw-r--r-- | svl/source/items/poolitem.cxx | 6 | ||||
-rw-r--r-- | svx/source/dialog/optgrid.cxx | 16 | ||||
-rw-r--r-- | svx/source/items/algitem.cxx | 19 | ||||
-rw-r--r-- | svx/source/items/pageitem.cxx | 2 | ||||
-rw-r--r-- | svx/source/items/postattr.cxx | 9 | ||||
-rw-r--r-- | svx/source/svdraw/svdattr.cxx | 50 | ||||
-rw-r--r-- | svx/source/xoutdev/xattr.cxx | 321 | ||||
-rw-r--r-- | svx/source/xoutdev/xattr2.cxx | 279 | ||||
-rw-r--r-- | svx/source/xoutdev/xattrbmp.cxx | 16 | ||||
-rw-r--r-- | sw/source/uibase/utlui/attrdesc.cxx | 1071 | ||||
-rw-r--r-- | sw/source/uibase/utlui/uiitems.cxx | 26 |
21 files changed, 793 insertions, 2140 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 ) diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx index 0aaf16d8a9e1..d32de3274e8b 100644 --- a/include/svl/poolitem.hxx +++ b/include/svl/poolitem.hxx @@ -119,7 +119,6 @@ enum SfxItemPresentation */ { - SFX_ITEM_PRESENTATION_NONE, SFX_ITEM_PRESENTATION_NAMELESS, SFX_ITEM_PRESENTATION_COMPLETE }; diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx index f0edf65caa28..d7affc2708a3 100644 --- a/sc/source/core/data/attrib.cxx +++ b/sc/source/core/data/attrib.cxx @@ -302,10 +302,6 @@ bool ScProtectionAttr::GetPresentation switch ( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - break; - case SFX_ITEM_PRESENTATION_NAMELESS: rText = GetValueText(); break; @@ -328,11 +324,10 @@ bool ScProtectionAttr::GetPresentation + (!bHidePrint ? aStrYes : aStrNo); break; - default: - ePres = SFX_ITEM_PRESENTATION_NONE; + default: break; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } bool ScProtectionAttr::operator==( const SfxPoolItem& rItem ) const @@ -433,7 +428,7 @@ bool ScRangeItem::GetPresentation } } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } // ScTableListItem - List from Tables (-numbers) @@ -514,10 +509,6 @@ bool ScTableListItem::GetPresentation { switch ( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return ePres; - case SFX_ITEM_PRESENTATION_NAMELESS: { rText = "("; @@ -1025,7 +1016,7 @@ bool ScPageScaleToItem::GetPresentation( SfxItemPresentation ePres, SfxMapUnit, SfxMapUnit, OUString& rText, const IntlWrapper* ) const { rText = OUString(); - if( !IsValid() || (ePres == SFX_ITEM_PRESENTATION_NONE) ) + if( !IsValid()) return false; OUString aName( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALETO ) ); @@ -1036,10 +1027,6 @@ bool ScPageScaleToItem::GetPresentation( switch( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - return false; - break; - case SFX_ITEM_PRESENTATION_NAMELESS: rText = aValue; return true; diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx index f9d76e184ca6..4b1fc9df8c64 100644 --- a/svl/source/items/poolitem.cxx +++ b/svl/source/items/poolitem.cxx @@ -172,11 +172,7 @@ SvStream& SfxPoolItem::Store(SvStream &rStream, sal_uInt16 ) const * The corresponding unit of measure is passed as 'ePresentationMetric'. * * - * @return SfxItemPresentation SFX_ITEM_PRESENTATION_NONE - * A textual representation could not be - * created - * - * SFX_ITEM_PRESENTATION_NAMELESS + * @return SfxItemPresentation SFX_ITEM_PRESENTATION_NAMELESS * A textual representation (if applicable * with a unit of measure) could be created, * but it doesn't contain any semantic meaning diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx index 7b8d804a65e4..f1df7ae8ded4 100644 --- a/svx/source/dialog/optgrid.cxx +++ b/svx/source/dialog/optgrid.cxx @@ -105,24 +105,14 @@ bool SvxGridItem::operator==( const SfxPoolItem& rAttr ) const bool SvxGridItem::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 = "SvxGridItem"; - return ePres; - default: - return false; - } + rText = "SvxGridItem"; + return true; } // TabPage Screen Settings diff --git a/svx/source/items/algitem.cxx b/svx/source/items/algitem.cxx index 5f534a31c43d..7615aa8c8cc6 100644 --- a/svx/source/items/algitem.cxx +++ b/svx/source/items/algitem.cxx @@ -62,23 +62,13 @@ SvxOrientationItem::SvxOrientationItem( sal_Int32 nRotation, bool bStacked, cons bool SvxOrientationItem::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; } @@ -240,9 +230,6 @@ bool SvxMarginItem::GetPresentation switch ( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; case SFX_ITEM_PRESENTATION_NAMELESS: { rText = GetMetricText( (long)nLeftMargin, eCoreUnit, ePresUnit, pIntl ) + diff --git a/svx/source/items/pageitem.cxx b/svx/source/items/pageitem.cxx index b7dee44cdf66..9968429eb8e7 100644 --- a/svx/source/items/pageitem.cxx +++ b/svx/source/items/pageitem.cxx @@ -109,8 +109,6 @@ bool SvxPageItem::GetPresentation switch ( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - return false; case SFX_ITEM_PRESENTATION_NAMELESS: { if ( !aDescName.isEmpty() ) diff --git a/svx/source/items/postattr.cxx b/svx/source/items/postattr.cxx index 36e4ff367c1a..6a6b68a63f69 100644 --- a/svx/source/items/postattr.cxx +++ b/svx/source/items/postattr.cxx @@ -55,9 +55,6 @@ bool SvxPostItAuthorItem::GetPresentation { switch ( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; case SFX_ITEM_PRESENTATION_NAMELESS: rText = GetValue(); return true; @@ -103,9 +100,6 @@ bool SvxPostItDateItem::GetPresentation { switch ( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; case SFX_ITEM_PRESENTATION_NAMELESS: rText = GetValue(); return true; @@ -151,9 +145,6 @@ bool SvxPostItTextItem::GetPresentation { switch ( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; case SFX_ITEM_PRESENTATION_NAMELESS: rText = GetValue(); return true; diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index 61016ed6f333..0d6ade274ae7 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -741,7 +741,7 @@ bool SdrScaleItem::GetPresentation( rText = aStr + " " + rText; } - return ePresentation != SFX_ITEM_PRESENTATION_NONE; + return true; } SfxPoolItem* SdrScaleItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const @@ -787,7 +787,7 @@ bool SdrOnOffItem::GetPresentation(SfxItemPresentation ePres, SdrItemPool::TakeItemName(Which(), aStr); rText = aStr + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } TYPEINIT1_AUTOFACTORY(SdrYesNoItem,SfxBoolItem); @@ -819,7 +819,7 @@ bool SdrYesNoItem::GetPresentation(SfxItemPresentation ePres, SdrItemPool::TakeItemName(Which(), aStr); rText = aStr + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } @@ -853,7 +853,7 @@ bool SdrPercentItem::GetPresentation( rText = aStr + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } @@ -942,7 +942,7 @@ bool SdrAngleItem::GetPresentation( } rText = aText.makeStringAndClear(); - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } @@ -993,7 +993,7 @@ bool SdrMetricItem::GetPresentation(SfxItemPresentation ePres, SdrItemPool::TakeItemName(Which(), aStr2); rText = aStr2 + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } @@ -1023,7 +1023,7 @@ bool SdrCaptionTypeItem::GetPresentation(SfxItemPresentation ePres, SdrItemPool::TakeItemName(Which(), aStr); rText = aStr + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } TYPEINIT1_AUTOFACTORY(SdrCaptionEscDirItem,SfxEnumItem); @@ -1049,7 +1049,7 @@ bool SdrCaptionEscDirItem::GetPresentation(SfxItemPresentation ePres, SdrItemPool::TakeItemName(Which(), aStr); rText = aStr + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } @@ -1080,7 +1080,7 @@ bool SdrTextFitToSizeTypeItem::GetPresentation(SfxItemPresentation ePres, SdrItemPool::TakeItemName(Which(), aStr); rText = aStr + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } bool SdrTextFitToSizeTypeItem::HasBoolValue() const { return true; } @@ -1140,7 +1140,7 @@ bool SdrTextVertAdjustItem::GetPresentation(SfxItemPresentation ePres, SdrItemPool::TakeItemName(Which(), aStr); rText = aStr + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } bool SdrTextVertAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const @@ -1189,7 +1189,7 @@ bool SdrTextHorzAdjustItem::GetPresentation(SfxItemPresentation ePres, SdrItemPool::TakeItemName(Which(), aStr); rText = aStr + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } bool SdrTextHorzAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const @@ -1238,7 +1238,7 @@ bool SdrTextAniKindItem::GetPresentation(SfxItemPresentation ePres, SdrItemPool::TakeItemName(Which(), aStr); rText = aStr + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } bool SdrTextAniKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const @@ -1286,7 +1286,7 @@ bool SdrTextAniDirectionItem::GetPresentation(SfxItemPresentation ePres, SdrItemPool::TakeItemName(Which(), aStr); rText = aStr + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } bool SdrTextAniDirectionItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const @@ -1332,7 +1332,7 @@ bool SdrTextAniDelayItem::GetPresentation( rText = aStr + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } TYPEINIT1_AUTOFACTORY(SdrTextAniAmountItem,SfxInt16Item); @@ -1389,7 +1389,7 @@ bool SdrTextAniAmountItem::GetPresentation( rText = aStr + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } TYPEINIT1_AUTOFACTORY( SdrTextFixedCellHeightItem, SfxBoolItem ); @@ -1418,7 +1418,7 @@ bool SdrTextFixedCellHeightItem::GetPresentation( SfxItemPresentation ePres, SdrItemPool::TakeItemName(Which(), aStr); rText = aStr + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } SfxPoolItem* SdrTextFixedCellHeightItem::Create( SvStream& rIn, sal_uInt16 nItemVersion ) const { @@ -1516,7 +1516,7 @@ bool SdrCustomShapeAdjustmentItem::GetPresentation( SdrItemPool::TakeItemName( Which(), aStr ); rText = aStr + " " + rText; } - return ePresentation != SFX_ITEM_PRESENTATION_NONE; + return true; } SfxPoolItem* SdrCustomShapeAdjustmentItem::Create( SvStream& rIn, sal_uInt16 nItemVersion ) const @@ -1633,7 +1633,7 @@ bool SdrEdgeKindItem::GetPresentation(SfxItemPresentation ePres, SdrItemPool::TakeItemName(Which(), aStr); rText = aStr + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } bool SdrEdgeKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const @@ -1822,7 +1822,7 @@ bool SdrMeasureKindItem::GetPresentation(SfxItemPresentation ePres, SdrItemPool::TakeItemName(Which(), aStr); rText = aStr + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } bool SdrMeasureKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const @@ -1870,7 +1870,7 @@ bool SdrMeasureTextHPosItem::GetPresentation(SfxItemPresentation ePres, SdrItemPool::TakeItemName(Which(), aStr); rText = aStr + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } bool SdrMeasureTextHPosItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const @@ -1918,7 +1918,7 @@ bool SdrMeasureTextVPosItem::GetPresentation(SfxItemPresentation ePres, SdrItemPool::TakeItemName(Which(), aStr); rText = aStr + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } bool SdrMeasureTextVPosItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const @@ -1973,7 +1973,7 @@ bool SdrMeasureUnitItem::GetPresentation(SfxItemPresentation ePres, SdrItemPool::TakeItemName(Which(), aStr); rText = aStr + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } bool SdrMeasureUnitItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const @@ -2019,7 +2019,7 @@ bool SdrCircKindItem::GetPresentation(SfxItemPresentation ePres, SdrItemPool::TakeItemName(Which(), aStr); rText = aStr + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } bool SdrCircKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const @@ -2076,7 +2076,7 @@ bool SdrSignedPercentItem::GetPresentation( rText = aStr + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -2289,7 +2289,7 @@ bool SdrGrafModeItem::GetPresentation( SfxItemPresentation ePres, rText = aStr + " " + rText; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 37d610a4ff08..109ae972e536 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -377,7 +377,7 @@ SfxPoolItem* XLineStyleItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const bool XLineStyleItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * @@ -385,32 +385,21 @@ bool XLineStyleItem::GetPresentation { rText = OUString(); - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - return false; - case SFX_ITEM_PRESENTATION_COMPLETE: - case SFX_ITEM_PRESENTATION_NAMELESS: - { - sal_uInt16 nId = 0; + sal_uInt16 nId = 0; - switch( (sal_uInt16)GetValue() ) - { - case XLINE_NONE: - nId = RID_SVXSTR_INVISIBLE; - break; - case XLINE_SOLID: - nId = RID_SVXSTR_SOLID; - break; - } - - if ( nId ) - rText = SVX_RESSTR( nId ); - return true; - } - default: - return false; + switch( (sal_uInt16)GetValue() ) + { + case XLINE_NONE: + nId = RID_SVXSTR_INVISIBLE; + break; + case XLINE_SOLID: + nId = RID_SVXSTR_SOLID; + break; } + + if ( nId ) + rText = SVX_RESSTR( nId ); + return true; } bool XLineStyleItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const @@ -733,24 +722,14 @@ SvStream& XLineDashItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const bool XLineDashItem::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 = GetName(); - return true; - default: - return false; - } + rText = GetName(); + return true; } bool XLineDashItem::HasMetrics() const @@ -1061,26 +1040,16 @@ SfxPoolItem* XLineWidthItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const bool XLineWidthItem::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 = GetMetricText( (long) GetValue(), - eCoreUnit, ePresUnit, pIntl) + - " " + EE_RESSTR( GetMetricId( ePresUnit) ); - return true; - default: - return false; - } + rText = GetMetricText( (long) GetValue(), + eCoreUnit, ePresUnit, pIntl) + + " " + EE_RESSTR( GetMetricId( ePresUnit) ); + return true; } bool XLineWidthItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const @@ -1135,24 +1104,14 @@ SfxPoolItem* XLineColorItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const bool XLineColorItem::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 = GetName(); - return true; - default: - return false; - } + rText = GetName(); + return true; } bool XLineColorItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const @@ -1333,24 +1292,14 @@ SvStream& XLineStartItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const bool XLineStartItem::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 = GetName(); - return true; - default: - return false; - } + rText = GetName(); + return true; } bool XLineStartItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const @@ -1908,24 +1857,14 @@ XLineEndItem* XLineEndItem::checkForUniqueItem( SdrModel* pModel ) const bool XLineEndItem::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 = GetName(); - return true; - default: - return false; - } + rText = GetName(); + return true; } bool XLineEndItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const @@ -2000,26 +1939,16 @@ SfxPoolItem* XLineStartWidthItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) con bool XLineStartWidthItem::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 = GetMetricText( (long) GetValue(), - eCoreUnit, ePresUnit, pIntl) + - " " + EE_RESSTR( GetMetricId( ePresUnit) ); - return true; - default: - return false; - } + rText = GetMetricText( (long) GetValue(), + eCoreUnit, ePresUnit, pIntl) + + " " + EE_RESSTR( GetMetricId( ePresUnit) ); + return true; } bool XLineStartWidthItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const @@ -2062,26 +1991,16 @@ SfxPoolItem* XLineEndWidthItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const bool XLineEndWidthItem::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 = GetMetricText( (long) GetValue(), - eCoreUnit, ePresUnit, pIntl) + - " " + EE_RESSTR( GetMetricId( ePresUnit) ); - return true; - default: - return false; - } + rText = GetMetricText( (long) GetValue(), + eCoreUnit, ePresUnit, pIntl) + + " " + EE_RESSTR( GetMetricId( ePresUnit) ); + return true; } bool XLineEndWidthItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const @@ -2124,25 +2043,15 @@ SfxPoolItem* XLineStartCenterItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) co bool XLineStartCenterItem::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 = OUString( ResId( GetValue() ? RID_SVXSTR_CENTERED : - RID_SVXSTR_NOTCENTERED, DIALOG_MGR() ) ); - return true; - default: - return false; - } + rText = OUString( ResId( GetValue() ? RID_SVXSTR_CENTERED : + RID_SVXSTR_NOTCENTERED, DIALOG_MGR() ) ); + return true; } bool XLineStartCenterItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const @@ -2187,25 +2096,15 @@ SfxPoolItem* XLineEndCenterItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) cons bool XLineEndCenterItem::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 = OUString( ResId( GetValue() ? RID_SVXSTR_CENTERED : - RID_SVXSTR_NOTCENTERED, DIALOG_MGR() ) ); - return true; - default: - return false; - } + rText = OUString( ResId( GetValue() ? RID_SVXSTR_CENTERED : + RID_SVXSTR_NOTCENTERED, DIALOG_MGR() ) ); + return true; } bool XLineEndCenterItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const @@ -2252,7 +2151,7 @@ SfxPoolItem* XFillStyleItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const bool XFillStyleItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * @@ -2260,42 +2159,30 @@ bool XFillStyleItem::GetPresentation { rText = OUString(); - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - return false; - - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - sal_uInt16 nId = 0; - - switch( (sal_uInt16)GetValue() ) - { - case drawing::FillStyle_NONE: - nId = RID_SVXSTR_INVISIBLE; - break; - case drawing::FillStyle_SOLID: - nId = RID_SVXSTR_SOLID; - break; - case drawing::FillStyle_GRADIENT: - nId = RID_SVXSTR_GRADIENT; - break; - case drawing::FillStyle_HATCH: - nId = RID_SVXSTR_HATCH; - break; - case drawing::FillStyle_BITMAP: - nId = RID_SVXSTR_BITMAP; - break; - } + sal_uInt16 nId = 0; - if ( nId ) - rText = SVX_RESSTR( nId ); - return true; - } - default: - return false; + switch( (sal_uInt16)GetValue() ) + { + case drawing::FillStyle_NONE: + nId = RID_SVXSTR_INVISIBLE; + break; + case drawing::FillStyle_SOLID: + nId = RID_SVXSTR_SOLID; + break; + case drawing::FillStyle_GRADIENT: + nId = RID_SVXSTR_GRADIENT; + break; + case drawing::FillStyle_HATCH: + nId = RID_SVXSTR_HATCH; + break; + case drawing::FillStyle_BITMAP: + nId = RID_SVXSTR_BITMAP; + break; } + + if ( nId ) + rText = SVX_RESSTR( nId ); + return true; } sal_uInt16 XFillStyleItem::GetValueCount() const @@ -2360,24 +2247,14 @@ SfxPoolItem* XFillColorItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const bool XFillColorItem::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 = GetName(); - return true; - default: - return false; - } + rText = GetName(); + return true; } bool XFillColorItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const @@ -2431,24 +2308,14 @@ sal_uInt16 XSecondaryFillColorItem::GetVersion( sal_uInt16 /*nFileFormatVersion* bool XSecondaryFillColorItem::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 = GetName(); - return true; - default: - return false; - } + rText = GetName(); + return true; } // class XGradient @@ -2634,24 +2501,14 @@ sal_uInt16 XFillGradientItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/) con bool XFillGradientItem::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 = GetName(); - return true; - default: - return false; - } + rText = GetName(); + return true; } bool XFillGradientItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const @@ -3110,24 +2967,14 @@ SvStream& XFillHatchItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const bool XFillHatchItem::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 = GetName(); - return true; - default: - return false; - } + rText = GetName(); + return true; } bool XFillHatchItem::HasMetrics() const diff --git a/svx/source/xoutdev/xattr2.cxx b/svx/source/xoutdev/xattr2.cxx index 4e283d5b1914..cd03b2b08e7e 100644 --- a/svx/source/xoutdev/xattr2.cxx +++ b/svx/source/xoutdev/xattr2.cxx @@ -68,8 +68,6 @@ bool XLineTransparenceItem::GetPresentation switch ( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - return false; case SFX_ITEM_PRESENTATION_COMPLETE: rText = OUString( ResId( RID_SVXSTR_TRANSPARENCE, DIALOG_MGR() ) ) + ": "; case SFX_ITEM_PRESENTATION_NAMELESS: @@ -115,55 +113,44 @@ SfxPoolItem* XLineJointItem::Clone(SfxItemPool* /*pPool*/) const return new XLineJointItem( *this ); } -bool XLineJointItem::GetPresentation( SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, +bool XLineJointItem::GetPresentation( SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper*) const { rText = OUString(); - switch( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: return false; - - case SFX_ITEM_PRESENTATION_COMPLETE: - case SFX_ITEM_PRESENTATION_NAMELESS: - { - sal_uInt16 nId = 0; + sal_uInt16 nId = 0; - switch( GetValue() ) - { - case( com::sun::star::drawing::LineJoint_MAKE_FIXED_SIZE ): - case( com::sun::star::drawing::LineJoint_NONE ): - nId = RID_SVXSTR_LINEJOINT_NONE; - break; + switch( GetValue() ) + { + case( com::sun::star::drawing::LineJoint_MAKE_FIXED_SIZE ): + case( com::sun::star::drawing::LineJoint_NONE ): + nId = RID_SVXSTR_LINEJOINT_NONE; + break; - case( com::sun::star::drawing::LineJoint_MIDDLE ): - nId = RID_SVXSTR_LINEJOINT_MIDDLE; - break; + case( com::sun::star::drawing::LineJoint_MIDDLE ): + nId = RID_SVXSTR_LINEJOINT_MIDDLE; + break; - case( com::sun::star::drawing::LineJoint_BEVEL ): - nId = RID_SVXSTR_LINEJOINT_BEVEL; - break; + case( com::sun::star::drawing::LineJoint_BEVEL ): + nId = RID_SVXSTR_LINEJOINT_BEVEL; + break; - case( com::sun::star::drawing::LineJoint_MITER ): - nId = RID_SVXSTR_LINEJOINT_MITER; - break; + case( com::sun::star::drawing::LineJoint_MITER ): + nId = RID_SVXSTR_LINEJOINT_MITER; + break; - case( com::sun::star::drawing::LineJoint_ROUND ): - nId = RID_SVXSTR_LINEJOINT_ROUND; - break; - } + case( com::sun::star::drawing::LineJoint_ROUND ): + nId = RID_SVXSTR_LINEJOINT_ROUND; + break; + } - if( nId ) - rText = SVX_RESSTR( nId ); + if( nId ) + rText = SVX_RESSTR( nId ); - return true; - } - default: - return false; - } + return true; } bool XLineJointItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const @@ -334,43 +321,32 @@ SfxPoolItem* XLineCapItem::Clone(SfxItemPool* /*pPool*/) const return new XLineCapItem( *this ); } -bool XLineCapItem::GetPresentation( SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, +bool XLineCapItem::GetPresentation( SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper*) const { rText = OUString(); - switch( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: return false; + sal_uInt16 nId = 0; - case SFX_ITEM_PRESENTATION_COMPLETE: - case SFX_ITEM_PRESENTATION_NAMELESS: - { - sal_uInt16 nId = 0; - - switch( GetValue() ) - { - default: /*com::sun::star::drawing::LineCap_BUTT*/ - nId = RID_SVXSTR_LINECAP_BUTT; - break; + switch( GetValue() ) + { + default: /*com::sun::star::drawing::LineCap_BUTT*/ + nId = RID_SVXSTR_LINECAP_BUTT; + break; - case(com::sun::star::drawing::LineCap_ROUND): - nId = RID_SVXSTR_LINECAP_ROUND; - break; + case(com::sun::star::drawing::LineCap_ROUND): + nId = RID_SVXSTR_LINECAP_ROUND; + break; - case(com::sun::star::drawing::LineCap_SQUARE): - nId = RID_SVXSTR_LINECAP_SQUARE; - break; - } + case(com::sun::star::drawing::LineCap_SQUARE): + nId = RID_SVXSTR_LINECAP_SQUARE; + break; + } - if( nId ) - rText = SVX_RESSTR( nId ); + if( nId ) + rText = SVX_RESSTR( nId ); - return true; - } - default: - return false; - } + return true; } bool XLineCapItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const @@ -458,8 +434,6 @@ bool XFillTransparenceItem::GetPresentation switch ( ePres ) { - case SFX_ITEM_PRESENTATION_NONE: - return false; case SFX_ITEM_PRESENTATION_COMPLETE: rText = OUString( ResId( RID_SVXSTR_TRANSPARENCE, DIALOG_MGR() ) ) + ": "; case SFX_ITEM_PRESENTATION_NAMELESS: @@ -521,7 +495,7 @@ SfxPoolItem* XGradientStepCountItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) bool XGradientStepCountItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * @@ -529,18 +503,8 @@ bool XGradientStepCountItem::GetPresentation { rText = OUString(); - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - return false; - case SFX_ITEM_PRESENTATION_COMPLETE: -// rText = OUString( ResId( RID_SVXSTR_GRADIENTSTEPCOUNT, DIALOG_MGR() ) ) + ": "; - case SFX_ITEM_PRESENTATION_NAMELESS: - rText += OUString::number(GetValue()); - return true; - default: - return false; - } + rText += OUString::number(GetValue()); + return true; } // class XFillBmpTileItem @@ -569,24 +533,14 @@ SfxPoolItem* XFillBmpTileItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const bool XFillBmpTileItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * ) const { rText = OUString(); - - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - return false; - case SFX_ITEM_PRESENTATION_COMPLETE: - case SFX_ITEM_PRESENTATION_NAMELESS: - return true; - default: - return false; - } + return true; } // class XFillBmpTilePosItem @@ -615,24 +569,14 @@ SfxPoolItem* XFillBmpPosItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const bool XFillBmpPosItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * ) const { rText = OUString(); - - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - return false; - case SFX_ITEM_PRESENTATION_COMPLETE: - case SFX_ITEM_PRESENTATION_NAMELESS: - return true; - default: - return false; - } + return true; } sal_uInt16 XFillBmpPosItem::GetValueCount() const @@ -666,24 +610,14 @@ SfxPoolItem* XFillBmpSizeXItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) cons bool XFillBmpSizeXItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * ) const { rText = OUString(); - - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - return false; - case SFX_ITEM_PRESENTATION_COMPLETE: - case SFX_ITEM_PRESENTATION_NAMELESS: - return true; - default: - return false; - } + return true; } bool XFillBmpSizeXItem::HasMetrics() const @@ -717,24 +651,14 @@ SfxPoolItem* XFillBmpSizeYItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) cons bool XFillBmpSizeYItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * ) const { rText = OUString(); - - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - return false; - case SFX_ITEM_PRESENTATION_COMPLETE: - case SFX_ITEM_PRESENTATION_NAMELESS: - return true; - default: - return false; - } + return true; } bool XFillBmpSizeYItem::HasMetrics() const @@ -768,24 +692,14 @@ SfxPoolItem* XFillBmpSizeLogItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) co bool XFillBmpSizeLogItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * ) const { rText = OUString(); - - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - return false; - case SFX_ITEM_PRESENTATION_COMPLETE: - case SFX_ITEM_PRESENTATION_NAMELESS: - return true; - default: - return false; - } + return true; } // class XFillBmpTileOffXItem @@ -814,24 +728,14 @@ SfxPoolItem* XFillBmpTileOffsetXItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/ bool XFillBmpTileOffsetXItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * ) const { rText = OUString(); - - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - return false; - case SFX_ITEM_PRESENTATION_COMPLETE: - case SFX_ITEM_PRESENTATION_NAMELESS: - return true; - default: - return false; - } + return true; } // class XFillBmpTileOffYItem @@ -860,24 +764,14 @@ SfxPoolItem* XFillBmpTileOffsetYItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/ bool XFillBmpTileOffsetYItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * ) const { rText = OUString(); - - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - return false; - case SFX_ITEM_PRESENTATION_COMPLETE: - case SFX_ITEM_PRESENTATION_NAMELESS: - return true; - default: - return false; - } + return true; } // class XFillBmpStretchItem @@ -906,24 +800,14 @@ SfxPoolItem* XFillBmpStretchItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) co bool XFillBmpStretchItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * ) const { rText = OUString(); - - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - return false; - case SFX_ITEM_PRESENTATION_COMPLETE: - case SFX_ITEM_PRESENTATION_NAMELESS: - return true; - default: - return false; - } + return true; } // class XFillBmpTileOffPosXItem @@ -952,24 +836,14 @@ SfxPoolItem* XFillBmpPosOffsetXItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) bool XFillBmpPosOffsetXItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * ) const { rText = OUString(); - - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - return false; - case SFX_ITEM_PRESENTATION_COMPLETE: - case SFX_ITEM_PRESENTATION_NAMELESS: - return true; - default: - return false; - } + return true; } // class XFillBmpTileOffPosYItem @@ -998,24 +872,14 @@ SfxPoolItem* XFillBmpPosOffsetYItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) bool XFillBmpPosOffsetYItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * ) const { rText = OUString(); - - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - return false; - case SFX_ITEM_PRESENTATION_COMPLETE: - case SFX_ITEM_PRESENTATION_NAMELESS: - return true; - default: - return false; - } + return true; } // class XFillBackgroundItem @@ -1042,22 +906,11 @@ SfxPoolItem* XFillBackgroundItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) con return new XFillBackgroundItem( rIn ); } -bool XFillBackgroundItem::GetPresentation( SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, +bool XFillBackgroundItem::GetPresentation( SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper*) const { rText = OUString(); - - switch( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - return false; - - case SFX_ITEM_PRESENTATION_COMPLETE: - case SFX_ITEM_PRESENTATION_NAMELESS: - return true; - default: - return false; - } + return true; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx index ed12a6217f48..b7cce270d38a 100644 --- a/svx/source/xoutdev/xattrbmp.cxx +++ b/svx/source/xoutdev/xattrbmp.cxx @@ -382,24 +382,14 @@ sal_uInt16 XFillBitmapItem::GetVersion(sal_uInt16 /*nFileFormatVersion*/) const } bool XFillBitmapItem::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 += GetName(); - return true; - default: - return false; - } + rText += GetName(); + return true; } bool XFillBitmapItem::QueryValue(::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId) const diff --git a/sw/source/uibase/utlui/attrdesc.cxx b/sw/source/uibase/utlui/attrdesc.cxx index ebcda5e23d86..5984a257cde1 100644 --- a/sw/source/uibase/utlui/attrdesc.cxx +++ b/sw/source/uibase/utlui/attrdesc.cxx @@ -100,104 +100,56 @@ bool SwFmtCharFmt::GetPresentation const IntlWrapper* /*pIntl*/ ) const { - switch ( ePres ) + const SwCharFmt *pCharFmt = GetCharFmt(); + if ( pCharFmt ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - break; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - const SwCharFmt *pCharFmt = GetCharFmt(); - if ( pCharFmt ) - { - OUString aStr; - rText = OUString( SW_RESSTR( STR_CHARFMT ) ); - pCharFmt->GetPresentation( ePres, eCoreUnit, ePresUnit, aStr ); - rText = rText + "(" + aStr + ")"; - } - else - rText = OUString( SW_RESSTR( STR_NO_CHARFMT ) ); - return true; - } - default:;//prevent warning + OUString aStr; + rText = OUString( SW_RESSTR( STR_CHARFMT ) ); + pCharFmt->GetPresentation( ePres, eCoreUnit, ePresUnit, aStr ); + rText = rText + "(" + aStr + ")"; } - return false; + else + rText = OUString( SW_RESSTR( STR_NO_CHARFMT ) ); + return true; } bool SwFmtAutoFmt::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, 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 = OUString(); //TODO - return true; - } - default:;//prevent warning - } - return false; + rText = OUString(); //TODO + return true; } bool SwFmtINetFmt::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, 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(); - return true; - } - default:;//prevent warning - } - return false; + rText = GetValue(); + return true; } -bool SwFmtRuby::GetPresentation( SfxItemPresentation ePres, +bool SwFmtRuby::GetPresentation( 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 = OUString(); - return true; - } - default:;//prevent warning - } - return false; + rText = OUString(); + return true; } bool SwFmtDrop::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, @@ -205,169 +157,108 @@ bool SwFmtDrop::GetPresentation ) const { rText = OUString(); - switch ( ePres ) + if ( GetLines() > 1 ) { - case SFX_ITEM_PRESENTATION_NONE: - break; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: + if ( GetChars() > 1 ) { - if ( GetLines() > 1 ) - { - if ( GetChars() > 1 ) - { - rText = OUString::number( GetChars() ) + " "; - } - rText = rText + - OUString( SW_RESSTR( STR_DROP_OVER ) ) + - " " + - OUString::number( GetLines() ) + - " " + - OUString( SW_RESSTR( STR_DROP_LINES ) ); - } - else - rText = SW_RESSTR( STR_NO_DROP_LINES ); - return true; + rText = OUString::number( GetChars() ) + " "; } - default:;//prevent warning + rText = rText + + OUString( SW_RESSTR( STR_DROP_OVER ) ) + + " " + + OUString::number( GetLines() ) + + " " + + OUString( SW_RESSTR( STR_DROP_LINES ) ); } - return false; + else + rText = SW_RESSTR( STR_NO_DROP_LINES ); + return true; } bool SwRegisterItem::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: - { - const sal_uInt16 nId = GetValue() ? STR_REGISTER_ON : STR_REGISTER_OFF; - rText = SW_RESSTR( nId ); - return true; - } - default:;//prevent warning - } - return false; + const sal_uInt16 nId = GetValue() ? STR_REGISTER_ON : STR_REGISTER_OFF; + rText = SW_RESSTR( nId ); + return true; } bool SwNumRuleItem::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: - { - if( !GetValue().isEmpty() ) - rText = SW_RESSTR( STR_NUMRULE_ON ) + - "(" + GetValue() + ")"; - else - rText = SW_RESSTR( STR_NUMRULE_OFF ); - return true; - } - default:;//prevent warning - } - return false; + if( !GetValue().isEmpty() ) + rText = SW_RESSTR( STR_NUMRULE_ON ) + + "(" + GetValue() + ")"; + else + rText = SW_RESSTR( STR_NUMRULE_OFF ); + return true; } bool SwParaConnectBorderItem::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: - { - const sal_uInt16 nId = GetValue() ? STR_CONNECT_BORDER_ON : STR_CONNECT_BORDER_OFF; - rText = SW_RESSTR( nId ); - return true; - } - default:;//prevent warning - } - return false; + const sal_uInt16 nId = GetValue() ? STR_CONNECT_BORDER_ON : STR_CONNECT_BORDER_OFF; + rText = SW_RESSTR( nId ); + return true; } // Frame attribute bool SwFmtFrmSize::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit eCoreUnit, SfxMapUnit ePresUnit, OUString& rText, const IntlWrapper* pIntl ) const { - switch ( ePres ) + rText = SW_RESSTR( STR_FRM_WIDTH ) + " "; + if ( GetWidthPercent() ) { - case SFX_ITEM_PRESENTATION_NONE: + rText = rText + unicode::formatPercent(GetWidthPercent(), + Application::GetSettings().GetUILanguageTag()); + } + else + { + rText = rText + ::GetMetricText( GetWidth(), eCoreUnit, ePresUnit, pIntl ) + + " " + ::GetSvxString( ::GetMetricId( ePresUnit ) ); + } + if ( ATT_VAR_SIZE != GetHeightSizeType() ) + { + const sal_uInt16 nId = ATT_FIX_SIZE == m_eFrmHeightType ? + STR_FRM_FIXEDHEIGHT : STR_FRM_MINHEIGHT; + rText = rText + ", " + SW_RESSTR( nId ) + " "; + if ( GetHeightPercent() ) { - rText = OUString(); - break; + rText = rText + unicode::formatPercent(GetHeightPercent(), + Application::GetSettings().GetUILanguageTag()); } - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: + else { - rText = SW_RESSTR( STR_FRM_WIDTH ) + " "; - if ( GetWidthPercent() ) - { - rText = rText + unicode::formatPercent(GetWidthPercent(), - Application::GetSettings().GetUILanguageTag()); - } - else - { - rText = rText + ::GetMetricText( GetWidth(), eCoreUnit, ePresUnit, pIntl ) + + rText = OUString( ::GetMetricText( GetHeight(), eCoreUnit, ePresUnit, pIntl ) ) + " " + ::GetSvxString( ::GetMetricId( ePresUnit ) ); - } - if ( ATT_VAR_SIZE != GetHeightSizeType() ) - { - const sal_uInt16 nId = ATT_FIX_SIZE == m_eFrmHeightType ? - STR_FRM_FIXEDHEIGHT : STR_FRM_MINHEIGHT; - rText = rText + ", " + SW_RESSTR( nId ) + " "; - if ( GetHeightPercent() ) - { - rText = rText + unicode::formatPercent(GetHeightPercent(), - Application::GetSettings().GetUILanguageTag()); - } - else - { - rText = OUString( ::GetMetricText( GetHeight(), eCoreUnit, ePresUnit, pIntl ) ) + - " " + ::GetSvxString( ::GetMetricId( ePresUnit ) ); - } - } - return true; } - default:;//prevent warning } - return false; + return true; } //Header for page formats. @@ -375,28 +266,16 @@ bool SwFmtFrmSize::GetPresentation bool SwFmtHeader::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, 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: - { - const sal_uInt16 nId = GetHeaderFmt() ? STR_HEADER : STR_NO_HEADER; - rText = SW_RESSTR( nId ); - return true; - } - default:;//prevent warning - } - return false; + const sal_uInt16 nId = GetHeaderFmt() ? STR_HEADER : STR_NO_HEADER; + rText = SW_RESSTR( nId ); + return true; } //Footer for page formats. @@ -404,316 +283,232 @@ bool SwFmtHeader::GetPresentation bool SwFmtFooter::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, 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: - { - const sal_uInt16 nId = GetFooterFmt() ? STR_FOOTER : STR_NO_FOOTER; - rText = SW_RESSTR( nId ); - return true; - } - default:;//prevent warning - } - return false; + const sal_uInt16 nId = GetFooterFmt() ? STR_FOOTER : STR_NO_FOOTER; + rText = SW_RESSTR( nId ); + return true; } bool SwFmtSurround::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper* /*pIntl*/ ) const { - switch ( ePres ) + sal_uInt16 nId = 0; + switch ( (SwSurround)GetValue() ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - break; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - sal_uInt16 nId = 0; - switch ( (SwSurround)GetValue() ) - { - case SURROUND_NONE: - nId = STR_SURROUND_NONE; - break; - case SURROUND_THROUGHT: - nId = STR_SURROUND_THROUGHT; - break; - case SURROUND_PARALLEL: - nId = STR_SURROUND_PARALLEL; - break; - case SURROUND_IDEAL: - nId = STR_SURROUND_IDEAL; - break; - case SURROUND_LEFT: - nId = STR_SURROUND_LEFT; - break; - case SURROUND_RIGHT: - nId = STR_SURROUND_RIGHT; - break; - default:;//prevent warning - } - if ( nId ) - rText = SW_RESSTR( nId ); - - if ( IsAnchorOnly() ) - { - rText = rText + " " + SW_RESSTR( STR_SURROUND_ANCHORONLY ); - } - return true; - } + case SURROUND_NONE: + nId = STR_SURROUND_NONE; + break; + case SURROUND_THROUGHT: + nId = STR_SURROUND_THROUGHT; + break; + case SURROUND_PARALLEL: + nId = STR_SURROUND_PARALLEL; + break; + case SURROUND_IDEAL: + nId = STR_SURROUND_IDEAL; + break; + case SURROUND_LEFT: + nId = STR_SURROUND_LEFT; + break; + case SURROUND_RIGHT: + nId = STR_SURROUND_RIGHT; + break; default:;//prevent warning } - return false; + if ( nId ) + rText = SW_RESSTR( nId ); + + if ( IsAnchorOnly() ) + { + rText = rText + " " + SW_RESSTR( STR_SURROUND_ANCHORONLY ); + } + return true; } //VertOrientation, how and by what orientate the FlyFrm in the vertical? bool SwFmtVertOrient::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit eCoreUnit, SfxMapUnit ePresUnit, OUString& rText, const IntlWrapper* pIntl ) const { - switch ( ePres ) + sal_uInt16 nId = 0; + switch ( GetVertOrient() ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - break; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: + case text::VertOrientation::NONE: { - sal_uInt16 nId = 0; - switch ( GetVertOrient() ) - { - case text::VertOrientation::NONE: - { - rText = rText + SW_RESSTR( STR_POS_Y ) + " " + - ::GetMetricText( GetPos(), eCoreUnit, ePresUnit, pIntl ) + - " " + ::GetSvxString( ::GetMetricId( ePresUnit ) ); - } - break; - case text::VertOrientation::TOP: - nId = STR_VERT_TOP; - break; - case text::VertOrientation::CENTER: - nId = STR_VERT_CENTER; - break; - case text::VertOrientation::BOTTOM: - nId = STR_VERT_BOTTOM; - break; - case text::VertOrientation::LINE_TOP: - nId = STR_LINE_TOP; - break; - case text::VertOrientation::LINE_CENTER: - nId = STR_LINE_CENTER; - break; - case text::VertOrientation::LINE_BOTTOM: - nId = STR_LINE_BOTTOM; - break; - default:;//prevent warning - } - if ( nId ) - rText += SW_RESSTR( nId ); - return true; + rText = rText + SW_RESSTR( STR_POS_Y ) + " " + + ::GetMetricText( GetPos(), eCoreUnit, ePresUnit, pIntl ) + + " " + ::GetSvxString( ::GetMetricId( ePresUnit ) ); } + break; + case text::VertOrientation::TOP: + nId = STR_VERT_TOP; + break; + case text::VertOrientation::CENTER: + nId = STR_VERT_CENTER; + break; + case text::VertOrientation::BOTTOM: + nId = STR_VERT_BOTTOM; + break; + case text::VertOrientation::LINE_TOP: + nId = STR_LINE_TOP; + break; + case text::VertOrientation::LINE_CENTER: + nId = STR_LINE_CENTER; + break; + case text::VertOrientation::LINE_BOTTOM: + nId = STR_LINE_BOTTOM; + break; default:;//prevent warning } - return false; + if ( nId ) + rText += SW_RESSTR( nId ); + return true; } //HoriOrientation, how and by what orientate the FlyFrm in the horizontal? bool SwFmtHoriOrient::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit eCoreUnit, SfxMapUnit ePresUnit, OUString& rText, const IntlWrapper* pIntl ) const { - switch ( ePres ) + sal_uInt16 nId = 0; + switch ( GetHoriOrient() ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - break; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: + case text::HoriOrientation::NONE: { - sal_uInt16 nId = 0; - switch ( GetHoriOrient() ) - { - case text::HoriOrientation::NONE: - { - rText = rText + SW_RESSTR( STR_POS_X ) + " " + - ::GetMetricText( GetPos(), eCoreUnit, ePresUnit, pIntl ) + - " " + ::GetSvxString( ::GetMetricId( ePresUnit ) ); - } - break; - case text::HoriOrientation::RIGHT: - nId = STR_HORI_RIGHT; - break; - case text::HoriOrientation::CENTER: - nId = STR_HORI_CENTER; - break; - case text::HoriOrientation::LEFT: - nId = STR_HORI_LEFT; - break; - case text::HoriOrientation::INSIDE: - nId = STR_HORI_INSIDE; - break; - case text::HoriOrientation::OUTSIDE: - nId = STR_HORI_OUTSIDE; - break; - case text::HoriOrientation::FULL: - nId = STR_HORI_FULL; - break; - default:;//prevent warning - } - if ( nId ) - rText += SW_RESSTR( nId ); - return true; + rText = rText + SW_RESSTR( STR_POS_X ) + " " + + ::GetMetricText( GetPos(), eCoreUnit, ePresUnit, pIntl ) + + " " + ::GetSvxString( ::GetMetricId( ePresUnit ) ); } + break; + case text::HoriOrientation::RIGHT: + nId = STR_HORI_RIGHT; + break; + case text::HoriOrientation::CENTER: + nId = STR_HORI_CENTER; + break; + case text::HoriOrientation::LEFT: + nId = STR_HORI_LEFT; + break; + case text::HoriOrientation::INSIDE: + nId = STR_HORI_INSIDE; + break; + case text::HoriOrientation::OUTSIDE: + nId = STR_HORI_OUTSIDE; + break; + case text::HoriOrientation::FULL: + nId = STR_HORI_FULL; + break; default:;//prevent warning } - return false; + if ( nId ) + rText += SW_RESSTR( nId ); + return true; } // FlyAnchor, Anchor of the free-flying frame bool SwFmtAnchor::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper* /*pIntl*/ ) const { - switch ( ePres ) + sal_uInt16 nId = 0; + switch ( GetAnchorId() ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); + case FLY_AT_PARA: + nId = STR_FLY_AT_PARA; + break; + case FLY_AS_CHAR: + nId = STR_FLY_AS_CHAR; + break; + case FLY_AT_PAGE: + nId = STR_FLY_AT_PAGE; break; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - sal_uInt16 nId = 0; - switch ( GetAnchorId() ) - { - case FLY_AT_PARA: - nId = STR_FLY_AT_PARA; - break; - case FLY_AS_CHAR: - nId = STR_FLY_AS_CHAR; - break; - case FLY_AT_PAGE: - nId = STR_FLY_AT_PAGE; - break; - default:;//prevent warning - } - if ( nId ) - rText += SW_RESSTR( nId ); - return true; - } default:;//prevent warning } - return false; + if ( nId ) + rText += SW_RESSTR( nId ); + return true; } bool SwFmtPageDesc::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, 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: - { - const SwPageDesc *pPageDesc = GetPageDesc(); - if ( pPageDesc ) - rText = pPageDesc->GetName(); - else - rText = SW_RESSTR( STR_NO_PAGEDESC ); - return true; - } - default:;//prevent warning - } - return false; + const SwPageDesc *pPageDesc = GetPageDesc(); + if ( pPageDesc ) + rText = pPageDesc->GetName(); + else + rText = SW_RESSTR( STR_NO_PAGEDESC ); + return true; } //The ColumnDescriptor bool SwFmtCol::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit eCoreUnit, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper* pIntl ) const { - switch ( ePres ) + sal_uInt16 nCnt = GetNumCols(); + if ( nCnt > 1 ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - break; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: + rText = OUString::number(nCnt) + " " + SW_RESSTR( STR_COLUMNS ); + if ( COLADJ_NONE != GetLineAdj() ) { - sal_uInt16 nCnt = GetNumCols(); - if ( nCnt > 1 ) - { - rText = OUString::number(nCnt) + " " + SW_RESSTR( STR_COLUMNS ); - if ( COLADJ_NONE != GetLineAdj() ) - { - const long nWdth = static_cast<long>(GetLineWidth()); - rText = rText + " " + SW_RESSTR( STR_LINE_WIDTH ) + " " + - ::GetMetricText( nWdth, eCoreUnit, - SFX_MAPUNIT_POINT, pIntl ); - } - } - else - rText = OUString(); - return true; + const long nWdth = static_cast<long>(GetLineWidth()); + rText = rText + " " + SW_RESSTR( STR_LINE_WIDTH ) + " " + + ::GetMetricText( nWdth, eCoreUnit, + SFX_MAPUNIT_POINT, pIntl ); } - default:;//prevent warning } - return false; + else + rText = OUString(); + return true; } //URL's and maps bool SwFmtURL::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, @@ -721,37 +516,26 @@ bool SwFmtURL::GetPresentation ) const { rText = OUString(); - switch ( ePres ) + if ( pMap ) + rText += "Client-Map"; + if ( !sURL.isEmpty() ) { - case SFX_ITEM_PRESENTATION_NONE: - break; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - if ( pMap ) - rText += "Client-Map"; - if ( !sURL.isEmpty() ) - { - if ( pMap ) - rText += " - "; - rText = rText + "URL: " + sURL; - if ( bIsServerMap ) - rText += " (Server-Map)"; - } - if ( !sTargetFrameName.isEmpty() ) - { - rText = rText + ", Target: " + sTargetFrameName; - } - return true; - } - default:;//prevent warning + if ( pMap ) + rText += " - "; + rText = rText + "URL: " + sURL; + if ( bIsServerMap ) + rText += " (Server-Map)"; } - return false; + if ( !sTargetFrameName.isEmpty() ) + { + rText = rText + ", Target: " + sTargetFrameName; + } + return true; } bool SwFmtEditInReadonly::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, @@ -759,47 +543,23 @@ bool SwFmtEditInReadonly::GetPresentation ) const { rText = OUString(); - switch ( ePres ) - { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - break; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - if ( GetValue() ) - rText = SW_RESSTR(STR_EDIT_IN_READONLY); - return true; - } - default:;//prevent warning - } - return false; + if ( GetValue() ) + rText = SW_RESSTR(STR_EDIT_IN_READONLY); + return true; } bool SwFmtLayoutSplit::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: - { - if ( GetValue() ) - rText = SW_RESSTR(STR_LAYOUT_SPLIT); - return true; - } - default:;//prevent warning - } - return false; + if ( GetValue() ) + rText = SW_RESSTR(STR_LAYOUT_SPLIT); + return true; } bool SwFmtRowSplit::GetPresentation @@ -816,151 +576,87 @@ bool SwFmtRowSplit::GetPresentation bool SwFmtFtnEndAtTxtEnd::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, - OUString& rText, + 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: - { - switch( GetValue() ) - { - case FTNEND_ATPGORDOCEND: - break; - - case FTNEND_ATTXTEND: - break; - - case FTNEND_ATTXTEND_OWNNUMSEQ: - break; - } - } - break; - - default: - ePres = SFX_ITEM_PRESENTATION_NONE; - break; - } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } bool SwFmtChain::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper* /*pIntl*/ ) const { - switch ( ePres ) + if ( GetPrev() || GetNext() ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: + rText = SW_RESSTR(STR_CONNECT1); + if ( GetPrev() ) { - if ( GetPrev() || GetNext() ) - { - rText = SW_RESSTR(STR_CONNECT1); - if ( GetPrev() ) - { - rText += GetPrev()->GetName(); - if ( GetNext() ) - rText += SW_RESSTR(STR_CONNECT2); - } - if ( GetNext() ) - rText += GetNext()->GetName(); - } - return true; + rText += GetPrev()->GetName(); + if ( GetNext() ) + rText += SW_RESSTR(STR_CONNECT2); } - default:;//prevent warning + if ( GetNext() ) + rText += GetNext()->GetName(); } - return false; + return true; } bool SwFmtLineNumber::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper* /*pIntl*/ ) const { - switch ( ePres ) + if ( IsCount() ) + rText += SW_RESSTR(STR_LINECOUNT); + else + rText += SW_RESSTR(STR_DONTLINECOUNT); + if ( GetStartValue() ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - if ( IsCount() ) - rText += SW_RESSTR(STR_LINECOUNT); - else - rText += SW_RESSTR(STR_DONTLINECOUNT); - if ( GetStartValue() ) - { - rText = rText + " " + SW_RESSTR(STR_LINCOUNT_START) + - OUString::number( GetStartValue() ); - } - return true; - } - default:;//prevent warning + rText = rText + " " + SW_RESSTR(STR_LINCOUNT_START) + + OUString::number( GetStartValue() ); } - return false; + return true; } bool SwTextGridItem::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 = 0; + sal_uInt16 nId = 0; - switch ( GetGridType() ) - { - case GRID_NONE : - nId = STR_GRID_NONE; - break; - case GRID_LINES_ONLY : - nId = STR_GRID_LINES_ONLY; - break; - case GRID_LINES_CHARS : - nId = STR_GRID_LINES_CHARS; - break; - } - if ( nId ) - rText += SW_RESSTR( nId ); - return true; - } - default:;//prevent warning + switch ( GetGridType() ) + { + case GRID_NONE : + nId = STR_GRID_NONE; + break; + case GRID_LINES_ONLY : + nId = STR_GRID_LINES_ONLY; + break; + case GRID_LINES_CHARS : + nId = STR_GRID_LINES_CHARS; + break; } - - return false; + if ( nId ) + rText += SW_RESSTR( nId ); + return true; } bool SwHeaderAndFooterEatSpacingItem::GetPresentation @@ -978,145 +674,89 @@ bool SwHeaderAndFooterEatSpacingItem::GetPresentation // Graphic attributes bool SwMirrorGrf::GetPresentation( - SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, + SfxItemPresentation /*ePres*/, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper* /*pIntl*/ ) const { - switch ( ePres ) + sal_uInt16 nId; + switch( GetValue() ) { - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - sal_uInt16 nId; - switch( GetValue() ) - { - case RES_MIRROR_GRAPH_DONT: nId = STR_NO_MIRROR; break; - case RES_MIRROR_GRAPH_VERT: nId = STR_VERT_MIRROR; break; - case RES_MIRROR_GRAPH_HOR: nId = STR_HORI_MIRROR; break; - case RES_MIRROR_GRAPH_BOTH: nId = STR_BOTH_MIRROR; break; - default: nId = 0; break; - } - if ( nId ) - { - rText = SW_RESSTR( nId ); - if (bGrfToggle) - rText += SW_RESSTR( STR_MIRROR_TOGGLE ); - } - } - break; - default: - ePres = SFX_ITEM_PRESENTATION_NONE; - rText = OUString(); - break; + case RES_MIRROR_GRAPH_DONT: nId = STR_NO_MIRROR; break; + case RES_MIRROR_GRAPH_VERT: nId = STR_VERT_MIRROR; break; + case RES_MIRROR_GRAPH_HOR: nId = STR_HORI_MIRROR; break; + case RES_MIRROR_GRAPH_BOTH: nId = STR_BOTH_MIRROR; break; + default: nId = 0; break; + } + if ( nId ) + { + rText = SW_RESSTR( nId ); + if (bGrfToggle) + rText += SW_RESSTR( STR_MIRROR_TOGGLE ); } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } bool SwRotationGrf::GetPresentation( SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString &rText, const IntlWrapper* /*pIntl*/) const { - switch( ePres ) - { - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - if( SFX_ITEM_PRESENTATION_COMPLETE == ePres ) - rText = SW_RESSTR( STR_ROTATION ); - else if( rText.getLength() ) - rText = OUString(); - rText = rText + OUString::number( GetValue() ) + "\xB0"; - break; - - default: - ePres = SFX_ITEM_PRESENTATION_NONE; + if( SFX_ITEM_PRESENTATION_COMPLETE == ePres ) + rText = SW_RESSTR( STR_ROTATION ); + else if( rText.getLength() ) rText = OUString(); - break; - } - return ePres != SFX_ITEM_PRESENTATION_NONE; + rText = rText + OUString::number( GetValue() ) + "\xB0"; + return true; } bool SwLuminanceGrf::GetPresentation( SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString &rText, const IntlWrapper* /*pIntl*/) const { - switch( ePres ) - { - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - if( SFX_ITEM_PRESENTATION_COMPLETE == ePres ) - rText = SW_RESSTR( STR_LUMINANCE ); - else if( rText.getLength() ) - rText = OUString(); - rText = rText + unicode::formatPercent(GetValue(), - Application::GetSettings().GetUILanguageTag()); - break; - - default: - ePres = SFX_ITEM_PRESENTATION_NONE; + if( SFX_ITEM_PRESENTATION_COMPLETE == ePres ) + rText = SW_RESSTR( STR_LUMINANCE ); + else if( rText.getLength() ) rText = OUString(); - break; - } - return ePres != SFX_ITEM_PRESENTATION_NONE; + rText = rText + unicode::formatPercent(GetValue(), + Application::GetSettings().GetUILanguageTag()); + return true; } bool SwContrastGrf::GetPresentation( SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString &rText, const IntlWrapper* /*pIntl*/) const { - switch( ePres ) - { - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - if( SFX_ITEM_PRESENTATION_COMPLETE == ePres ) - rText = SW_RESSTR( STR_CONTRAST ); - else if( rText.getLength() ) - rText = OUString(); - rText = rText + unicode::formatPercent(GetValue(), - Application::GetSettings().GetUILanguageTag()); - break; - - default: - ePres = SFX_ITEM_PRESENTATION_NONE; + if( SFX_ITEM_PRESENTATION_COMPLETE == ePres ) + rText = SW_RESSTR( STR_CONTRAST ); + else if( rText.getLength() ) rText = OUString(); - break; - } - return ePres != SFX_ITEM_PRESENTATION_NONE; + rText = rText + unicode::formatPercent(GetValue(), + Application::GetSettings().GetUILanguageTag()); + return true; } bool SwChannelGrf::GetPresentation( SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString &rText, const IntlWrapper* /*pIntl*/) const { - switch( ePres ) + if( SFX_ITEM_PRESENTATION_COMPLETE == ePres ) { - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - if( SFX_ITEM_PRESENTATION_COMPLETE == ePres ) + sal_uInt16 nId; + switch ( Which() ) { - sal_uInt16 nId; - switch ( Which() ) - { - case RES_GRFATR_CHANNELR: nId = STR_CHANNELR; break; - case RES_GRFATR_CHANNELG: nId = STR_CHANNELG; break; - case RES_GRFATR_CHANNELB: nId = STR_CHANNELB; break; - default: nId = 0; break; - } - if( nId ) - rText = SW_RESSTR( nId ); - else if( rText.getLength() ) - rText = OUString(); + case RES_GRFATR_CHANNELR: nId = STR_CHANNELR; break; + case RES_GRFATR_CHANNELG: nId = STR_CHANNELG; break; + case RES_GRFATR_CHANNELB: nId = STR_CHANNELB; break; + default: nId = 0; break; } + if( nId ) + rText = SW_RESSTR( nId ); else if( rText.getLength() ) rText = OUString(); - rText = rText + unicode::formatPercent(GetValue(), - Application::GetSettings().GetUILanguageTag()); - break; - - default: - ePres = SFX_ITEM_PRESENTATION_NONE; - rText = OUString(); - break; } - return ePres != SFX_ITEM_PRESENTATION_NONE; + else if( rText.getLength() ) + rText = OUString(); + rText = rText + unicode::formatPercent(GetValue(), + Application::GetSettings().GetUILanguageTag()); + return true; } bool SwGammaGrf::GetPresentation( @@ -1124,22 +764,12 @@ bool SwGammaGrf::GetPresentation( OUString &rText, const IntlWrapper* /*pIntl*/) const { OUStringBuffer aText; - switch( ePres ) - { - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - if( SFX_ITEM_PRESENTATION_COMPLETE == ePres ) - aText.append(SW_RESSTR(STR_GAMMA)); - aText.append(unicode::formatPercent(GetValue(), - Application::GetSettings().GetUILanguageTag())); - break; - - default: - ePres = SFX_ITEM_PRESENTATION_NONE; - break; - } + if( SFX_ITEM_PRESENTATION_COMPLETE == ePres ) + aText.append(SW_RESSTR(STR_GAMMA)); + aText.append(unicode::formatPercent(GetValue(), + Application::GetSettings().GetUILanguageTag())); rText = aText.makeStringAndClear(); - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } bool SwInvertGrf::GetPresentation( @@ -1147,46 +777,25 @@ bool SwInvertGrf::GetPresentation( OUString &rText, const IntlWrapper* /*pIntl*/) const { rText = OUString(); - switch( ePres ) + if( SFX_ITEM_PRESENTATION_COMPLETE == ePres ) { - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - if( SFX_ITEM_PRESENTATION_COMPLETE == ePres ) - { - const sal_uInt16 nId = GetValue() ? STR_INVERT : STR_INVERT_NOT; - rText = SW_RESSTR( nId ); - } - break; - - default: - ePres = SFX_ITEM_PRESENTATION_NONE; - break; + const sal_uInt16 nId = GetValue() ? STR_INVERT : STR_INVERT_NOT; + rText = SW_RESSTR( nId ); } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } bool SwTransparencyGrf::GetPresentation( SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/, OUString &rText, const IntlWrapper* /*pIntl*/) const { - switch( ePres ) - { - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - if( SFX_ITEM_PRESENTATION_COMPLETE == ePres ) - rText = SW_RESSTR( STR_TRANSPARENCY ); - else if( rText.getLength() ) - rText = OUString(); - rText = rText + unicode::formatPercent(GetValue(), - Application::GetSettings().GetUILanguageTag()); - break; - - default: - ePres = SFX_ITEM_PRESENTATION_NONE; + if( SFX_ITEM_PRESENTATION_COMPLETE == ePres ) + rText = SW_RESSTR( STR_TRANSPARENCY ); + else if( rText.getLength() ) rText = OUString(); - break; - } - return ePres != SFX_ITEM_PRESENTATION_NONE; + rText = rText + unicode::formatPercent(GetValue(), + Application::GetSettings().GetUILanguageTag()); + return true; } bool SwDrawModeGrf::GetPresentation( @@ -1194,30 +803,20 @@ bool SwDrawModeGrf::GetPresentation( OUString &rText, const IntlWrapper* /*pIntl*/) const { rText = OUString(); - switch( ePres ) + if( SFX_ITEM_PRESENTATION_COMPLETE == ePres ) { - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - if( SFX_ITEM_PRESENTATION_COMPLETE == ePres ) + sal_uInt16 nId; + switch ( GetValue() ) { - sal_uInt16 nId; - switch ( GetValue() ) - { - case GRAPHICDRAWMODE_GREYS: nId = STR_DRAWMODE_GREY; break; - case GRAPHICDRAWMODE_MONO: nId = STR_DRAWMODE_BLACKWHITE; break; - case GRAPHICDRAWMODE_WATERMARK: nId = STR_DRAWMODE_WATERMARK; break; - default: nId = STR_DRAWMODE_STD; break; - } - rText = SW_RESSTR( STR_DRAWMODE ) + SW_RESSTR( nId ); + case GRAPHICDRAWMODE_GREYS: nId = STR_DRAWMODE_GREY; break; + case GRAPHICDRAWMODE_MONO: nId = STR_DRAWMODE_BLACKWHITE; break; + case GRAPHICDRAWMODE_WATERMARK: nId = STR_DRAWMODE_WATERMARK; break; + default: nId = STR_DRAWMODE_STD; break; } - break; - - default: - ePres = SFX_ITEM_PRESENTATION_NONE; - break; + rText = SW_RESSTR( STR_DRAWMODE ) + SW_RESSTR( nId ); } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } bool SwFmtFollowTextFlow::GetPresentation( SfxItemPresentation ePres, @@ -1227,22 +826,12 @@ bool SwFmtFollowTextFlow::GetPresentation( SfxItemPresentation ePres, const IntlWrapper* /*pIntl*/ ) const { rText = OUString(); - switch( ePres ) + if( SFX_ITEM_PRESENTATION_COMPLETE == ePres ) { - case SFX_ITEM_PRESENTATION_NAMELESS: - break; - case SFX_ITEM_PRESENTATION_COMPLETE: - { - const sal_uInt16 nId = GetValue() ? STR_FOLLOW_TEXT_FLOW : STR_DONT_FOLLOW_TEXT_FLOW; - rText = SW_RESSTR( nId ); - } - break; - - default: - ePres = SFX_ITEM_PRESENTATION_NONE; - break; + const sal_uInt16 nId = GetValue() ? STR_FOLLOW_TEXT_FLOW : STR_DONT_FOLLOW_TEXT_FLOW; + rText = SW_RESSTR( nId ); } - return ePres != SFX_ITEM_PRESENTATION_NONE; + return true; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/utlui/uiitems.cxx b/sw/source/uibase/utlui/uiitems.cxx index 194933add10a..2bd0c8b911b6 100644 --- a/sw/source/uibase/utlui/uiitems.cxx +++ b/sw/source/uibase/utlui/uiitems.cxx @@ -61,33 +61,21 @@ bool SwPageFtnInfoItem::operator==( const SfxPoolItem& rAttr ) const bool SwPageFtnInfoItem::GetPresentation ( - SfxItemPresentation ePres, + SfxItemPresentation /*ePres*/, SfxMapUnit eCoreUnit, SfxMapUnit ePresUnit, OUString& rText, const IntlWrapper* pIntl ) const { - switch ( ePres ) + const SwTwips nHght = GetPageFtnInfo().GetHeight(); + if ( nHght ) { - case SFX_ITEM_PRESENTATION_NONE: - rText = OUString(); - return false; - case SFX_ITEM_PRESENTATION_NAMELESS: - case SFX_ITEM_PRESENTATION_COMPLETE: - { - const SwTwips nHght = GetPageFtnInfo().GetHeight(); - if ( nHght ) - { - rText = SW_RESSTR( STR_MAX_FTN_HEIGHT ) + " " + - ::GetMetricText( nHght, eCoreUnit, ePresUnit, pIntl ) + " " + - ::GetSvxString( ::GetMetricId( ePresUnit ) ); - } - return true; - } - default:; //prevent warning + rText = SW_RESSTR( STR_MAX_FTN_HEIGHT ) + " " + + ::GetMetricText( nHght, eCoreUnit, ePresUnit, pIntl ) + " " + + ::GetSvxString( ::GetMetricId( ePresUnit ) ); } - return false; + return true; } bool SwPageFtnInfoItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const |