diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-08-19 09:31:35 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-08-19 11:25:18 +0000 |
commit | 396138a6bc7192abe0837b419283860d3331f607 (patch) | |
tree | f80818ba86220abb8db205b402429e3d45aa62d1 /svl | |
parent | sw: remove never read SwViewShell::mbInLibreOfficeKitCallback (diff) | |
download | core-396138a6bc7192abe0837b419283860d3331f607.tar.gz core-396138a6bc7192abe0837b419283860d3331f607.zip |
Resolves: coverity#705366 Mixing enum types
and
coverity#705367 Mixing enum types
coverity#705371 Mixing enum types
coverity#982694 Mixing enum types
coverity#1027717 Mixing enum types
coverity#1371228 Mixing enum types
coverity#1371242 Mixing enum types
coverity#1371280 Mixing enum types
coverity#1371310 Mixing enum types
MapUnit and SfxMapUnit share the same values and
are freely cast from one to the other.
Now that
commit d30a4298bdb5ba53cd1fe659f2b742f218a2e527
Date: Thu Aug 11 15:02:19 2016 +0200
loplugin:unusedenumconstants in package..svtools
removed the SfxMapUnit entries that were directly unused, they
don't match anymore and casting from one to the other is dangerous.
Why there was two of these anyway escapes me, get rid of SfxMapUnit
and just use MapUnit universally
Change-Id: I4db5dcd04b59be2f85b62b728f96c90afe00c57e
Reviewed-on: https://gerrit.libreoffice.org/28234
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/inc/poolio.hxx | 4 | ||||
-rw-r--r-- | svl/source/items/cenumitm.cxx | 6 | ||||
-rw-r--r-- | svl/source/items/cintitem.cxx | 25 | ||||
-rw-r--r-- | svl/source/items/ctypeitm.cxx | 4 | ||||
-rw-r--r-- | svl/source/items/custritm.cxx | 4 | ||||
-rw-r--r-- | svl/source/items/flagitem.cxx | 4 | ||||
-rw-r--r-- | svl/source/items/int64item.cxx | 2 | ||||
-rw-r--r-- | svl/source/items/intitem.cxx | 2 | ||||
-rw-r--r-- | svl/source/items/itempool.cxx | 8 | ||||
-rw-r--r-- | svl/source/items/macitem.cxx | 4 | ||||
-rw-r--r-- | svl/source/items/poolitem.cxx | 8 | ||||
-rw-r--r-- | svl/source/items/ptitem.cxx | 4 | ||||
-rw-r--r-- | svl/source/items/rectitem.cxx | 4 | ||||
-rw-r--r-- | svl/source/items/rngitem.cxx | 14 | ||||
-rw-r--r-- | svl/source/items/sitem.cxx | 6 | ||||
-rw-r--r-- | svl/source/items/slstitm.cxx | 4 | ||||
-rw-r--r-- | svl/source/items/srchitem.cxx | 4 | ||||
-rw-r--r-- | svl/source/items/style.cxx | 2 | ||||
-rw-r--r-- | svl/source/items/szitem.cxx | 4 | ||||
-rw-r--r-- | svl/source/items/visitem.cxx | 6 |
20 files changed, 58 insertions, 61 deletions
diff --git a/svl/source/inc/poolio.hxx b/svl/source/inc/poolio.hxx index fc62eb2f2006..4a3219663935 100644 --- a/svl/source/inc/poolio.hxx +++ b/svl/source/inc/poolio.hxx @@ -106,7 +106,7 @@ struct SfxItemPool_Impl sal_uInt16 nVerStart, nVerEnd; // WhichRange in versions sal_uInt16 nStoringStart, nStoringEnd; // Range to be saved sal_uInt8 nMajorVer, nMinorVer; // The Pool itself - SfxMapUnit eDefMetric; + MapUnit eDefMetric; bool bInSetItem; bool bStreaming; // in Load() or Store() bool mbPersistentRefCounts; @@ -131,7 +131,7 @@ struct SfxItemPool_Impl , nStoringEnd(0) , nMajorVer(0) , nMinorVer(0) - , eDefMetric(SFX_MAPUNIT_CM) + , eDefMetric(MAP_CM) , bInSetItem(false) , bStreaming(false) , mbPersistentRefCounts(false) diff --git a/svl/source/items/cenumitm.cxx b/svl/source/items/cenumitm.cxx index 6f1bd0512ce3..f17ce3c1eb55 100644 --- a/svl/source/items/cenumitm.cxx +++ b/svl/source/items/cenumitm.cxx @@ -37,8 +37,8 @@ bool SfxEnumItemInterface::operator ==(const SfxPoolItem & rItem) const } // virtual -bool SfxEnumItemInterface::GetPresentation(SfxItemPresentation, SfxMapUnit, - SfxMapUnit, OUString & rText, +bool SfxEnumItemInterface::GetPresentation(SfxItemPresentation, MapUnit, + MapUnit, OUString & rText, const IntlWrapper *) const { rText = OUString::number( GetEnumValue() ); @@ -167,7 +167,7 @@ bool SfxBoolItem::operator ==(const SfxPoolItem & rItem) const // virtual bool SfxBoolItem::GetPresentation(SfxItemPresentation, - SfxMapUnit, SfxMapUnit, + MapUnit, MapUnit, OUString & rText, const IntlWrapper *) const { diff --git a/svl/source/items/cintitem.cxx b/svl/source/items/cintitem.cxx index 6d30f4a44dd6..0ce5f256f32f 100644 --- a/svl/source/items/cintitem.cxx +++ b/svl/source/items/cintitem.cxx @@ -32,10 +32,9 @@ bool CntByteItem::operator ==(const SfxPoolItem & rItem) const } // virtual -bool CntByteItem::GetPresentation(SfxItemPresentation, - SfxMapUnit, SfxMapUnit, - OUString & rText, - const IntlWrapper *) const +bool CntByteItem::GetPresentation(SfxItemPresentation, MapUnit, MapUnit, + OUString & rText, + const IntlWrapper *) const { rText = OUString::number( m_nValue ); return true; @@ -104,9 +103,9 @@ bool CntUInt16Item::operator ==(const SfxPoolItem & rItem) const // virtual bool CntUInt16Item::GetPresentation(SfxItemPresentation, - SfxMapUnit, SfxMapUnit, - OUString & rText, - const IntlWrapper *) + MapUnit, MapUnit, + OUString & rText, + const IntlWrapper *) const { rText = OUString::number( m_nValue ); @@ -174,9 +173,9 @@ bool CntInt32Item::operator ==(const SfxPoolItem & rItem) const // virtual bool CntInt32Item::GetPresentation(SfxItemPresentation, - SfxMapUnit, SfxMapUnit, - OUString & rText, - const IntlWrapper *) const + MapUnit, MapUnit, + OUString & rText, + const IntlWrapper *) const { rText = OUString::number( m_nValue ); return true; @@ -243,9 +242,9 @@ bool CntUInt32Item::operator ==(const SfxPoolItem & rItem) const // virtual bool CntUInt32Item::GetPresentation(SfxItemPresentation, - SfxMapUnit, SfxMapUnit, - OUString & rText, - const IntlWrapper *) + MapUnit, MapUnit, + OUString & rText, + const IntlWrapper *) const { rText = OUString::number(m_nValue); diff --git a/svl/source/items/ctypeitm.cxx b/svl/source/items/ctypeitm.cxx index 82b779bf4384..e01703bef86a 100644 --- a/svl/source/items/ctypeitm.cxx +++ b/svl/source/items/ctypeitm.cxx @@ -115,8 +115,8 @@ void CntContentTypeItem::SetValue( const OUString& rNewVal ) bool CntContentTypeItem::GetPresentation( SfxItemPresentation ePres, - SfxMapUnit eCoreMetric, - SfxMapUnit ePresMetric, + MapUnit eCoreMetric, + MapUnit ePresMetric, OUString & rText, const IntlWrapper * pIntlWrapper) const { diff --git a/svl/source/items/custritm.cxx b/svl/source/items/custritm.cxx index 9f84dc32a0e6..c9f63d2e1e5d 100644 --- a/svl/source/items/custritm.cxx +++ b/svl/source/items/custritm.cxx @@ -36,8 +36,8 @@ bool CntUnencodedStringItem::operator ==(const SfxPoolItem & rItem) const } // virtual -bool CntUnencodedStringItem::GetPresentation(SfxItemPresentation, SfxMapUnit, - SfxMapUnit, OUString & rText, +bool CntUnencodedStringItem::GetPresentation(SfxItemPresentation, MapUnit, + MapUnit, OUString & rText, const IntlWrapper *) const { rText = m_aValue; diff --git a/svl/source/items/flagitem.cxx b/svl/source/items/flagitem.cxx index c5934897b9a2..e22c2888cb58 100644 --- a/svl/source/items/flagitem.cxx +++ b/svl/source/items/flagitem.cxx @@ -47,8 +47,8 @@ SvStream& SfxFlagItem::Store(SvStream &rStream, sal_uInt16) const bool SfxFlagItem::GetPresentation ( SfxItemPresentation /*ePresentation*/, - SfxMapUnit /*eCoreMetric*/, - SfxMapUnit /*ePresentationMetric*/, + MapUnit /*eCoreMetric*/, + MapUnit /*ePresentationMetric*/, OUString& rText, const IntlWrapper * ) const diff --git a/svl/source/items/int64item.cxx b/svl/source/items/int64item.cxx index ed5f7889b4c9..6cfc0036c619 100644 --- a/svl/source/items/int64item.cxx +++ b/svl/source/items/int64item.cxx @@ -34,7 +34,7 @@ bool SfxInt64Item::operator== ( const SfxPoolItem& rItem ) const } bool SfxInt64Item::GetPresentation( - SfxItemPresentation, SfxMapUnit, SfxMapUnit, OUString& rText, + SfxItemPresentation, MapUnit, MapUnit, OUString& rText, const IntlWrapper* /*pIntlWrapper*/ ) const { rText = OUString::number(mnValue); diff --git a/svl/source/items/intitem.cxx b/svl/source/items/intitem.cxx index e6795e93f951..2b63937dc116 100644 --- a/svl/source/items/intitem.cxx +++ b/svl/source/items/intitem.cxx @@ -66,7 +66,7 @@ bool SfxInt16Item::operator ==(const SfxPoolItem & rItem) const // virtual bool SfxInt16Item::GetPresentation(SfxItemPresentation, - SfxMapUnit, SfxMapUnit, + MapUnit, MapUnit, OUString & rText, const IntlWrapper *) const { diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx index fbbfcea51db3..4cb9ccebabbd 100644 --- a/svl/source/items/itempool.cxx +++ b/svl/source/items/itempool.cxx @@ -175,7 +175,7 @@ SfxItemPool::SfxItemPool pItemInfos(pInfo), pImpl( new SfxItemPool_Impl( this, rName, nStartWhich, nEndWhich ) ) { - pImpl->eDefMetric = SFX_MAPUNIT_TWIP; + pImpl->eDefMetric = MAP_TWIP; pImpl->nVersion = 0; pImpl->bStreaming = false; pImpl->nLoadingVersion = 0; @@ -445,13 +445,13 @@ void SfxItemPool::SetItemInfos(SfxItemInfo const*const pInfo) } -SfxMapUnit SfxItemPool::GetMetric( sal_uInt16 ) const +MapUnit SfxItemPool::GetMetric( sal_uInt16 ) const { return pImpl->eDefMetric; } -void SfxItemPool::SetDefaultMetric( SfxMapUnit eNewMetric ) +void SfxItemPool::SetDefaultMetric( MapUnit eNewMetric ) { pImpl->eDefMetric = eNewMetric; } @@ -465,7 +465,7 @@ const OUString& SfxItemPool::GetName() const bool SfxItemPool::GetPresentation ( const SfxPoolItem& rItem, - SfxMapUnit eMetric, + MapUnit eMetric, OUString& rText, const IntlWrapper * pIntlWrapper ) const diff --git a/svl/source/items/macitem.cxx b/svl/source/items/macitem.cxx index 7a4ff58056b9..9580aab08bb4 100644 --- a/svl/source/items/macitem.cxx +++ b/svl/source/items/macitem.cxx @@ -223,8 +223,8 @@ SfxPoolItem* SvxMacroItem::Clone( SfxItemPool* ) const bool SvxMacroItem::GetPresentation ( SfxItemPresentation /*ePres*/, - SfxMapUnit /*eCoreUnit*/, - SfxMapUnit /*ePresUnit*/, + MapUnit /*eCoreUnit*/, + MapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper * ) const diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx index c5595615d2d2..89ac95263969 100644 --- a/svl/source/items/poolitem.cxx +++ b/svl/source/items/poolitem.cxx @@ -180,8 +180,8 @@ SvStream& SfxPoolItem::Store(SvStream &rStream, sal_uInt16 ) const bool SfxPoolItem::GetPresentation ( SfxItemPresentation /*ePresentation*/, // IN: how we should format - SfxMapUnit /*eCoreMetric*/, // IN: current metric of the SfxPoolItems - SfxMapUnit /*ePresentationMetric*/, // IN: target metric of the presentation + MapUnit /*eCoreMetric*/, // IN: current metric of the SfxPoolItems + MapUnit /*ePresentationMetric*/, // IN: target metric of the presentation OUString& /*rText*/, // OUT: textual representation const IntlWrapper * ) const @@ -230,8 +230,8 @@ bool SfxVoidItem::operator==( const SfxPoolItem& rCmp ) const bool SfxVoidItem::GetPresentation ( SfxItemPresentation /*ePresentation*/, - SfxMapUnit /*eCoreMetric*/, - SfxMapUnit /*ePresentationMetric*/, + MapUnit /*eCoreMetric*/, + MapUnit /*ePresentationMetric*/, OUString& rText, const IntlWrapper * ) const diff --git a/svl/source/items/ptitem.cxx b/svl/source/items/ptitem.cxx index 4f1dee4a9bbf..cdfcb448c7f6 100644 --- a/svl/source/items/ptitem.cxx +++ b/svl/source/items/ptitem.cxx @@ -56,8 +56,8 @@ SfxPointItem::SfxPointItem( const SfxPointItem& rItem ) : bool SfxPointItem::GetPresentation ( SfxItemPresentation /*ePresentation*/, - SfxMapUnit /*eCoreMetric*/, - SfxMapUnit /*ePresentationMetric*/, + MapUnit /*eCoreMetric*/, + MapUnit /*ePresentationMetric*/, OUString& rText, const IntlWrapper * ) const diff --git a/svl/source/items/rectitem.cxx b/svl/source/items/rectitem.cxx index 57e7827423be..b1f14e4546a8 100644 --- a/svl/source/items/rectitem.cxx +++ b/svl/source/items/rectitem.cxx @@ -53,8 +53,8 @@ SfxRectangleItem::SfxRectangleItem( const SfxRectangleItem& rItem ) : bool SfxRectangleItem::GetPresentation ( SfxItemPresentation /*ePresentation*/, - SfxMapUnit /*eCoreMetric*/, - SfxMapUnit /*ePresentationMetric*/, + MapUnit /*eCoreMetric*/, + MapUnit /*ePresentationMetric*/, OUString& rText, const IntlWrapper * ) const diff --git a/svl/source/items/rngitem.cxx b/svl/source/items/rngitem.cxx index 7a0e2d1f69ad..467439ab66c9 100644 --- a/svl/source/items/rngitem.cxx +++ b/svl/source/items/rngitem.cxx @@ -50,8 +50,8 @@ SfxRangeItem::SfxRangeItem( const SfxRangeItem& rItem ) : bool SfxRangeItem::GetPresentation ( SfxItemPresentation /*ePresentation*/, - SfxMapUnit /*eCoreMetric*/, - SfxMapUnit /*ePresentationMetric*/, + MapUnit /*eCoreMetric*/, + MapUnit /*ePresentationMetric*/, OUString& rText, const IntlWrapper * ) const @@ -138,18 +138,16 @@ bool SfxUShortRangesItem::operator==( const SfxPoolItem &rItem ) const return !_pRanges[n] && !rOther._pRanges[n]; } - bool SfxUShortRangesItem::GetPresentation( SfxItemPresentation /*ePres*/, - SfxMapUnit /*eCoreMetric*/, - SfxMapUnit /*ePresMetric*/, - OUString & /*rText*/, - const IntlWrapper * ) const + MapUnit /*eCoreMetric*/, + MapUnit /*ePresMetric*/, + OUString & /*rText*/, + const IntlWrapper * ) const { // not implemented return false; } - SfxPoolItem* SfxUShortRangesItem::Clone( SfxItemPool * ) const { return new SfxUShortRangesItem( *this ); diff --git a/svl/source/items/sitem.cxx b/svl/source/items/sitem.cxx index 79473821671f..f82d5099ebc4 100644 --- a/svl/source/items/sitem.cxx +++ b/svl/source/items/sitem.cxx @@ -59,9 +59,9 @@ bool SfxSetItem::operator==( const SfxPoolItem& rCmp) const bool SfxSetItem::GetPresentation ( - SfxItemPresentation /*ePresentation*/, - SfxMapUnit /*eCoreMetric*/, - SfxMapUnit /*ePresentationMetric*/, + SfxItemPresentation /*ePresentation*/, + MapUnit /*eCoreMetric*/, + MapUnit /*ePresentationMetric*/, OUString& /*rText*/, const IntlWrapper * ) const diff --git a/svl/source/items/slstitm.cxx b/svl/source/items/slstitm.cxx index e66c4ae18c28..5d4ccae725b1 100644 --- a/svl/source/items/slstitm.cxx +++ b/svl/source/items/slstitm.cxx @@ -117,8 +117,8 @@ bool SfxStringListItem::operator==( const SfxPoolItem& rItem ) const bool SfxStringListItem::GetPresentation ( SfxItemPresentation /*ePresentation*/, - SfxMapUnit /*eCoreMetric*/, - SfxMapUnit /*ePresentationMetric*/, + MapUnit /*eCoreMetric*/, + MapUnit /*ePresentationMetric*/, OUString& rText, const IntlWrapper * ) const diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx index f26597fc61d7..7cdcea9e3f20 100644 --- a/svl/source/items/srchitem.cxx +++ b/svl/source/items/srchitem.cxx @@ -284,8 +284,8 @@ bool SvxSearchItem::operator==( const SfxPoolItem& rItem ) const bool SvxSearchItem::GetPresentation ( SfxItemPresentation , - SfxMapUnit , - SfxMapUnit , + MapUnit , + MapUnit , OUString& , const IntlWrapper * ) const diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index 1c04d7bf4bc8..9e69c302a478 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -340,7 +340,7 @@ bool SfxStyleSheetBase::IsUsed() const /** * Return set attributes */ -OUString SfxStyleSheetBase::GetDescription( SfxMapUnit eMetric ) +OUString SfxStyleSheetBase::GetDescription( MapUnit eMetric ) { SfxItemIter aIter( GetItemSet() ); OUString aDesc; diff --git a/svl/source/items/szitem.cxx b/svl/source/items/szitem.cxx index ee4b77e25aeb..8a8db4fe4720 100644 --- a/svl/source/items/szitem.cxx +++ b/svl/source/items/szitem.cxx @@ -45,8 +45,8 @@ SfxSizeItem::SfxSizeItem( const SfxSizeItem& rItem ) : bool SfxSizeItem::GetPresentation ( SfxItemPresentation /*ePresentation*/, - SfxMapUnit /*eCoreMetric*/, - SfxMapUnit /*ePresentationMetric*/, + MapUnit /*eCoreMetric*/, + MapUnit /*ePresentationMetric*/, OUString& rText, const IntlWrapper * ) const diff --git a/svl/source/items/visitem.cxx b/svl/source/items/visitem.cxx index 99f3ca4fbac0..da59348b3550 100644 --- a/svl/source/items/visitem.cxx +++ b/svl/source/items/visitem.cxx @@ -41,9 +41,9 @@ bool SfxVisibilityItem::operator ==(const SfxPoolItem & rItem) const // virtual bool SfxVisibilityItem::GetPresentation(SfxItemPresentation, - SfxMapUnit, SfxMapUnit, - OUString & rText, - const IntlWrapper *) const + MapUnit, MapUnit, + OUString & rText, + const IntlWrapper *) const { rText = GetValueTextByVal(m_nValue.bVisible); return true; |