tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / cppu / source / uno / any.cxx
blob342e760d0832cecc28db297724c237ea62a9fd36
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include "copy.hxx"
22 #include "destr.hxx"
24 using namespace cppu;
27 extern "C"
30 void SAL_CALL uno_type_any_assign(
31 uno_Any * pDest, void * pSource,
32 typelib_TypeDescriptionReference * pType,
33 uno_AcquireFunc acquire, uno_ReleaseFunc release ) noexcept
35 _destructAny( pDest, release );
36 if (pType)
38 _copyConstructAny( pDest, pSource, pType, nullptr, acquire, nullptr );
40 else
42 CONSTRUCT_EMPTY_ANY( pDest );
46 void SAL_CALL uno_any_assign(
47 uno_Any * pDest, void * pSource,
48 typelib_TypeDescription * pTypeDescr,
49 uno_AcquireFunc acquire, uno_ReleaseFunc release ) noexcept
51 _destructAny( pDest, release );
52 if (pTypeDescr)
54 _copyConstructAny( pDest, pSource, pTypeDescr->pWeakRef, pTypeDescr, acquire, nullptr );
56 else
58 CONSTRUCT_EMPTY_ANY( pDest );
62 void SAL_CALL uno_type_any_construct(
63 uno_Any * pDest, void * pSource,
64 typelib_TypeDescriptionReference * pType,
65 uno_AcquireFunc acquire ) noexcept
67 if (pType)
69 _copyConstructAny( pDest, pSource, pType, nullptr, acquire, nullptr );
71 else
73 CONSTRUCT_EMPTY_ANY( pDest );
77 void SAL_CALL uno_any_construct(
78 uno_Any * pDest, void * pSource,
79 typelib_TypeDescription * pTypeDescr,
80 uno_AcquireFunc acquire ) noexcept
82 if (pTypeDescr)
84 _copyConstructAny( pDest, pSource, pTypeDescr->pWeakRef, pTypeDescr, acquire, nullptr );
86 else
88 CONSTRUCT_EMPTY_ANY( pDest );
92 void SAL_CALL uno_type_any_constructAndConvert(
93 uno_Any * pDest, void * pSource,
94 typelib_TypeDescriptionReference * pType,
95 uno_Mapping * mapping ) noexcept
97 if (pType)
99 _copyConstructAny( pDest, pSource, pType, nullptr, nullptr, mapping );
101 else
103 CONSTRUCT_EMPTY_ANY( pDest );
107 void SAL_CALL uno_any_constructAndConvert(
108 uno_Any * pDest, void * pSource,
109 typelib_TypeDescription * pTypeDescr,
110 uno_Mapping * mapping ) noexcept
112 if (pTypeDescr)
114 _copyConstructAny( pDest, pSource, pTypeDescr->pWeakRef, pTypeDescr, nullptr, mapping );
116 else
118 CONSTRUCT_EMPTY_ANY( pDest );
122 void SAL_CALL uno_any_destruct( uno_Any * pValue, uno_ReleaseFunc release ) noexcept
124 _destructAny( pValue, release );
127 void SAL_CALL uno_any_clear( uno_Any * pValue, uno_ReleaseFunc release ) noexcept
129 _destructAny( pValue, release );
130 CONSTRUCT_EMPTY_ANY( pValue );
134 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */