/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
switch (pParamTD->eTypeClass)
{ case typelib_TypeClass_HYPER: case typelib_TypeClass_UNSIGNED_HYPER: case typelib_TypeClass_DOUBLE:
pCppStack += sizeof(sal_Int32); // extra long break; default: break;
} // no longer needed
TYPELIB_DANGER_RELEASE( pParamTD );
} else// ptr to complex value | ref
{ if (! rParam.bIn) // is pure out
{ // C++ out is constructed mem, UNO out is not!
::uno_constructData(
*(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTD->nSize ),
pParamTD );
// default constructed for C++ call
pTempIndexes[nTempIndexes] = nPos;
// will be released at reconversion
pTempParamTD[nTempIndexes++] = pParamTD;
} // is in/inout elseif (bridges::cpp_uno::shared::relatesToInterfaceType(pParamTD))
{
::uno_copyAndConvertData(
*(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTD->nSize ),
pUnoArgs[nPos], pParamTD,
pThis->getBridge()->getUno2Cpp() );
// has to be reconverted
pTempIndexes[nTempIndexes] = nPos;
// will be released at reconversion
pTempParamTD[nTempIndexes++] = pParamTD;
} else// direct way
{
*(void **)pCppStack = pCppArgs[nPos] = pUnoArgs[nPos]; // no longer needed
TYPELIB_DANGER_RELEASE( pParamTD );
}
}
pCppStack += sizeof(sal_Int32); // standard parameter length
}
__try
{ // pCppI is msci this pointer
callVirtualMethod( reinterpret_cast< void ** >(pThis->getCppI()) + aVtableSlot.offset,
aVtableSlot.index,
pCppReturn, pReturnTD->eTypeClass,
(sal_Int32 *)pCppStackStart,
(pCppStack - pCppStackStart) / sizeof(sal_Int32) );
}
__except (msvc_filterCppException(
GetExceptionInformation(),
*ppUnoExc, pThis->getBridge()->getCpp2Uno() ))
{ // *ppUnoExc was constructed by filter function // temporary params while (nTempIndexes--)
{
sal_Int32 nIndex = pTempIndexes[nTempIndexes]; // destroy temp C++ param => C++: every param was constructed
::uno_destructData(
pCppArgs[nIndex], pTempParamTD[nTempIndexes],
uno::cpp_release );
TYPELIB_DANGER_RELEASE( pTempParamTD[nTempIndexes] );
}
// return type if (pReturnTD)
TYPELIB_DANGER_RELEASE( pReturnTD );
return;
}
// NO exception occurred
*ppUnoExc = nullptr;
// reconvert temporary params while (nTempIndexes--)
{ int nIndex = pTempIndexes[nTempIndexes];
typelib_TypeDescription * pParamTD =
pTempParamTD[nTempIndexes];
if (pParams[nIndex].bIn)
{ if (pParams[nIndex].bOut) // inout
{
::uno_destructData(
pUnoArgs[nIndex], pParamTD, nullptr ); // destroy UNO value
::uno_copyAndConvertData(
pUnoArgs[nIndex], pCppArgs[nIndex], pParamTD,
pThis->getBridge()->getCpp2Uno() );
}
} else// pure out
{
::uno_copyAndConvertData(
pUnoArgs[nIndex], pCppArgs[nIndex], pParamTD,
pThis->getBridge()->getCpp2Uno() );
}
// destroy temp C++ param => C++: every param was constructed
::uno_destructData(
pCppArgs[nIndex], pParamTD, uno::cpp_release );
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.