diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-12-08 13:39:35 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-12-08 17:18:38 +0100 |
commit | 2e83a62f15b564edfe7f585dd72fcb41058120b3 (patch) | |
tree | b43e06c3a7867251813d876b5be32be3e7c32ebd | |
parent | 7ce84d71b5a7e46bc4322997b1727b260e9b2cbd (diff) |
Clean up LIBO_INTERNAL_ONLY uses of SAL_WARN_UNUSED_RESULT
Change-Id: I98b2d90c8345f07010f6defd82557188d5cd35c7
Reviewed-on: https://gerrit.libreoffice.org/64808
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | include/filter/msfilter/msdffimp.hxx | 2 | ||||
-rw-r--r-- | include/oox/helper/binaryinputstream.hxx | 22 | ||||
-rw-r--r-- | include/oox/ole/axbinaryreader.hxx | 2 | ||||
-rw-r--r-- | include/rtl/stringconcat.hxx | 16 | ||||
-rw-r--r-- | include/rtl/ustring.hxx | 48 | ||||
-rw-r--r-- | include/sfx2/docfile.hxx | 14 | ||||
-rw-r--r-- | include/svx/svdundo.hxx | 2 | ||||
-rw-r--r-- | include/svx/unoapi.hxx | 4 | ||||
-rw-r--r-- | include/tools/helpers.hxx | 4 | ||||
-rw-r--r-- | include/tools/stream.hxx | 2 | ||||
-rw-r--r-- | include/vcl/bitmapex.hxx | 8 | ||||
-rw-r--r-- | include/vcl/vclptr.hxx | 2 | ||||
-rw-r--r-- | sc/inc/address.hxx | 24 | ||||
-rw-r--r-- | sc/inc/compressedarray.hxx | 8 | ||||
-rw-r--r-- | sc/inc/document.hxx | 2 | ||||
-rw-r--r-- | sc/inc/segmenttree.hxx | 2 | ||||
-rw-r--r-- | sc/inc/table.hxx | 8 | ||||
-rw-r--r-- | sc/source/filter/inc/xistream.hxx | 12 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/inc/viewdata.hxx | 2 | ||||
-rw-r--r-- | starmath/source/mathmlimport.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/regionband.hxx | 4 | ||||
-rw-r--r-- | vcl/inc/salframe.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/salgdi.hxx | 2 |
25 files changed, 100 insertions, 100 deletions
diff --git a/include/filter/msfilter/msdffimp.hxx b/include/filter/msfilter/msdffimp.hxx index f6d0b76d5a20..4ff14484e398 100644 --- a/include/filter/msfilter/msdffimp.hxx +++ b/include/filter/msfilter/msdffimp.hxx @@ -574,7 +574,7 @@ public: sal_uInt32 nMaxLen, bool bUniCode); - SAL_WARN_UNUSED_RESULT static bool ReadCommonRecordHeader( SvStream& rSt, + [[nodiscard]] static bool ReadCommonRecordHeader( SvStream& rSt, sal_uInt8& rVer, sal_uInt16& rInst, sal_uInt16& rFbt, diff --git a/include/oox/helper/binaryinputstream.hxx b/include/oox/helper/binaryinputstream.hxx index 50c4c800961f..1174b0f61f2f 100644 --- a/include/oox/helper/binaryinputstream.hxx +++ b/include/oox/helper/binaryinputstream.hxx @@ -86,28 +86,28 @@ public: All data types supported by the ByteOrderConverter class can be used. */ template< typename Type > - SAL_WARN_UNUSED_RESULT + [[nodiscard]] Type readValue(); - SAL_WARN_UNUSED_RESULT + [[nodiscard]] sal_Int8 readInt8() { return readValue<sal_Int8>(); } - SAL_WARN_UNUSED_RESULT + [[nodiscard]] sal_uInt8 readuInt8() { return readValue<sal_uInt8>(); } - SAL_WARN_UNUSED_RESULT + [[nodiscard]] sal_Int16 readInt16() { return readValue<sal_Int16>(); } - SAL_WARN_UNUSED_RESULT + [[nodiscard]] sal_uInt16 readuInt16() { return readValue<sal_uInt16>(); } - SAL_WARN_UNUSED_RESULT + [[nodiscard]] sal_Int32 readInt32() { return readValue<sal_Int32>(); } - SAL_WARN_UNUSED_RESULT + [[nodiscard]] sal_uInt32 readuInt32() { return readValue<sal_uInt32>(); } - SAL_WARN_UNUSED_RESULT + [[nodiscard]] sal_Int64 readInt64() { return readValue<sal_Int64>(); } - SAL_WARN_UNUSED_RESULT + [[nodiscard]] float readFloat() { return readValue<float>(); } - SAL_WARN_UNUSED_RESULT + [[nodiscard]] double readDouble() { return readValue<double>(); } - SAL_WARN_UNUSED_RESULT + [[nodiscard]] unsigned char readuChar() { return readValue<unsigned char>(); } /** Reads a (preallocated!) C array of values from the stream. diff --git a/include/oox/ole/axbinaryreader.hxx b/include/oox/ole/axbinaryreader.hxx index b15a7f1e4507..f9e3ddea24ff 100644 --- a/include/oox/ole/axbinaryreader.hxx +++ b/include/oox/ole/axbinaryreader.hxx @@ -76,7 +76,7 @@ public: /** Aligns the stream according to the passed type and reads a value. */ template< typename Type > - SAL_WARN_UNUSED_RESULT + [[nodiscard]] Type readAligned() { align( sizeof( Type ) ); return readValue< Type >(); } /** Aligns the stream according to the passed type and skips the size of the type. */ template< typename Type > diff --git a/include/rtl/stringconcat.hxx b/include/rtl/stringconcat.hxx index f1c1ca8b5e6e..220d0a2cfc9e 100644 --- a/include/rtl/stringconcat.hxx +++ b/include/rtl/stringconcat.hxx @@ -221,7 +221,7 @@ struct ToStringHelper< OUStringConcat< T1, T2 > > }; template< typename T1, typename T2 > -SAL_WARN_UNUSED_RESULT +[[nodiscard]] inline typename libreoffice_internal::Enable< OStringConcat< T1, T2 >, ToStringHelper< T1 >::allowOStringConcat && ToStringHelper< T2 >::allowOStringConcat >::Type operator+( const T1& left, const T2& right ) { @@ -230,7 +230,7 @@ typename libreoffice_internal::Enable< OStringConcat< T1, T2 >, ToStringHelper< // char[N] and const char[N] need to be done explicitly, otherwise the compiler likes to treat them the same way for some reason template< typename T, int N > -SAL_WARN_UNUSED_RESULT +[[nodiscard]] inline typename libreoffice_internal::Enable< OStringConcat< T, const char[ N ] >, ToStringHelper< T >::allowOStringConcat >::Type operator+( const T& left, const char (&right)[ N ] ) { @@ -238,7 +238,7 @@ typename libreoffice_internal::Enable< OStringConcat< T, const char[ N ] >, ToSt } template< typename T, int N > -SAL_WARN_UNUSED_RESULT +[[nodiscard]] inline typename libreoffice_internal::Enable< OStringConcat< const char[ N ], T >, ToStringHelper< T >::allowOStringConcat >::Type operator+( const char (&left)[ N ], const T& right ) { @@ -246,7 +246,7 @@ typename libreoffice_internal::Enable< OStringConcat< const char[ N ], T >, ToSt } template< typename T, int N > -SAL_WARN_UNUSED_RESULT +[[nodiscard]] inline typename libreoffice_internal::Enable< OStringConcat< T, char[ N ] >, ToStringHelper< T >::allowOStringConcat >::Type operator+( const T& left, char (&right)[ N ] ) { @@ -254,7 +254,7 @@ typename libreoffice_internal::Enable< OStringConcat< T, char[ N ] >, ToStringHe } template< typename T, int N > -SAL_WARN_UNUSED_RESULT +[[nodiscard]] inline typename libreoffice_internal::Enable< OStringConcat< char[ N ], T >, ToStringHelper< T >::allowOStringConcat >::Type operator+( char (&left)[ N ], const T& right ) { @@ -262,7 +262,7 @@ typename libreoffice_internal::Enable< OStringConcat< char[ N ], T >, ToStringHe } template< typename T1, typename T2 > -SAL_WARN_UNUSED_RESULT +[[nodiscard]] inline typename libreoffice_internal::Enable< OUStringConcat< T1, T2 >, ToStringHelper< T1 >::allowOUStringConcat && ToStringHelper< T2 >::allowOUStringConcat >::Type operator+( const T1& left, const T2& right ) { @@ -270,7 +270,7 @@ typename libreoffice_internal::Enable< OUStringConcat< T1, T2 >, ToStringHelper< } template< typename T1, typename T2 > -SAL_WARN_UNUSED_RESULT +[[nodiscard]] inline typename libreoffice_internal::Enable< OUStringConcat< T1, T2 >, ToStringHelper< T1 >::allowOUStringConcat && ToStringHelper< T2 >::allowOUStringConcat && libreoffice_internal::ConstCharArrayDetector< T1, void >::ok >::Type operator+( T1& left, const T2& right ) { @@ -278,7 +278,7 @@ typename libreoffice_internal::Enable< OUStringConcat< T1, T2 >, ToStringHelper< } template< typename T1, typename T2 > -SAL_WARN_UNUSED_RESULT +[[nodiscard]] inline typename libreoffice_internal::Enable< OUStringConcat< T1, T2 >, ToStringHelper< T1 >::allowOUStringConcat && ToStringHelper< T2 >::allowOUStringConcat && libreoffice_internal::ConstCharArrayDetector< T2, void >::ok >::Type operator+( const T1& left, T2& right ) { diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx index d803a1ad4e6f..5f738cfaa5fc 100644 --- a/include/rtl/ustring.hxx +++ b/include/rtl/ustring.hxx @@ -2413,7 +2413,7 @@ public: #if defined LIBO_INTERNAL_ONLY /** @overload @since LibreOffice 5.3 */ - template<typename T> SAL_WARN_UNUSED_RESULT + template<typename T> [[nodiscard]] typename libreoffice_internal::ConstCharArrayDetector<T, OUString>::TypeUtf16 replaceFirst(T & from, OUString const & to, sal_Int32 * index = nullptr) @@ -2433,7 +2433,7 @@ public: return OUString(s, SAL_NO_ACQUIRE); } /** @overload @since LibreOffice 5.3 */ - template<typename T> SAL_WARN_UNUSED_RESULT + template<typename T> [[nodiscard]] typename libreoffice_internal::ConstCharArrayDetector<T, OUString>::TypeUtf16 replaceFirst(OUString const & from, T & to, sal_Int32 * index = nullptr) @@ -2453,7 +2453,7 @@ public: return OUString(s, SAL_NO_ACQUIRE); } /** @overload @since LibreOffice 5.3 */ - template<typename T1, typename T2> SAL_WARN_UNUSED_RESULT + template<typename T1, typename T2> [[nodiscard]] typename libreoffice_internal::ConstCharArrayDetector< T1, @@ -2477,7 +2477,7 @@ public: return OUString(s, SAL_NO_ACQUIRE); } /** @overload @since LibreOffice 5.3 */ - template<typename T1, typename T2> SAL_WARN_UNUSED_RESULT + template<typename T1, typename T2> [[nodiscard]] typename libreoffice_internal::ConstCharArrayDetector< T1, @@ -2501,7 +2501,7 @@ public: return OUString(s, SAL_NO_ACQUIRE); } /** @overload @since LibreOffice 5.3 */ - template<typename T1, typename T2> SAL_WARN_UNUSED_RESULT + template<typename T1, typename T2> [[nodiscard]] typename libreoffice_internal::ConstCharArrayDetector< T1, @@ -2526,7 +2526,7 @@ public: } /** @overload @since LibreOffice 5.4 */ - SAL_WARN_UNUSED_RESULT OUString replaceFirst( + [[nodiscard]] OUString replaceFirst( OUStringLiteral const & from, OUString const & to, sal_Int32 * index = nullptr) const { @@ -2538,7 +2538,7 @@ public: return OUString(s, SAL_NO_ACQUIRE); } /** @overload @since LibreOffice 5.4 */ - SAL_WARN_UNUSED_RESULT OUString replaceFirst( + [[nodiscard]] OUString replaceFirst( OUString const & from, OUStringLiteral const & to, sal_Int32 * index = nullptr) const { @@ -2550,7 +2550,7 @@ public: return OUString(s, SAL_NO_ACQUIRE); } /** @overload @since LibreOffice 5.4 */ - SAL_WARN_UNUSED_RESULT OUString replaceFirst( + [[nodiscard]] OUString replaceFirst( OUStringLiteral const & from, OUStringLiteral const & to, sal_Int32 * index = nullptr) const { @@ -2562,7 +2562,7 @@ public: return OUString(s, SAL_NO_ACQUIRE); } /** @overload @since LibreOffice 5.4 */ - template<typename T> SAL_WARN_UNUSED_RESULT + template<typename T> [[nodiscard]] typename libreoffice_internal::ConstCharArrayDetector<T, OUString >::Type replaceFirst( OUStringLiteral const & from, T & to, sal_Int32 * index = nullptr) const @@ -2578,7 +2578,7 @@ public: return OUString(s, SAL_NO_ACQUIRE); } /** @overload @since LibreOffice 5.4 */ - template<typename T> SAL_WARN_UNUSED_RESULT + template<typename T> [[nodiscard]] typename libreoffice_internal::ConstCharArrayDetector<T, OUString >::Type replaceFirst( T & from, OUStringLiteral const & to, sal_Int32 * index = nullptr) const @@ -2594,7 +2594,7 @@ public: return OUString(s, SAL_NO_ACQUIRE); } /** @overload @since LibreOffice 5.4 */ - template<typename T> SAL_WARN_UNUSED_RESULT + template<typename T> [[nodiscard]] typename libreoffice_internal::ConstCharArrayDetector<T, OUString >::TypeUtf16 replaceFirst( @@ -2611,7 +2611,7 @@ public: return OUString(s, SAL_NO_ACQUIRE); } /** @overload @since LibreOffice 5.4 */ - template<typename T> SAL_WARN_UNUSED_RESULT + template<typename T> [[nodiscard]] typename libreoffice_internal::ConstCharArrayDetector<T, OUString >::TypeUtf16 replaceFirst( @@ -2733,7 +2733,7 @@ public: #if defined LIBO_INTERNAL_ONLY /** @overload @since LibreOffice 5.3 */ - template<typename T> SAL_WARN_UNUSED_RESULT + template<typename T> [[nodiscard]] typename libreoffice_internal::ConstCharArrayDetector<T, OUString>::TypeUtf16 replaceAll(T & from, OUString const & to) const { @@ -2750,7 +2750,7 @@ public: return OUString(s, SAL_NO_ACQUIRE); } /** @overload @since LibreOffice 5.3 */ - template<typename T> SAL_WARN_UNUSED_RESULT + template<typename T> [[nodiscard]] typename libreoffice_internal::ConstCharArrayDetector<T, OUString>::TypeUtf16 replaceAll(OUString const & from, T & to) const { @@ -2766,7 +2766,7 @@ public: return OUString(s, SAL_NO_ACQUIRE); } /** @overload @since LibreOffice 5.3 */ - template<typename T1, typename T2> SAL_WARN_UNUSED_RESULT + template<typename T1, typename T2> [[nodiscard]] typename libreoffice_internal::ConstCharArrayDetector< T1, @@ -2788,7 +2788,7 @@ public: return OUString(s, SAL_NO_ACQUIRE); } /** @overload @since LibreOffice 5.3 */ - template<typename T1, typename T2> SAL_WARN_UNUSED_RESULT + template<typename T1, typename T2> [[nodiscard]] typename libreoffice_internal::ConstCharArrayDetector< T1, @@ -2810,7 +2810,7 @@ public: return OUString(s, SAL_NO_ACQUIRE); } /** @overload @since LibreOffice 5.3 */ - template<typename T1, typename T2> SAL_WARN_UNUSED_RESULT + template<typename T1, typename T2> [[nodiscard]] typename libreoffice_internal::ConstCharArrayDetector< T1, @@ -2833,7 +2833,7 @@ public: } /** @overload @since LibreOffice 5.4 */ - SAL_WARN_UNUSED_RESULT OUString replaceAll( + [[nodiscard]] OUString replaceAll( OUStringLiteral const & from, OUString const & to) const { rtl_uString * s = nullptr; @@ -2842,7 +2842,7 @@ public: return OUString(s, SAL_NO_ACQUIRE); } /** @overload @since LibreOffice 5.4 */ - SAL_WARN_UNUSED_RESULT OUString replaceAll( + [[nodiscard]] OUString replaceAll( OUString const & from, OUStringLiteral const & to) const { rtl_uString * s = nullptr; @@ -2851,7 +2851,7 @@ public: return OUString(s, SAL_NO_ACQUIRE); } /** @overload @since LibreOffice 5.4 */ - SAL_WARN_UNUSED_RESULT OUString replaceAll( + [[nodiscard]] OUString replaceAll( OUStringLiteral const & from, OUStringLiteral const & to) const { rtl_uString * s = nullptr; @@ -2860,7 +2860,7 @@ public: return OUString(s, SAL_NO_ACQUIRE); } /** @overload @since LibreOffice 5.4 */ - template<typename T> SAL_WARN_UNUSED_RESULT + template<typename T> [[nodiscard]] typename libreoffice_internal::ConstCharArrayDetector<T, OUString >::Type replaceAll(OUStringLiteral const & from, T & to) const { assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(to)); @@ -2872,7 +2872,7 @@ public: return OUString(s, SAL_NO_ACQUIRE); } /** @overload @since LibreOffice 5.4 */ - template<typename T> SAL_WARN_UNUSED_RESULT + template<typename T> [[nodiscard]] typename libreoffice_internal::ConstCharArrayDetector<T, OUString >::Type replaceAll(T & from, OUStringLiteral const & to) const { assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(from)); @@ -2885,7 +2885,7 @@ public: return OUString(s, SAL_NO_ACQUIRE); } /** @overload @since LibreOffice 5.4 */ - template<typename T> SAL_WARN_UNUSED_RESULT + template<typename T> [[nodiscard]] typename libreoffice_internal::ConstCharArrayDetector<T, OUString >::TypeUtf16 replaceAll(OUStringLiteral const & from, T & to) const { @@ -2898,7 +2898,7 @@ public: return OUString(s, SAL_NO_ACQUIRE); } /** @overload @since LibreOffice 5.4 */ - template<typename T> SAL_WARN_UNUSED_RESULT + template<typename T> [[nodiscard]] typename libreoffice_internal::ConstCharArrayDetector<T, OUString >::TypeUtf16 replaceAll(T & from, OUStringLiteral const & to) const { diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx index 2f7d9454c1e5..8e22b0a40b31 100644 --- a/include/sfx2/docfile.hxx +++ b/include/sfx2/docfile.hxx @@ -132,13 +132,13 @@ public: const INetURLObject& GetURLObject() const; void CheckFileDate( const css::util::DateTime& aInitDate ); - SAL_WARN_UNUSED_RESULT bool DocNeedsFileDateCheck() const; + [[nodiscard]] bool DocNeedsFileDateCheck() const; css::util::DateTime const & GetInitFileDate( bool bIgnoreOldValue ); css::uno::Reference< css::ucb::XContent > GetContent() const; const OUString& GetPhysicalName() const; - SAL_WARN_UNUSED_RESULT bool IsRemote() const; - SAL_WARN_UNUSED_RESULT bool IsOpen() const; // { return aStorage.Is() || pInStream; } + [[nodiscard]] bool IsRemote() const; + [[nodiscard]] bool IsOpen() const; // { return aStorage.Is() || pInStream; } void Download( const Link<void*,void>& aLink = Link<void*,void>()); void SetDoneLink( const Link<void*,void>& rLink ); @@ -178,23 +178,23 @@ public: css::uno::Reference< css::embed::XStorage > GetStorage( bool bCreateTempIfNo = true ); css::uno::Reference< css::embed::XStorage > GetOutputStorage(); void ResetError(); - SAL_WARN_UNUSED_RESULT bool IsExpired() const; + [[nodiscard]] bool IsExpired() const; void SetName( const OUString& rName, bool bSetOrigURL = false ); const css::uno::Sequence < css::util::RevisionTag >& GetVersionList( bool _bNoReload = false ); - SAL_WARN_UNUSED_RESULT bool IsReadOnly() const; + [[nodiscard]] bool IsReadOnly() const; // Whether the medium had originally been opened r/o (either because it is // "physically" r/o, or because it was requested to be opened r/o, // independent of later changes via SetOpenMode; used to keep track of the // "true" state of the medium across toggles via SID_EDITDOC (which do // change SetOpenMode): - SAL_WARN_UNUSED_RESULT bool IsOriginallyReadOnly() const; + [[nodiscard]] bool IsOriginallyReadOnly() const; // Whether the medium had originally been requested to be opened r/o, // independent of later changes via SetOpenMode; used for SID_RELOAD: - SAL_WARN_UNUSED_RESULT bool IsOriginallyLoadedReadOnly() const; + [[nodiscard]] bool IsOriginallyLoadedReadOnly() const; css::uno::Reference< css::io::XInputStream > const & GetInputStream(); diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx index 0b1d6ffee904..f046700050c3 100644 --- a/include/svx/svdundo.hxx +++ b/include/svx/svdundo.hxx @@ -128,7 +128,7 @@ protected: void ImpTakeDescriptionStr(const char* pStrCacheID, OUString& rStr, bool bRepeat = false) const; - SAL_WARN_UNUSED_RESULT static OUString GetDescriptionStringForObject( const SdrObject& _rForObject, const char* pStrCacheID, bool bRepeat = false ); + [[nodiscard]] static OUString GetDescriptionStringForObject( const SdrObject& _rForObject, const char* pStrCacheID, bool bRepeat = false ); // #94278# new method for evtl. PageChange at UNDO/REDO void ImpShowPageOfThisObject(); diff --git a/include/svx/unoapi.hxx b/include/svx/unoapi.hxx index 0f07186497fb..71d699ad0a65 100644 --- a/include/svx/unoapi.hxx +++ b/include/svx/unoapi.hxx @@ -79,7 +79,7 @@ SVX_DLLPUBLIC bool SvxFieldUnitToMeasureUnit( const FieldUnit nVcl, short& eApi * * @throws std::exception */ -SAL_WARN_UNUSED_RESULT SVX_DLLPUBLIC OUString +[[nodiscard]] SVX_DLLPUBLIC OUString SvxUnogetApiNameForItem(const sal_uInt16 nWhich, const OUString& rInternalName); /** @@ -88,7 +88,7 @@ SAL_WARN_UNUSED_RESULT SVX_DLLPUBLIC OUString * * @throws std::exception */ -SAL_WARN_UNUSED_RESULT SVX_DLLPUBLIC OUString +[[nodiscard]] SVX_DLLPUBLIC OUString SvxUnogetInternalNameForItem(const sal_uInt16 nWhich, const OUString& rApiName); #endif // INCLUDED_SVX_UNOAPI_HXX diff --git a/include/tools/helpers.hxx b/include/tools/helpers.hxx index 2ce550c42e03..1d00bad7112e 100644 --- a/include/tools/helpers.hxx +++ b/include/tools/helpers.hxx @@ -78,7 +78,7 @@ inline long FRound( double fVal ) //valid range: (-180,180] template <typename T> -SAL_WARN_UNUSED_RESULT inline typename std::enable_if<std::is_signed<T>::value, T>::type +[[nodiscard]] inline typename std::enable_if<std::is_signed<T>::value, T>::type NormAngle180(T angle) { while (angle <= -180) @@ -89,7 +89,7 @@ NormAngle180(T angle) } //valid range: [0,360) -template <typename T> SAL_WARN_UNUSED_RESULT inline T NormAngle360(T angle) +template <typename T> [[nodiscard]] inline T NormAngle360(T angle) { while (angle < 0) angle += 360; diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx index ea3e53d21ff9..e4da2748a3ac 100644 --- a/include/tools/stream.hxx +++ b/include/tools/stream.hxx @@ -564,7 +564,7 @@ inline std::size_t write_uInt16_lenPrefixed_uInt8s_FromOUString(SvStream& rStrm, return write_uInt16_lenPrefixed_uInt8s_FromOString(rStrm, OUStringToOString(rStr, eEnc)); } -SAL_WARN_UNUSED_RESULT TOOLS_DLLPUBLIC bool checkSeek(SvStream &rSt, sal_uInt64 nOffset); +[[nodiscard]] TOOLS_DLLPUBLIC bool checkSeek(SvStream &rSt, sal_uInt64 nOffset); // FileStream diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx index c519f459642d..722466aa2914 100644 --- a/include/vcl/bitmapex.hxx +++ b/include/vcl/bitmapex.hxx @@ -375,7 +375,7 @@ public: @param bSmooth Defines if pixel interpolation is to be used to create the result */ - SAL_WARN_UNUSED_RESULT + [[nodiscard]] BitmapEx TransformBitmapEx( double fWidth, double fHeight, @@ -403,7 +403,7 @@ public: @return The transformed bitmap */ - SAL_WARN_UNUSED_RESULT + [[nodiscard]] BitmapEx getTransformed( const basegfx::B2DHomMatrix& rTransformation, const basegfx::B2DRange& rVisibleRange, @@ -415,10 +415,10 @@ public: @param rBColorModifierStack A ColrModifierStack which defines how each pixel has to be modified */ - SAL_WARN_UNUSED_RESULT + [[nodiscard]] BitmapEx ModifyBitmapEx( const basegfx::BColorModifierStack& rBColorModifierStack) const; - SAL_WARN_UNUSED_RESULT + [[nodiscard]] static BitmapEx AutoScaleBitmap( BitmapEx const & aBitmap, const long aStandardSize ); /// populate from a canvas implementation diff --git a/include/vcl/vclptr.hxx b/include/vcl/vclptr.hxx index 9e1ce33d3184..1308b5d1a68b 100644 --- a/include/vcl/vclptr.hxx +++ b/include/vcl/vclptr.hxx @@ -124,7 +124,7 @@ public: * * @tparam reference_type must be a subclass of vcl::Window */ - template<typename... Arg> SAL_WARN_UNUSED_RESULT static VclPtr< reference_type > Create(Arg &&... arg) + template<typename... Arg> [[nodiscard]] static VclPtr< reference_type > Create(Arg &&... arg) { return VclPtr< reference_type >( new reference_type(std::forward<Arg>(arg)...), SAL_NO_ACQUIRE ); } diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx index 66275ac6e1dd..02a83a132d79 100644 --- a/sc/inc/address.hxx +++ b/sc/inc/address.hxx @@ -91,47 +91,47 @@ const SCROW SCROW_REPEAT_NONE = SCROW_MAX; #define MAXROW_30 8191 -SAL_WARN_UNUSED_RESULT inline bool ValidCol( SCCOL nCol ) +[[nodiscard]] inline bool ValidCol( SCCOL nCol ) { return nCol >= 0 && nCol <= MAXCOL; } -SAL_WARN_UNUSED_RESULT inline bool ValidRow( SCROW nRow ) +[[nodiscard]] inline bool ValidRow( SCROW nRow ) { return nRow >= 0 && nRow <= MAXROW; } -SAL_WARN_UNUSED_RESULT inline bool ValidTab( SCTAB nTab ) +[[nodiscard]] inline bool ValidTab( SCTAB nTab ) { return nTab >= 0 && nTab <= MAXTAB; } -SAL_WARN_UNUSED_RESULT inline bool ValidTab( SCTAB nTab, SCTAB nMaxTab ) +[[nodiscard]] inline bool ValidTab( SCTAB nTab, SCTAB nMaxTab ) { return nTab >= 0 && nTab <= nMaxTab; } -SAL_WARN_UNUSED_RESULT inline bool ValidColRow( SCCOL nCol, SCROW nRow ) +[[nodiscard]] inline bool ValidColRow( SCCOL nCol, SCROW nRow ) { return ValidCol( nCol) && ValidRow( nRow); } -SAL_WARN_UNUSED_RESULT inline bool ValidColRowTab( SCCOL nCol, SCROW nRow, SCTAB nTab ) +[[nodiscard]] inline bool ValidColRowTab( SCCOL nCol, SCROW nRow, SCTAB nTab ) { return ValidCol( nCol) && ValidRow( nRow) && ValidTab( nTab); } -SAL_WARN_UNUSED_RESULT inline SCCOL SanitizeCol( SCCOL nCol ) +[[nodiscard]] inline SCCOL SanitizeCol( SCCOL nCol ) { return nCol < 0 ? 0 : std::min(nCol, MAXCOL); } -SAL_WARN_UNUSED_RESULT inline SCROW SanitizeRow( SCROW nRow ) +[[nodiscard]] inline SCROW SanitizeRow( SCROW nRow ) { return nRow < 0 ? 0 : std::min(nRow, MAXROW); } -SAL_WARN_UNUSED_RESULT inline SCTAB SanitizeTab( SCTAB nTab ) +[[nodiscard]] inline SCTAB SanitizeTab( SCTAB nTab ) { return nTab < 0 ? 0 : std::min(nTab, MAXTAB); } @@ -341,7 +341,7 @@ public: @param pDocument The document for the maximum defined sheet number. */ - SAL_WARN_UNUSED_RESULT SC_DLLPUBLIC bool Move( SCCOL nDeltaX, SCROW nDeltaY, SCTAB nDeltaZ, + [[nodiscard]] SC_DLLPUBLIC bool Move( SCCOL nDeltaX, SCROW nDeltaY, SCTAB nDeltaZ, ScAddress& rErrorPos, const ScDocument* pDocument = nullptr ); inline bool operator==( const ScAddress& rAddress ) const; @@ -616,11 +616,11 @@ public: @param pDocument The document for the maximum defined sheet number. */ - SAL_WARN_UNUSED_RESULT SC_DLLPUBLIC bool Move( SCCOL aDeltaX, SCROW aDeltaY, SCTAB aDeltaZ, + [[nodiscard]] SC_DLLPUBLIC bool Move( SCCOL aDeltaX, SCROW aDeltaY, SCTAB aDeltaZ, ScRange& rErrorRange, const ScDocument* pDocument = nullptr ); /** Same as Move() but with sticky end col/row anchors. */ - SAL_WARN_UNUSED_RESULT SC_DLLPUBLIC bool MoveSticky( SCCOL aDeltaX, SCROW aDeltaY, SCTAB aDeltaZ, + [[nodiscard]] SC_DLLPUBLIC bool MoveSticky( SCCOL aDeltaX, SCROW aDeltaY, SCTAB aDeltaZ, ScRange& rErrorRange ); SC_DLLPUBLIC void IncColIfNotLessThan(SCCOL nStartCol, SCCOL nOffset); diff --git a/sc/inc/compressedarray.hxx b/sc/inc/compressedarray.hxx index d514aaed475c..bfcb07888318 100644 --- a/sc/inc/compressedarray.hxx +++ b/sc/inc/compressedarray.hxx @@ -73,19 +73,19 @@ public: void Reset( const D& rValue ); void SetValue( A nPos, const D& rValue ); void SetValue( A nStart, A nEnd, const D& rValue ); - SAL_WARN_UNUSED_RESULT + [[nodiscard]] const D& GetValue( A nPos ) const; - SAL_WARN_UNUSED_RESULT + [[nodiscard]] A GetLastPos() const { return pData[nCount-1].nEnd; } /** Get value for a row, and it's region end row */ - SAL_WARN_UNUSED_RESULT + [[nodiscard]] const D& GetValue( A nPos, size_t& nIndex, A& nEnd ) const; /** Get next value and it's region end row. If nIndex<nCount, nIndex is incremented first. If the resulting nIndex>=nCount, the value of the last entry is returned again. */ - SAL_WARN_UNUSED_RESULT + [[nodiscard]] const D& GetNextValue( size_t& nIndex, A& nEnd ) const; /** Insert rows before nStart and copy value for inserted rows from diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 31278f83798b..f5f8fdbd594d 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1014,7 +1014,7 @@ public: void BeginUnoRefUndo(); bool HasUnoRefUndo() const { return ( pUnoRefUndoList != nullptr ); } - SAL_WARN_UNUSED_RESULT + [[nodiscard]] std::unique_ptr<ScUnoRefList> EndUnoRefUndo(); // must be deleted by caller! sal_Int64 GetNewUnoId() { return ++nUnoObjectId; } void AddUnoRefChange( sal_Int64 nId, const ScRangeList& rOldRanges ); diff --git a/sc/inc/segmenttree.hxx b/sc/inc/segmenttree.hxx index 40f584a931d5..8a7eb1ae0a8d 100644 --- a/sc/inc/segmenttree.hxx +++ b/sc/inc/segmenttree.hxx @@ -41,7 +41,7 @@ public: public: explicit ForwardIterator(ScFlatBoolRowSegments& rSegs); - SAL_WARN_UNUSED_RESULT + [[nodiscard]] bool getValue(SCROW nPos, bool& rVal); SCROW getLastPos() const { return mnLastPos;} diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index e804a1ca9cc2..64bf2bd95b2c 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -313,15 +313,15 @@ public: bool IsStreamValid() const { return bStreamValid; } void SetStreamValid( bool bSet, bool bIgnoreLock = false ); - SAL_WARN_UNUSED_RESULT bool IsColValid( const SCCOL nScCol ) const + [[nodiscard]] bool IsColValid( const SCCOL nScCol ) const { return nScCol >= static_cast< SCCOL >( 0 ) && nScCol < aCol.size(); } - SAL_WARN_UNUSED_RESULT bool IsColRowValid( const SCCOL nScCol, const SCROW nScRow ) const + [[nodiscard]] bool IsColRowValid( const SCCOL nScCol, const SCROW nScRow ) const { return IsColValid( nScCol ) && ValidRow( nScRow ); } - SAL_WARN_UNUSED_RESULT bool IsColRowTabValid( const SCCOL nScCol, const SCROW nScRow, const SCTAB nScTab ) const + [[nodiscard]] bool IsColRowTabValid( const SCCOL nScCol, const SCROW nScRow, const SCTAB nScTab ) const { return IsColValid( nScCol ) && ValidRow( nScRow ) && ValidTab( nScTab ); } @@ -944,7 +944,7 @@ public: void GetFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, ScFilterEntries& rFilterEntries ); void GetFilteredFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, const ScQueryParam& rParam, ScFilterEntries& rFilterEntries ); - SAL_WARN_UNUSED_RESULT + [[nodiscard]] bool GetDataEntries(SCCOL nCol, SCROW nRow, std::set<ScTypedStrData>& rStrings, bool bLimit); bool HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ) const; diff --git a/sc/source/filter/inc/xistream.hxx b/sc/source/filter/inc/xistream.hxx index a2baae681283..15cde8c9a911 100644 --- a/sc/source/filter/inc/xistream.hxx +++ b/sc/source/filter/inc/xistream.hxx @@ -363,17 +363,17 @@ public: sal_uInt16 PeekRecId( std::size_t nPos ); - SAL_WARN_UNUSED_RESULT + [[nodiscard]] sal_uInt8 ReaduInt8(); - SAL_WARN_UNUSED_RESULT + [[nodiscard]] sal_Int16 ReadInt16(); - SAL_WARN_UNUSED_RESULT + [[nodiscard]] sal_uInt16 ReaduInt16(); - SAL_WARN_UNUSED_RESULT + [[nodiscard]] sal_Int32 ReadInt32(); - SAL_WARN_UNUSED_RESULT + [[nodiscard]] sal_uInt32 ReaduInt32(); - SAL_WARN_UNUSED_RESULT + [[nodiscard]] double ReadDouble(); /** Reads nBytes bytes to the existing(!) buffer pData. diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index ad89b34082a6..c05d552ffa19 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -2110,7 +2110,7 @@ tools::Rectangle ScDocShell::GetVisArea( sal_uInt16 nAspect ) const namespace { -SAL_WARN_UNUSED_RESULT +[[nodiscard]] long SnapHorizontal( const ScDocument& rDoc, SCTAB nTab, long nVal, SCCOL& rStartCol ) { SCCOL nCol = 0; @@ -2132,7 +2132,7 @@ long SnapHorizontal( const ScDocument& rDoc, SCTAB nTab, long nVal, SCCOL& rStar return nVal; } -SAL_WARN_UNUSED_RESULT +[[nodiscard]] long SnapVertical( const ScDocument& rDoc, SCTAB nTab, long nVal, SCROW& rStartRow ) { SCROW nRow = 0; diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx index 8a2d3cf4f65f..09342f1d741c 100644 --- a/sc/source/ui/inc/viewdata.hxx +++ b/sc/source/ui/inc/viewdata.hxx @@ -264,7 +264,7 @@ private: we want this function to be const to be able to call the check from anywhere. */ - SAL_WARN_UNUSED_RESULT ScSplitPos SanitizeWhichActive() const; + [[nodiscard]] ScSplitPos SanitizeWhichActive() const; }; class SC_DLLPUBLIC ScViewData diff --git a/starmath/source/mathmlimport.hxx b/starmath/source/mathmlimport.hxx index b91a51bea2bd..3c8a389edc37 100644 --- a/starmath/source/mathmlimport.hxx +++ b/starmath/source/mathmlimport.hxx @@ -180,7 +180,7 @@ public: SmNodeStack & GetNodeStack() { return aNodeStack; } bool GetSuccess() { return bSuccess; } - SAL_WARN_UNUSED_RESULT const OUString& GetText() { return aText; } + [[nodiscard]] const OUString& GetText() { return aText; } void SetText(const OUString &rStr) { aText = rStr; } virtual void SetViewSettings(const css::uno::Sequence<css::beans::PropertyValue>& aViewProps) override; diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index 3eae6d1b30b3..2e4ae3e40af4 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -1861,7 +1861,7 @@ public: Word2CHPX ReadWord2Chpx(SvStream &rSt, std::size_t nOffset, sal_uInt8 nSize); std::vector<sal_uInt8> ChpxToSprms(const Word2CHPX &rChpx); -SAL_WARN_UNUSED_RESULT bool checkRead(SvStream &rSt, void *pDest, sal_uInt32 nLength); +[[nodiscard]] bool checkRead(SvStream &rSt, void *pDest, sal_uInt32 nLength); //MS has a (slightly) inaccurate view of how many twips //are in the default letter size of a page diff --git a/vcl/inc/regionband.hxx b/vcl/inc/regionband.hxx index b227226353d1..a007261489fb 100644 --- a/vcl/inc/regionband.hxx +++ b/vcl/inc/regionband.hxx @@ -36,7 +36,7 @@ private: ImplRegionBand* mpLastCheckedBand; void implReset(); - SAL_WARN_UNUSED_RESULT bool CheckConsistency() const; + [[nodiscard]] bool CheckConsistency() const; public: RegionBand(); @@ -47,7 +47,7 @@ public: bool operator==( const RegionBand& rRegionBand ) const; - SAL_WARN_UNUSED_RESULT bool load(SvStream& rIStrm); + [[nodiscard]] bool load(SvStream& rIStrm); void save(SvStream& rIStrm) const; bool isSingleRectangle() const; diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx index b27b46d828c8..fb3618b3f6bd 100644 --- a/vcl/inc/salframe.hxx +++ b/vcl/inc/salframe.hxx @@ -156,7 +156,7 @@ public: virtual void SetWindowState( const SalFrameState* pState ) = 0; // if this returns false the structure is uninitialised - SAL_WARN_UNUSED_RESULT + [[nodiscard]] virtual bool GetWindowState( SalFrameState* pState ) = 0; virtual void ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) = 0; virtual void PositionByToolkit( const tools::Rectangle&, FloatWinPopupFlags ) {}; diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index c71235816bae..d3d459d058fe 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -203,7 +203,7 @@ public: void mirror( long& nX, const OutputDevice *pOutDev ) const; // only called mirror2 to avoid ambiguity - SAL_WARN_UNUSED_RESULT + [[nodiscard]] long mirror2( long nX, const OutputDevice *pOutDev ) const; void mirror( long& nX, long nWidth, const OutputDevice *pOutDev, bool bBack = false ) const; bool mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev ) const; |