include/svl/imageitm.hxx | 4 ++-- include/svl/metitem.hxx | 2 +- include/svl/poolitem.hxx | 3 ++- include/svl/svdde.hxx | 21 +++++++++++---------- svl/source/crypto/cryptosign.cxx | 2 +- svl/source/items/imageitm.cxx | 6 +++--- svl/source/items/intitem.cxx | 2 +- svl/source/items/poolitem.cxx | 2 +- svl/source/numbers/zformat.cxx | 11 ++++++----- svl/source/undo/undo.cxx | 3 ++- svl/unx/source/svdde/ddedummy.cxx | 17 +++++++++-------- 11 files changed, 39 insertions(+), 34 deletions(-)
New commits: commit 73b115b1a399f57efd727eb71d7ef9e4a27afbc9 Author: Noel <noelgran...@gmail.com> AuthorDate: Mon Oct 19 10:46:18 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Oct 19 13:52:32 2020 +0200 use tools::Long in svl Change-Id: Ic63d3c0ebd1e58d7bab5b0fd6313cabddc16eb98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104517 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/svl/imageitm.hxx b/include/svl/imageitm.hxx index ccecc5356637..c135216cc482 100644 --- a/include/svl/imageitm.hxx +++ b/include/svl/imageitm.hxx @@ -39,8 +39,8 @@ 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; - void SetRotation( long nValue ); - long GetRotation() const; + void SetRotation( tools::Long nValue ); + tools::Long GetRotation() const; void SetMirrored( bool bSet ); bool IsMirrored() const; }; diff --git a/include/svl/metitem.hxx b/include/svl/metitem.hxx index be5b1b7ba497..9d64d6bdd34f 100644 --- a/include/svl/metitem.hxx +++ b/include/svl/metitem.hxx @@ -27,7 +27,7 @@ class SVL_DLLPUBLIC SfxMetricItem: public SfxInt32Item public: explicit SfxMetricItem( sal_uInt16 nWhich, sal_uInt32 nValue ); - virtual void ScaleMetrics( long lMult, long lDiv ) override; + virtual void ScaleMetrics( tools::Long lMult, tools::Long lDiv ) override; virtual bool HasMetrics() const override; }; diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx index f1bb0cfab4d3..ce4ebeaef679 100644 --- a/include/svl/poolitem.hxx +++ b/include/svl/poolitem.hxx @@ -29,6 +29,7 @@ #include <svl/svldllapi.h> #include <svl/typedwhich.hxx> #include <tools/mapunit.hxx> +#include <tools/long.hxx> #include <boost/property_tree/ptree_fwd.hpp> class IntlWrapper; @@ -164,7 +165,7 @@ public: OUString &rText, const IntlWrapper& rIntlWrapper ) const; - virtual void ScaleMetrics( long lMult, long lDiv ); + virtual void ScaleMetrics( tools::Long lMult, tools::Long lDiv ); virtual bool HasMetrics() const; virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; diff --git a/include/svl/svdde.hxx b/include/svl/svdde.hxx index c0d5975e84c7..eecd48d72e91 100644 --- a/include/svl/svdde.hxx +++ b/include/svl/svdde.hxx @@ -27,6 +27,7 @@ #include <rtl/ustring.hxx> #include <tools/solar.h> #include <tools/link.hxx> +#include <tools/long.hxx> #include <memory> #include <vector> @@ -56,14 +57,14 @@ class SVL_DLLPUBLIC DdeData public: DdeData(); - DdeData(SAL_UNUSED_PARAMETER const void*, SAL_UNUSED_PARAMETER long, SAL_UNUSED_PARAMETER SotClipboardFormatId = SotClipboardFormatId::STRING); + DdeData(SAL_UNUSED_PARAMETER const void*, SAL_UNUSED_PARAMETER tools::Long, SAL_UNUSED_PARAMETER SotClipboardFormatId = SotClipboardFormatId::STRING); DdeData(SAL_UNUSED_PARAMETER const OUString&); DdeData(const DdeData&); DdeData(DdeData&&) noexcept; ~DdeData(); void const * getData() const; - long getSize() const; + tools::Long getSize() const; SotClipboardFormatId GetFormat() const; @@ -91,7 +92,7 @@ protected: Link<bool,void> aDone; bool bBusy; - DdeTransaction( DdeConnection&, SAL_UNUSED_PARAMETER const OUString&, SAL_UNUSED_PARAMETER long = 0 ); + DdeTransaction( DdeConnection&, SAL_UNUSED_PARAMETER const OUString&, SAL_UNUSED_PARAMETER tools::Long = 0 ); public: virtual ~DdeTransaction(); @@ -110,7 +111,7 @@ public: void SetFormat( SotClipboardFormatId nFmt ) { aDdeData.SetFormat( nFmt ); } SotClipboardFormatId GetFormat() const { return aDdeData.GetFormat(); } - long GetError() const; + tools::Long GetError() const; private: friend class DdeInternal; @@ -127,7 +128,7 @@ class SVL_DLLPUBLIC DdeLink : public DdeTransaction Link<void*,void> aNotify; public: - DdeLink( DdeConnection&, const OUString&, long = 0 ); + DdeLink( DdeConnection&, const OUString&, tools::Long = 0 ); virtual ~DdeLink() override; void SetNotifyHdl( const Link<void*,void>& rLink ) { aNotify = rLink; } @@ -146,21 +147,21 @@ public: class SVL_DLLPUBLIC DdeRequest : public DdeTransaction { public: - DdeRequest( DdeConnection&, const OUString&, long = 0 ); + DdeRequest( DdeConnection&, const OUString&, tools::Long = 0 ); }; class SVL_DLLPUBLIC DdePoke : public DdeTransaction { public: - DdePoke( DdeConnection&, const OUString&, SAL_UNUSED_PARAMETER const DdeData&, long = 0 ); + DdePoke( DdeConnection&, const OUString&, SAL_UNUSED_PARAMETER const DdeData&, tools::Long = 0 ); }; class SVL_DLLPUBLIC DdeExecute : public DdeTransaction { public: - DdeExecute( DdeConnection&, const OUString&, long = 0 ); + DdeExecute( DdeConnection&, const OUString&, tools::Long = 0 ); }; @@ -177,7 +178,7 @@ public: DdeConnection( SAL_UNUSED_PARAMETER const OUString&, SAL_UNUSED_PARAMETER const OUString& ); ~DdeConnection(); - long GetError() const; + tools::Long GetError() const; static const std::vector<DdeConnection*>& GetConnections(); @@ -316,7 +317,7 @@ public: }; -inline long DdeTransaction::GetError() const +inline tools::Long DdeTransaction::GetError() const { return rDde.GetError(); } diff --git a/svl/source/crypto/cryptosign.cxx b/svl/source/crypto/cryptosign.cxx index 202d2d1ac42f..64f0fe4b59e0 100644 --- a/svl/source/crypto/cryptosign.cxx +++ b/svl/source/crypto/cryptosign.cxx @@ -1099,7 +1099,7 @@ bool Signing::Sign(OStringBuffer& rCMSHexBuffer) return false; } - if ((rc = curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<long>(timestamp_request->len))) != CURLE_OK || + if ((rc = curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<tools::Long>(timestamp_request->len))) != CURLE_OK || (rc = curl_easy_setopt(curl, CURLOPT_POSTFIELDS, timestamp_request->data)) != CURLE_OK) { SAL_WARN("svl.crypto", "curl_easy_setopt(CURLOPT_POSTFIELDSIZE or CURLOPT_POSTFIELDS) failed: " << curl_easy_strerror(rc)); diff --git a/svl/source/items/imageitm.cxx b/svl/source/items/imageitm.cxx index 4959914b152d..0fa250fc043b 100644 --- a/svl/source/items/imageitm.cxx +++ b/svl/source/items/imageitm.cxx @@ -27,7 +27,7 @@ SfxPoolItem* SfxImageItem::CreateDefault() { return new SfxImageItem; } struct SfxImageItem_Impl { OUString aURL; - long nAngle; + tools::Long nAngle; bool bMirrored; bool operator == ( const SfxImageItem_Impl& rOther ) const { return nAngle == rOther.nAngle && bMirrored == rOther.bMirrored; } @@ -94,12 +94,12 @@ bool SfxImageItem::PutValue( const css::uno::Any& rVal, sal_uInt8 ) return false; } -void SfxImageItem::SetRotation( long nValue ) +void SfxImageItem::SetRotation( tools::Long nValue ) { pImpl->nAngle = nValue; } -long SfxImageItem::GetRotation() const +tools::Long SfxImageItem::GetRotation() const { return pImpl->nAngle; } diff --git a/svl/source/items/intitem.cxx b/svl/source/items/intitem.cxx index c0c4831a5c3d..072de0501f40 100644 --- a/svl/source/items/intitem.cxx +++ b/svl/source/items/intitem.cxx @@ -165,7 +165,7 @@ SfxMetricItem::SfxMetricItem(sal_uInt16 which, sal_uInt32 nValue): } // virtual -void SfxMetricItem::ScaleMetrics(long nMult, long nDiv) +void SfxMetricItem::ScaleMetrics(tools::Long nMult, tools::Long nDiv) { BigInt aTheValue(GetValue()); aTheValue *= nMult; diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx index 25f2720b547c..0d6513f70483 100644 --- a/svl/source/items/poolitem.cxx +++ b/svl/source/items/poolitem.cxx @@ -620,7 +620,7 @@ bool SfxVoidItem::IsVoidItem() const return true; } -void SfxPoolItem::ScaleMetrics( long /*lMult*/, long /*lDiv*/ ) +void SfxPoolItem::ScaleMetrics( tools::Long /*lMult*/, tools::Long /*lDiv*/ ) { } diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index ae9055852fdf..4974fe9d5ac4 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -23,6 +23,7 @@ #include <comphelper/string.hxx> #include <sal/log.hxx> #include <tools/debug.hxx> +#include <tools/long.hxx> #include <i18nlangtag/mslangid.hxx> #include <rtl/math.hxx> #include <unotools/charclass.hxx> @@ -95,17 +96,17 @@ sal_Int32 SvNumberformat::InsertBlanks( OUStringBuffer& r, sal_Int32 nPos, sal_U return nPos; } -static long GetPrecExp( double fAbsVal ) +static tools::Long GetPrecExp( double fAbsVal ) { DBG_ASSERT( fAbsVal > 0.0, "GetPrecExp: fAbsVal <= 0.0" ); if ( fAbsVal < 1e-7 || fAbsVal > 1e7 ) { // Shear: whether it's faster or not, falls in between 1e6 and 1e7 - return static_cast<long>(floor( log10( fAbsVal ) )) + 1; + return static_cast<tools::Long>(floor( log10( fAbsVal ) )) + 1; } else { - long nPrecExp = 1; + tools::Long nPrecExp = 1; while( fAbsVal < 1 ) { fAbsVal *= 10; @@ -4273,7 +4274,7 @@ bool SvNumberformat::ImpGetNumberOutput(double fNumber, { // Special formatting only if no GENERAL keyword in format code const sal_uInt16 nThousand = rInfo.nThousand; - long nPrecExp; + tools::Long nPrecExp; for (i = 0; i < nThousand; i++) { if (fNumber > D_MIN_M_BY_1000) @@ -4298,7 +4299,7 @@ bool SvNumberformat::ImpGetNumberOutput(double fNumber, if ((rInfo.nCntPost + nPrecExp) > 15 && nPrecExp < 15) { sStr = ::rtl::math::doubleToUString( fNumber, rtl_math_StringFormat_F, 15-nPrecExp, '.'); - for (long l = 15-nPrecExp; l < static_cast<long>(rInfo.nCntPost); l++) + for (tools::Long l = 15-nPrecExp; l < static_cast<tools::Long>(rInfo.nCntPost); l++) { sStr.append('0'); } diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx index b678fba83948..2ce8fa84bf17 100644 --- a/svl/source/undo/undo.cxx +++ b/svl/source/undo/undo.cxx @@ -25,6 +25,7 @@ #include <sal/log.hxx> #include <comphelper/flagguard.hxx> #include <tools/diagnose_ex.h> +#include <tools/long.hxx> #include <libxml/xmlwriter.h> #include <boost/property_tree/json_parser.hpp> #include <unotools/datetime.hxx> @@ -388,7 +389,7 @@ void SfxUndoManager::SetMaxUndoActionCount( size_t nMaxUndoActionCount ) // Both redo and undo action entries will be removed until we reached the // new nMaxUndoActionCount. - long nNumToDelete = m_xData->pActUndoArray->maUndoActions.size() - nMaxUndoActionCount; + tools::Long nNumToDelete = m_xData->pActUndoArray->maUndoActions.size() - nMaxUndoActionCount; while ( nNumToDelete > 0 ) { size_t nPos = m_xData->pActUndoArray->maUndoActions.size(); diff --git a/svl/unx/source/svdde/ddedummy.cxx b/svl/unx/source/svdde/ddedummy.cxx index 613bfe4ab471..fa5aef5faaef 100644 --- a/svl/unx/source/svdde/ddedummy.cxx +++ b/svl/unx/source/svdde/ddedummy.cxx @@ -19,6 +19,7 @@ #include <svl/svdde.hxx> #include <rtl/instance.hxx> +#include <tools/long.hxx> struct Conversation { @@ -44,7 +45,7 @@ DdeData::DdeData(DdeData&&) noexcept { } -DdeData::DdeData( const void*, long, SotClipboardFormatId) +DdeData::DdeData( const void*, tools::Long, SotClipboardFormatId) { } @@ -71,7 +72,7 @@ DdeData& DdeData::operator=(DdeData&&) noexcept return *this; } -long DdeData::getSize() const +tools::Long DdeData::getSize() const { return 0L; } @@ -83,7 +84,7 @@ void const * DdeData::getData() const struct DdeImp {}; -long DdeConnection::GetError() const +tools::Long DdeConnection::GetError() const { return 0L; } @@ -108,7 +109,7 @@ OUString DdeConnection::GetTopicName() const return OUString(); } -DdeTransaction::DdeTransaction( DdeConnection& rConnection, const OUString&, long ) +DdeTransaction::DdeTransaction( DdeConnection& rConnection, const OUString&, tools::Long ) : rDde(rConnection) , pName(nullptr) , nType(0) @@ -134,17 +135,17 @@ DdeTransaction::~DdeTransaction() { } -DdeRequest::DdeRequest( DdeConnection& rConnection, const OUString& rString, long lLong ) +DdeRequest::DdeRequest( DdeConnection& rConnection, const OUString& rString, tools::Long lLong ) : DdeTransaction( rConnection, rString, lLong ) { } -DdeExecute::DdeExecute( DdeConnection& rConnection, const OUString& rString, long lLong ) +DdeExecute::DdeExecute( DdeConnection& rConnection, const OUString& rString, tools::Long lLong ) : DdeTransaction( rConnection, rString, lLong ) { } -DdePoke::DdePoke( DdeConnection& rConnection, const OUString& rString, const DdeData&, long lLong ) +DdePoke::DdePoke( DdeConnection& rConnection, const OUString& rString, const DdeData&, tools::Long lLong ) : DdeTransaction( rConnection, rString, lLong ) { } @@ -308,7 +309,7 @@ void DdeGetPutItem::AdviseLoop( SAL_UNUSED_PARAMETER bool ) { } -DdeLink::DdeLink( DdeConnection& rConnection, const OUString& rString, long l ) +DdeLink::DdeLink( DdeConnection& rConnection, const OUString& rString, tools::Long l ) : DdeTransaction( rConnection, rString, l ) { } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits