[Libreoffice-commits] core.git: connectivity/source extensions/source
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Thu Nov 26 16:01:58 UTC 2020
connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx | 4 +-
connectivity/source/drivers/ado/AResultSet.cxx | 4 +-
connectivity/source/drivers/ado/Aolevariant.cxx | 6 +--
connectivity/source/drivers/ado/Awrapado.cxx | 2 -
extensions/source/activex/SOActionsApproval.h | 2 -
extensions/source/activex/SOActiveX.cxx | 10 +++---
extensions/source/activex/SOComWindowPeer.h | 2 -
extensions/source/activex/SODispatchInterceptor.cxx | 10 +++---
extensions/source/activex/SODispatchInterceptor.h | 2 -
extensions/source/ole/unoconversionutilities.hxx | 16 +++++-----
10 files changed, 29 insertions(+), 29 deletions(-)
New commits:
commit 5a448a920302c52b1366844efeab0f2e23bef95a
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Nov 26 15:38:15 2020 +0100
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Nov 26 17:01:08 2020 +0100
The Windows oleauto.h SafeArray* functions use LONG for indexing
Change-Id: If973cc337e0674462cfe2a15e347881a861a761f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106697
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
index 16acbc133bf3..a12f6e1fd6c4 100644
--- a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
@@ -151,14 +151,14 @@ Reference< css::io::XInputStream > SAL_CALL ODatabaseMetaDataResultSet::getBinar
//Copy the data only up to the Actual Size of Field.
sal_Int32 nSize = aField.GetActualSize();
Sequence<sal_Int8> aData(nSize);
- long index = 0;
+ sal_Int32 index = 0;
while(index < nSize)
{
m_aValue = aField.GetChunk(BLOCK_SIZE);
if(m_aValue.isNull())
break;
UCHAR chData;
- for(long index2 = 0;index2 < BLOCK_SIZE;++index2)
+ for(LONG index2 = 0;index2 < BLOCK_SIZE;++index2)
{
HRESULT hr = ::SafeArrayGetElement(m_aValue.parray,&index2,&chData);
if(SUCCEEDED(hr))
diff --git a/connectivity/source/drivers/ado/AResultSet.cxx b/connectivity/source/drivers/ado/AResultSet.cxx
index dae0f91efb61..bf33edbd4528 100644
--- a/connectivity/source/drivers/ado/AResultSet.cxx
+++ b/connectivity/source/drivers/ado/AResultSet.cxx
@@ -174,14 +174,14 @@ Reference< css::io::XInputStream > SAL_CALL OResultSet::getBinaryStream( sal_Int
//Copy the data only up to the Actual Size of Field.
sal_Int32 nSize = aField.GetActualSize();
Sequence<sal_Int8> aData(nSize);
- long index = 0;
+ sal_Int32 index = 0;
while(index < nSize)
{
m_aValue = aField.GetChunk(BLOCK_SIZE);
if(m_aValue.isNull())
break;
UCHAR chData;
- for(long index2 = 0;index2 < BLOCK_SIZE;++index2)
+ for(LONG index2 = 0;index2 < BLOCK_SIZE;++index2)
{
HRESULT hr = ::SafeArrayGetElement(m_aValue.parray,&index2,&chData);
if(SUCCEEDED(hr))
diff --git a/connectivity/source/drivers/ado/Aolevariant.cxx b/connectivity/source/drivers/ado/Aolevariant.cxx
index ae7c3f30572c..5c2d014b31d1 100644
--- a/connectivity/source/drivers/ado/Aolevariant.cxx
+++ b/connectivity/source/drivers/ado/Aolevariant.cxx
@@ -437,16 +437,16 @@ css::uno::Sequence< sal_Int8 > OLEVariant::getByteSequence() const
if(pArray)
{
HRESULT hresult1,hresult2;
- long lBound,uBound;
+ LONG lBound,uBound;
// Verify that the SafeArray is the proper shape.
hresult1 = ::SafeArrayGetLBound(pArray, 1, &lBound);
hresult2 = ::SafeArrayGetUBound(pArray, 1, &uBound);
if ( SUCCEEDED(hresult1) && SUCCEEDED(hresult2) )
{
- long nCount = uBound-lBound+1;
+ LONG nCount = uBound-lBound+1;
aRet.realloc(nCount);
sal_Int8* pData = aRet.getArray();
- for(long i=0; SUCCEEDED(hresult1) && lBound <= uBound ;++i,++lBound)
+ for(; SUCCEEDED(hresult1) && lBound <= uBound ;++lBound)
{
sal_Int32 nData = 0;
hresult1 = ::SafeArrayGetElement(pArray,&lBound,&nData);
diff --git a/connectivity/source/drivers/ado/Awrapado.cxx b/connectivity/source/drivers/ado/Awrapado.cxx
index 1fc664f89a5a..0393dc35c9a2 100644
--- a/connectivity/source/drivers/ado/Awrapado.cxx
+++ b/connectivity/source/drivers/ado/Awrapado.cxx
@@ -1981,7 +1981,7 @@ ADORecordset* WpADOConnection::getTables( const css::uno::Any& catalog,
SAFEARRAY *psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
// Set the values for each element of the array
- for( long i = 0 ; i < nCrit && SUCCEEDED( hr );i++)
+ for( LONG i = 0 ; i < nCrit && SUCCEEDED( hr );i++)
{
hr = SafeArrayPutElement(psa, &i,&varCriteria[i]);
}
diff --git a/extensions/source/activex/SOActionsApproval.h b/extensions/source/activex/SOActionsApproval.h
index fd0c05331e89..f96b23fd9452 100644
--- a/extensions/source/activex/SOActionsApproval.h
+++ b/extensions/source/activex/SOActionsApproval.h
@@ -95,7 +95,7 @@ DECLARE_REGISTRY_RESOURCEID(IDR_SODOCUMENTEVENTLISTENER)
if( !*pVal )
return E_FAIL;
- long ix = 0;
+ LONG ix = 0;
CComBSTR aInterface( OLESTR( "com.sun.star.embed.XActionsApproval" ) );
SafeArrayPutElement( *pVal, &ix, aInterface );
diff --git a/extensions/source/activex/SOActiveX.cxx b/extensions/source/activex/SOActiveX.cxx
index 489fd6b363b1..5b387bc2beef 100644
--- a/extensions/source/activex/SOActiveX.cxx
+++ b/extensions/source/activex/SOActiveX.cxx
@@ -224,7 +224,7 @@ HRESULT CSOActiveX::Cleanup()
if ( SUCCEEDED( hr ) && pDispDocumentCloser )
{
SAFEARRAY FAR* pInitFrame = SafeArrayCreateVector( VT_VARIANT, 0, 1 );
- long nInitInd = 0;
+ LONG nInitInd = 0;
CComVariant pFrameVariant( mpDispFrame );
SafeArrayPutElement( pInitFrame, &nInitInd, &pFrameVariant );
CComVariant aVarInitFrame;
@@ -593,7 +593,7 @@ HRESULT CSOActiveX::CreateFrameOldWay( HWND hwnd, int width, int height )
SAFEARRAY FAR* pInitVals = SafeArrayCreateVector( VT_VARIANT, 0, 3 );
// the first sequence element
- long nInitInd = 0;
+ LONG nInitInd = 0;
CComVariant pFrameVariant( mpDispFrame );
SafeArrayPutElement( pInitVals, &nInitInd, &pFrameVariant );
@@ -632,7 +632,7 @@ HRESULT CSOActiveX::CreateFrameOldWay( HWND hwnd, int width, int height )
HRESULT CSOActiveX::CallLoadComponentFromURL1PBool( OLECHAR const * sUrl, OLECHAR const * sArgName, BOOL sArgVal )
{
SAFEARRAY FAR* pPropVals = SafeArrayCreateVector( VT_DISPATCH, 0, 1 );
- long ix = 0;
+ LONG ix = 0;
CComPtr<IDispatch> pdispPropVal;
HRESULT hr = GetUnoStruct( L"com.sun.star.beans.PropertyValue", pdispPropVal );
if( !SUCCEEDED( hr ) ) return hr;
@@ -682,7 +682,7 @@ HRESULT CSOActiveX::CallDispatchMethod( OLECHAR const * sUrl,
if( !SUCCEEDED( hr ) ) return hr;
SAFEARRAY FAR* pPropVals = SafeArrayCreateVector( VT_DISPATCH, 0, count );
- for( long ix = 0; ix < static_cast<long>(count); ix ++ )
+ for( LONG ix = 0; ix < static_cast<LONG>(count); ix ++ )
{
CComPtr<IDispatch> pdispPropVal;
hr = GetUnoStruct( L"com.sun.star.beans.PropertyValue", pdispPropVal );
@@ -880,7 +880,7 @@ SOVersion CSOActiveX::GetVersionConnected()
if( pInitParams )
{
- long ix = 0;
+ LONG ix = 0;
CComVariant aConfPath( L"org.openoffice.Setup" );
SafeArrayPutElement( pInitParams, &ix, &aConfPath );
diff --git a/extensions/source/activex/SOComWindowPeer.h b/extensions/source/activex/SOComWindowPeer.h
index b06f2efbdd67..8e2b704e6783 100644
--- a/extensions/source/activex/SOComWindowPeer.h
+++ b/extensions/source/activex/SOComWindowPeer.h
@@ -143,7 +143,7 @@ DECLARE_REGISTRY_RESOURCEID(IDR_SOCOMWINDOWPEER)
if( !*pVal )
return E_FAIL;
- long ix = 0;
+ LONG ix = 0;
CComBSTR aInterface( OLESTR( "com.sun.star.awt.XSystemDependentWindowPeer" ) );
SafeArrayPutElement( *pVal, &ix, aInterface );
diff --git a/extensions/source/activex/SODispatchInterceptor.cxx b/extensions/source/activex/SODispatchInterceptor.cxx
index a5f9aa91865c..f5497fc0efdd 100644
--- a/extensions/source/activex/SODispatchInterceptor.cxx
+++ b/extensions/source/activex/SODispatchInterceptor.cxx
@@ -121,7 +121,7 @@ STDMETHODIMP SODispatchInterceptor::queryDispatches( SAFEARRAY FAR* aDescripts,
if ( !aDescripts || !retVal || SafeArrayGetDim( aDescripts ) != 1 )
return E_FAIL;
- long nLB, nUB;
+ LONG nLB, nUB;
HRESULT hr = SafeArrayGetLBound( aDescripts, 1, &nLB );
if( !SUCCEEDED( hr ) ) return hr;
@@ -132,7 +132,7 @@ STDMETHODIMP SODispatchInterceptor::queryDispatches( SAFEARRAY FAR* aDescripts,
*retVal = SafeArrayCreateVector( VT_DISPATCH, 0, nUB - nLB );
- for ( long ind = nLB; ind <= nUB; ind ++ )
+ for ( LONG ind = nLB; ind <= nUB; ind ++ )
{
CComPtr<IDispatch> pElem;
SafeArrayGetElement( aDescripts, &ind, pElem );
@@ -168,7 +168,7 @@ STDMETHODIMP SODispatchInterceptor::dispatch( IDispatch FAR* aURL, SAFEARRAY FAR
if (!wcsncmp(pValue.bstrVal, L".uno:OpenHyperlink", 18))
{
- long nLB = 0, nUB = 0;
+ LONG nLB = 0, nUB = 0;
// long nDim = SafeArrayGetDim( aArgs );
hr = SafeArrayGetLBound( aArgs, 1, &nLB );
@@ -178,7 +178,7 @@ STDMETHODIMP SODispatchInterceptor::dispatch( IDispatch FAR* aURL, SAFEARRAY FAR
if( !SUCCEEDED( hr ) ) return hr;
if( nUB < nLB ) return E_FAIL;
- for ( long ind = nLB; ind <= nUB; ind ++ )
+ for ( LONG ind = nLB; ind <= nUB; ind ++ )
{
CComVariant pVarElem;
SafeArrayGetElement( aArgs, &ind, &pVarElem );
@@ -230,7 +230,7 @@ STDMETHODIMP SODispatchInterceptor::getInterceptedURLs( SAFEARRAY FAR* FAR* pVal
if( !*pVal )
return E_FAIL;
- long ix = 0;
+ LONG ix = 0;
CComBSTR aPattern( OLESTR( "ftp://*" ) );
SafeArrayPutElement( *pVal, &ix, aPattern );
diff --git a/extensions/source/activex/SODispatchInterceptor.h b/extensions/source/activex/SODispatchInterceptor.h
index dbb2b6a4f031..aa8138024fc6 100644
--- a/extensions/source/activex/SODispatchInterceptor.h
+++ b/extensions/source/activex/SODispatchInterceptor.h
@@ -153,7 +153,7 @@ DECLARE_REGISTRY_RESOURCEID(IDR_SODISPATCHINTERCEPTOR)
if( !*pVal )
return E_FAIL;
- long ix = 0;
+ LONG ix = 0;
CComBSTR aInterface( OLESTR( "com.sun.star.frame.XDispatchProviderInterceptor" ) );
SafeArrayPutElement( *pVal, &ix, aInterface );
diff --git a/extensions/source/ole/unoconversionutilities.hxx b/extensions/source/ole/unoconversionutilities.hxx
index 4065fd682c92..32788abc4ad5 100644
--- a/extensions/source/ole/unoconversionutilities.hxx
+++ b/extensions/source/ole/unoconversionutilities.hxx
@@ -154,7 +154,7 @@ public:
bool convertValueObject( const VARIANTARG *var, Any& any);
void dispatchExObject2Sequence( const VARIANTARG* pvar, Any& anySeq, const Type& type);
- Sequence<Any> createOleArrayWrapperOfDim(SAFEARRAY* pArray, unsigned int dimCount, unsigned int actDim, long* index,
+ Sequence<Any> createOleArrayWrapperOfDim(SAFEARRAY* pArray, unsigned int dimCount, unsigned int actDim, LONG* index,
VARTYPE type, const Type& unotype);
Sequence<Any> createOleArrayWrapper(SAFEARRAY* pArray, VARTYPE type, const Type& unotype= Type());
@@ -1299,7 +1299,7 @@ SAFEARRAY* UnoConversionUtilities<T>::createUnoSequenceWrapper(const Any& rSeq)
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = n;
VARIANT oleElement;
- long safeI[1];
+ LONG safeI[1];
pArray = SafeArrayCreate(VT_VARIANT, 1, rgsabound);
@@ -2066,12 +2066,12 @@ void UnoConversionUtilities<T>::dispatchExObject2Sequence( const VARIANTARG* pva
*/
template<class T>
Sequence<Any> UnoConversionUtilities<T>::createOleArrayWrapperOfDim(SAFEARRAY* pArray,
- unsigned int dimCount, unsigned int actDim, long* index, VARTYPE type, const Type& unotype)
+ unsigned int dimCount, unsigned int actDim, LONG* index, VARTYPE type, const Type& unotype)
{
HRESULT hr= S_OK;
- long lBound;
- long uBound;
- long nCountElements;
+ LONG lBound;
+ LONG uBound;
+ LONG nCountElements;
SafeArrayGetLBound(pArray, actDim, &lBound);
SafeArrayGetUBound(pArray, actDim, &uBound);
@@ -2187,8 +2187,8 @@ Sequence<Any> UnoConversionUtilities<T>::createOleArrayWrapper(SAFEARRAY* pArray
if (dim > 0)
{
- std::unique_ptr<long[]> sarIndex(new long[dim]);
- long * index = sarIndex.get();
+ std::unique_ptr<LONG[]> sarIndex(new LONG[dim]);
+ LONG * index = sarIndex.get();
for (unsigned int i = 0; i < dim; i++)
{
More information about the Libreoffice-commits
mailing list