File: | stoc/source/registry_tdprovider/structtypedescription.cxx |
Location: | line 61, column 12 |
Description: | Called C++ object pointer is null |
1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | /* |
3 | * This file is part of the LibreOffice project. |
4 | * |
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/. |
8 | * |
9 | * This file incorporates work covered by the following license notice: |
10 | * |
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 . |
18 | */ |
19 | |
20 | |
21 | #include "structtypedescription.hxx" |
22 | |
23 | #include "base.hxx" |
24 | |
25 | #include "com/sun/star/reflection/XTypeDescription.hpp" |
26 | #include "com/sun/star/uno/Reference.hxx" |
27 | #include "com/sun/star/uno/RuntimeException.hpp" |
28 | #include "com/sun/star/uno/Sequence.hxx" |
29 | #include "com/sun/star/uno/TypeClass.hpp" |
30 | #include "cppuhelper/weak.hxx" |
31 | #include "osl/diagnose.h" |
32 | #include "registry/reader.hxx" |
33 | #include "registry/types.h" |
34 | #include "registry/version.h" |
35 | #include "rtl/ustring.h" |
36 | #include "rtl/ustring.hxx" |
37 | |
38 | #include <new> |
39 | |
40 | namespace css = com::sun::star; |
41 | using stoc::registry_tdprovider::StructTypeDescription; |
42 | |
43 | StructTypeDescription::StructTypeDescription( |
44 | css::uno::Reference< css::container::XHierarchicalNameAccess > const & |
45 | manager, |
46 | rtl::OUString const & name, rtl::OUString const & baseTypeName, |
47 | css::uno::Sequence< sal_Int8 > const & data, bool published): |
48 | m_data(data), |
49 | m_base( |
50 | new stoc_rdbtdp::CompoundTypeDescriptionImpl( |
51 | manager, css::uno::TypeClass_STRUCT, name, baseTypeName, data, |
52 | published)) |
53 | {} |
54 | |
55 | StructTypeDescription::~StructTypeDescription() |
56 | {} |
57 | |
58 | css::uno::TypeClass StructTypeDescription::getTypeClass() |
59 | throw (css::uno::RuntimeException) |
60 | { |
61 | return m_base->getTypeClass(); |
Called C++ object pointer is null | |
62 | } |
63 | |
64 | rtl::OUString StructTypeDescription::getName() |
65 | throw (css::uno::RuntimeException) |
66 | { |
67 | return m_base->getName(); |
68 | } |
69 | |
70 | css::uno::Reference< css::reflection::XTypeDescription > |
71 | StructTypeDescription::getBaseType() throw (css::uno::RuntimeException) |
72 | { |
73 | return m_base->getBaseType(); |
74 | } |
75 | |
76 | css::uno::Sequence< css::uno::Reference< css::reflection::XTypeDescription > > |
77 | StructTypeDescription::getMemberTypes() throw (css::uno::RuntimeException) |
78 | { |
79 | return m_base->getMemberTypes(); |
80 | } |
81 | |
82 | css::uno::Sequence< rtl::OUString > StructTypeDescription::getMemberNames() |
83 | throw (css::uno::RuntimeException) |
84 | { |
85 | return m_base->getMemberNames(); |
86 | } |
87 | |
88 | css::uno::Sequence< rtl::OUString > StructTypeDescription::getTypeParameters() |
89 | throw (css::uno::RuntimeException) |
90 | { |
91 | try { |
92 | typereg::Reader reader( |
93 | m_data.getConstArray(), m_data.getLength(), false, |
94 | TYPEREG_VERSION_1); |
95 | OSL_ASSERT(reader.isValid())do { if (true && (!(reader.isValid()))) { sal_detail_logFormat ((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/usr/local/src/libreoffice/stoc/source/registry_tdprovider/structtypedescription.cxx" ":" "95" ": "), "OSL_ASSERT: %s", "reader.isValid()"); } } while (false); |
96 | sal_uInt16 n = reader.getReferenceCount(); |
97 | css::uno::Sequence< rtl::OUString > parameters(n); |
98 | for (sal_uInt16 i = 0; i < n; ++i) { |
99 | if (reader.getReferenceFlags(i) != RT_ACCESS_INVALID0x0000 |
100 | || reader.getReferenceSort(i) != RT_REF_TYPE_PARAMETER) |
101 | { |
102 | throw css::uno::RuntimeException( |
103 | rtl::OUString( |
104 | RTL_CONSTASCII_USTRINGPARAM((&("type parameter of polymorphic struct type template" " not RT_ACCESS_INVALID/RT_REF_TYPE_PARAMETER" )[0]), ((sal_Int32)((sizeof ("type parameter of polymorphic struct type template" " not RT_ACCESS_INVALID/RT_REF_TYPE_PARAMETER") / sizeof (("type parameter of polymorphic struct type template" " not RT_ACCESS_INVALID/RT_REF_TYPE_PARAMETER")[0]))-1)), (( (rtl_TextEncoding) 11)) |
105 | "type parameter of polymorphic struct type template"(&("type parameter of polymorphic struct type template" " not RT_ACCESS_INVALID/RT_REF_TYPE_PARAMETER" )[0]), ((sal_Int32)((sizeof ("type parameter of polymorphic struct type template" " not RT_ACCESS_INVALID/RT_REF_TYPE_PARAMETER") / sizeof (("type parameter of polymorphic struct type template" " not RT_ACCESS_INVALID/RT_REF_TYPE_PARAMETER")[0]))-1)), (( (rtl_TextEncoding) 11)) |
106 | " not RT_ACCESS_INVALID/RT_REF_TYPE_PARAMETER")(&("type parameter of polymorphic struct type template" " not RT_ACCESS_INVALID/RT_REF_TYPE_PARAMETER" )[0]), ((sal_Int32)((sizeof ("type parameter of polymorphic struct type template" " not RT_ACCESS_INVALID/RT_REF_TYPE_PARAMETER") / sizeof (("type parameter of polymorphic struct type template" " not RT_ACCESS_INVALID/RT_REF_TYPE_PARAMETER")[0]))-1)), (( (rtl_TextEncoding) 11))), |
107 | static_cast< cppu::OWeakObject * >(this)); |
108 | } |
109 | parameters[i] = reader.getReferenceTypeName(i); |
110 | } |
111 | return parameters; |
112 | } catch (std::bad_alloc &) { |
113 | throw css::uno::RuntimeException( |
114 | rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("std::bad_alloc")(&("std::bad_alloc")[0]), ((sal_Int32)((sizeof ("std::bad_alloc" ) / sizeof (("std::bad_alloc")[0]))-1)), (((rtl_TextEncoding) 11))), |
115 | static_cast< cppu::OWeakObject * >(this)); |
116 | } |
117 | } |
118 | |
119 | css::uno::Sequence< css::uno::Reference< css::reflection::XTypeDescription > > |
120 | StructTypeDescription::getTypeArguments() throw (css::uno::RuntimeException) |
121 | { |
122 | return css::uno::Sequence< |
123 | css::uno::Reference< css::reflection::XTypeDescription > >(); |
124 | } |
125 | |
126 | sal_Bool StructTypeDescription::isPublished() throw (css::uno::RuntimeException) |
127 | { |
128 | return m_base->isPublished(); |
129 | } |
130 | |
131 | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |