From f54b1d1e0937cf43d74e34bfd5ae921923527a09 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 19 Nov 2020 11:54:51 +0100 Subject: Clarify DdeData::GetExternalFormat return type The implementation (in svl/source/svdde/ddedata.cxx) returns any of: * {CF_TEXT=1, CF_BITMAP=2, CF_METFILEPICT=3} from the Windows API; * the return value of Windows API's RegisterClipboardFormatW, which is UINT from the Windows API (i.e., 32-bit unsigned int); * a enum SotClipboardFormatId value, whose underlying type is sal_uInt32. So the natural choice is sal_uInt32 here. (Windows API's UINT would also do, but cannot be used in include/svl/svdde.hxx, which is used on all platforms.) That in turn shows that DdeService's aFormats and HasCbFormat should also use sal_uInt32. (And then, simplify some of the std algorithms use in svl/source/svdde/ddesvr.cxx.) Change-Id: I593d0a7df78bfdd08ce2de04c3da2078d973e262 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106151 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- include/svl/svdde.hxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/svl') diff --git a/include/svl/svdde.hxx b/include/svl/svdde.hxx index beea2ef5e53d..e8b808ea1159 100644 --- a/include/svl/svdde.hxx +++ b/include/svl/svdde.hxx @@ -71,7 +71,7 @@ public: DdeData& operator=(const DdeData&); DdeData& operator=(DdeData&&) noexcept; - static sal_uLong GetExternalFormat(SotClipboardFormatId nFmt); + static sal_uInt32 GetExternalFormat(SotClipboardFormatId nFmt); static SotClipboardFormatId GetInternalFormat(sal_uLong nFmt); }; @@ -286,14 +286,14 @@ protected: const DdeTopic* GetSysTopic() const { return pSysTopic; } private: std::vector aTopics; - std::vector< tools::Long > aFormats; + std::vector< sal_uInt32 > aFormats; DdeTopic* pSysTopic; DdeString* pName; std::vector> m_vConv; short nStatus; - SVL_DLLPRIVATE bool HasCbFormat( sal_uInt16 ); + SVL_DLLPRIVATE bool HasCbFormat( sal_uInt32 ); public: DdeService( SAL_UNUSED_PARAMETER const OUString& ); -- cgit