Coverage Report

Created: 2025-12-31 10:39

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/connectivity/source/sdbcx/VIndexColumn.cxx
Line
Count
Source
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
#include <sdbcx/VIndexColumn.hxx>
21
#include <com/sun/star/beans/PropertyAttribute.hpp>
22
#include <cppuhelper/supportsservice.hxx>
23
#include <TConnection.hxx>
24
25
using namespace connectivity;
26
using namespace connectivity::sdbcx;
27
using namespace ::com::sun::star::beans;
28
using namespace ::com::sun::star::uno;
29
30
OUString SAL_CALL OIndexColumn::getImplementationName(  )
31
0
{
32
0
    if(isNew())
33
0
        return u"com.sun.star.sdbcx.VIndexColumnDescriptor"_ustr;
34
0
    return u"com.sun.star.sdbcx.VIndexColumn"_ustr;
35
0
}
36
37
css::uno::Sequence< OUString > SAL_CALL OIndexColumn::getSupportedServiceNames(  )
38
0
{
39
0
    return { isNew()?u"com.sun.star.sdbcx.IndexColumnDescriptor"_ustr:u"com.sun.star.sdbcx.IndexColumn"_ustr };
40
0
}
41
42
sal_Bool SAL_CALL OIndexColumn::supportsService( const OUString& _rServiceName )
43
0
{
44
0
    return cppu::supportsService(this, _rServiceName);
45
0
}
46
47
0
OIndexColumn::OIndexColumn(bool _bCase) : OColumn(_bCase),  m_IsAscending(true)
48
0
{
49
0
    construct();
50
0
}
51
52
53
OIndexColumn::OIndexColumn( bool             IsAscending,
54
                            const OUString&  Name,
55
                            const OUString&  TypeName,
56
                            const OUString&  DefaultValue,
57
                            sal_Int32        IsNullable,
58
                            sal_Int32        Precision,
59
                            sal_Int32        Scale,
60
                            sal_Int32        Type,
61
                            bool             _bCase,
62
                            const OUString&  CatalogName,
63
                            const OUString&  SchemaName,
64
                            const OUString&  TableName
65
0
                        ) : OColumn(Name,
66
0
                            TypeName,
67
0
                            DefaultValue,
68
0
                            OUString(),
69
0
                            IsNullable,
70
0
                            Precision,
71
0
                            Scale,
72
0
                            Type,
73
0
                            false/*IsAutoIncrement*/,
74
0
                            false/*IsRowVersion*/,
75
0
                            false/*IsCurrency*/,
76
0
                            _bCase,
77
0
                            CatalogName,
78
0
                            SchemaName,
79
0
                            TableName)
80
0
                        ,   m_IsAscending(IsAscending)
81
0
{
82
0
    construct();
83
0
}
84
85
::cppu::IPropertyArrayHelper* OIndexColumn::createArrayHelper( sal_Int32 /*_nId*/ ) const
86
0
{
87
0
    return doCreateArrayHelper();
88
0
}
89
90
::cppu::IPropertyArrayHelper& SAL_CALL OIndexColumn::getInfoHelper()
91
0
{
92
0
    return *OIndexColumn_PROP::getArrayHelper(isNew() ? 1 : 0);
93
0
}
94
95
void OIndexColumn::construct()
96
0
{
97
0
    sal_Int32 nAttrib = isNew() ? 0 : PropertyAttribute::READONLY;
98
0
    registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISASCENDING), PROPERTY_ID_ISASCENDING,    nAttrib,&m_IsAscending, cppu::UnoType<bool>::get());
99
0
}
100
101
102
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */