summaryrefslogtreecommitdiff
path: root/svx/source/items
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-07-24 11:31:39 +0200
committerNoel Grandin <noel@peralex.com>2014-07-29 11:04:01 +0200
commit7e018afaf74ab118fe21d92edc9fb95ddea5d61b (patch)
tree740eb08b1a2841f35f68e8f6257d7abd46d09219 /svx/source/items
parent86c0a56a9ee2e3d15286b11afad65568d1a87c11 (diff)
simplify return argument of SfxPoolItem::GetPresentation
since all two of the actual call-sites only care about whether it is a valid presentation or not, not what kind of presentation it is. Change-Id: I75717c88878d37b2897741b0c833ff283b3fee59
Diffstat (limited to 'svx/source/items')
-rw-r--r--svx/source/items/algitem.cxx18
-rw-r--r--svx/source/items/chrtitem.cxx4
-rw-r--r--svx/source/items/customshapeitem.cxx7
-rw-r--r--svx/source/items/drawitem.cxx24
-rw-r--r--svx/source/items/grfitem.cxx18
-rw-r--r--svx/source/items/numinf.cxx4
-rw-r--r--svx/source/items/pageitem.cxx14
-rw-r--r--svx/source/items/postattr.cxx30
-rw-r--r--svx/source/items/rotmodit.cxx5
9 files changed, 63 insertions, 61 deletions
diff --git a/svx/source/items/algitem.cxx b/svx/source/items/algitem.cxx
index 2cdc3ca31635..5f534a31c43d 100644
--- a/svx/source/items/algitem.cxx
+++ b/svx/source/items/algitem.cxx
@@ -60,7 +60,7 @@ SvxOrientationItem::SvxOrientationItem( sal_Int32 nRotation, bool bStacked, cons
-SfxItemPresentation SvxOrientationItem::GetPresentation
+bool SvxOrientationItem::GetPresentation
(
SfxItemPresentation ePres,
SfxMapUnit /*eCoreUnit*/,
@@ -71,14 +71,14 @@ SfxItemPresentation SvxOrientationItem::GetPresentation
{
case SFX_ITEM_PRESENTATION_NONE:
rText = OUString();
- return SFX_ITEM_PRESENTATION_NONE;
+ return false;
case SFX_ITEM_PRESENTATION_NAMELESS:
case SFX_ITEM_PRESENTATION_COMPLETE:
rText = GetValueText( GetValue() );
- return SFX_ITEM_PRESENTATION_COMPLETE;
+ return true;
default: ; //prevent warning
}
- return SFX_ITEM_PRESENTATION_NONE;
+ return false;
}
@@ -228,7 +228,7 @@ SvxMarginItem::SvxMarginItem( const SvxMarginItem& rItem ) :
-SfxItemPresentation SvxMarginItem::GetPresentation
+bool SvxMarginItem::GetPresentation
(
SfxItemPresentation ePres,
SfxMapUnit eCoreUnit,
@@ -242,7 +242,7 @@ SfxItemPresentation SvxMarginItem::GetPresentation
{
case SFX_ITEM_PRESENTATION_NONE:
rText = OUString();
- return SFX_ITEM_PRESENTATION_NONE;
+ return false;
case SFX_ITEM_PRESENTATION_NAMELESS:
{
rText = GetMetricText( (long)nLeftMargin, eCoreUnit, ePresUnit, pIntl ) +
@@ -252,7 +252,7 @@ SfxItemPresentation SvxMarginItem::GetPresentation
GetMetricText( (long)nRightMargin, eCoreUnit, ePresUnit, pIntl ) +
cpDelimTmp +
GetMetricText( (long)nBottomMargin, eCoreUnit, ePresUnit, pIntl );
- return SFX_ITEM_PRESENTATION_NAMELESS;
+ return true;
}
case SFX_ITEM_PRESENTATION_COMPLETE:
{
@@ -271,11 +271,11 @@ SfxItemPresentation SvxMarginItem::GetPresentation
SVX_RESSTR(RID_SVXITEMS_MARGIN_BOTTOM) +
GetMetricText( (long)nBottomMargin, eCoreUnit, ePresUnit, pIntl ) +
" " + EE_RESSTR(GetMetricId(ePresUnit));
- return SFX_ITEM_PRESENTATION_COMPLETE;
+ return true;
}
default: ; //prevent warning
}
- return SFX_ITEM_PRESENTATION_NONE;
+ return false;
}
diff --git a/svx/source/items/chrtitem.cxx b/svx/source/items/chrtitem.cxx
index f975bd9bf02d..128df692105a 100644
--- a/svx/source/items/chrtitem.cxx
+++ b/svx/source/items/chrtitem.cxx
@@ -246,7 +246,7 @@ OUString SvxDoubleItem::GetValueText() const
-SfxItemPresentation SvxDoubleItem::GetPresentation
+bool SvxDoubleItem::GetPresentation
( SfxItemPresentation /*ePresentation*/, SfxMapUnit /*eCoreMetric*/,
SfxMapUnit /*ePresentationMetric*/, OUString& rText,
const IntlWrapper * pIntlWrapper) const
@@ -259,7 +259,7 @@ SfxItemPresentation SvxDoubleItem::GetPresentation
}
else
rText = GetValueText();
- return SFX_ITEM_PRESENTATION_NAMELESS;
+ return true;
}
diff --git a/svx/source/items/customshapeitem.cxx b/svx/source/items/customshapeitem.cxx
index 16a57671eba3..b5bc7a9d56fb 100644
--- a/svx/source/items/customshapeitem.cxx
+++ b/svx/source/items/customshapeitem.cxx
@@ -239,7 +239,7 @@ bool SdrCustomShapeGeometryItem::operator==( const SfxPoolItem& rCmp ) const
return bRet;
}
-SfxItemPresentation SdrCustomShapeGeometryItem::GetPresentation(
+bool SdrCustomShapeGeometryItem::GetPresentation(
SfxItemPresentation ePresentation, SfxMapUnit /*eCoreMetric*/,
SfxMapUnit /*ePresentationMetric*/, OUString &rText, const IntlWrapper *) const
{
@@ -247,8 +247,11 @@ SfxItemPresentation SdrCustomShapeGeometryItem::GetPresentation(
if ( ePresentation == SFX_ITEM_PRESENTATION_COMPLETE )
{
rText = " " + rText;
+ return true;
}
- return ePresentation;
+ else if ( ePresentation == SFX_ITEM_PRESENTATION_NAMELESS )
+ return true;
+ return false;
}
SfxPoolItem* SdrCustomShapeGeometryItem::Create( SvStream& rIn, sal_uInt16 nItemVersion ) const
diff --git a/svx/source/items/drawitem.cxx b/svx/source/items/drawitem.cxx
index 91c2282343c7..93a981918639 100644
--- a/svx/source/items/drawitem.cxx
+++ b/svx/source/items/drawitem.cxx
@@ -54,7 +54,7 @@ SvxColorListItem::SvxColorListItem( const SvxColorListItem& rItem ) :
{
}
-SfxItemPresentation SvxColorListItem::GetPresentation
+bool SvxColorListItem::GetPresentation
(
SfxItemPresentation /*ePres*/,
SfxMapUnit /*eCoreUnit*/,
@@ -63,7 +63,7 @@ SfxItemPresentation SvxColorListItem::GetPresentation
) const
{
rText = OUString();
- return SFX_ITEM_PRESENTATION_NONE;
+ return false;
}
bool SvxColorListItem::operator==( const SfxPoolItem& rItem ) const
@@ -123,7 +123,7 @@ SvxGradientListItem::SvxGradientListItem( const SvxGradientListItem& rItem ) :
-SfxItemPresentation SvxGradientListItem::GetPresentation
+bool SvxGradientListItem::GetPresentation
(
SfxItemPresentation /*ePres*/,
SfxMapUnit /*eCoreUnit*/,
@@ -132,7 +132,7 @@ SfxItemPresentation SvxGradientListItem::GetPresentation
) const
{
rText = OUString();
- return SFX_ITEM_PRESENTATION_NONE;
+ return false;
}
@@ -177,7 +177,7 @@ SvxHatchListItem::SvxHatchListItem( const SvxHatchListItem& rItem ) :
-SfxItemPresentation SvxHatchListItem::GetPresentation
+bool SvxHatchListItem::GetPresentation
(
SfxItemPresentation /*ePres*/,
SfxMapUnit /*eCoreUnit*/,
@@ -186,7 +186,7 @@ SfxItemPresentation SvxHatchListItem::GetPresentation
) const
{
rText = OUString();
- return SFX_ITEM_PRESENTATION_NONE;
+ return false;
}
@@ -227,7 +227,7 @@ SvxBitmapListItem::SvxBitmapListItem( const SvxBitmapListItem& rItem ) :
{
}
-SfxItemPresentation SvxBitmapListItem::GetPresentation
+bool SvxBitmapListItem::GetPresentation
(
SfxItemPresentation /*ePres*/,
SfxMapUnit /*eCoreUnit*/,
@@ -236,7 +236,7 @@ SfxItemPresentation SvxBitmapListItem::GetPresentation
) const
{
rText = OUString();
- return SFX_ITEM_PRESENTATION_NONE;
+ return false;
}
bool SvxBitmapListItem::operator==( const SfxPoolItem& rItem ) const
@@ -275,7 +275,7 @@ SvxDashListItem::SvxDashListItem( const SvxDashListItem& rItem ) :
{
}
-SfxItemPresentation SvxDashListItem::GetPresentation
+bool SvxDashListItem::GetPresentation
(
SfxItemPresentation /*ePres*/,
SfxMapUnit /*eCoreUnit*/,
@@ -284,7 +284,7 @@ SfxItemPresentation SvxDashListItem::GetPresentation
) const
{
rText = OUString();
- return SFX_ITEM_PRESENTATION_NONE;
+ return false;
}
bool SvxDashListItem::operator==( const SfxPoolItem& rItem ) const
@@ -322,7 +322,7 @@ SvxLineEndListItem::SvxLineEndListItem( const SvxLineEndListItem& rItem ) :
{
}
-SfxItemPresentation SvxLineEndListItem::GetPresentation
+bool SvxLineEndListItem::GetPresentation
(
SfxItemPresentation /*ePres*/,
SfxMapUnit /*eCoreUnit*/,
@@ -331,7 +331,7 @@ SfxItemPresentation SvxLineEndListItem::GetPresentation
) const
{
rText = OUString();
- return SFX_ITEM_PRESENTATION_NONE;
+ return false;
}
bool SvxLineEndListItem::operator==( const SfxPoolItem& rItem ) const
diff --git a/svx/source/items/grfitem.cxx b/svx/source/items/grfitem.cxx
index 748221048dca..3158b83853b1 100644
--- a/svx/source/items/grfitem.cxx
+++ b/svx/source/items/grfitem.cxx
@@ -128,7 +128,7 @@ bool SvxGrfCrop::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
return true;
}
-SfxItemPresentation SvxGrfCrop::GetPresentation(
+bool SvxGrfCrop::GetPresentation(
SfxItemPresentation ePres, SfxMapUnit eCoreUnit, SfxMapUnit /*ePresUnit*/,
OUString &rText, const IntlWrapper* pIntl ) const
{
@@ -136,21 +136,19 @@ SfxItemPresentation SvxGrfCrop::GetPresentation(
switch( ePres )
{
case SFX_ITEM_PRESENTATION_NAMELESS:
+ return true;
case SFX_ITEM_PRESENTATION_COMPLETE:
- if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
- {
- rText = "L: " + OUString(::GetMetricText( GetLeft(), eCoreUnit, SFX_MAPUNIT_MM, pIntl )) +
- " R: " + OUString(::GetMetricText( GetRight(), eCoreUnit, SFX_MAPUNIT_MM, pIntl )) +
- " T: " + OUString(::GetMetricText( GetTop(), eCoreUnit, SFX_MAPUNIT_MM, pIntl )) +
- " B: " + OUString(::GetMetricText( GetBottom(), eCoreUnit, SFX_MAPUNIT_MM, pIntl ));
- }
+ rText = "L: " + OUString(::GetMetricText( GetLeft(), eCoreUnit, SFX_MAPUNIT_MM, pIntl )) +
+ " R: " + OUString(::GetMetricText( GetRight(), eCoreUnit, SFX_MAPUNIT_MM, pIntl )) +
+ " T: " + OUString(::GetMetricText( GetTop(), eCoreUnit, SFX_MAPUNIT_MM, pIntl )) +
+ " B: " + OUString(::GetMetricText( GetBottom(), eCoreUnit, SFX_MAPUNIT_MM, pIntl ));
+ return true;
break;
default:
- ePres = SFX_ITEM_PRESENTATION_NONE;
+ return false;
break;
}
- return ePres;
}
diff --git a/svx/source/items/numinf.cxx b/svx/source/items/numinf.cxx
index cbceee89cd80..6aabe79d4063 100644
--- a/svx/source/items/numinf.cxx
+++ b/svx/source/items/numinf.cxx
@@ -117,7 +117,7 @@ SvxNumberInfoItem::~SvxNumberInfoItem()
-SfxItemPresentation SvxNumberInfoItem::GetPresentation
+bool SvxNumberInfoItem::GetPresentation
(
SfxItemPresentation /*ePres*/,
SfxMapUnit /*eCoreUnit*/,
@@ -126,7 +126,7 @@ SfxItemPresentation SvxNumberInfoItem::GetPresentation
) const
{
rText = OUString();
- return SFX_ITEM_PRESENTATION_NONE;
+ return false;
}
diff --git a/svx/source/items/pageitem.cxx b/svx/source/items/pageitem.cxx
index 3539ff1cc6f7..b7dee44cdf66 100644
--- a/svx/source/items/pageitem.cxx
+++ b/svx/source/items/pageitem.cxx
@@ -96,7 +96,7 @@ inline OUString GetUsageText( const sal_uInt16 eU )
-SfxItemPresentation SvxPageItem::GetPresentation
+bool SvxPageItem::GetPresentation
(
SfxItemPresentation ePres,
SfxMapUnit /*eCoreUnit*/,
@@ -110,7 +110,7 @@ SfxItemPresentation SvxPageItem::GetPresentation
switch ( ePres )
{
case SFX_ITEM_PRESENTATION_NONE:
- return SFX_ITEM_PRESENTATION_NONE;
+ return false;
case SFX_ITEM_PRESENTATION_NAMELESS:
{
if ( !aDescName.isEmpty() )
@@ -128,7 +128,7 @@ SfxItemPresentation SvxPageItem::GetPresentation
{
rText += cpDelimTmp + aUsageText;
}
- return SFX_ITEM_PRESENTATION_NAMELESS;
+ return true;
}
case SFX_ITEM_PRESENTATION_COMPLETE:
{
@@ -148,11 +148,11 @@ SfxItemPresentation SvxPageItem::GetPresentation
{
rText += cpDelimTmp + aUsageText;
}
- return SFX_ITEM_PRESENTATION_COMPLETE;
+ return true;
}
default: ;//prevent warning
}
- return SFX_ITEM_PRESENTATION_NONE;
+ return false;
}
@@ -297,7 +297,7 @@ SfxPoolItem* SvxSetItem::Clone( SfxItemPool * ) const
-SfxItemPresentation SvxSetItem::GetPresentation
+bool SvxSetItem::GetPresentation
(
SfxItemPresentation /*ePres*/,
SfxMapUnit /*eCoreUnit*/,
@@ -306,7 +306,7 @@ SfxItemPresentation SvxSetItem::GetPresentation
) const
{
rText = OUString();
- return SFX_ITEM_PRESENTATION_NONE;
+ return false;
}
SfxPoolItem* SvxSetItem::Create(SvStream &rStrm, sal_uInt16 /*nVersion*/) const
diff --git a/svx/source/items/postattr.cxx b/svx/source/items/postattr.cxx
index 38e1384ab8dc..36e4ff367c1a 100644
--- a/svx/source/items/postattr.cxx
+++ b/svx/source/items/postattr.cxx
@@ -45,7 +45,7 @@ SvxPostItAuthorItem::SvxPostItAuthorItem( const OUString& rAuthor,
-SfxItemPresentation SvxPostItAuthorItem::GetPresentation
+bool SvxPostItAuthorItem::GetPresentation
(
SfxItemPresentation ePres,
SfxMapUnit /*eCoreUnit*/,
@@ -57,16 +57,16 @@ SfxItemPresentation SvxPostItAuthorItem::GetPresentation
{
case SFX_ITEM_PRESENTATION_NONE:
rText = OUString();
- return SFX_ITEM_PRESENTATION_NONE;
+ return false;
case SFX_ITEM_PRESENTATION_NAMELESS:
rText = GetValue();
- return SFX_ITEM_PRESENTATION_NAMELESS;
+ return true;
case SFX_ITEM_PRESENTATION_COMPLETE:
rText = SVX_RESSTR(RID_SVXITEMS_AUTHOR_COMPLETE) + GetValue();
- return SFX_ITEM_PRESENTATION_COMPLETE;
+ return true;
default: ;//prevent warning
}
- return SFX_ITEM_PRESENTATION_NONE;
+ return false;
}
@@ -93,7 +93,7 @@ SvxPostItDateItem::SvxPostItDateItem( const OUString& rDate, sal_uInt16 _nWhich
-SfxItemPresentation SvxPostItDateItem::GetPresentation
+bool SvxPostItDateItem::GetPresentation
(
SfxItemPresentation ePres,
SfxMapUnit /*eCoreUnit*/,
@@ -105,16 +105,16 @@ SfxItemPresentation SvxPostItDateItem::GetPresentation
{
case SFX_ITEM_PRESENTATION_NONE:
rText = OUString();
- return SFX_ITEM_PRESENTATION_NONE;
+ return false;
case SFX_ITEM_PRESENTATION_NAMELESS:
rText = GetValue();
- return SFX_ITEM_PRESENTATION_NAMELESS;
+ return true;
case SFX_ITEM_PRESENTATION_COMPLETE:
rText = SVX_RESSTR(RID_SVXITEMS_DATE_COMPLETE) + GetValue();
- return SFX_ITEM_PRESENTATION_COMPLETE;
+ return true;
default: ;//prevent warning
}
- return SFX_ITEM_PRESENTATION_NONE;
+ return false;
}
@@ -141,7 +141,7 @@ SvxPostItTextItem::SvxPostItTextItem( const OUString& rText, sal_uInt16 _nWhich
-SfxItemPresentation SvxPostItTextItem::GetPresentation
+bool SvxPostItTextItem::GetPresentation
(
SfxItemPresentation ePres,
SfxMapUnit /*eCoreUnit*/,
@@ -153,16 +153,16 @@ SfxItemPresentation SvxPostItTextItem::GetPresentation
{
case SFX_ITEM_PRESENTATION_NONE:
rText = OUString();
- return SFX_ITEM_PRESENTATION_NONE;
+ return false;
case SFX_ITEM_PRESENTATION_NAMELESS:
rText = GetValue();
- return SFX_ITEM_PRESENTATION_NAMELESS;
+ return true;
case SFX_ITEM_PRESENTATION_COMPLETE:
rText = SVX_RESSTR(RID_SVXITEMS_TEXT_COMPLETE) + GetValue();
- return SFX_ITEM_PRESENTATION_COMPLETE;
+ return true;
default: ;//prevent warning
}
- return SFX_ITEM_PRESENTATION_NONE;
+ return false;
}
diff --git a/svx/source/items/rotmodit.cxx b/svx/source/items/rotmodit.cxx
index c3e87d97a596..abf7296632ba 100644
--- a/svx/source/items/rotmodit.cxx
+++ b/svx/source/items/rotmodit.cxx
@@ -66,7 +66,7 @@ SfxPoolItem* SvxRotateModeItem::Create( SvStream& rStream, sal_uInt16 ) const
return new SvxRotateModeItem( (SvxRotateMode) nVal,Which() );
}
-SfxItemPresentation SvxRotateModeItem::GetPresentation(
+bool SvxRotateModeItem::GetPresentation(
SfxItemPresentation ePres,
SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
OUString& rText, const IntlWrapper * ) const
@@ -81,11 +81,12 @@ SfxItemPresentation SvxRotateModeItem::GetPresentation(
case SFX_ITEM_PRESENTATION_NAMELESS:
rText += OUString( GetValue() );
+ return true;
break;
default: ;//prevent warning
}
- return ePres;
+ return false;
}
OUString SvxRotateModeItem::GetValueText( sal_uInt16 nVal ) const