From bf057fab3c0d17bf2832c8d9fc6d34b1b859e660 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 10 Nov 2015 10:24:53 +0100 Subject: loplugin:nullptr (automatic rewrite) Change-Id: I0f2f81dae91f62639e79799b1bed1b2df1fd79ab --- include/svl/aeitem.hxx | 2 +- include/svl/cenumitm.hxx | 2 +- include/svl/cintitem.hxx | 16 +-- include/svl/cntwall.hxx | 2 +- include/svl/ctypeitm.hxx | 4 +- include/svl/custritm.hxx | 4 +- include/svl/eitem.hxx | 4 +- include/svl/filerec.hxx | 2 +- include/svl/flagitem.hxx | 4 +- include/svl/globalnameitem.hxx | 2 +- include/svl/grabbagitem.hxx | 4 +- include/svl/ilstitem.hxx | 2 +- include/svl/imageitm.hxx | 2 +- include/svl/inettype.hxx | 6 +- include/svl/int64item.hxx | 4 +- include/svl/intitem.hxx | 12 +-- include/svl/itempool.hxx | 8 +- include/svl/itemset.hxx | 10 +- include/svl/lckbitem.hxx | 2 +- include/svl/macitem.hxx | 4 +- include/svl/nranges.hxx | 2 +- include/svl/ondemand.hxx | 24 ++--- include/svl/poolitem.hxx | 14 +-- include/svl/ptitem.hxx | 4 +- include/svl/rectitem.hxx | 4 +- include/svl/rngitem.hxx | 8 +- include/svl/slstitm.hxx | 6 +- include/svl/srchitem.hxx | 4 +- include/svl/stritem.hxx | 2 +- include/svl/style.hxx | 2 +- include/svl/stylepool.hxx | 2 +- include/svl/szitem.hxx | 4 +- include/svl/undo.hxx | 2 +- include/svl/visitem.hxx | 4 +- include/svl/zforlist.hxx | 4 +- svl/qa/unit/items/test_IndexedStyleSheets.cxx | 2 +- svl/qa/unit/items/test_itempool.cxx | 14 +-- svl/qa/unit/svl.cxx | 16 +-- svl/qa/unit/test_INetContentType.cxx | 2 +- svl/qa/unit/test_URIHelper.cxx | 110 ++++++++++----------- svl/source/config/asiancfg.cxx | 4 +- svl/source/config/cjkoptions.cxx | 2 +- svl/source/config/ctloptions.cxx | 2 +- svl/source/config/itemholder2.cxx | 2 +- svl/source/filerec/filerec.cxx | 2 +- svl/source/fsstor/fsfactory.cxx | 4 +- svl/source/fsstor/fsstorage.cxx | 10 +- svl/source/fsstor/oinputstreamcontainer.cxx | 10 +- svl/source/fsstor/ostreamcontainer.cxx | 10 +- svl/source/inc/poolio.hxx | 12 +-- svl/source/items/IndexedStyleSheets.cxx | 2 +- svl/source/items/aeitem.cxx | 20 ++-- svl/source/items/flagitem.cxx | 2 +- svl/source/items/itemiter.cxx | 2 +- svl/source/items/itempool.cxx | 20 ++-- svl/source/items/itemprop.cxx | 8 +- svl/source/items/itemset.cxx | 44 ++++----- svl/source/items/lckbitem.cxx | 2 +- svl/source/items/macitem.cxx | 4 +- svl/source/items/nranges.cxx | 8 +- svl/source/items/poolcach.cxx | 6 +- svl/source/items/poolio.cxx | 36 +++---- svl/source/items/rngitem.cxx | 2 +- svl/source/items/sitem.cxx | 2 +- svl/source/items/slstitm.cxx | 6 +- svl/source/items/style.cxx | 22 ++--- svl/source/items/stylepool.cxx | 20 ++-- svl/source/misc/adrparse.cxx | 30 +++--- svl/source/misc/inettype.cxx | 10 +- svl/source/misc/sharecontrolfile.cxx | 2 +- svl/source/misc/sharedstring.cxx | 10 +- svl/source/misc/sharedstringpool.cxx | 2 +- svl/source/misc/strmadpt.cxx | 22 ++--- svl/source/misc/urihelper.cxx | 2 +- svl/source/notify/SfxBroadcaster.cxx | 4 +- svl/source/numbers/numfmuno.cxx | 36 +++---- svl/source/numbers/numuno.cxx | 4 +- svl/source/numbers/supservs.cxx | 8 +- svl/source/numbers/zforfind.cxx | 16 +-- svl/source/numbers/zforfind.hxx | 14 +-- svl/source/numbers/zforlist.cxx | 44 ++++----- svl/source/numbers/zformat.cxx | 32 +++--- svl/source/numbers/zforscan.cxx | 2 +- svl/source/passwordcontainer/passwordcontainer.cxx | 18 ++-- svl/source/undo/undo.cxx | 40 ++++---- svl/unx/source/svdde/ddedummy.cxx | 42 ++++---- 86 files changed, 464 insertions(+), 464 deletions(-) diff --git a/include/svl/aeitem.hxx b/include/svl/aeitem.hxx index ed844fbd2c46..3dce3b88429f 100644 --- a/include/svl/aeitem.hxx +++ b/include/svl/aeitem.hxx @@ -52,7 +52,7 @@ public: virtual sal_uInt16 GetValueCount() const override; virtual sal_uInt16 GetValueByPos( sal_uInt16 nPos ) const override; virtual OUString GetValueTextByPos( sal_uInt16 nPos ) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVersion) const override; virtual bool IsEnabled( sal_uInt16 ) const override; void DisableValue( sal_uInt16 ); diff --git a/include/svl/cenumitm.hxx b/include/svl/cenumitm.hxx index a14f0c77b9b3..ad9ce1867629 100644 --- a/include/svl/cenumitm.hxx +++ b/include/svl/cenumitm.hxx @@ -39,7 +39,7 @@ public: virtual bool GetPresentation(SfxItemPresentation, SfxMapUnit, SfxMapUnit, OUString & rText, - const IntlWrapper * = 0) + const IntlWrapper * = nullptr) const override; virtual bool QueryValue(css::uno::Any & rVal, sal_uInt8 = 0) const override; diff --git a/include/svl/cintitem.hxx b/include/svl/cintitem.hxx index 1ea75ae8e07f..a6861141fe3e 100644 --- a/include/svl/cintitem.hxx +++ b/include/svl/cintitem.hxx @@ -45,7 +45,7 @@ public: virtual bool GetPresentation(SfxItemPresentation, SfxMapUnit, SfxMapUnit, OUString & rText, - const IntlWrapper * = 0) + const IntlWrapper * = nullptr) const override; virtual bool QueryValue(css::uno::Any& rVal, @@ -58,7 +58,7 @@ public: virtual SvStream & Store(SvStream & rStream, sal_uInt16) const override; - virtual SfxPoolItem * Clone(SfxItemPool * = 0) const override; + virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override; sal_uInt8 GetValue() const { return m_nValue; } @@ -95,7 +95,7 @@ public: virtual bool GetPresentation(SfxItemPresentation, SfxMapUnit, SfxMapUnit, OUString & rText, - const IntlWrapper * = 0) + const IntlWrapper * = nullptr) const override; virtual bool QueryValue(css::uno::Any& rVal, @@ -108,7 +108,7 @@ public: virtual SvStream & Store(SvStream & rStream, sal_uInt16) const override; - virtual SfxPoolItem * Clone(SfxItemPool * = 0) const override; + virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override; sal_uInt16 GetValue() const { return m_nValue; } @@ -145,7 +145,7 @@ public: virtual bool GetPresentation(SfxItemPresentation, SfxMapUnit, SfxMapUnit, OUString & rText, - const IntlWrapper * = 0) + const IntlWrapper * = nullptr) const override; virtual bool QueryValue(css::uno::Any& rVal, @@ -158,7 +158,7 @@ public: virtual SvStream & Store(SvStream &, sal_uInt16) const override; - virtual SfxPoolItem * Clone(SfxItemPool * = 0) const override; + virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override; sal_Int32 GetValue() const { return m_nValue; } @@ -195,7 +195,7 @@ public: virtual bool GetPresentation(SfxItemPresentation, SfxMapUnit, SfxMapUnit, OUString & rText, - const IntlWrapper * = 0) + const IntlWrapper * = nullptr) const override; virtual bool QueryValue(css::uno::Any& rVal, @@ -208,7 +208,7 @@ public: virtual SvStream & Store(SvStream & rStream, sal_uInt16) const override; - virtual SfxPoolItem * Clone(SfxItemPool * = 0) const override; + virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override; sal_uInt32 GetValue() const { return m_nValue; } diff --git a/include/svl/cntwall.hxx b/include/svl/cntwall.hxx index 991a8036ec08..a9fb8e1aa771 100644 --- a/include/svl/cntwall.hxx +++ b/include/svl/cntwall.hxx @@ -47,7 +47,7 @@ public: virtual bool operator==( const SfxPoolItem& ) const override; virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nItemVersion ) const override; virtual SvStream& Store( SvStream&, sal_uInt16 nItemVersion ) const override; - virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const override; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override; virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; diff --git a/include/svl/ctypeitm.hxx b/include/svl/ctypeitm.hxx index bd72434ae87f..64beb5fe4181 100644 --- a/include/svl/ctypeitm.hxx +++ b/include/svl/ctypeitm.hxx @@ -45,7 +45,7 @@ public: virtual sal_uInt16 GetVersion(sal_uInt16) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = NULL ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; void SetValue( const OUString& rNewVal ); @@ -53,7 +53,7 @@ public: SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString & rText, - const IntlWrapper* pIntlWrapper = 0 ) const override; + const IntlWrapper* pIntlWrapper = nullptr ) const override; virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; diff --git a/include/svl/custritm.hxx b/include/svl/custritm.hxx index 4c59264de5e1..142c4c33c344 100644 --- a/include/svl/custritm.hxx +++ b/include/svl/custritm.hxx @@ -49,7 +49,7 @@ public: virtual bool GetPresentation(SfxItemPresentation, SfxMapUnit, SfxMapUnit, OUString & rText, - const IntlWrapper * = 0) + const IntlWrapper * = nullptr) const override; virtual bool QueryValue(css::uno::Any& rVal, @@ -57,7 +57,7 @@ public: virtual bool PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId) override; - virtual SfxPoolItem * Clone(SfxItemPool * = 0) const override; + virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override; const OUString & GetValue() const { return m_aValue; } diff --git a/include/svl/eitem.hxx b/include/svl/eitem.hxx index 46c8534327ea..84d9f4270ae4 100644 --- a/include/svl/eitem.hxx +++ b/include/svl/eitem.hxx @@ -91,7 +91,7 @@ public: virtual bool GetPresentation(SfxItemPresentation, SfxMapUnit, SfxMapUnit, OUString & rText, - const IntlWrapper * = 0) + const IntlWrapper * = nullptr) const override; virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 = 0) const override; @@ -104,7 +104,7 @@ public: virtual SvStream & Store(SvStream & rStream, sal_uInt16) const override; - virtual SfxPoolItem * Clone(SfxItemPool * = 0) const override; + virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override; virtual OUString GetValueTextByVal(bool bTheValue) const; }; diff --git a/include/svl/filerec.hxx b/include/svl/filerec.hxx index 3f7db59cc996..bf92859b07c5 100644 --- a/include/svl/filerec.hxx +++ b/include/svl/filerec.hxx @@ -232,7 +232,7 @@ protected: // three phase constructor for sub-classes SfxMiniRecordReader() - : _pStream(NULL) + : _pStream(nullptr) , _nEofRec(0) , _bSkipped(false) , _nPreTag(0) diff --git a/include/svl/flagitem.hxx b/include/svl/flagitem.hxx index 71324d81510c..3b78d7ed6cd9 100644 --- a/include/svl/flagitem.hxx +++ b/include/svl/flagitem.hxx @@ -43,12 +43,12 @@ public: virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVersion) const override; virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual bool GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString & rText, - const IntlWrapper * = 0 ) const override; + const IntlWrapper * = nullptr ) const override; sal_uInt16 GetValue() const { return nVal; } void SetValue( sal_uInt16 nNewVal ) { DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" ); diff --git a/include/svl/globalnameitem.hxx b/include/svl/globalnameitem.hxx index 3e552c2e40e6..7128cda41350 100644 --- a/include/svl/globalnameitem.hxx +++ b/include/svl/globalnameitem.hxx @@ -35,7 +35,7 @@ public: virtual ~SfxGlobalNameItem(); virtual bool operator==( const SfxPoolItem& ) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; SvGlobalName GetValue() const { return m_aName; } virtual bool PutValue ( const css::uno::Any& rVal, diff --git a/include/svl/grabbagitem.hxx b/include/svl/grabbagitem.hxx index 9fc6949eb69c..95bcf11b7ba8 100644 --- a/include/svl/grabbagitem.hxx +++ b/include/svl/grabbagitem.hxx @@ -26,7 +26,7 @@ public: TYPEINFO_OVERRIDE(); SfxGrabBagItem(); - SfxGrabBagItem(sal_uInt16 nWhich, const std::map* pMap = 0); + SfxGrabBagItem(sal_uInt16 nWhich, const std::map* pMap = nullptr); SfxGrabBagItem(const SfxGrabBagItem& rItem); virtual ~SfxGrabBagItem(); @@ -41,7 +41,7 @@ public: } virtual bool operator==(const SfxPoolItem&) const override; - virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const override; + virtual SfxPoolItem* Clone(SfxItemPool* pPool = nullptr) const override; virtual bool PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId) override; virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override; diff --git a/include/svl/ilstitem.hxx b/include/svl/ilstitem.hxx index 64410a8e0196..e3f2bc56f216 100644 --- a/include/svl/ilstitem.hxx +++ b/include/svl/ilstitem.hxx @@ -46,7 +46,7 @@ public: void GetList( ::std::vector < sal_Int32 >& rList ) const; virtual bool operator==( const SfxPoolItem& ) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual bool PutValue ( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; }; diff --git a/include/svl/imageitm.hxx b/include/svl/imageitm.hxx index a6bfd1d09176..662eed5dc7ff 100644 --- a/include/svl/imageitm.hxx +++ b/include/svl/imageitm.hxx @@ -33,7 +33,7 @@ public: SfxImageItem( const SfxImageItem& ); virtual ~SfxImageItem(); - virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const override; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override; virtual bool operator==( const SfxPoolItem& ) const override; virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; diff --git a/include/svl/inettype.hxx b/include/svl/inettype.hxx index 59d63d6d1b42..4fe32060585b 100644 --- a/include/svl/inettype.hxx +++ b/include/svl/inettype.hxx @@ -219,8 +219,8 @@ class SVL_DLLPUBLIC INetContentTypes public: static INetContentType RegisterContentType(OUString const & rTypeName, OUString const & rPresentation, - OUString const * pExtension = 0, - OUString const * pSystemFileType = 0); + OUString const * pExtension = nullptr, + OUString const * pSystemFileType = nullptr); static INetContentType GetContentType(OUString const & rTypeName); @@ -237,7 +237,7 @@ public: static bool parse(OUString const & rMediaType, OUString & rType, OUString & rSubType, - INetContentTypeParameterList * pParameters = 0); + INetContentTypeParameterList * pParameters = nullptr); }; #endif // INCLUDED_SVL_INETTYPE_HXX diff --git a/include/svl/int64item.hxx b/include/svl/int64item.hxx index feb0734e77d9..3402e1d96d68 100644 --- a/include/svl/int64item.hxx +++ b/include/svl/int64item.hxx @@ -28,7 +28,7 @@ public: virtual bool GetPresentation( SfxItemPresentation, SfxMapUnit, SfxMapUnit, - OUString& rText, const IntlWrapper* pIntlWrapper = NULL ) const override; + OUString& rText, const IntlWrapper* pIntlWrapper = nullptr ) const override; virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; @@ -40,7 +40,7 @@ public: virtual SvStream& Store( SvStream& rStream, sal_uInt16 nItemVersion ) const override; - virtual SfxPoolItem* Clone( SfxItemPool* pOther = NULL ) const override; + virtual SfxPoolItem* Clone( SfxItemPool* pOther = nullptr ) const override; sal_Int64 GetValue() const { return mnValue;} diff --git a/include/svl/intitem.hxx b/include/svl/intitem.hxx index 9ecbfce68b2d..ff5e7af020aa 100644 --- a/include/svl/intitem.hxx +++ b/include/svl/intitem.hxx @@ -34,7 +34,7 @@ public: virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const override; - virtual SfxPoolItem * Clone(SfxItemPool * = 0) const override + virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override { return new SfxByteItem(*this); } }; @@ -62,7 +62,7 @@ public: virtual bool GetPresentation(SfxItemPresentation, SfxMapUnit, SfxMapUnit, OUString & rText, - const IntlWrapper * = 0) + const IntlWrapper * = nullptr) const override; virtual bool QueryValue( css::uno::Any& rVal, @@ -75,7 +75,7 @@ public: virtual SvStream & Store(SvStream & rStream, sal_uInt16) const override; - virtual SfxPoolItem * Clone(SfxItemPool * = 0) const override; + virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override; sal_Int16 GetValue() const { return m_nValue; } @@ -103,7 +103,7 @@ public: virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const override { return new SfxUInt16Item(Which(), rStream); } - virtual SfxPoolItem * Clone(SfxItemPool * = 0) const override + virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override { return new SfxUInt16Item(*this); } void dumpAsXml(struct _xmlTextWriter* pWriter) const override; @@ -124,7 +124,7 @@ public: virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const override { return new SfxInt32Item(Which(), rStream); } - virtual SfxPoolItem * Clone(SfxItemPool * = 0) const override + virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override { return new SfxInt32Item(*this); } }; @@ -144,7 +144,7 @@ public: virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const override { return new SfxUInt32Item(Which(), rStream); } - virtual SfxPoolItem * Clone(SfxItemPool * = 0) const override + virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override { return new SfxUInt32Item(*this); } }; diff --git a/include/svl/itempool.hxx b/include/svl/itempool.hxx index 8098e415572a..a719a11c69da 100644 --- a/include/svl/itempool.hxx +++ b/include/svl/itempool.hxx @@ -103,7 +103,7 @@ public: SfxItemPool( const OUString &rName, sal_uInt16 nStart, sal_uInt16 nEnd, const SfxItemInfo *pItemInfos, - SfxPoolItem **pDefaults = 0, + SfxPoolItem **pDefaults = nullptr, bool bLoadRefCounts = true ); protected: @@ -154,7 +154,7 @@ public: virtual bool GetPresentation( const SfxPoolItem& rItem, SfxMapUnit ePresentationMetric, OUString& rText, - const IntlWrapper * pIntlWrapper = 0 ) const; + const IntlWrapper * pIntlWrapper = nullptr ) const; virtual SfxItemPool* Clone() const; const OUString& GetName() const; @@ -164,7 +164,7 @@ public: const SfxPoolItem* LoadItem( SvStream &rStream, bool bDirect = false, - const SfxItemPool *pRefPool = 0 ); + const SfxItemPool *pRefPool = nullptr ); bool StoreItem( SvStream &rStream, const SfxPoolItem &rItem, bool bDirect = false ) const; @@ -175,7 +175,7 @@ public: sal_uInt32 GetItemCount2(sal_uInt16 nWhich) const; const SfxPoolItem* LoadSurrogate(SvStream& rStream, sal_uInt16 &rWhich, sal_uInt16 nSlotId, - const SfxItemPool* pRefPool = 0 ); + const SfxItemPool* pRefPool = nullptr ); bool StoreSurrogate(SvStream& rStream, const SfxPoolItem *pItem ) const; diff --git a/include/svl/itemset.hxx b/include/svl/itemset.hxx index c3710dbd5961..3c2cba1e0e7d 100644 --- a/include/svl/itemset.hxx +++ b/include/svl/itemset.hxx @@ -71,7 +71,7 @@ public: SfxItemSet( SfxItemPool&, const sal_uInt16* nWhichPairTable ); virtual ~SfxItemSet(); - virtual SfxItemSet * Clone(bool bItems = true, SfxItemPool *pToPool = 0) const; + virtual SfxItemSet * Clone(bool bItems = true, SfxItemPool *pToPool = nullptr) const; // Get number of items sal_uInt16 Count() const { return m_nCount; } @@ -112,9 +112,9 @@ public: // Get item-status SfxItemState GetItemState( sal_uInt16 nWhich, bool bSrchInParent = true, - const SfxPoolItem **ppItem = 0 ) const; + const SfxPoolItem **ppItem = nullptr ) const; - bool HasItem(sal_uInt16 nWhich, const SfxPoolItem** ppItem = NULL) const; + bool HasItem(sal_uInt16 nWhich, const SfxPoolItem** ppItem = nullptr) const; void DisableItem(sal_uInt16 nWhich); void InvalidateItem( sal_uInt16 nWhich ); @@ -149,7 +149,7 @@ public: const SfxItemSet* GetParent() const { return m_pParent; } SvStream & Load( SvStream &, bool bDirect = false, - const SfxItemPool *pRefPool = 0 ); + const SfxItemPool *pRefPool = nullptr ); SvStream & Store( SvStream &, bool bDirect = false ) const; bool operator==(const SfxItemSet &) const; @@ -176,7 +176,7 @@ public: SfxAllItemSet( const SfxItemSet & ); SfxAllItemSet( const SfxAllItemSet & ); - virtual SfxItemSet * Clone( bool bItems = true, SfxItemPool *pToPool = 0 ) const override; + virtual SfxItemSet * Clone( bool bItems = true, SfxItemPool *pToPool = nullptr ) const override; virtual const SfxPoolItem* Put( const SfxPoolItem&, sal_uInt16 nWhich ) override; using SfxItemSet::Put; }; diff --git a/include/svl/lckbitem.hxx b/include/svl/lckbitem.hxx index 716e8fce8ea9..589bcff52078 100644 --- a/include/svl/lckbitem.hxx +++ b/include/svl/lckbitem.hxx @@ -36,7 +36,7 @@ public: virtual ~SfxLockBytesItem(); virtual bool operator==( const SfxPoolItem& ) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const override; virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const override; diff --git a/include/svl/macitem.hxx b/include/svl/macitem.hxx index fbded02af880..43e9a394048f 100644 --- a/include/svl/macitem.hxx +++ b/include/svl/macitem.hxx @@ -130,8 +130,8 @@ public: SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString &rText, - const IntlWrapper * = 0 ) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + const IntlWrapper * = nullptr ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const override; virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const override; virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const override; diff --git a/include/svl/nranges.hxx b/include/svl/nranges.hxx index 497f3a1b296b..4cc9fc213f89 100644 --- a/include/svl/nranges.hxx +++ b/include/svl/nranges.hxx @@ -31,7 +31,7 @@ class SfxUShortRanges sal_uInt16* _pRanges; // 0-terminated array of sal_uInt16-pairs public: - SfxUShortRanges() : _pRanges( 0 ) {} + SfxUShortRanges() : _pRanges( nullptr ) {} SfxUShortRanges( const SfxUShortRanges &rOrig ); SfxUShortRanges( sal_uInt16 nWhich1, sal_uInt16 nWhich2 ); SfxUShortRanges( const sal_uInt16* nNumTable ); diff --git a/include/svl/ondemand.hxx b/include/svl/ondemand.hxx index 8b9f3672da01..b32dc3608663 100644 --- a/include/svl/ondemand.hxx +++ b/include/svl/ondemand.hxx @@ -67,8 +67,8 @@ class OnDemandLocaleDataWrapper public: OnDemandLocaleDataWrapper() : eLastAnyLanguage( LANGUAGE_DONTKNOW ) - , pEnglish(0) - , pAny(0) + , pEnglish(nullptr) + , pAny(nullptr) , bInitialized(false) { pCurrent = pSystem = aSysLocale.GetLocaleDataPtr(); @@ -78,9 +78,9 @@ public: const css::uno::Reference< css::uno::XComponentContext >& rxContext, const LanguageTag& rLanguageTag ) - : pEnglish(0) - , pAny(0) - , pCurrent(0) + : pEnglish(nullptr) + , pAny(nullptr) + , pCurrent(nullptr) , bInitialized(false) { pSystem = aSysLocale.GetLocaleDataPtr(); @@ -156,7 +156,7 @@ class OnDemandCalendarWrapper public: OnDemandCalendarWrapper() - : pPtr(0) + : pPtr(nullptr) , bValid(false) , bInitialized(false) {} @@ -184,7 +184,7 @@ public: if ( pPtr ) { delete pPtr; - pPtr = NULL; + pPtr = nullptr; } bInitialized = true; } @@ -229,7 +229,7 @@ public: OnDemandTransliterationWrapper() : eLanguage( LANGUAGE_SYSTEM ) , nType(css::i18n::TransliterationModules_END_OF_MODULE) - , pPtr(0) + , pPtr(nullptr) , bValid(false) , bInitialized(false) {} @@ -262,7 +262,7 @@ public: if ( pPtr ) { delete pPtr; - pPtr = NULL; + pPtr = nullptr; } bInitialized = true; } @@ -304,13 +304,13 @@ class OnDemandNativeNumberWrapper public: OnDemandNativeNumberWrapper() - : pPtr(0) + : pPtr(nullptr) , bInitialized(false) {} OnDemandNativeNumberWrapper( const css::uno::Reference< css::uno::XComponentContext >& rxContext ) - : pPtr(0) + : pPtr(nullptr) , bInitialized(false) { init( rxContext ); @@ -328,7 +328,7 @@ public: if ( pPtr ) { delete pPtr; - pPtr = NULL; + pPtr = nullptr; } bInitialized = true; } diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx index f6a7df9b98bf..ff83ea32df8b 100644 --- a/include/svl/poolitem.hxx +++ b/include/svl/poolitem.hxx @@ -175,7 +175,7 @@ public: SfxMapUnit eCoreMetric, SfxMapUnit ePresentationMetric, OUString &rText, - const IntlWrapper * pIntlWrapper = 0 ) const; + const IntlWrapper * pIntlWrapper = nullptr ) const; virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const; virtual bool ScaleMetrics( long lMult, long lDiv ); @@ -186,7 +186,7 @@ public: virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nItemVersion ) const; virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const = 0; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const = 0; sal_uLong GetRefCount() const { return m_nRefCount; } inline SfxItemKind GetKind() const { return m_nKind; } @@ -264,10 +264,10 @@ public: SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString &rText, - const IntlWrapper * = 0 ) const override; + const IntlWrapper * = nullptr ) const override; // create a copy of itself - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; }; class SVL_DLLPUBLIC SfxSetItem: public SfxPoolItem @@ -280,7 +280,7 @@ public: TYPEINFO_OVERRIDE(); SfxSetItem( sal_uInt16 nWhich, SfxItemSet *pSet ); SfxSetItem( sal_uInt16 nWhich, const SfxItemSet &rSet ); - SfxSetItem( const SfxSetItem&, SfxItemPool *pPool = 0 ); + SfxSetItem( const SfxSetItem&, SfxItemPool *pPool = nullptr ); virtual ~SfxSetItem(); virtual bool operator==( const SfxPoolItem& ) const override; @@ -289,10 +289,10 @@ public: SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString &rText, - const IntlWrapper * = 0 ) const override; + const IntlWrapper * = nullptr ) const override; // create a copy of itself - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override = 0; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override = 0; virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVersion) const override = 0; virtual SvStream& Store(SvStream &, sal_uInt16 nVer) const override; diff --git a/include/svl/ptitem.hxx b/include/svl/ptitem.hxx index 92dd2abaa2b1..4e5e51dddf85 100644 --- a/include/svl/ptitem.hxx +++ b/include/svl/ptitem.hxx @@ -40,11 +40,11 @@ public: SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString &rText, - const IntlWrapper * = 0 ) const override; + const IntlWrapper * = nullptr ) const override; virtual bool operator==( const SfxPoolItem& ) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const override; virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const override; diff --git a/include/svl/rectitem.hxx b/include/svl/rectitem.hxx index 5031f0732f53..c6bab73dc38c 100644 --- a/include/svl/rectitem.hxx +++ b/include/svl/rectitem.hxx @@ -41,10 +41,10 @@ public: SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString &rText, - const IntlWrapper * = 0 ) const override; + const IntlWrapper * = nullptr ) const override; virtual bool operator==( const SfxPoolItem& ) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const override; virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const override; diff --git a/include/svl/rngitem.hxx b/include/svl/rngitem.hxx index a449a9339b47..8739be11e4e5 100644 --- a/include/svl/rngitem.hxx +++ b/include/svl/rngitem.hxx @@ -42,8 +42,8 @@ public: SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString &rText, - const IntlWrapper * = 0 ) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + const IntlWrapper * = nullptr ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; inline sal_uInt16& From() { return nFrom; } virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const override; virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const override; @@ -67,8 +67,8 @@ public: SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString &rText, - const IntlWrapper * = 0 ) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + const IntlWrapper * = nullptr ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const override; virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const override; }; diff --git a/include/svl/slstitm.hxx b/include/svl/slstitm.hxx index 9f1fac772b1c..57bc2e34eaea 100644 --- a/include/svl/slstitm.hxx +++ b/include/svl/slstitm.hxx @@ -37,7 +37,7 @@ public: TYPEINFO_OVERRIDE(); SfxStringListItem(); - SfxStringListItem( sal_uInt16 nWhich, const std::vector *pList=NULL ); + SfxStringListItem( sal_uInt16 nWhich, const std::vector *pList=nullptr ); SfxStringListItem( sal_uInt16 nWhich, SvStream& rStream ); SfxStringListItem( const SfxStringListItem& rItem ); virtual ~SfxStringListItem(); @@ -58,8 +58,8 @@ public: SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString &rText, - const IntlWrapper * = 0 ) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + const IntlWrapper * = nullptr ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const override; virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const override; diff --git a/include/svl/srchitem.hxx b/include/svl/srchitem.hxx index 7a48eebf492c..acca4911fbcb 100644 --- a/include/svl/srchitem.hxx +++ b/include/svl/srchitem.hxx @@ -101,11 +101,11 @@ public: virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; virtual bool operator == ( const SfxPoolItem& ) const override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual bool GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, - OUString &rText, const IntlWrapper * = 0 ) const override; + OUString &rText, const IntlWrapper * = nullptr ) const override; // ConfigItem virtual void Notify( const css::uno::Sequence< OUString > &rPropertyNames ) override; diff --git a/include/svl/stritem.hxx b/include/svl/stritem.hxx index ad775c5f5424..ca20acc142f5 100644 --- a/include/svl/stritem.hxx +++ b/include/svl/stritem.hxx @@ -40,7 +40,7 @@ public: virtual SvStream & Store(SvStream & rStream, sal_uInt16) const override; - virtual SfxPoolItem * Clone(SfxItemPool * = 0) const override; + virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override; void dumpAsXml(struct _xmlTextWriter* pWriter) const override; }; diff --git a/include/svl/style.hxx b/include/svl/style.hxx index cff7f49dfcee..c1d9a8209b7a 100644 --- a/include/svl/style.hxx +++ b/include/svl/style.hxx @@ -280,7 +280,7 @@ public: protected: SfxStyleSheet() // do not use! needed by MSVC at compile time to satisfy ImplInheritanceHelper2 - : SfxStyleSheetBase(OUString("dummy"), NULL, SFX_STYLE_FAMILY_ALL, 0) + : SfxStyleSheetBase(OUString("dummy"), nullptr, SFX_STYLE_FAMILY_ALL, 0) { assert(false); } diff --git a/include/svl/stylepool.hxx b/include/svl/stylepool.hxx index 18f3bef940e1..f12528ad56c4 100644 --- a/include/svl/stylepool.hxx +++ b/include/svl/stylepool.hxx @@ -33,7 +33,7 @@ private: public: typedef std::shared_ptr SfxItemSet_Pointer_t; - explicit StylePool( SfxItemSet* pIgnorableItems = 0 ); + explicit StylePool( SfxItemSet* pIgnorableItems = nullptr ); /** Insert a SfxItemSet into the style pool. diff --git a/include/svl/szitem.hxx b/include/svl/szitem.hxx index 3d9894ba4f42..f9d3d1248fae 100644 --- a/include/svl/szitem.hxx +++ b/include/svl/szitem.hxx @@ -41,7 +41,7 @@ public: SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, OUString &rText, - const IntlWrapper * = 0 ) const override; + const IntlWrapper * = nullptr ) const override; virtual bool operator==( const SfxPoolItem& ) const override; virtual bool QueryValue( css::uno::Any& rVal, @@ -49,7 +49,7 @@ public: virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const override; virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const override; }; diff --git a/include/svl/undo.hxx b/include/svl/undo.hxx index aacc127d13e3..96c77cb600f1 100644 --- a/include/svl/undo.hxx +++ b/include/svl/undo.hxx @@ -117,7 +117,7 @@ struct SVL_DLLPUBLIC SfxUndoArray SfxUndoArray *pFatherUndoArray; SfxUndoArray(size_t nMax=0): nMaxUndoActions(nMax), nCurUndoAction(0), - pFatherUndoArray(0) {} + pFatherUndoArray(nullptr) {} virtual ~SfxUndoArray(); }; diff --git a/include/svl/visitem.hxx b/include/svl/visitem.hxx index 107c8087b3d4..0819d35f28e5 100644 --- a/include/svl/visitem.hxx +++ b/include/svl/visitem.hxx @@ -50,7 +50,7 @@ public: virtual bool GetPresentation(SfxItemPresentation, SfxMapUnit, SfxMapUnit, OUString & rText, - const IntlWrapper * = 0) + const IntlWrapper * = nullptr) const override; virtual bool QueryValue( css::uno::Any& rVal, @@ -63,7 +63,7 @@ public: virtual SvStream & Store(SvStream & rStream, sal_uInt16) const override; - virtual SfxPoolItem * Clone(SfxItemPool * = 0) const override; + virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override; OUString GetValueTextByVal(bool bTheValue) const; diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx index 216d354d3db1..2e3760e084ee 100644 --- a/include/svl/zforlist.hxx +++ b/include/svl/zforlist.hxx @@ -704,8 +704,8 @@ public: returned, even if the format code only contains [$xxx] ! */ bool GetNewCurrencySymbolString( sal_uInt32 nFormat, OUString& rSymbol, - const NfCurrencyEntry** ppEntry = NULL, - bool* pBank = NULL ) const; + const NfCurrencyEntry** ppEntry = nullptr, + bool* pBank = nullptr ) const; /** Look up the corresponding NfCurrencyEntry matching rSymbol (may be CurrencySymbol or CurrencyAbbreviation) and possibly diff --git a/svl/qa/unit/items/test_IndexedStyleSheets.cxx b/svl/qa/unit/items/test_IndexedStyleSheets.cxx index 17edaf036d1f..c6c728818979 100644 --- a/svl/qa/unit/items/test_IndexedStyleSheets.cxx +++ b/svl/qa/unit/items/test_IndexedStyleSheets.cxx @@ -24,7 +24,7 @@ class MockedStyleSheet : public SfxStyleSheetBase { public: MockedStyleSheet(const rtl::OUString& name, SfxStyleFamily fam = SFX_STYLE_FAMILY_CHAR) - : SfxStyleSheetBase(name, NULL, fam, 0) + : SfxStyleSheetBase(name, nullptr, fam, 0) {;} }; diff --git a/svl/qa/unit/items/test_itempool.cxx b/svl/qa/unit/items/test_itempool.cxx index f42ee3fec23e..0c817ec804be 100644 --- a/svl/qa/unit/items/test_itempool.cxx +++ b/svl/qa/unit/items/test_itempool.cxx @@ -43,7 +43,7 @@ void PoolItemTest::testPool() SfxItemPool *pPool = new SfxItemPool("testpool", 0, 3, aItems); SfxItemPool_Impl *pImpl = SfxItemPool_Impl::GetImpl(pPool); - CPPUNIT_ASSERT(pImpl != NULL); + CPPUNIT_ASSERT(pImpl != nullptr); CPPUNIT_ASSERT(pImpl->maPoolItems.size() == 4); // Poolable @@ -51,10 +51,10 @@ void PoolItemTest::testPool() SfxVoidItem aNotherZero( 0 ); { - CPPUNIT_ASSERT(pImpl->maPoolItems[0] == NULL); + CPPUNIT_ASSERT(pImpl->maPoolItems[0] == nullptr); const SfxPoolItem &rVal = pPool->Put(aItemZero); CPPUNIT_ASSERT(rVal == aItemZero); - CPPUNIT_ASSERT(pImpl->maPoolItems[0] != NULL); + CPPUNIT_ASSERT(pImpl->maPoolItems[0] != nullptr); const SfxPoolItem &rVal2 = pPool->Put(aNotherZero); CPPUNIT_ASSERT(rVal2 == rVal); CPPUNIT_ASSERT(&rVal2 == &rVal); @@ -70,10 +70,10 @@ void PoolItemTest::testPool() SfxVoidItem aItemOne( 1 ); SfxVoidItem aNotherOne( 1 ); { - CPPUNIT_ASSERT(pImpl->maPoolItems[1] == NULL); + CPPUNIT_ASSERT(pImpl->maPoolItems[1] == nullptr); const SfxPoolItem &rVal = pPool->Put(aItemOne); CPPUNIT_ASSERT(rVal == aItemOne); - CPPUNIT_ASSERT(pImpl->maPoolItems[1] != NULL); + CPPUNIT_ASSERT(pImpl->maPoolItems[1] != nullptr); const SfxPoolItem &rVal2 = pPool->Put(aNotherOne); CPPUNIT_ASSERT(rVal2 == rVal); @@ -84,10 +84,10 @@ void PoolItemTest::testPool() SfxVoidItem aItemTwo( 2 ); SfxVoidItem aNotherTwo( 2 ); { - CPPUNIT_ASSERT(pImpl->maPoolItems[2] == NULL); + CPPUNIT_ASSERT(pImpl->maPoolItems[2] == nullptr); const SfxPoolItem &rVal = pPool->Put(aItemTwo); // those guys just don't go in ... - CPPUNIT_ASSERT(pImpl->maPoolItems[2] == NULL); + CPPUNIT_ASSERT(pImpl->maPoolItems[2] == nullptr); CPPUNIT_ASSERT(rVal == aItemOne); } diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx index 695483ae0c37..e10221132dcf 100644 --- a/svl/qa/unit/svl.cxx +++ b/svl/qa/unit/svl.cxx @@ -123,19 +123,19 @@ void Test::testNumberFormat() "#,##0", "#,##0.00", "#,###.00", - 0 + nullptr }; const char* pScientific[] = { "0.00E+000", "0.00E+00", - 0 + nullptr }; const char* pPercent[] = { "0%", "0.00%", - 0 + nullptr }; const char* pFraction[] = { @@ -147,7 +147,7 @@ void Test::testNumberFormat() "# \?/4", "# \?\?/100", #endif - 0 + nullptr }; #if 0 // TODO: Find out why on some systems the last two currency format codes differ. @@ -197,7 +197,7 @@ void Test::testNumberFormat() "[HH]:MM:SS", "MM:SS.00", "[HH]:MM:SS.00", - 0 + nullptr }; #if 0 // TODO: This currently fails @@ -210,12 +210,12 @@ void Test::testNumberFormat() const char* pBoolean[] = { "BOOLEAN", - 0 + nullptr }; const char* pText[] = { "@", - 0 + nullptr }; struct { @@ -400,7 +400,7 @@ void Test::checkPreviewString(SvNumberFormatter& aFormatter, OUString& sExpected) { OUString sStr; - Color* pColor = 0; + Color* pColor = nullptr; Color** ppColor = &pColor; if (!aFormatter.GetPreviewString(sCode, fPreviewNumber, sStr, ppColor, eLang)) CPPUNIT_FAIL("GetPreviewString() failed"); diff --git a/svl/qa/unit/test_INetContentType.cxx b/svl/qa/unit/test_INetContentType.cxx index 68badb6745c6..7c83a1e0252b 100644 --- a/svl/qa/unit/test_INetContentType.cxx +++ b/svl/qa/unit/test_INetContentType.cxx @@ -40,7 +40,7 @@ public: void Test::testBad() { OUString in("foo=bar"); CPPUNIT_ASSERT_EQUAL( - static_cast(0), + static_cast(nullptr), INetMIME::scanContentType(in.getStr(), in.getStr() + in.getLength())); OUString t; OUString s; diff --git a/svl/qa/unit/test_URIHelper.cxx b/svl/qa/unit/test_URIHelper.cxx index 37d53e90ec6c..50b239943594 100644 --- a/svl/qa/unit/test_URIHelper.cxx +++ b/svl/qa/unit/test_URIHelper.cxx @@ -266,7 +266,7 @@ void Test::testNormalizedMakeRelative() { URIHelper::normalizedMakeRelative( m_context, OUString::createFromAscii(tests[i].base), OUString::createFromAscii(tests[i].absolute))); - bool ok = tests[i].relative == 0 + bool ok = tests[i].relative == nullptr ? !ref.is() : ref.is() && ref->getUriReference().equalsAscii(tests[i].relative); OString msg; @@ -287,7 +287,7 @@ void Test::testNormalizedMakeRelative() { buf.append("none"); } buf.append(" instead of "); - if (tests[i].relative == 0) { + if (tests[i].relative == nullptr) { buf.append("none"); } else { buf.append('<'); @@ -310,7 +310,7 @@ void Test::testFindFirstURLInText() { static Data const tests[] = { { "...ftp://bla.bla.bla/blubber/...", "ftp://bla.bla.bla/blubber/", 3, 29 }, - { "..\\ftp://bla.bla.bla/blubber/...", 0, 0, 0 }, + { "..\\ftp://bla.bla.bla/blubber/...", nullptr, 0, 0 }, { "..\\ftp:\\\\bla.bla.bla\\blubber/...", //Sync with tools/source/fsys/urlobj.cxx and changeScheme #ifdef LINUX @@ -320,12 +320,12 @@ void Test::testFindFirstURLInText() { #endif { "http://sun.com", "http://sun.com/", 0, 14 }, { "http://sun.com/", "http://sun.com/", 0, 15 }, - { "http://www.xerox.com@www.pcworld.com/go/3990332.htm", 0, 0, 0 }, + { "http://www.xerox.com@www.pcworld.com/go/3990332.htm", nullptr, 0, 0 }, { "ftp://www.xerox.com@www.pcworld.com/go/3990332.htm", "ftp://www.xerox.com@www.pcworld.com/go/3990332.htm", 0, 50 }, - { "Version.1.2.3", 0, 0, 0 }, - { "Version:1.2.3", 0, 0, 0 }, - { "a.b.c", 0, 0, 0 }, + { "Version.1.2.3", nullptr, 0, 0 }, + { "Version:1.2.3", nullptr, 0, 0 }, + { "a.b.c", nullptr, 0, 0 }, { "file:///a|...", "file:///a:", 0, 10 }, { "file:///a||...", "file:///a%7C%7C", 0, 11 }, { "file:///a|/bc#...", "file:///a:/bc", 0, 13 }, @@ -333,61 +333,61 @@ void Test::testFindFirstURLInText() { { "abc.def.ghi,ftp.xxx.yyy/zzz...", "ftp://ftp.xxx.yyy/zzz", 12, 27 }, { "abc.def.ghi,Ftp.xxx.yyy/zzz...", "ftp://Ftp.xxx.yyy/zzz", 12, 27 }, { "abc.def.ghi,www.xxx.yyy...", "http://www.xxx.yyy/", 12, 23 }, - { "abc.def.ghi,wwww.xxx.yyy...", 0, 0, 0 }, + { "abc.def.ghi,wwww.xxx.yyy...", nullptr, 0, 0 }, { "abc.def.ghi,wWW.xxx.yyy...", "http://wWW.xxx.yyy/", 12, 23 }, { "Bla {mailto.me@abc.def.g.h.i}...", "mailto:%7Bmailto.me@abc.def.g.h.i", 4, 28 }, - { "abc@def@ghi", 0, 0, 0 }, + { "abc@def@ghi", nullptr, 0, 0 }, { "lala@sun.com", "mailto:lala@sun.com", 0, 12 }, { "1lala@sun.com", "mailto:1lala@sun.com", 0, 13 }, { "aaa_bbb@xxx.yy", "mailto:aaa_bbb@xxx.yy", 0, 14 }, { "{a:\\bla/bla/bla...}", "file:///a:/bla/bla/bla", 1, 15 }, { "#b:/c/d#e#f#", "file:///b:/c/d", 1, 7 }, { "a:/", "file:///a:/", 0, 3 }, - { ".component:", 0, 0, 0 }, - { ".uno:", 0, 0, 0 }, - { "cid:", 0, 0, 0 }, - { "data:", 0, 0, 0 }, - { "db:", 0, 0, 0 }, - { "file:", 0, 0, 0 }, - { "ftp:", 0, 0, 0 }, - { "http:", 0, 0, 0 }, - { "https:", 0, 0, 0 }, - { "imap:", 0, 0, 0 }, - { "javascript:", 0, 0, 0 }, - { "ldap:", 0, 0, 0 }, - { "macro:", 0, 0, 0 }, - { "mailto:", 0, 0, 0 }, - { "news:", 0, 0, 0 }, - { "out:", 0, 0, 0 }, - { "pop3:", 0, 0, 0 }, - { "private:", 0, 0, 0 }, - { "slot:", 0, 0, 0 }, - { "staroffice.component:", 0, 0, 0 }, - { "staroffice.db:", 0, 0, 0 }, - { "staroffice.factory:", 0, 0, 0 }, - { "staroffice.helpid:", 0, 0, 0 }, - { "staroffice.java:", 0, 0, 0 }, - { "staroffice.macro:", 0, 0, 0 }, - { "staroffice.out:", 0, 0, 0 }, - { "staroffice.pop3:", 0, 0, 0 }, - { "staroffice.private:", 0, 0, 0 }, - { "staroffice.searchfolder:", 0, 0, 0 }, - { "staroffice.slot:", 0, 0, 0 }, - { "staroffice.trashcan:", 0, 0, 0 }, - { "staroffice.uno:", 0, 0, 0 }, - { "staroffice.vim:", 0, 0, 0 }, - { "staroffice:", 0, 0, 0 }, - { "vim:", 0, 0, 0 }, - { "vnd.sun.star.cmd:", 0, 0, 0 }, - { "vnd.sun.star.help:", 0, 0, 0 }, - { "vnd.sun.star.hier:", 0, 0, 0 }, - { "vnd.sun.star.pkg:", 0, 0, 0 }, - { "vnd.sun.star.script:", 0, 0, 0 }, - { "vnd.sun.star.webdav:", 0, 0, 0 }, - { "vnd.sun.star.wfs:", 0, 0, 0 }, - { "generic:path", 0, 0, 0 }, - { "wfs:", 0, 0, 0 } + { ".component:", nullptr, 0, 0 }, + { ".uno:", nullptr, 0, 0 }, + { "cid:", nullptr, 0, 0 }, + { "data:", nullptr, 0, 0 }, + { "db:", nullptr, 0, 0 }, + { "file:", nullptr, 0, 0 }, + { "ftp:", nullptr, 0, 0 }, + { "http:", nullptr, 0, 0 }, + { "https:", nullptr, 0, 0 }, + { "imap:", nullptr, 0, 0 }, + { "javascript:", nullptr, 0, 0 }, + { "ldap:", nullptr, 0, 0 }, + { "macro:", nullptr, 0, 0 }, + { "mailto:", nullptr, 0, 0 }, + { "news:", nullptr, 0, 0 }, + { "out:", nullptr, 0, 0 }, + { "pop3:", nullptr, 0, 0 }, + { "private:", nullptr, 0, 0 }, + { "slot:", nullptr, 0, 0 }, + { "staroffice.component:", nullptr, 0, 0 }, + { "staroffice.db:", nullptr, 0, 0 }, + { "staroffice.factory:", nullptr, 0, 0 }, + { "staroffice.helpid:", nullptr, 0, 0 }, + { "staroffice.java:", nullptr, 0, 0 }, + { "staroffice.macro:", nullptr, 0, 0 }, + { "staroffice.out:", nullptr, 0, 0 }, + { "staroffice.pop3:", nullptr, 0, 0 }, + { "staroffice.private:", nullptr, 0, 0 }, + { "staroffice.searchfolder:", nullptr, 0, 0 }, + { "staroffice.slot:", nullptr, 0, 0 }, + { "staroffice.trashcan:", nullptr, 0, 0 }, + { "staroffice.uno:", nullptr, 0, 0 }, + { "staroffice.vim:", nullptr, 0, 0 }, + { "staroffice:", nullptr, 0, 0 }, + { "vim:", nullptr, 0, 0 }, + { "vnd.sun.star.cmd:", nullptr, 0, 0 }, + { "vnd.sun.star.help:", nullptr, 0, 0 }, + { "vnd.sun.star.hier:", nullptr, 0, 0 }, + { "vnd.sun.star.pkg:", nullptr, 0, 0 }, + { "vnd.sun.star.script:", nullptr, 0, 0 }, + { "vnd.sun.star.webdav:", nullptr, 0, 0 }, + { "vnd.sun.star.wfs:", nullptr, 0, 0 }, + { "generic:path", nullptr, 0, 0 }, + { "wfs:", nullptr, 0, 0 } }; CharClass charClass( m_context, LanguageTag( css::lang::Locale("en", "US", ""))); for (std::size_t i = 0; i < SAL_N_ELEMENTS(tests); ++i) { @@ -396,7 +396,7 @@ void Test::testFindFirstURLInText() { sal_Int32 end = input.getLength(); OUString result( URIHelper::FindFirstURLInText(input, begin, end, charClass)); - bool ok = tests[i].result == 0 + bool ok = tests[i].result == nullptr ? (result.getLength() == 0 && begin == input.getLength() && end == input.getLength()) : (result.equalsAscii(tests[i].result) && begin == tests[i].begin @@ -407,7 +407,7 @@ void Test::testFindFirstURLInText() { buf.append('"'); buf.append(tests[i].input); buf.append("\" -> "); - buf.append(tests[i].result == 0 ? "none" : tests[i].result); + buf.append(tests[i].result == nullptr ? "none" : tests[i].result); buf.append(" ("); buf.append(static_cast< sal_Int32 >(tests[i].begin)); buf.append(", "); diff --git a/svl/source/config/asiancfg.cxx b/svl/source/config/asiancfg.cxx index a4af225c86ba..3386689987f7 100644 --- a/svl/source/config/asiancfg.cxx +++ b/svl/source/config/asiancfg.cxx @@ -135,12 +135,12 @@ void SvxAsianConfig::SetStartEndChars( css::lang::Locale const & locale, OUString const * startChars, OUString const * endChars) { - assert((startChars == 0) == (endChars == 0)); + assert((startChars == nullptr) == (endChars == nullptr)); css::uno::Reference< css::container::XNameContainer > set( officecfg::Office::Common::AsianLayout::StartEndCharacters::get( impl_->batch)); OUString name(toString(locale)); - if (startChars == 0) { + if (startChars == nullptr) { try { set->removeByName(name); } catch (css::container::NoSuchElementException &) {} diff --git a/svl/source/config/cjkoptions.cxx b/svl/source/config/cjkoptions.cxx index 69d456b907bc..59b82ca49692 100644 --- a/svl/source/config/cjkoptions.cxx +++ b/svl/source/config/cjkoptions.cxx @@ -379,7 +379,7 @@ bool SvtCJKOptions_Impl::IsReadOnly(SvtCJKOptions::EOption eOption) const // global -static SvtCJKOptions_Impl* pCJKOptions = NULL; +static SvtCJKOptions_Impl* pCJKOptions = nullptr; static sal_Int32 nCJKRefCount = 0; namespace { struct theCJKOptionsMutex : public rtl::Static< ::osl::Mutex , theCJKOptionsMutex >{}; } diff --git a/svl/source/config/ctloptions.cxx b/svl/source/config/ctloptions.cxx index 4e526404e864..cb9acf10cd16 100644 --- a/svl/source/config/ctloptions.cxx +++ b/svl/source/config/ctloptions.cxx @@ -376,7 +376,7 @@ void SvtCTLOptions_Impl::SetCTLTextNumerals( SvtCTLOptions::TextNumerals _eNumer } // global -static SvtCTLOptions_Impl* pCTLOptions = NULL; +static SvtCTLOptions_Impl* pCTLOptions = nullptr; static sal_Int32 nCTLRefCount = 0; namespace { struct CTLMutex : public rtl::Static< osl::Mutex, CTLMutex > {}; } diff --git a/svl/source/config/itemholder2.cxx b/svl/source/config/itemholder2.cxx index 5e46847dc7b5..a3b58097a8c2 100644 --- a/svl/source/config/itemholder2.cxx +++ b/svl/source/config/itemholder2.cxx @@ -142,7 +142,7 @@ void ItemHolder2::impl_deleteItem(TItemInfo& rItem) if (rItem.pItem) { delete rItem.pItem; - rItem.pItem = 0; + rItem.pItem = nullptr; } } diff --git a/svl/source/filerec/filerec.cxx b/svl/source/filerec/filerec.cxx index ef538605af87..73bd612161d2 100644 --- a/svl/source/filerec/filerec.cxx +++ b/svl/source/filerec/filerec.cxx @@ -523,7 +523,7 @@ bool SfxMultiRecordReader::ReadHeader_Impl() SfxMultiRecordReader::SfxMultiRecordReader( SvStream *pStream, sal_uInt16 nTag ) - : _pContentOfs(0) + : _pContentOfs(nullptr) , _nContentSize(0) , _nContentCount(0) , _nContentNo(0) diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx index c9ad983ea073..9c482eb3f157 100644 --- a/svl/source/fsstor/fsfactory.cxx +++ b/svl/source/fsstor/fsfactory.cxx @@ -61,7 +61,7 @@ uno::Reference< uno::XInterface > SAL_CALL FSStorageFactory::createInstance() { OUString aTempURL; - aTempURL = ::utl::TempFile( NULL, true ).GetURL(); + aTempURL = ::utl::TempFile( nullptr, true ).GetURL(); if ( aTempURL.isEmpty() ) throw uno::RuntimeException(); // TODO: can not create tempfile @@ -183,7 +183,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL fsstorage_component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, SAL_UNUSED_PARAMETER void * /* pRegistryKey */) { - void * pResult = 0; + void * pResult = nullptr; if (pServiceManager) { uno::Reference< lang::XSingleServiceFactory > xFactory; diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx index 86ba08f7218e..bb70c8c7a1a8 100644 --- a/svl/source/fsstor/fsstorage.cxx +++ b/svl/source/fsstor/fsstorage.cxx @@ -78,8 +78,8 @@ struct FSStorage_Impl : m_aURL( aContent.getURL() ) , m_pContent( new ::ucbhelper::Content( aContent ) ) , m_nMode( nMode ) - , m_pListenersContainer( NULL ) - , m_pTypeCollection( NULL ) + , m_pListenersContainer( nullptr ) + , m_pTypeCollection( nullptr ) , m_xContext( xContext ) { OSL_ENSURE( !m_aURL.isEmpty(), "The URL must not be empty" ); @@ -286,11 +286,11 @@ void SAL_CALL FSStorage::release() throw() uno::Sequence< uno::Type > SAL_CALL FSStorage::getTypes() throw( uno::RuntimeException, std::exception ) { - if ( m_pImpl->m_pTypeCollection == NULL ) + if ( m_pImpl->m_pTypeCollection == nullptr ) { ::osl::MutexGuard aGuard( m_aMutex ); - if ( m_pImpl->m_pTypeCollection == NULL ) + if ( m_pImpl->m_pTypeCollection == nullptr ) { m_pImpl->m_pTypeCollection = new ::cppu::OTypeCollection ( cppu::UnoType::get() @@ -1155,7 +1155,7 @@ void SAL_CALL FSStorage::dispose() } delete m_pImpl; - m_pImpl = NULL; + m_pImpl = nullptr; } void SAL_CALL FSStorage::addEventListener( diff --git a/svl/source/fsstor/oinputstreamcontainer.cxx b/svl/source/fsstor/oinputstreamcontainer.cxx index 948b44c8dc87..ec086fe2a4dc 100644 --- a/svl/source/fsstor/oinputstreamcontainer.cxx +++ b/svl/source/fsstor/oinputstreamcontainer.cxx @@ -29,7 +29,7 @@ OFSInputStreamContainer::OFSInputStreamContainer( const uno::Reference< io::XInp , m_xSeekable( xStream, uno::UNO_QUERY ) , m_bSeekable( false ) , m_bDisposed( false ) -, m_pListenersContainer( NULL ) +, m_pListenersContainer( nullptr ) { m_bSeekable = m_xSeekable.is(); } @@ -39,20 +39,20 @@ OFSInputStreamContainer::~OFSInputStreamContainer() if ( m_pListenersContainer ) { delete m_pListenersContainer; - m_pListenersContainer = NULL; + m_pListenersContainer = nullptr; } } uno::Sequence< uno::Type > SAL_CALL OFSInputStreamContainer::getTypes() throw ( uno::RuntimeException, std::exception ) { - static ::cppu::OTypeCollection* pTypeCollection = NULL ; + static ::cppu::OTypeCollection* pTypeCollection = nullptr ; - if ( pTypeCollection == NULL ) + if ( pTypeCollection == nullptr ) { ::osl::MutexGuard aGuard( m_aMutex ) ; - if ( pTypeCollection == NULL ) + if ( pTypeCollection == nullptr ) { if ( m_bSeekable ) { diff --git a/svl/source/fsstor/ostreamcontainer.cxx b/svl/source/fsstor/ostreamcontainer.cxx index 5ed416ee3a33..f5e92ec07723 100644 --- a/svl/source/fsstor/ostreamcontainer.cxx +++ b/svl/source/fsstor/ostreamcontainer.cxx @@ -28,8 +28,8 @@ OFSStreamContainer::OFSStreamContainer( const uno::Reference < io::XStream >& xS : m_bDisposed( false ) , m_bInputClosed( false ) , m_bOutputClosed( false ) -, m_pListenersContainer( NULL ) -, m_pTypeCollection( NULL ) +, m_pListenersContainer( nullptr ) +, m_pTypeCollection( nullptr ) { try { @@ -59,7 +59,7 @@ OFSStreamContainer::~OFSStreamContainer() if ( m_pListenersContainer ) { delete m_pListenersContainer; - m_pListenersContainer = NULL; + m_pListenersContainer = nullptr; } } @@ -145,11 +145,11 @@ void SAL_CALL OFSStreamContainer::release() uno::Sequence< uno::Type > SAL_CALL OFSStreamContainer::getTypes() throw( uno::RuntimeException, std::exception ) { - if ( m_pTypeCollection == NULL ) + if ( m_pTypeCollection == nullptr ) { ::osl::MutexGuard aGuard( m_aMutex ); - if ( m_pTypeCollection == NULL ) + if ( m_pTypeCollection == nullptr ) { ::cppu::OTypeCollection aTypeCollection ( cppu::UnoType::get() diff --git a/svl/source/inc/poolio.hxx b/svl/source/inc/poolio.hxx index dc524ac24aec..10caa003bbc8 100644 --- a/svl/source/inc/poolio.hxx +++ b/svl/source/inc/poolio.hxx @@ -112,13 +112,13 @@ struct SfxItemPool_Impl bool mbPersistentRefCounts; SfxItemPool_Impl( SfxItemPool* pMaster, const OUString& rName, sal_uInt16 nStart, sal_uInt16 nEnd ) - : maPoolItems(nEnd - nStart + 1, static_cast(NULL)) + : maPoolItems(nEnd - nStart + 1, static_cast(nullptr)) , aName(rName) , ppPoolDefaults(new SfxPoolItem* [nEnd - nStart + 1]) - , ppStaticDefaults(0) + , ppStaticDefaults(nullptr) , mpMaster(pMaster) - , mpSecondary(NULL) - , mpPoolRanges(NULL) + , mpSecondary(nullptr) + , mpPoolRanges(nullptr) , mnStart(nStart) , mnEnd(nEnd) , mnFileFormatVersion(0) @@ -153,9 +153,9 @@ struct SfxItemPool_Impl maPoolItems.clear(); delete[] mpPoolRanges; - mpPoolRanges = NULL; + mpPoolRanges = nullptr; delete[] ppPoolDefaults; - ppPoolDefaults = NULL; + ppPoolDefaults = nullptr; } void readTheItems(SvStream & rStream, sal_uInt32 nCount, sal_uInt16 nVersion, diff --git a/svl/source/items/IndexedStyleSheets.cxx b/svl/source/items/IndexedStyleSheets.cxx index dc5b8ed3baf3..c433864bc333 100644 --- a/svl/source/items/IndexedStyleSheets.cxx +++ b/svl/source/items/IndexedStyleSheets.cxx @@ -225,7 +225,7 @@ IndexedStyleSheets::GetStyleSheetByPosition(unsigned pos) { if( pos < mStyleSheets.size() ) return mStyleSheets.at(pos); - return NULL; + return nullptr; } void diff --git a/svl/source/items/aeitem.cxx b/svl/source/items/aeitem.cxx index f2428afb488b..57dbd88d9996 100644 --- a/svl/source/items/aeitem.cxx +++ b/svl/source/items/aeitem.cxx @@ -37,38 +37,38 @@ class SfxAllEnumValueArr : public std::vector {}; SfxAllEnumItem::SfxAllEnumItem() : SfxEnumItem(), - pValues( 0 ), - pDisabledValues( 0 ) + pValues( nullptr ), + pDisabledValues( nullptr ) { } SfxAllEnumItem::SfxAllEnumItem(sal_uInt16 which, sal_uInt16 nVal): SfxEnumItem(which, nVal), - pValues( 0 ), - pDisabledValues( 0 ) + pValues( nullptr ), + pDisabledValues( nullptr ) { InsertValue( nVal ); } SfxAllEnumItem::SfxAllEnumItem( sal_uInt16 which, SvStream &rStream ): SfxEnumItem(which, rStream), - pValues( 0 ), - pDisabledValues( 0 ) + pValues( nullptr ), + pDisabledValues( nullptr ) { InsertValue( GetValue() ); } SfxAllEnumItem::SfxAllEnumItem(sal_uInt16 which): SfxEnumItem(which, 0), - pValues( 0 ), - pDisabledValues( 0 ) + pValues( nullptr ), + pDisabledValues( nullptr ) { } SfxAllEnumItem::SfxAllEnumItem(const SfxAllEnumItem &rCopy): SfxEnumItem(rCopy), - pValues(0), - pDisabledValues( 0 ) + pValues(nullptr), + pDisabledValues( nullptr ) { if ( !rCopy.pValues ) return; diff --git a/svl/source/items/flagitem.cxx b/svl/source/items/flagitem.cxx index e08bc41f7fc5..faa63f53d0df 100644 --- a/svl/source/items/flagitem.cxx +++ b/svl/source/items/flagitem.cxx @@ -78,7 +78,7 @@ sal_uInt8 SfxFlagItem::GetFlagCount() const SfxPoolItem* SfxFlagItem::Create(SvStream &, sal_uInt16) const { SAL_INFO("svl", "calling Create() on SfxFlagItem -- override!"); - return 0; + return nullptr; } diff --git a/svl/source/items/itemiter.cxx b/svl/source/items/itemiter.cxx index 7b026e618b29..a42a90bc2358 100644 --- a/svl/source/items/itemiter.cxx +++ b/svl/source/items/itemiter.cxx @@ -62,7 +62,7 @@ const SfxPoolItem* SfxItemIter::NextItem() } while (m_nCurrent < m_nEnd && !*(ppFnd + m_nCurrent )); return *(ppFnd+m_nCurrent); } - return 0; + return nullptr; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx index 362e7257c974..71dcfb0e57a8 100644 --- a/svl/source/items/itempool.cxx +++ b/svl/source/items/itempool.cxx @@ -108,7 +108,7 @@ const SfxPoolItem* SfxItemPool::GetPoolDefaultItem( sal_uInt16 nWhich ) const else { SFX_ASSERT( false, nWhich, "unknown WhichId - cannot get pool default" ); - pRet = 0; + pRet = nullptr; } return pRet; } @@ -309,7 +309,7 @@ void SfxItemPool::ReleaseDefaults // ppStaticDefaults points to deleted memory if bDelete == true. if ( bDelete ) - pImp->ppStaticDefaults = 0; + pImp->ppStaticDefaults = nullptr; } @@ -343,11 +343,11 @@ void SfxItemPool::ReleaseDefaults n, "this is not a static Default" ); (*( pDefaults + n ))->SetRefCount( 0 ); if ( bDelete ) - { delete *( pDefaults + n ); *(pDefaults + n) = 0; } + { delete *( pDefaults + n ); *(pDefaults + n) = nullptr; } } if ( bDelete ) - { delete[] pDefaults; pDefaults = 0; } + { delete[] pDefaults; pDefaults = nullptr; } } @@ -357,7 +357,7 @@ SfxItemPool::~SfxItemPool() if ( !pImp->maPoolItems.empty() && pImp->ppPoolDefaults ) Delete(); - if (pImp->mpMaster != NULL && pImp->mpMaster != this) + if (pImp->mpMaster != nullptr && pImp->mpMaster != this) { // This condition indicates an error. // A pImp->mpMaster->SetSecondaryPool(...) call should have been made @@ -365,7 +365,7 @@ SfxItemPool::~SfxItemPool() // prevent a crash later on. DBG_ASSERT( pImp->mpMaster == this, "destroying active Secondary-Pool" ); if (pImp->mpMaster->pImp->mpSecondary == this) - pImp->mpMaster->pImp->mpSecondary = NULL; + pImp->mpMaster->pImp->mpSecondary = nullptr; } delete pImp; @@ -767,7 +767,7 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich { sal_uInt32 nOffset = std::distance(pItemArr->begin(), ppFree); pItemArr->maPtrToIndex.insert(std::make_pair(pNewItem, nOffset)); - assert(*ppFree == NULL); + assert(*ppFree == nullptr); *ppFree = pNewItem; } return *pNewItem; @@ -953,7 +953,7 @@ const SfxPoolItem *SfxItemPool::GetItem2(sal_uInt16 nWhich, sal_uInt32 nOfst) co if ( pImp->mpSecondary ) return pImp->mpSecondary->GetItem2( nWhich, nOfst ); SFX_ASSERT( false, nWhich, "unknown WhichId - cannot resolve surrogate" ); - return 0; + return nullptr; } // default attribute? @@ -964,7 +964,7 @@ const SfxPoolItem *SfxItemPool::GetItem2(sal_uInt16 nWhich, sal_uInt32 nOfst) co if( pItemArr && nOfst < pItemArr->size() ) return (*pItemArr)[nOfst]; - return 0; + return nullptr; } sal_uInt32 SfxItemPool::GetItemCount2(sal_uInt16 nWhich) const @@ -1065,6 +1065,6 @@ void SfxItemPool::SetFileFormatVersion( sal_uInt16 nFileFormatVersion ) pPool->pImp->mnFileFormatVersion = nFileFormatVersion; } -const SfxItemPool* SfxItemPool::pStoringPool_ = 0; +const SfxItemPool* SfxItemPool::pStoringPool_ = nullptr; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/itemprop.cxx b/svl/source/items/itemprop.cxx index 66951f1340c0..a815405a1afb 100644 --- a/svl/source/items/itemprop.cxx +++ b/svl/source/items/itemprop.cxx @@ -84,7 +84,7 @@ const SfxItemPropertySimpleEntry* SfxItemPropertyMap::getByName( const OUString { SfxItemPropertyHashMap_t::const_iterator aIter = m_pImpl->find(rName); if( aIter == m_pImpl->end() ) - return 0; + return nullptr; return &aIter->second; } @@ -178,7 +178,7 @@ void SfxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry& rEn throw(RuntimeException) { // get the SfxPoolItem - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; SfxItemState eState = rSet.GetItemState( rEntry.nWID, true, &pItem ); if(SfxItemState::SET != eState && SFX_WHICH_MAX > rEntry.nWID ) pItem = &rSet.GetPool()->GetDefaultItem(rEntry.nWID); @@ -192,7 +192,7 @@ void SfxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry& rEn SfxItemSet aSet(*rSet.GetPool(), rEntry.nWID, rEntry.nWID); if(0 == (rEntry.nFlags & PropertyAttribute::MAYBEVOID)) throw RuntimeException( - "Property not found in ItemSet but not MAYBEVOID?", 0); + "Property not found in ItemSet but not MAYBEVOID?", nullptr); } @@ -232,7 +232,7 @@ void SfxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry& rEn IllegalArgumentException) { // get the SfxPoolItem - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; std::unique_ptr pNewItem; SfxItemState eState = rSet.GetItemState( rEntry.nWID, true, &pItem ); if(SfxItemState::SET != eState && SFX_WHICH_MAX > rEntry.nWID ) diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index 6272a748eb0d..a21cdb5ebf8b 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -69,7 +69,7 @@ const sal_Char *DbgCheckItemSet( const void* pVoid ) } assert(pSet->m_nCount == nCount); - return 0; + return nullptr; } #endif @@ -210,7 +210,7 @@ SfxItemSet::SfxItemSet( const SfxItemSet& rASet ) // Copy attributes SfxItemArray ppDst = m_pItems, ppSrc = rASet.m_pItems; for( sal_uInt16 n = nCnt; n; --n, ++ppDst, ++ppSrc ) - if ( 0 == *ppSrc || // Current Default? + if ( nullptr == *ppSrc || // Current Default? IsInvalidItem(*ppSrc) || // DontCare? IsStaticDefaultItem(*ppSrc) ) // Defaults that are not to be pooled? // Just copy the pointer @@ -288,7 +288,7 @@ sal_uInt16 SfxItemSet::ClearItem( sal_uInt16 nWhich ) // Due to the assertions in the sub calls, we need to do the following --m_nCount; const SfxPoolItem *pItemToClear = *ppFnd; - *ppFnd = 0; + *ppFnd = nullptr; if ( !IsInvalidItem(pItemToClear) ) { @@ -326,7 +326,7 @@ sal_uInt16 SfxItemSet::ClearItem( sal_uInt16 nWhich ) // Due to the assertions in the sub calls, we need to do this --m_nCount; const SfxPoolItem *pItemToClear = *ppFnd; - *ppFnd = 0; + *ppFnd = nullptr; if ( !IsInvalidItem(pItemToClear) ) { @@ -377,7 +377,7 @@ void SfxItemSet::ClearInvalidItems( bool bHardDefault ) for( sal_uInt16 nWhich = *pPtr; nWhich <= *(pPtr+1); ++nWhich, ++ppFnd ) if( IsInvalidItem(*ppFnd) ) { - *ppFnd = 0; + *ppFnd = nullptr; --m_nCount; } pPtr += 2; @@ -461,14 +461,14 @@ bool SfxItemSet::HasItem(sal_uInt16 nWhich, const SfxPoolItem** ppItem) const { bool bRet = SfxItemState::SET == GetItemState(nWhich, true, ppItem); if (!bRet && ppItem) - *ppItem = NULL; + *ppItem = nullptr; return bRet; } const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich ) { if ( !nWhich ) - return 0; //FIXME: Only because of Outliner bug + return nullptr; //FIXME: Only because of Outliner bug SfxItemArray ppFnd = m_pItems; const sal_uInt16* pPtr = m_pWhichRanges; @@ -482,7 +482,7 @@ const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich { // Same Item already present? if ( *ppFnd == &rItem ) - return 0; + return nullptr; // Will 'dontcare' or 'disabled' be overwritten with some real value? if ( rItem.Which() && ( IsInvalidItem(*ppFnd) || !(*ppFnd)->Which() ) ) @@ -495,13 +495,13 @@ const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich if( !rItem.Which() ) { *ppFnd = rItem.Clone(m_pPool); - return 0; + return nullptr; } else { // Same value already present? if ( rItem == **ppFnd ) - return 0; + return nullptr; // Add the new one, remove the old one const SfxPoolItem& rNew = m_pPool->Put( rItem, nWhich ); @@ -537,7 +537,7 @@ const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich ppFnd += *(pPtr+1) - *pPtr + 1; pPtr += 2; } - return 0; + return nullptr; } bool SfxItemSet::Put( const SfxItemSet& rSet, bool bInvalidAsDefault ) @@ -562,7 +562,7 @@ bool SfxItemSet::Put( const SfxItemSet& rSet, bool bInvalidAsDefault ) InvalidateItem( nWhich ); } else - bRet |= 0 != Put( **ppFnd, nWhich ); + bRet |= nullptr != Put( **ppFnd, nWhich ); } pPtr += 2; } @@ -721,7 +721,7 @@ void SfxItemSet::SetRanges( const sal_uInt16 *pNewRanges ) else { // default - aNewItems[n] = 0; + aNewItems[n] = nullptr; } } } @@ -801,7 +801,7 @@ bool SfxItemSet::Set { const SfxPoolItem* pItem; if( SfxItemState::SET == rSet.GetItemState( nWhich, true, &pItem ) ) - bRet |= 0 != Put( *pItem, pItem->Which() ); + bRet |= nullptr != Put( *pItem, pItem->Which() ); nWhich = aIter.NextWhich(); } } @@ -817,7 +817,7 @@ const SfxPoolItem* SfxItemSet::GetItem(sal_uInt16 nId, bool bSearchInParent) con sal_uInt16 nWhich = GetPool()->GetWhich(nId); // Is the Item set or 'bDeep == true' available? - const SfxPoolItem *pItem = 0; + const SfxPoolItem *pItem = nullptr; SfxItemState eState = GetItemState(nWhich, bSearchInParent, &pItem); if (bSearchInParent && SfxItemState::DEFAULT == eState && nWhich <= SFX_WHICH_MAX) { @@ -951,7 +951,7 @@ void SfxItemSet::Intersect( const SfxItemSet& rSet ) } m_pPool->Remove( **ppFnd1 ); } - *ppFnd1 = 0; + *ppFnd1 = nullptr; --m_nCount; } } @@ -1017,7 +1017,7 @@ void SfxItemSet::Differentiate( const SfxItemSet& rSet ) } m_pPool->Remove( **ppFnd1 ); } - *ppFnd1 = 0; + *ppFnd1 = nullptr; --m_nCount; } } @@ -1122,7 +1122,7 @@ static void MergeItem_Impl( SfxItemPool *_pPool, sal_uInt16 &rCount, const SfxPoolItem **ppFnd1, const SfxPoolItem *pFnd2, bool bIgnoreDefaults ) { - assert(ppFnd1 != 0 && "Merging to 0-Item"); + assert(ppFnd1 != nullptr && "Merging to 0-Item"); // 1st Item is Default? if ( !*ppFnd1 ) @@ -1219,7 +1219,7 @@ void SfxItemSet::MergeValues( const SfxItemSet& rSet, bool bIgnoreDefaults ) sal_uInt16 nWhich; while( 0 != ( nWhich = aIter.NextWhich() ) ) { - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; rSet.GetItemState( nWhich, true, &pItem ); if( !pItem ) { @@ -1465,7 +1465,7 @@ bool SfxItemSet::operator==(const SfxItemSet &rCmp) const nWh = aIter.NextWhich() ) { // If the pointer of the poolable Items are unequal, the Items must match - const SfxPoolItem *pItem1 = 0, *pItem2 = 0; + const SfxPoolItem *pItem1 = nullptr, *pItem2 = nullptr; if ( GetItemState( nWh, false, &pItem1 ) != rCmp.GetItemState( nWh, false, &pItem2 ) || ( pItem1 != pItem2 && @@ -1682,7 +1682,7 @@ static SfxItemArray AddItem_Impl(SfxItemArray pItems, sal_uInt16 nOldSize, sal_u } // Initialize new Item - *(pNew + nPos) = 0; + *(pNew + nPos) = nullptr; // Free old ItemArray delete[] pItems; @@ -1785,7 +1785,7 @@ const SfxPoolItem* SfxAllItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhi bool bIncrementCount = false; const SfxPoolItem* pOld = *( m_pItems + nPos ); if ( reinterpret_cast< SfxPoolItem* >( -1 ) == pOld ) // state "dontcare" - pOld = NULL; + pOld = nullptr; if ( !pOld ) { bIncrementCount = true; diff --git a/svl/source/items/lckbitem.cxx b/svl/source/items/lckbitem.cxx index c9418d4ec0fc..573765b0bea5 100644 --- a/svl/source/items/lckbitem.cxx +++ b/svl/source/items/lckbitem.cxx @@ -128,7 +128,7 @@ bool SfxLockBytesItem::PutValue( const css::uno::Any& rVal, sal_uInt8 ) _xVal = new SvLockBytes( pStream, true ); } else - _xVal = NULL; + _xVal = nullptr; return true; } diff --git a/svl/source/items/macitem.cxx b/svl/source/items/macitem.cxx index 8f0b66aaceed..f8406c477fe8 100644 --- a/svl/source/items/macitem.cxx +++ b/svl/source/items/macitem.cxx @@ -172,14 +172,14 @@ SvStream& SvxMacroTableDtor::Write( SvStream& rStream ) const const SvxMacro* SvxMacroTableDtor::Get(sal_uInt16 nEvent) const { SvxMacroTable::const_iterator it = aSvxMacroTable.find(nEvent); - return it == aSvxMacroTable.end() ? NULL : &(it->second); + return it == aSvxMacroTable.end() ? nullptr : &(it->second); } // returns NULL if no entry exists, or a pointer to the internal value SvxMacro* SvxMacroTableDtor::Get(sal_uInt16 nEvent) { SvxMacroTable::iterator it = aSvxMacroTable.find(nEvent); - return it == aSvxMacroTable.end() ? NULL : &(it->second); + return it == aSvxMacroTable.end() ? nullptr : &(it->second); } // return true if the key exists diff --git a/svl/source/items/nranges.cxx b/svl/source/items/nranges.cxx index d454058bc726..bc8990eb53d8 100644 --- a/svl/source/items/nranges.cxx +++ b/svl/source/items/nranges.cxx @@ -138,7 +138,7 @@ SfxUShortRanges::SfxUShortRanges( const SfxUShortRanges &rOrig ) memcpy( _pRanges, rOrig._pRanges, sizeof(sal_uInt16) * nCount ); } else - _pRanges = 0; + _pRanges = nullptr; } /** @@ -215,7 +215,7 @@ SfxUShortRanges& SfxUShortRanges::operator = // special case: 'rRanges' is empty if ( rRanges.IsEmpty() ) - _pRanges = 0; + _pRanges = nullptr; else { // copy ranges @@ -511,7 +511,7 @@ SfxUShortRanges& SfxUShortRanges::operator -= memcpy( _pRanges, pTarget.get(), nUShorts * sizeof(sal_uInt16) ); } else - _pRanges = 0; + _pRanges = nullptr; return *this; } @@ -624,7 +624,7 @@ SfxUShortRanges& SfxUShortRanges::operator /= memcpy( _pRanges, pTarget.get(), nUShorts * sizeof(sal_uInt16) ); } else - _pRanges = 0; + _pRanges = nullptr; return *this; } diff --git a/svl/source/items/poolcach.cxx b/svl/source/items/poolcach.cxx index eb1f955dbece..5fc786e05bea 100644 --- a/svl/source/items/poolcach.cxx +++ b/svl/source/items/poolcach.cxx @@ -28,7 +28,7 @@ SfxItemPoolCache::SfxItemPoolCache( SfxItemPool *pItemPool, const SfxPoolItem *pPutItem ): pPool(pItemPool), pCache(new SfxItemModifyArr_Impl), - pSetToPut( 0 ), + pSetToPut( nullptr ), pItemToPut( &pItemPool->Put(*pPutItem) ) { DBG_ASSERT(pItemPool, "No Pool provided"); @@ -40,7 +40,7 @@ SfxItemPoolCache::SfxItemPoolCache( SfxItemPool *pItemPool, pPool(pItemPool), pCache(new SfxItemModifyArr_Impl), pSetToPut( pPutSet ), - pItemToPut( 0 ) + pItemToPut( nullptr ) { DBG_ASSERT(pItemPool, "No Pool provided"); } @@ -52,7 +52,7 @@ SfxItemPoolCache::~SfxItemPoolCache() pPool->Remove( *(*pCache)[nPos].pPoolItem ); pPool->Remove( *(*pCache)[nPos].pOrigItem ); } - delete pCache; pCache = 0; + delete pCache; pCache = nullptr; if ( pItemToPut ) pPool->Remove( *pItemToPut ); diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx index bf5fba842f49..4edf4aade20b 100644 --- a/svl/source/items/poolio.cxx +++ b/svl/source/items/poolio.cxx @@ -122,7 +122,7 @@ static SfxItemKind convertUInt16ToSfxItemKind(sal_uInt16 x) SvStream &SfxItemPool::Store(SvStream &rStream) const { // Find StoreMaster - SfxItemPool *pStoreMaster = pImp->mpMaster != this ? pImp->mpMaster : 0; + SfxItemPool *pStoreMaster = pImp->mpMaster != this ? pImp->mpMaster : nullptr; while ( pStoreMaster && !pStoreMaster->pImp->bStreaming ) pStoreMaster = pStoreMaster->pImp->mpSecondary; @@ -280,7 +280,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const } // Write out additional Pools - pStoringPool_ = 0; + pStoringPool_ = nullptr; aPoolRec.Close(); if ( !rStream.GetError() && pImp->mpSecondary ) pImp->mpSecondary->Store( rStream ); @@ -364,7 +364,7 @@ void SfxItemPool_Impl::readTheItems ( SfxMultiRecordReader aItemsRec( &rStream, SFX_ITEMPOOL_REC_ITEMS ); SfxPoolItemArray_Impl *pNewArr = new SfxPoolItemArray_Impl(); - SfxPoolItem *pItem = 0; + SfxPoolItem *pItem = nullptr; sal_uLong n, nLastSurrogate = sal_uLong(-1); while (aItemsRec.GetContent()) @@ -376,7 +376,7 @@ void SfxItemPool_Impl::readTheItems ( // Fill up missing ones // coverity[tainted_data] - ignore this, though we should finally kill off this format - for ( pItem = 0, n = nLastSurrogate+1; n < nSurrogate; ++n ) + for ( pItem = nullptr, n = nLastSurrogate+1; n < nSurrogate; ++n ) pNewArr->push_back( pItem ); nLastSurrogate = nSurrogate; @@ -400,7 +400,7 @@ void SfxItemPool_Impl::readTheItems ( } // Fill up missing ones - for ( pItem = 0, n = nLastSurrogate+1; n < nItemCount; ++n ) + for ( pItem = nullptr, n = nLastSurrogate+1; n < nItemCount; ++n ) pNewArr->push_back( pItem ); SfxPoolItemArray_Impl *pOldArr = *ppArr; @@ -408,9 +408,9 @@ void SfxItemPool_Impl::readTheItems ( // Remember items that are already in the pool bool bEmpty = true; - if ( 0 != pOldArr ) + if ( nullptr != pOldArr ) for ( n = 0; bEmpty && n < pOldArr->size(); ++n ) - bEmpty = pOldArr->operator[](n) == 0; + bEmpty = pOldArr->operator[](n) == nullptr; SAL_WARN_IF( !bEmpty, "svl", "loading non-empty pool" ); if ( !bEmpty ) { @@ -492,7 +492,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) } // Find LoadMaster - SfxItemPool *pLoadMaster = pImp->mpMaster != this ? pImp->mpMaster : 0; + SfxItemPool *pLoadMaster = pImp->mpMaster != this ? pImp->mpMaster : nullptr; while ( pLoadMaster && !pLoadMaster->pImp->bStreaming ) pLoadMaster = pLoadMaster->pImp->mpSecondary; @@ -779,13 +779,13 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate // Is item stored directly? if ( SFX_ITEMS_DIRECT == nSurrogat ) - return 0; + return nullptr; // Item does not exist? if ( SFX_ITEMS_NULL == nSurrogat ) { rWhich = 0; - return 0; + return nullptr; } // If the Pool in the stream has the same structure, the surrogate @@ -810,7 +810,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate // Can the surrogate be resolved? if ( bResolvable ) { - const SfxPoolItem *pItem = 0; + const SfxPoolItem *pItem = nullptr; for ( SfxItemPool *pTarget = this; pTarget; pTarget = pTarget->pImp->mpSecondary ) { // Found the right (Range-)Pool? @@ -825,12 +825,12 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate pTarget->pImp->maPoolItems[pTarget->GetIndex_Impl(rWhich)]; pItem = pItemArr && nSurrogat < pItemArr->size() ? (*pItemArr)[nSurrogat] - : 0; + : nullptr; if ( !pItem ) { OSL_FAIL( "can't resolve surrogate" ); rWhich = 0; // Just to be sure; for the right StreamPos - return 0; + return nullptr; } // Reload from RefPool? @@ -850,7 +850,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate SFX_ASSERT( false, rWhich, "can't resolve Which-Id in LoadSurrogate" ); } - return 0; + return nullptr; } @@ -1159,7 +1159,7 @@ bool SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem, const SfxItemPool *pPool = this; while ( !pPool->IsInStoringRange(rItem.Which()) ) - if ( 0 == ( pPool = pPool->pImp->mpSecondary ) ) + if ( nullptr == ( pPool = pPool->pImp->mpSecondary ) ) return false; DBG_ASSERT( !pImp->bInSetItem || dynamic_cast( &rItem ) == nullptr, @@ -1216,7 +1216,7 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, bool bDirect, rStream.ReadUInt16( nVersion ).ReadUInt16( nLen ); rStream.SeekRel( nLen ); } - return 0; + return nullptr; } } @@ -1230,7 +1230,7 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, bool bDirect, "loading SetItem in ItemSet of SetItem" ); // Are we loading via surrogate? - const SfxPoolItem *pItem = 0; + const SfxPoolItem *pItem = nullptr; if ( !bDirect ) { // WhichId known in this version? @@ -1266,7 +1266,7 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, bool bDirect, delete pNewItem; } else - pItem = 0; + pItem = nullptr; sal_uLong nIEnd = rStream.Tell(); DBG_ASSERT( nIEnd <= (nIStart+nLen), "read past end of item" ); if ( (nIStart+nLen) != nIEnd ) diff --git a/svl/source/items/rngitem.cxx b/svl/source/items/rngitem.cxx index 83728de6f7cf..1eb615b2a2b0 100644 --- a/svl/source/items/rngitem.cxx +++ b/svl/source/items/rngitem.cxx @@ -110,7 +110,7 @@ SvStream& SfxRangeItem::Store(SvStream &rStream, sal_uInt16) const } SfxUShortRangesItem::SfxUShortRangesItem() -: _pRanges(0) +: _pRanges(nullptr) { } diff --git a/svl/source/items/sitem.cxx b/svl/source/items/sitem.cxx index 5013f9bb2d29..9f5e23b97f77 100644 --- a/svl/source/items/sitem.cxx +++ b/svl/source/items/sitem.cxx @@ -49,7 +49,7 @@ SfxSetItem::SfxSetItem( const SfxSetItem& rCopy, SfxItemPool *pPool ) : SfxSetItem::~SfxSetItem() { - delete pSet; pSet = 0; + delete pSet; pSet = nullptr; } diff --git a/svl/source/items/slstitm.cxx b/svl/source/items/slstitm.cxx index 9bf84eab905c..9f35483ec7fd 100644 --- a/svl/source/items/slstitm.cxx +++ b/svl/source/items/slstitm.cxx @@ -46,14 +46,14 @@ SfxImpStringList::~SfxImpStringList() } SfxStringListItem::SfxStringListItem() : - pImp(NULL) + pImp(nullptr) { } SfxStringListItem::SfxStringListItem( sal_uInt16 which, const std::vector* pList ) : SfxPoolItem( which ), - pImp(NULL) + pImp(nullptr) { // FIXME: Putting an empty list does not work // Therefore the query after the count is commented out @@ -67,7 +67,7 @@ SfxStringListItem::SfxStringListItem( sal_uInt16 which, const std::vectorpImp->mxIndexedStyleSheets->GetStyleSheetByPosition(nIdx).get(); @@ -471,14 +471,14 @@ SfxStyleSheetBase* SfxStyleSheetIterator::operator[](sal_uInt16 nIdx) DoesStyleMatchStyleSheetPredicate predicate(this); rtl::Reference< SfxStyleSheetBase > ref = pBasePool->pImp->mxIndexedStyleSheets->GetNthStyleSheetThatMatchesPredicate(nIdx, predicate); - if (ref.get() != NULL) + if (ref.get() != nullptr) { nAktPosition = pBasePool->pImp->mxIndexedStyleSheets->FindStyleSheetPosition(*ref); retval = ref.get(); } } - if (retval == NULL) + if (retval == nullptr) { OSL_FAIL("Incorrect index"); } @@ -492,14 +492,14 @@ SfxStyleSheetBase* SfxStyleSheetIterator::First() return operator[](0); } else { - return NULL; + return nullptr; } } SfxStyleSheetBase* SfxStyleSheetIterator::Next() { - SfxStyleSheetBase* retval = NULL; + SfxStyleSheetBase* retval = nullptr; if ( IsTrivialSearch() ) { @@ -530,7 +530,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Next() pBasePool->pImp->mxIndexedStyleSheets->GetNthStyleSheetThatMatchesPredicate( 0, predicate, nAktPosition+1); retval = ref.get(); - if (retval != NULL) { + if (retval != nullptr) { nAktPosition = pBasePool->pImp->mxIndexedStyleSheets->FindStyleSheetPosition(*ref); } } @@ -546,7 +546,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Find(const OUString& rStr) pBasePool->pImp->mxIndexedStyleSheets->FindPositionsByNameAndPredicate(rStr, predicate, svl::IndexedStyleSheets::RETURN_FIRST); if (positions.empty()) { - return NULL; + return nullptr; } unsigned pos = positions.front(); diff --git a/svl/source/items/stylepool.cxx b/svl/source/items/stylepool.cxx index b86fc924f3b6..5e3afe6aadaf 100644 --- a/svl/source/items/stylepool.cxx +++ b/svl/source/items/stylepool.cxx @@ -46,8 +46,8 @@ namespace { Node() // root node Ctor : mChildren(), maItemSet(), - mpItem( 0 ), - mpUpper( 0 ), + mpItem( nullptr ), + mpUpper( nullptr ), mbIsItemIgnorable( false ) {} Node( const SfxPoolItem& rItem, Node* pParent, const bool bIgnorable ) // child node Ctor @@ -174,7 +174,7 @@ namespace { if( aIter != mChildren.end() ) ++aIter; } - Node *pNext = 0; + Node *pNext = nullptr; while( aIter != mChildren.end() ) { // #i86923# @@ -194,7 +194,7 @@ namespace { { return pNext; } - pNext = pNext->nextItemSet( 0, bSkipUnusedItemSets, bSkipIgnorable ); // 0 => downstairs only + pNext = pNext->nextItemSet( nullptr, bSkipUnusedItemSets, bSkipIgnorable ); // 0 => downstairs only if( pNext ) return pNext; ++aIter; @@ -248,7 +248,7 @@ namespace { } else { - pChild = pChild->nextItemSet( 0, bSkipUnusedItemSets, false ); + pChild = pChild->nextItemSet( nullptr, bSkipUnusedItemSets, false ); if ( pChild ) { return pChild->getUsedOrLastAddedItemSet(); @@ -287,7 +287,7 @@ namespace { const bool bSkipIgnorable ) : mrRoot( rR ), mpCurrNode( rR.begin() ), - mpNode(0), + mpNode(nullptr), mbSkipUnusedItemSets( bSkipUnusedItemSets ), mbSkipIgnorable( bSkipIgnorable ) {} @@ -352,12 +352,12 @@ private: SfxItemSet* mpIgnorableItems; public: // #i86923# - explicit StylePoolImpl( SfxItemSet* pIgnorableItems = 0 ) + explicit StylePoolImpl( SfxItemSet* pIgnorableItems = nullptr ) : maRoot(), mnCount(0), - mpIgnorableItems( pIgnorableItems != 0 + mpIgnorableItems( pIgnorableItems != nullptr ? pIgnorableItems->Clone( false ) - : 0 ) + : nullptr ) { DBG_ASSERT( !pIgnorableItems || !pIgnorableItems->Count(), " - misusage: item set for ignorable item should be empty. Please correct usage." ); @@ -396,7 +396,7 @@ StylePool::SfxItemSet_Pointer_t StylePoolImpl::insertItemSet( const SfxItemSet& if( !rSet.GetPool()->IsItemFlag(pItem->Which(), SfxItemPoolFlags::POOLABLE ) ) bNonPoolable = true; if ( !xFoundIgnorableItems.get() || - (xFoundIgnorableItems->Put( *pItem ) == 0 ) ) + (xFoundIgnorableItems->Put( *pItem ) == nullptr ) ) { pCurNode = pCurNode->findChildNode( *pItem ); } diff --git a/svl/source/misc/adrparse.cxx b/svl/source/misc/adrparse.cxx index 27ca0f658346..96849b1dedd4 100644 --- a/svl/source/misc/adrparse.cxx +++ b/svl/source/misc/adrparse.cxx @@ -46,8 +46,8 @@ struct ParsedAddrSpec inline void ParsedAddrSpec::reset() { - m_pBegin = 0; - m_pEnd = 0; + m_pBegin = nullptr; + m_pEnd = nullptr; m_eLastElem = ELEMENT_START; m_bAtFound = false; m_bReparse = false; @@ -115,14 +115,14 @@ public: inline void SvAddressParser_Impl::resetRealNameAndFirstComment() { - m_pRealNameBegin = 0; - m_pRealNameEnd = 0; - m_pRealNameContentBegin = 0; - m_pRealNameContentEnd = 0; + m_pRealNameBegin = nullptr; + m_pRealNameEnd = nullptr; + m_pRealNameContentBegin = nullptr; + m_pRealNameContentEnd = nullptr; m_bRealNameReparse = false; m_bRealNameFinished = false; - m_pFirstCommentBegin = 0; - m_pFirstCommentEnd = 0; + m_pFirstCommentBegin = nullptr; + m_pFirstCommentEnd = nullptr; m_bFirstCommentReparse = false; } @@ -221,8 +221,8 @@ bool SvAddressParser_Impl::readToken() case TOKEN_COMMENT: { m_pCurTokenBegin = m_pInputPos - 1; - m_pCurTokenContentBegin = 0; - m_pCurTokenContentEnd = 0; + m_pCurTokenContentBegin = nullptr; + m_pCurTokenContentEnd = nullptr; bool bEscaped = false; int nLevel = 0; for (;;) @@ -440,10 +440,10 @@ OUString SvAddressParser_Impl::reparseComment(sal_Unicode const * pBegin, SvAddressParser_Impl::SvAddressParser_Impl(SvAddressParser * pParser, const OUString& rInput) - : m_pCurTokenBegin(NULL) - , m_pCurTokenEnd(NULL) - , m_pCurTokenContentBegin(NULL) - , m_pCurTokenContentEnd(NULL) + : m_pCurTokenBegin(nullptr) + , m_pCurTokenEnd(nullptr) + , m_pCurTokenContentBegin(nullptr) + , m_pCurTokenContentEnd(nullptr) { m_pInputPos = rInput.getStr(); m_pInputEnd = m_pInputPos + rInput.getLength(); @@ -619,7 +619,7 @@ SvAddressParser_Impl::SvAddressParser_Impl(SvAddressParser * pParser, } else { - m_pAddrSpec = 0; + m_pAddrSpec = nullptr; } if (m_pAddrSpec) diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx index 596536c450e8..1f51d09cc0eb 100644 --- a/svl/source/misc/inettype.cxx +++ b/svl/source/misc/inettype.cxx @@ -117,7 +117,7 @@ inline TypeIDMapEntry * Registration::getEntry(INetContentType eTypeID) if( it != rRegistration.m_aTypeIDMap.end() ) return it->second; else - return NULL; + return nullptr; } MediaTypeEntry const * seekEntry(OUString const & rTypeName, @@ -444,7 +444,7 @@ TypeNameMapEntry * Registration::getExtensionEntry(OUString const & rTypeName) TypeNameMap::iterator it = rRegistration.m_aTypeNameMap.find(aTheTypeName); if (it != rRegistration.m_aTypeNameMap.end()) return & it->second; - return 0; + return nullptr; } // static @@ -558,7 +558,7 @@ MediaTypeEntry const * seekEntry(OUString const & rTypeName, else nLow = nMiddle + 1; } - return 0; + return nullptr; } } @@ -789,10 +789,10 @@ bool INetContentTypes::parse( OUString t; OUString s; INetContentTypeParameterList p; - if (INetMIME::scanContentType(b, e, &t, &s, pParameters == 0 ? 0 : &p) == e) { + if (INetMIME::scanContentType(b, e, &t, &s, pParameters == nullptr ? nullptr : &p) == e) { rType = t; rSubType = s; - if (pParameters != 0) { + if (pParameters != nullptr) { *pParameters = p; } return true; diff --git a/svl/source/misc/sharecontrolfile.cxx b/svl/source/misc/sharecontrolfile.cxx index 3c286e97ad81..8ca316d1b061 100644 --- a/svl/source/misc/sharecontrolfile.cxx +++ b/svl/source/misc/sharecontrolfile.cxx @@ -81,7 +81,7 @@ void ShareControlFile::OpenStream() uno::Reference< ucb::XCommandEnvironment > xDummyEnv; ::ucbhelper::Content aContent = ::ucbhelper::Content( m_aURL, xDummyEnv, comphelper::getProcessComponentContext() ); - uno::Reference< ucb::XContentIdentifier > xContId( aContent.get().is() ? aContent.get()->getIdentifier() : 0 ); + uno::Reference< ucb::XContentIdentifier > xContId( aContent.get().is() ? aContent.get()->getIdentifier() : nullptr ); if ( !xContId.is() || xContId->getContentProviderScheme() != "file" ) throw io::IOException(); // the implementation supports only local files for now diff --git a/svl/source/misc/sharedstring.cxx b/svl/source/misc/sharedstring.cxx index 81379520a3d9..b81f8fcf8072 100644 --- a/svl/source/misc/sharedstring.cxx +++ b/svl/source/misc/sharedstring.cxx @@ -15,12 +15,12 @@ SharedString SharedString::getEmptyString() { // unicode string array for empty string is globally shared in OUString. // Let's take advantage of that. - rtl_uString* pData = NULL; + rtl_uString* pData = nullptr; rtl_uString_new(&pData); return SharedString(pData, pData); } -SharedString::SharedString() : mpData(NULL), mpDataIgnoreCase(NULL) {} +SharedString::SharedString() : mpData(nullptr), mpDataIgnoreCase(nullptr) {} SharedString::SharedString( rtl_uString* pData, rtl_uString* pDataIgnoreCase ) : mpData(pData), mpDataIgnoreCase(pDataIgnoreCase) @@ -31,7 +31,7 @@ SharedString::SharedString( rtl_uString* pData, rtl_uString* pDataIgnoreCase ) : rtl_uString_acquire(mpDataIgnoreCase); } -SharedString::SharedString( const OUString& rStr ) : mpData(rStr.pData), mpDataIgnoreCase(NULL) +SharedString::SharedString( const OUString& rStr ) : mpData(rStr.pData), mpDataIgnoreCase(nullptr) { rtl_uString_acquire(mpData); } @@ -122,12 +122,12 @@ const rtl_uString* SharedString::getDataIgnoreCase() const bool SharedString::isValid() const { - return mpData != NULL; + return mpData != nullptr; } bool SharedString::isEmpty() const { - return mpData == NULL || mpData->length == 0; + return mpData == nullptr || mpData->length == 0; } sal_Int32 SharedString::getLength() const diff --git a/svl/source/misc/sharedstringpool.cxx b/svl/source/misc/sharedstringpool.cxx index bb9be8c7b7eb..435209a68874 100644 --- a/svl/source/misc/sharedstringpool.cxx +++ b/svl/source/misc/sharedstringpool.cxx @@ -81,7 +81,7 @@ SharedString SharedStringPool::intern( const OUString& rStr ) if (!mpImpl->mpCharClass) // We don't track case insensitive strings. - return SharedString(pOrig, NULL); + return SharedString(pOrig, nullptr); if (!aRes.second) { diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx index a661bfa32755..f350153a8b9f 100644 --- a/svl/source/misc/strmadpt.cxx +++ b/svl/source/misc/strmadpt.cxx @@ -82,7 +82,7 @@ public: sal_uInt32 read(); - void clearReadBuffer() { m_pReadBuffer = 0; } + void clearReadBuffer() { m_pReadBuffer = nullptr; } sal_uInt32 write(sal_Int8 const * pBuffer, sal_uInt32 nSize); @@ -96,10 +96,10 @@ public: SvDataPipe_Impl::SvDataPipe_Impl(sal_uInt32 nThePageSize, sal_uInt32 nTheMinPages, sal_uInt32 nTheMaxPages) - : m_pFirstPage( 0 ) - , m_pReadPage( 0 ) - , m_pWritePage( 0 ) - , m_pReadBuffer( 0 ) + : m_pFirstPage( nullptr ) + , m_pReadPage( nullptr ) + , m_pWritePage( nullptr ) + , m_pReadBuffer( nullptr ) , m_nReadBufferSize( 0 ) , m_nReadBufferFilled( 0 ) , m_nPageSize(std::min< sal_uInt32 >( @@ -413,7 +413,7 @@ void SvInputStream::SetSize(sal_uInt64) SvInputStream::SvInputStream( css::uno::Reference< css::io::XInputStream > const & rTheStream): m_xStream(rTheStream), - m_pPipe(0), + m_pPipe(nullptr), m_nSeekedFrom(STREAM_SEEK_TO_END) { SetBufferSize(0); @@ -563,7 +563,7 @@ bool SvDataPipe_Impl::remove(Page * pPage) SvDataPipe_Impl::~SvDataPipe_Impl() { - if (m_pFirstPage != 0) + if (m_pFirstPage != nullptr) for (Page * pPage = m_pFirstPage;;) { Page * pNext = pPage->m_pNext; @@ -576,7 +576,7 @@ SvDataPipe_Impl::~SvDataPipe_Impl() sal_uInt32 SvDataPipe_Impl::read() { - if (m_pReadBuffer == 0 || m_nReadBufferSize == 0 || m_pReadPage == 0) + if (m_pReadBuffer == nullptr || m_nReadBufferSize == 0 || m_pReadPage == nullptr) return 0; sal_uInt32 nSize = m_nReadBufferSize; @@ -617,7 +617,7 @@ sal_uInt32 SvDataPipe_Impl::write(sal_Int8 const * pBuffer, sal_uInt32 nSize) if (nSize == 0) return 0; - if (m_pWritePage == 0) + if (m_pWritePage == nullptr) { m_pFirstPage = static_cast< Page * >(rtl_allocateMemory(sizeof (Page) @@ -636,7 +636,7 @@ sal_uInt32 SvDataPipe_Impl::write(sal_Int8 const * pBuffer, sal_uInt32 nSize) sal_uInt32 nRemain = nSize; - if (m_pReadBuffer != 0 && m_pReadPage == m_pWritePage + if (m_pReadBuffer != nullptr && m_pReadPage == m_pWritePage && m_pReadPage->m_pRead == m_pWritePage->m_pEnd) { sal_uInt32 nBlock = std::min(nRemain, @@ -713,7 +713,7 @@ sal_uInt32 SvDataPipe_Impl::write(sal_Int8 const * pBuffer, sal_uInt32 nSize) SvDataPipe_Impl::SeekResult SvDataPipe_Impl::setReadPosition(sal_uInt32 nPosition) { - if (m_pFirstPage == 0) + if (m_pFirstPage == nullptr) return nPosition == 0 ? SEEK_OK : SEEK_PAST_END; if (nPosition diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx index bb5678a9291f..0746cb221ce3 100644 --- a/svl/source/misc/urihelper.cxx +++ b/svl/source/misc/urihelper.cxx @@ -135,7 +135,7 @@ enum Result { Success, GeneralFailure, SpecificFailure }; Result normalizePrefix( css::uno::Reference< css::ucb::XUniversalContentBroker > const & broker, OUString const & uri, OUString * normalized) { - OSL_ASSERT(broker.is() && normalized != 0); + OSL_ASSERT(broker.is() && normalized != nullptr); css::uno::Reference< css::ucb::XContent > content; try { content = broker->queryContent(broker->createContentIdentifier(uri)); diff --git a/svl/source/notify/SfxBroadcaster.cxx b/svl/source/notify/SfxBroadcaster.cxx index f68fc472a203..d132e86e0651 100644 --- a/svl/source/notify/SfxBroadcaster.cxx +++ b/svl/source/notify/SfxBroadcaster.cxx @@ -104,7 +104,7 @@ void SfxBroadcaster::AddListener( SfxListener& rListener ) { size_t targetPosition = mpImpl->m_RemovedPositions.back(); mpImpl->m_RemovedPositions.pop_back(); - assert(mpImpl->m_Listeners[targetPosition] == NULL); + assert(mpImpl->m_Listeners[targetPosition] == nullptr); mpImpl->m_Listeners[targetPosition] = &rListener; } } @@ -133,7 +133,7 @@ void SfxBroadcaster::RemoveListener( SfxListener& rListener ) assert(aIter != mpImpl->m_Listeners.end()); // "RemoveListener: Listener unknown" // DO NOT erase the listener, set the pointer to 0 // because the current continuation may contain this->Broadcast - *aIter = 0; + *aIter = nullptr; size_t positionOfRemovedElement = std::distance(mpImpl->m_Listeners.begin(), aIter); mpImpl->m_RemovedPositions.push_back(positionOfRemovedElement); } diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx index 89b54db038b1..60bbbfd56bcb 100644 --- a/svl/source/numbers/numfmuno.cxx +++ b/svl/source/numbers/numfmuno.cxx @@ -149,7 +149,7 @@ sal_Int32 SAL_CALL SvNumberFormatterServiceObj::detectNumberFormat( sal_Int32 nK ::osl::MutexGuard aGuard( m_aMutex ); sal_Int32 nRet = 0; - SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : NULL; + SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : nullptr; if (pFormatter) { sal_uInt32 nUKey = nKey; @@ -171,7 +171,7 @@ double SAL_CALL SvNumberFormatterServiceObj::convertStringToNumber( sal_Int32 nK ::osl::MutexGuard aGuard( m_aMutex ); double fRet = 0.0; - SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : NULL; + SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : nullptr; if (pFormatter) { sal_uInt32 nUKey = nKey; @@ -193,10 +193,10 @@ OUString SAL_CALL SvNumberFormatterServiceObj::convertNumberToString( sal_Int32 ::osl::MutexGuard aGuard( m_aMutex ); OUString aRet; - SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : NULL; + SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : nullptr; if (pFormatter) { - Color* pColor = NULL; + Color* pColor = nullptr; pFormatter->GetOutputString(fValue, nKey, aRet, &pColor); } else @@ -213,11 +213,11 @@ util::Color SAL_CALL SvNumberFormatterServiceObj::queryColorForNumber( sal_Int32 ::osl::MutexGuard aGuard( m_aMutex ); util::Color nRet = aDefaultColor; // color = sal_Int32 - SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : NULL; + SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : nullptr; if (pFormatter) { OUString aStr; - Color* pColor = NULL; + Color* pColor = nullptr; pFormatter->GetOutputString(fValue, nKey, aStr, &pColor); if (pColor) nRet = pColor->GetColor(); @@ -236,10 +236,10 @@ OUString SAL_CALL SvNumberFormatterServiceObj::formatString( sal_Int32 nKey, ::osl::MutexGuard aGuard( m_aMutex ); OUString aRet; - SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : NULL; + SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : nullptr; if (pFormatter) { - Color* pColor = NULL; + Color* pColor = nullptr; pFormatter->GetOutputString(aString, nKey, aRet, &pColor); } else @@ -257,11 +257,11 @@ util::Color SAL_CALL SvNumberFormatterServiceObj::queryColorForString( sal_Int32 ::osl::MutexGuard aGuard( m_aMutex ); util::Color nRet = aDefaultColor; // color = sal_Int32 - SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : NULL; + SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : nullptr; if (pFormatter) { OUString aStr; - Color* pColor = NULL; + Color* pColor = nullptr; pFormatter->GetOutputString(aString, nKey, aStr, &pColor); if (pColor) { @@ -283,7 +283,7 @@ OUString SAL_CALL SvNumberFormatterServiceObj::getInputString( sal_Int32 nKey, d ::osl::MutexGuard aGuard( m_aMutex ); OUString aRet; - SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : NULL; + SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : nullptr; if (pFormatter) pFormatter->GetInputLineString(fValue, nKey, aRet); else @@ -303,11 +303,11 @@ OUString SAL_CALL SvNumberFormatterServiceObj::convertNumberToPreviewString( con ::osl::MutexGuard aGuard( m_aMutex ); OUString aRet; - SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : NULL; + SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : nullptr; if (pFormatter) { LanguageType eLang = lcl_GetLanguage( nLocale ); - Color* pColor = NULL; + Color* pColor = nullptr; bool bOk; if ( bAllowEnglish ) @@ -334,12 +334,12 @@ util::Color SAL_CALL SvNumberFormatterServiceObj::queryPreviewColorForNumber( co ::osl::MutexGuard aGuard( m_aMutex ); util::Color nRet = aDefaultColor; // color = sal_Int32 - SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : NULL; + SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : nullptr; if (pFormatter) { OUString aOutString; LanguageType eLang = lcl_GetLanguage( nLocale ); - Color* pColor = NULL; + Color* pColor = nullptr; bool bOk; if ( bAllowEnglish ) @@ -405,7 +405,7 @@ uno::Reference SAL_CALL SvNumberFormatsObj::getByKey( sal_I ::osl::MutexGuard aGuard( m_aMutex ); SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter(); - const SvNumberformat* pFormat = pFormatter ? pFormatter->GetEntry(nKey) : NULL; + const SvNumberformat* pFormat = pFormatter ? pFormatter->GetEntry(nKey) : nullptr; if (pFormat) return new SvNumberFormatObj( rSupplier, nKey, m_aMutex ); else @@ -717,7 +717,7 @@ uno::Any SAL_CALL SvNumberFormatObj::getPropertyValue( const OUString& aProperty uno::Any aRet; SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter(); - const SvNumberformat* pFormat = pFormatter ? pFormatter->GetEntry(nKey) : NULL; + const SvNumberformat* pFormat = pFormatter ? pFormatter->GetEntry(nKey) : nullptr; if (pFormat) { bool bThousand, bRed; @@ -844,7 +844,7 @@ uno::Sequence SAL_CALL SvNumberFormatObj::getPropertyValue ::osl::MutexGuard aGuard( m_aMutex ); SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter(); - const SvNumberformat* pFormat = pFormatter ? pFormatter->GetEntry(nKey) : NULL; + const SvNumberformat* pFormat = pFormatter ? pFormatter->GetEntry(nKey) : nullptr; if (pFormat) { OUString aSymbol, aExt; diff --git a/svl/source/numbers/numuno.cxx b/svl/source/numbers/numuno.cxx index 4bfb4a4282b4..5f7bd780d1bc 100644 --- a/svl/source/numbers/numuno.cxx +++ b/svl/source/numbers/numuno.cxx @@ -41,7 +41,7 @@ public: // Default ctor for getReflection SvNumberFormatsSupplierObj::SvNumberFormatsSupplierObj() { - pImpl = new SvNumFmtSuppl_Impl(NULL); + pImpl = new SvNumFmtSuppl_Impl(nullptr); } SvNumberFormatsSupplierObj::SvNumberFormatsSupplierObj(SvNumberFormatter* pForm) @@ -117,7 +117,7 @@ const uno::Sequence& SvNumberFormatsSupplierObj::getUnoTunnelId() SvNumberFormatsSupplierObj* SvNumberFormatsSupplierObj::getImplementation( const uno::Reference& rObj ) { - SvNumberFormatsSupplierObj* pRet = NULL; + SvNumberFormatsSupplierObj* pRet = nullptr; uno::Reference xUT(rObj, uno::UNO_QUERY); if (xUT.is()) pRet = reinterpret_cast(sal::static_int_cast(xUT->getSomething( getUnoTunnelId() ))); diff --git a/svl/source/numbers/supservs.cxx b/svl/source/numbers/supservs.cxx index d3d07e71756e..2c5c777d3681 100644 --- a/svl/source/numbers/supservs.cxx +++ b/svl/source/numbers/supservs.cxx @@ -41,7 +41,7 @@ using namespace ::utl; SvNumberFormatsSupplierServiceObject::SvNumberFormatsSupplierServiceObject(const css::uno::Reference< css::uno::XComponentContext >& _rxORB) - :m_pOwnFormatter(NULL) + :m_pOwnFormatter(nullptr) ,m_xORB(_rxORB) { } @@ -51,7 +51,7 @@ SvNumberFormatsSupplierServiceObject::~SvNumberFormatsSupplierServiceObject() if (m_pOwnFormatter) { delete m_pOwnFormatter; - m_pOwnFormatter = NULL; + m_pOwnFormatter = nullptr; } } @@ -72,14 +72,14 @@ void SAL_CALL SvNumberFormatsSupplierServiceObject::initialize( const Sequence< { ::osl::MutexGuard aGuard( getSharedMutex() ); - DBG_ASSERT(m_pOwnFormatter == NULL, + DBG_ASSERT(m_pOwnFormatter == nullptr, "SvNumberFormatsSupplierServiceObject::initialize : already initialized !"); // maybe you already called a method which needed the formatter // you should use XMultiServiceFactory::createInstanceWithArguments to avoid that if (m_pOwnFormatter) { // !!! this is only a emergency handling, normally this should not occur !!! delete m_pOwnFormatter; - m_pOwnFormatter = NULL; + m_pOwnFormatter = nullptr; SetNumberFormatter(m_pOwnFormatter); } diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 07d9dd10f9f8..da04cfca494e 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -69,14 +69,14 @@ static const sal_Unicode cNarrowNoBreakSpace = 0x202F; ImpSvNumberInputScan::ImpSvNumberInputScan( SvNumberFormatter* pFormatterP ) : - pUpperMonthText( NULL ), - pUpperAbbrevMonthText( NULL ), - pUpperGenitiveMonthText( NULL ), - pUpperGenitiveAbbrevMonthText( NULL ), - pUpperPartitiveMonthText( NULL ), - pUpperPartitiveAbbrevMonthText( NULL ), - pUpperDayText( NULL ), - pUpperAbbrevDayText( NULL ), + pUpperMonthText( nullptr ), + pUpperAbbrevMonthText( nullptr ), + pUpperGenitiveMonthText( nullptr ), + pUpperGenitiveAbbrevMonthText( nullptr ), + pUpperPartitiveMonthText( nullptr ), + pUpperPartitiveAbbrevMonthText( nullptr ), + pUpperDayText( nullptr ), + pUpperAbbrevDayText( nullptr ), bTextInitialized( false ), bScanGenitiveMonths( false ), bScanPartitiveMonths( false ), diff --git a/svl/source/numbers/zforfind.hxx b/svl/source/numbers/zforfind.hxx index 9c7ae84d8736..5d940a3277df 100644 --- a/svl/source/numbers/zforfind.hxx +++ b/svl/source/numbers/zforfind.hxx @@ -46,7 +46,7 @@ public: bool IsNumberFormat( const OUString& rString, /// input string short& F_Type, /// format type (in + out) double& fOutNumber, /// value determined (out) - const SvNumberformat* pFormat = NULL); /// optional a number format to which compare against + const SvNumberformat* pFormat = nullptr); /// optional a number format to which compare against /// after IsNumberFormat: get decimal position short GetDecPos() const { return nDecPos; } @@ -295,7 +295,7 @@ private: // Get currency symbol and advance string position bool GetCurrency( const OUString& rString, sal_Int32& nPos, - const SvNumberformat* pFormat = NULL ); // optional number format to match against + const SvNumberformat* pFormat = nullptr ); // optional number format to match against // Get symbol AM or PM and advance string position bool GetTimeAmPm( const OUString& rString, @@ -336,21 +336,21 @@ private: // Conversion of date to number bool GetDateRef( double& fDays, // OUT: days diff to null date sal_uInt16& nCounter, // Count of date substrings - const SvNumberformat* pFormat = NULL ); // optional number format to match against + const SvNumberformat* pFormat = nullptr ); // optional number format to match against // Analyze start of string bool ScanStartString( const OUString& rString, - const SvNumberformat* pFormat = NULL ); + const SvNumberformat* pFormat = nullptr ); // Analyze middle substring bool ScanMidString( const OUString& rString, sal_uInt16 nStringPos, - const SvNumberformat* pFormat = NULL ); + const SvNumberformat* pFormat = nullptr ); // Analyze end of string bool ScanEndString( const OUString& rString, - const SvNumberformat* pFormat = NULL ); + const SvNumberformat* pFormat = nullptr ); // Compare rString to substring of array indexed by nString // nString == 0xFFFF => last substring @@ -370,7 +370,7 @@ private: // Main analyzing function bool IsNumberFormatMain( const OUString& rString, - const SvNumberformat* pFormat = NULL); // optional number format to match against + const SvNumberformat* pFormat = nullptr); // optional number format to match against static inline bool MyIsdigit( sal_Unicode c ); diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index bbae9c00332a..53b421376b8c 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -227,7 +227,7 @@ void SvNumberFormatterRegistry_Impl::ConfigurationChanged( utl::ConfigurationBro -SvNumberFormatterRegistry_Impl* SvNumberFormatter::pFormatterRegistry = NULL; +SvNumberFormatterRegistry_Impl* SvNumberFormatter::pFormatterRegistry = nullptr; bool SvNumberFormatter::bCurrencyTableInitialized = false; namespace { @@ -267,7 +267,7 @@ SvNumberFormatter::~SvNumberFormatter() if ( !pFormatterRegistry->Count() ) { delete pFormatterRegistry; - pFormatterRegistry = NULL; + pFormatterRegistry = nullptr; } } @@ -309,10 +309,10 @@ void SvNumberFormatter::ImpConstruct( LanguageType eLang ) pStringScanner = new ImpSvNumberInputScan( this ); pFormatScanner = new ImpSvNumberformatScan( this ); - pFormatTable = NULL; + pFormatTable = nullptr; MaxCLOffset = 0; ImpGenerateFormats( 0, false ); // 0 .. 999 for initialized language formats - pMergeTable = NULL; + pMergeTable = nullptr; bNoZero = false; ::osl::MutexGuard aGuard( GetMutex() ); @@ -347,7 +347,7 @@ void SvNumberFormatter::ChangeIntl(LanguageType eLnge) // static ::osl::Mutex& SvNumberFormatter::GetMutex() { - static ::osl::Mutex* pMutex = NULL; + static ::osl::Mutex* pMutex = nullptr; if( !pMutex ) { ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); @@ -387,7 +387,7 @@ Color* SvNumberFormatter::GetUserDefColor(sal_uInt16 nIndex) } else { - return NULL; + return nullptr; } } @@ -1471,7 +1471,7 @@ void SvNumberFormatter::GetOutputString(const OUString& sString, } if (!pFormat->IsTextFormat() && !pFormat->HasTextFormat()) { - *ppColor = NULL; + *ppColor = nullptr; sOutString = sString; } else @@ -1704,7 +1704,7 @@ bool SvNumberFormatter::GetPreviewString( const OUString& sFormatString, } else { - *ppColor = NULL; + *ppColor = nullptr; sOutString = sPreviewString; } } @@ -1791,7 +1791,7 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat( const css::i18n::NumberForma LocaleDataWrapper::outputCheckMessage( xLocaleData->appendLocaleInfo( aMsg)); } delete pFormat; - return NULL; + return nullptr; } if ( rCode.Index >= NF_INDEX_TABLE_LOCALE_DATA_DEFAULTS ) { @@ -1823,7 +1823,7 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat( const css::i18n::NumberForma } } delete pFormat; - return NULL; + return nullptr; } else if ( nPos - nCLOffset >= SV_COUNTRY_LANGUAGE_OFFSET ) { @@ -1836,7 +1836,7 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat( const css::i18n::NumberForma LocaleDataWrapper::outputCheckMessage( xLocaleData->appendLocaleInfo( aMsg)); } delete pFormat; - return NULL; + return nullptr; } } if ( !aFTable.insert( make_pair( nPos, pFormat) ).second ) @@ -1856,7 +1856,7 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat( const css::i18n::NumberForma SAL_WARN( "svl.numbers", "SvNumberFormatter::ImpInsertFormat: dup position"); } delete pFormat; - return NULL; + return nullptr; } if ( rCode.Default ) pFormat->SetStandard(); @@ -2131,7 +2131,7 @@ SvNumberformat* SvNumberFormatter::GetFormatEntry( sal_uInt32 nKey ) SvNumberFormatTable::iterator it = aFTable.find( nKey); if (it != aFTable.end()) return it->second; - return 0; + return nullptr; } const SvNumberformat* SvNumberFormatter::GetFormatEntry( sal_uInt32 nKey ) const @@ -2144,7 +2144,7 @@ const SvNumberformat* SvNumberFormatter::GetEntry( sal_uInt32 nKey ) const SvNumberFormatTable::const_iterator it = aFTable.find( nKey); if (it != aFTable.end()) return it->second; - return 0; + return nullptr; } void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, bool bNoAdditionalFormats ) @@ -2159,7 +2159,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, bool bNoAdditio NumberFormatCodeWrapper aNumberFormatCode( m_xContext, GetLanguageTag().getLocale() ); - SvNumberformat* pNewFormat = NULL; + SvNumberformat* pNewFormat = nullptr; sal_Int32 nIdx; bool bDefault; @@ -3147,7 +3147,7 @@ const NfCurrencyEntry* SvNumberFormatter::MatchSystemCurrency() { // MUST call GetTheCurrencyTable() before accessing nSystemCurrencyPosition const NfCurrencyTable& rTable = GetTheCurrencyTable(); - return nSystemCurrencyPosition ? &rTable[nSystemCurrencyPosition] : NULL; + return nSystemCurrencyPosition ? &rTable[nSystemCurrencyPosition] : nullptr; } @@ -3188,7 +3188,7 @@ const NfCurrencyEntry* SvNumberFormatter::GetCurrencyEntry(const OUString& rAbbr return &rTable[j]; } } - return NULL; + return nullptr; } @@ -3210,7 +3210,7 @@ const NfCurrencyEntry* SvNumberFormatter::GetLegacyOnlyCurrencyEntry( const OUSt return &rTable[j]; } } - return NULL; + return nullptr; } @@ -3375,7 +3375,7 @@ bool SvNumberFormatter::ImpLookupCurrencyEntryLoopBody( { if ( pFoundEntry && pFoundEntry != pData ) { - pFoundEntry = NULL; + pFoundEntry = nullptr; return false; // break loop, not unique } if ( nPos == 0 ) @@ -3406,7 +3406,7 @@ bool SvNumberFormatter::GetNewCurrencySymbolString( sal_uInt32 nFormat, OUString bool* pBank /* = NULL */ ) const { if ( ppEntry ) - *ppEntry = NULL; + *ppEntry = nullptr; if ( pBank ) *pBank = false; @@ -3489,7 +3489,7 @@ const NfCurrencyEntry* SvNumberFormatter::GetCurrencyEntry( bool & bFoundBank, { eExtLang = LANGUAGE_DONTKNOW; } - const NfCurrencyEntry* pFoundEntry = NULL; + const NfCurrencyEntry* pFoundEntry = nullptr; const NfCurrencyTable& rTable = GetTheCurrencyTable(); sal_uInt16 nCount = rTable.size(); bool bCont = true; @@ -3788,7 +3788,7 @@ void SvNumberFormatter::ImpInitCurrencyTable() "SvNumberFormatter::ImpInitCurrencyTable: system currency not in I18N locale data."); } pLocaleData.reset(); - SvtSysLocaleOptions::SetCurrencyChangeLink( LINK( NULL, SvNumberFormatter, CurrencyChangeLink ) ); + SvtSysLocaleOptions::SetCurrencyChangeLink( LINK( nullptr, SvNumberFormatter, CurrencyChangeLink ) ); bInitializing = false; bCurrencyTableInitialized = true; } diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index c740cbe81ded..479b28aacd80 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -337,15 +337,15 @@ sal_uInt8 SvNumberNatNum::MapNatNumToDBNum( sal_uInt8 nNatNum, LanguageType eLan ImpSvNumFor::ImpSvNumFor() { nAnzStrings = 0; - aI.nTypeArray = NULL; - aI.sStrArray = NULL; + aI.nTypeArray = nullptr; + aI.sStrArray = nullptr; aI.eScannedType = css::util::NumberFormat::UNDEFINED; aI.bThousand = false; aI.nThousand = 0; aI.nCntPre = 0; aI.nCntPost = 0; aI.nCntExp = 0; - pColor = NULL; + pColor = nullptr; } ImpSvNumFor::~ImpSvNumFor() @@ -368,8 +368,8 @@ void ImpSvNumFor::Enlarge(sal_uInt16 nAnz) } else { - aI.nTypeArray = NULL; - aI.sStrArray = NULL; + aI.nTypeArray = nullptr; + aI.sStrArray = nullptr; } } } @@ -481,7 +481,7 @@ void SvNumberformat::ImpCopyNumberformat( const SvNumberformat& rFormat ) bAdditionalBuiltin = rFormat.bAdditionalBuiltin; // #121103# when copying between documents, get color pointers from own scanner - ImpSvNumberformatScan* pColorSc = ( &rScan != &rFormat.rScan ) ? &rScan : NULL; + ImpSvNumberformatScan* pColorSc = ( &rScan != &rFormat.rScan ) ? &rScan : nullptr; for (sal_uInt16 i = 0; i < 4; i++) { @@ -719,7 +719,7 @@ SvNumberformat::SvNumberformat(OUString& rString, switch ( eSymbolType ) { case BRACKET_SYMBOLTYPE_COLOR : - if ( NumFor[nIndex].GetColor() != NULL ) + if ( NumFor[nIndex].GetColor() != nullptr ) { // error, more than one color bCancel = true; // break for nCheckPos = nPosOld; @@ -728,7 +728,7 @@ SvNumberformat::SvNumberformat(OUString& rString, { Color* pColor = pSc->GetColor( sStr); NumFor[nIndex].SetColor( pColor, sStr); - if (pColor == NULL) + if (pColor == nullptr) { // error bCancel = true; // break for nCheckPos = nPosOld; @@ -1894,7 +1894,7 @@ bool SvNumberformat::GetOutputString(const OUString& sString, } else { - *ppColor = NULL; // no change of color + *ppColor = nullptr; // no change of color return false; } *ppColor = NumFor[nIx].GetColor(); @@ -2090,7 +2090,7 @@ bool SvNumberformat::GetOutputString(double fNumber, bool bRes = false; OUStringBuffer sBuff; OutString.clear(); - *ppColor = NULL; // No color change + *ppColor = nullptr; // No color change if (eType & css::util::NumberFormat::LOGICAL) { if (fNumber) @@ -4462,12 +4462,12 @@ const OUString* SvNumberformat::GetNumForString( sal_uInt16 nNumFor, sal_uInt16 { if ( nNumFor > 3 ) { - return NULL; + return nullptr; } sal_uInt16 nAnz = NumFor[nNumFor].GetCount(); if ( !nAnz ) { - return NULL; + return nullptr; } if ( nPos == 0xFFFF ) { @@ -4483,13 +4483,13 @@ const OUString* SvNumberformat::GetNumForString( sal_uInt16 nNumFor, sal_uInt16 } if ( (*pType != NF_SYMBOLTYPE_STRING) && (*pType != NF_SYMBOLTYPE_CURRENCY) ) { - return NULL; + return nullptr; } } } else if ( nPos > nAnz - 1 ) { - return NULL; + return nullptr; } else if ( bString ) { @@ -4504,7 +4504,7 @@ const OUString* SvNumberformat::GetNumForString( sal_uInt16 nNumFor, sal_uInt16 if ( nPos >= nAnz || ((*pType != NF_SYMBOLTYPE_STRING) && (*pType != NF_SYMBOLTYPE_CURRENCY)) ) { - return NULL; + return nullptr; } } return &NumFor[nNumFor].Info().sStrArray[nPos]; @@ -4685,7 +4685,7 @@ Color* SvNumberformat::GetColor( sal_uInt16 nNumFor ) const { if ( nNumFor > 3 ) { - return NULL; + return nullptr; } return NumFor[nNumFor].GetColor(); } diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 5d77fe849291..3dd3d7c08d05 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -482,7 +482,7 @@ Color* ImpSvNumberformatScan::GetColor(OUString& sStr) } } - Color* pResult = NULL; + Color* pResult = nullptr; if (i >= NF_MAX_DEFAULT_COLORS) { const OUString& rColorWord = rKeyword[NF_KEY_COLOR]; diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index 660765e4ff8e..78720601b7f3 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -390,7 +390,7 @@ void StorageItem::ImplCommit() PasswordContainer::PasswordContainer( const Reference& xServiceFactory ): - m_pStorageFile( NULL ) + m_pStorageFile( nullptr ) { // m_pStorageFile->Notify() can be called ::osl::MutexGuard aGuard( mMutex ); @@ -411,7 +411,7 @@ PasswordContainer::~PasswordContainer() if( m_pStorageFile ) { delete m_pStorageFile; - m_pStorageFile = NULL; + m_pStorageFile = nullptr; } if( mComponent.is() ) @@ -429,7 +429,7 @@ void SAL_CALL PasswordContainer::disposing( const EventObject& ) throw(RuntimeEx if( m_pStorageFile ) { delete m_pStorageFile; - m_pStorageFile = NULL; + m_pStorageFile = nullptr; } if( mComponent.is() ) @@ -457,7 +457,7 @@ vector< OUString > PasswordContainer::DecodePasswords( const OUString& aLine, co rtlCipherError result = rtl_cipher_init ( aDecoder, rtl_Cipher_DirectionDecode, - code, RTL_DIGEST_LENGTH_MD5, NULL, 0 ); + code, RTL_DIGEST_LENGTH_MD5, nullptr, 0 ); if( result == rtl_Cipher_E_None ) { @@ -508,7 +508,7 @@ OUString PasswordContainer::EncodePasswords(const vector< OUString >& lines, con rtlCipherError result = rtl_cipher_init ( aEncoder, rtl_Cipher_DirectionEncode, - code, RTL_DIGEST_LENGTH_MD5, NULL, 0 ); + code, RTL_DIGEST_LENGTH_MD5, nullptr, 0 ); if( result == rtl_Cipher_E_None ) { @@ -1073,7 +1073,7 @@ sal_Bool SAL_CALL PasswordContainer::authorizateWithMasterPassword( const uno::R { uno::Reference< lang::XMultiServiceFactory > xFactory( mComponent, uno::UNO_QUERY_THROW ); uno::Reference< uno::XComponentContext > xContext( comphelper::getComponentContext(xFactory) ); - xTmpHandler.set( InteractionHandler::createWithParent(xContext, 0), uno::UNO_QUERY_THROW ); + xTmpHandler.set( InteractionHandler::createWithParent(xContext, nullptr), uno::UNO_QUERY_THROW ); } if ( !m_aMasterPasswd.isEmpty() ) @@ -1117,7 +1117,7 @@ sal_Bool SAL_CALL PasswordContainer::changeMasterPassword( const uno::Reference< { uno::Reference< lang::XMultiServiceFactory > xFactory( mComponent, uno::UNO_QUERY_THROW ); uno::Reference< uno::XComponentContext > xContext( comphelper::getComponentContext(xFactory) ); - xTmpHandler.set( InteractionHandler::createWithParent(xContext, 0), uno::UNO_QUERY_THROW ); + xTmpHandler.set( InteractionHandler::createWithParent(xContext, nullptr), uno::UNO_QUERY_THROW ); } bool bCanChangePassword = true; @@ -1229,7 +1229,7 @@ sal_Bool SAL_CALL PasswordContainer::useDefaultMasterPassword( const uno::Refere { uno::Reference< lang::XMultiServiceFactory > xFactory( mComponent, uno::UNO_QUERY_THROW ); uno::Reference< uno::XComponentContext > xContext( comphelper::getComponentContext(xFactory) ); - xTmpHandler.set( InteractionHandler::createWithParent(xContext, 0), uno::UNO_QUERY_THROW ); + xTmpHandler.set( InteractionHandler::createWithParent(xContext, nullptr), uno::UNO_QUERY_THROW ); } bool bCanChangePassword = true; @@ -1444,7 +1444,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL passwordcontainer_component_getFactory ( SAL_UNUSED_PARAMETER void * pServiceManager, SAL_UNUSED_PARAMETER void * /* pRegistryKey */) { - void * pResult = 0; + void * pResult = nullptr; if (pServiceManager) { Reference< XSingleServiceFactory > xFactory; diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx index b843d5cc8445..7048b99f2bf4 100644 --- a/svl/source/undo/undo.cxx +++ b/svl/source/undo/undo.cxx @@ -61,13 +61,13 @@ SfxUndoAction::~SfxUndoAction() if(mpSfxLinkUndoAction) { mpSfxLinkUndoAction->LinkedSfxUndoActionDestructed(*this); - mpSfxLinkUndoAction = 0; + mpSfxLinkUndoAction = nullptr; } } SfxUndoAction::SfxUndoAction() -: mpSfxLinkUndoAction(0) +: mpSfxLinkUndoAction(nullptr) { } @@ -242,8 +242,8 @@ struct SVL_DLLPRIVATE SfxUndoManager_Data explicit SfxUndoManager_Data( size_t i_nMaxUndoActionCount ) :pUndoArray( new SfxUndoArray( i_nMaxUndoActionCount ) ) - ,pActUndoArray( NULL ) - ,pFatherUndoArray( NULL ) + ,pActUndoArray( nullptr ) + ,pFatherUndoArray( nullptr ) ,mnMarks( 0 ) ,mnEmptyMark(MARK_INVALID) ,mbUndoEnabled( true ) @@ -290,13 +290,13 @@ namespace svl { namespace undo { namespace impl { explicit NotifyUndoListener( UndoListenerVoidMethod i_notificationMethod ) :m_notificationMethod( i_notificationMethod ) - ,m_altNotificationMethod( NULL ) + ,m_altNotificationMethod( nullptr ) ,m_sActionComment() { } NotifyUndoListener( UndoListenerStringMethod i_notificationMethod, const OUString& i_actionComment ) - :m_notificationMethod( NULL ) + :m_notificationMethod( nullptr ) ,m_altNotificationMethod( i_notificationMethod ) ,m_sActionComment( i_actionComment ) { @@ -304,13 +304,13 @@ namespace svl { namespace undo { namespace impl bool is() const { - return ( m_notificationMethod != 0 ) || ( m_altNotificationMethod != 0 ); + return ( m_notificationMethod != nullptr ) || ( m_altNotificationMethod != nullptr ); } void operator()( SfxUndoListener* i_listener ) const { assert( is() && "NotifyUndoListener: this will crash!" ); - if ( m_altNotificationMethod != 0 ) + if ( m_altNotificationMethod != nullptr ) { ( i_listener->*m_altNotificationMethod )( m_sActionComment ); } @@ -646,7 +646,7 @@ bool SfxUndoManager::ImplAddUndoAction_NoNotify( SfxUndoAction *pAction, bool bT // merge, if required SfxUndoAction* pMergeWithAction = m_xData->pActUndoArray->nCurUndoAction ? - m_xData->pActUndoArray->aUndoActions[m_xData->pActUndoArray->nCurUndoAction-1].pAction : NULL; + m_xData->pActUndoArray->aUndoActions[m_xData->pActUndoArray->nCurUndoAction-1].pAction : nullptr; if ( bTryMerge && pMergeWithAction ) { bool bMerged = pMergeWithAction->Merge( pAction ); @@ -738,7 +738,7 @@ SfxUndoAction* SfxUndoManager::GetUndoAction( size_t nNo ) const assert(nNo < m_xData->pActUndoArray->nCurUndoAction); if( nNo >= m_xData->pActUndoArray->nCurUndoAction ) - return NULL; + return nullptr; return m_xData->pActUndoArray->aUndoActions[m_xData->pActUndoArray->nCurUndoAction-1-nNo].pAction; } @@ -773,7 +773,7 @@ bool SfxUndoManager::IsDoing() const bool SfxUndoManager::Undo() { - return ImplUndo( NULL ); + return ImplUndo( nullptr ); } @@ -810,7 +810,7 @@ bool SfxUndoManager::ImplUndo( SfxUndoContext* i_contextOrNull ) // clear the guard/mutex before calling into the SfxUndoAction - this can be an extension-implemented UNO component // nowadays ... aGuard.clear(); - if ( i_contextOrNull != NULL ) + if ( i_contextOrNull != nullptr ) pAction->UndoWithContext( *i_contextOrNull ); else pAction->Undo(); @@ -864,7 +864,7 @@ SfxUndoAction* SfxUndoManager::GetRedoAction( size_t nNo, bool const i_currentLe const SfxUndoArray* pUndoArray = i_currentLevel ? m_xData->pActUndoArray : m_xData->pUndoArray; if ( (pUndoArray->nCurUndoAction + nNo) > pUndoArray->aUndoActions.size() ) { - return NULL; + return nullptr; } return pUndoArray->aUndoActions[ pUndoArray->nCurUndoAction + nNo ].pAction; } @@ -885,7 +885,7 @@ OUString SfxUndoManager::GetRedoActionComment( size_t nNo, bool const i_currentL bool SfxUndoManager::Redo() { - return ImplRedo( NULL ); + return ImplRedo( nullptr ); } @@ -922,7 +922,7 @@ bool SfxUndoManager::ImplRedo( SfxUndoContext* i_contextOrNull ) // clear the guard/mutex before calling into the SfxUndoAction - this can be a extension-implemented UNO component // nowadays ... aGuard.clear(); - if ( i_contextOrNull != NULL ) + if ( i_contextOrNull != nullptr ) pAction->RedoWithContext( *i_contextOrNull ); else pAction->Redo(); @@ -1418,7 +1418,7 @@ SfxLinkUndoAction::SfxLinkUndoAction(::svl::IUndoManager *pManager) { pUndoManager = pManager; SfxUndoManager* pUndoManagerImplementation = dynamic_cast< SfxUndoManager* >( pManager ); - ENSURE_OR_THROW( pUndoManagerImplementation != NULL, "unsupported undo manager implementation!" ); + ENSURE_OR_THROW( pUndoManagerImplementation != nullptr, "unsupported undo manager implementation!" ); // yes, this cast is dirty. But reaching into the SfxUndoManager's implementation, // directly accessing its internal stack, and tampering with an action on that stack @@ -1430,7 +1430,7 @@ SfxLinkUndoAction::SfxLinkUndoAction(::svl::IUndoManager *pManager) pAction->SetLinkToSfxLinkUndoAction(this); } else - pAction = 0; + pAction = nullptr; } @@ -1485,16 +1485,16 @@ OUString SfxLinkUndoAction::GetRepeatComment(SfxRepeatTarget&r) const SfxLinkUndoAction::~SfxLinkUndoAction() { if( pAction ) - pAction->SetLinkToSfxLinkUndoAction(0); + pAction->SetLinkToSfxLinkUndoAction(nullptr); } void SfxLinkUndoAction::LinkedSfxUndoActionDestructed(const SfxUndoAction& rCandidate) { - assert(0 != pAction); + assert(nullptr != pAction); assert(pAction == &rCandidate && "Oops, the destroyed and linked UndoActions differ (!)"); (void)rCandidate; - pAction = 0; + pAction = nullptr; } diff --git a/svl/unx/source/svdde/ddedummy.cxx b/svl/unx/source/svdde/ddedummy.cxx index b504b5fe38fd..4926df3e6319 100644 --- a/svl/unx/source/svdde/ddedummy.cxx +++ b/svl/unx/source/svdde/ddedummy.cxx @@ -21,22 +21,22 @@ #include DdeData::DdeData() - : pImp(NULL) + : pImp(nullptr) { } DdeData::DdeData( const OUString& ) - : pImp(NULL) + : pImp(nullptr) { } DdeData::DdeData( const DdeData& ) - : pImp(NULL) + : pImp(nullptr) { } DdeData::DdeData( const void*, long, SotClipboardFormatId) - : pImp(NULL) + : pImp(nullptr) { } @@ -65,7 +65,7 @@ DdeData::operator long() const DdeData::operator const void*() const { - return NULL; + return nullptr; } long DdeConnection::GetError() @@ -74,9 +74,9 @@ long DdeConnection::GetError() } DdeConnection::DdeConnection( const OUString&, const OUString& ) - : pService(NULL) - , pTopic(NULL) - , pImp(NULL) + : pService(nullptr) + , pTopic(nullptr) + , pImp(nullptr) { } @@ -96,7 +96,7 @@ const OUString DdeConnection::GetTopicName() DdeTransaction::DdeTransaction( DdeConnection& rConnection, const OUString&, long ) : rDde(rConnection) - , pName(NULL) + , pName(nullptr) , nType(0) , nId(0) , nTime(0) @@ -137,7 +137,7 @@ DdePoke::DdePoke( DdeConnection& rConnection, const OUString& rString, const Dde DdeTopic::DdeTopic( const OUString& ) - : pName(NULL) + : pName(nullptr) { } @@ -160,7 +160,7 @@ void DdeTopic::RemoveItem( SAL_UNUSED_PARAMETER const DdeItem& ) DdeData* DdeTopic::Get(SAL_UNUSED_PARAMETER SotClipboardFormatId) { - return NULL; + return nullptr; } bool DdeTopic::MakeItem( SAL_UNUSED_PARAMETER const OUString& ) @@ -194,9 +194,9 @@ const OUString DdeTopic::GetName() const } DdeService::DdeService( const OUString& ) - : pSysTopic(NULL) - , pName(NULL) - , pConv(NULL) + : pSysTopic(nullptr) + , pName(nullptr) + , pConv(nullptr) , nStatus(0) { } @@ -278,17 +278,17 @@ DdeServices& DdeService::GetServices() } DdeItem::DdeItem( const OUString& ) - : pName(NULL) - , pMyTopic(NULL) - , pImpData(NULL) + : pName(nullptr) + , pMyTopic(nullptr) + , pImpData(nullptr) , nType(0) { } DdeItem::DdeItem( const DdeItem& ) - : pName(NULL) - , pMyTopic(NULL) - , pImpData(NULL) + : pName(nullptr) + , pMyTopic(nullptr) + , pImpData(nullptr) , nType(0) { } @@ -313,7 +313,7 @@ DdeGetPutItem::DdeGetPutItem( const DdeItem& rItem ) DdeData* DdeGetPutItem::Get( SAL_UNUSED_PARAMETER SotClipboardFormatId ) { - return NULL; + return nullptr; } bool DdeGetPutItem::Put( SAL_UNUSED_PARAMETER const DdeData* ) -- cgit v1.2.3