1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
19 #ifndef INCLUDED_EXTENSIONS_SOURCE_OLE_WINDATA_HXX
20 #define INCLUDED_EXTENSIONS_SOURCE_OLE_WINDATA_HXX
25 #pragma clang diagnostic push
26 #pragma clang diagnostic ignored "-Wall"
27 #pragma clang diagnostic ignored "-Wextra"
28 #pragma clang diagnostic ignored "-Wignored-attributes"
29 #pragma clang diagnostic ignored "-Wint-to-pointer-cast"
30 #pragma clang diagnostic ignored "-Winvalid-noreturn"
31 #pragma clang diagnostic ignored "-Wmicrosoft"
32 #pragma clang diagnostic ignored "-Wnon-pod-varargs"
33 #pragma clang diagnostic ignored "-Wnon-virtual-dtor"
39 #pragma clang diagnostic pop
42 #include <osl/diagnose.h>
47 VARDESC
* operator = (const VarDesc
*);
48 VarDesc(const VarDesc
&);
51 CComPtr
< ITypeInfo
> m_pTypeInfo
;
54 explicit VarDesc(ITypeInfo
* pTypeInfo
) :
55 m_pTypeInfo(pTypeInfo
),
58 OSL_ASSERT(pTypeInfo
);
62 if (m_pVarDesc
!= nullptr)
64 m_pTypeInfo
->ReleaseVarDesc(m_pVarDesc
);
84 //Wrapper for FUNCDESC structure
87 FUNCDESC
* operator = (const FuncDesc
&);
88 FuncDesc(const FuncDesc
&);
89 CComPtr
<ITypeInfo
> m_pTypeInfo
;
90 FUNCDESC
* m_pFuncDesc
;
94 explicit FuncDesc(ITypeInfo
* pTypeInfo
) :
95 m_pTypeInfo(pTypeInfo
),
98 OSL_ASSERT(pTypeInfo
);
105 FUNCDESC
* operator -> ()
110 FUNCDESC
** operator & ()
112 return & m_pFuncDesc
;
115 operator FUNCDESC
* ()
120 FUNCDESC
* operator = (FUNCDESC
* pDesc
)
128 FUNCDESC
* pDesc
= m_pFuncDesc
;
129 m_pFuncDesc
= nullptr;
133 void ReleaseFUNCDESC()
135 if (m_pFuncDesc
!= nullptr)
137 m_pTypeInfo
->ReleaseFuncDesc(m_pFuncDesc
);
139 m_pFuncDesc
= nullptr;
142 //Wrapper for EXCEPINFO structure
143 class ExcepInfo
: public EXCEPINFO
145 EXCEPINFO
* operator = (const ExcepInfo
& );
146 ExcepInfo(const ExcepInfo
&);
154 if (bstrSource
!= nullptr)
155 ::SysFreeString(bstrSource
);
156 if (bstrDescription
!= nullptr)
157 ::SysFreeString(bstrDescription
);
158 if (bstrHelpFile
!= nullptr)
159 ::SysFreeString(bstrHelpFile
);
163 //Wrapper for TYPEATTR
166 TYPEATTR
* operator = (const TypeAttr
&);
167 TypeAttr(const TypeAttr
&);
169 CComPtr
< ITypeInfo
> m_pTypeInfo
;
170 TYPEATTR
* m_pTypeAttr
;
172 explicit TypeAttr(ITypeInfo
* pTypeInfo
) :
173 m_pTypeInfo( pTypeInfo
),
174 m_pTypeAttr( nullptr )
176 OSL_ASSERT(pTypeInfo
);
180 if (m_pTypeAttr
!= nullptr)
182 m_pTypeInfo
->ReleaseTypeAttr(m_pTypeAttr
);
186 TYPEATTR
** operator&() throw()
191 TYPEATTR
* operator->() throw()
199 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */