LibreOffice Module connectivity (master) 1
AIndex.cxx
Go to the documentation of this file.
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 <ado/AIndex.hxx>
21#include <com/sun/star/sdbc/XRow.hpp>
22#include <com/sun/star/sdbc/XResultSet.hpp>
23#include <ado/AColumns.hxx>
24#include <TConnection.hxx>
26#include <comphelper/types.hxx>
27
28using namespace ::comphelper;
29
30using namespace connectivity::ado;
31using namespace com::sun::star::uno;
32using namespace com::sun::star::lang;
33using namespace com::sun::star::beans;
34using namespace com::sun::star::sdbc;
35
36
37OAdoIndex::OAdoIndex(bool _bCase,OConnection* _pConnection,ADOIndex* _pIndex)
38 : sdbcx::OIndex(OUString(),OUString(),false,false,false,_bCase)
39 ,m_pConnection(_pConnection)
40{
41 construct();
42 m_aIndex.set(_pIndex);
44}
45
46OAdoIndex::OAdoIndex(bool _bCase,OConnection* _pConnection)
47 : sdbcx::OIndex(_bCase)
48 ,m_pConnection(_pConnection)
49{
50 construct();
52}
53
54
56{
57 ::std::vector< OUString> aVector;
58
59 WpADOColumns aColumns;
60 if ( m_aIndex.IsValid() )
61 {
62 aColumns = m_aIndex.get_Columns();
63 aColumns.fillElementNames(aVector);
64 }
65
66 if ( m_pColumns )
67 m_pColumns->reFill(aVector);
68 else
69 m_pColumns.reset(new OColumns(*this, m_aMutex, aVector, aColumns, isCaseSensitive(), m_pConnection));
70}
71
72
73void SAL_CALL OAdoIndex::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue)
74{
75 if(m_aIndex.IsValid())
76 {
77 switch(nHandle)
78 {
80 {
81 OUString aVal;
82 rValue >>= aVal;
83 m_aIndex.put_Name(aVal);
84 }
85 break;
87 {
88 OUString aVal;
89 rValue >>= aVal;
90 m_aIndex.put_Name(aVal);
91 }
92 break;
95 break;
98 break;
101 break;
102 }
103 }
105}
106
107/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
Definition: AIndex.cxx:73
OAdoIndex(bool _bCase, OConnection *_pConnection, ADOIndex *_pIndex)
Definition: AIndex.cxx:37
OConnection * m_pConnection
Definition: AIndex.hxx:32
virtual void refreshColumns() override
Definition: AIndex.cxx:55
void put_Name(std::u16string_view _rName)
Definition: Awrapado.cxx:1180
WpADOColumns get_Columns() const
Definition: Awrapado.cxx:1229
void fillElementNames(::std::vector< OUString > &_rVector)
Definition: Aolewrap.hxx:129
std::unique_ptr< OCollection > m_pColumns
Definition: VIndex.hxx:54
virtual void construct() override
Definition: VIndex.cxx:116
mutable::osl::Mutex m_aMutex
bool getBOOL(const Any &_rAny)
#define PROPERTY_ID_NAME
Definition: propertyids.hxx:50
#define PROPERTY_ID_CATALOG
Definition: propertyids.hxx:64
#define PROPERTY_ID_ISUNIQUE
Definition: propertyids.hxx:65
#define PROPERTY_ID_ISPRIMARYKEYINDEX
Definition: propertyids.hxx:66
#define PROPERTY_ID_ISCLUSTERED
Definition: propertyids.hxx:67
sal_Int32 nHandle