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 .
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>
25 #include <comphelper/servicehelper.hxx>
26 #include <comphelper/types.hxx>
28 using namespace ::comphelper
;
30 using namespace connectivity::ado
;
31 using namespace com::sun::star::uno
;
32 using namespace com::sun::star::lang
;
33 using namespace com::sun::star::beans
;
34 using namespace com::sun::star::sdbc
;
37 OAdoIndex::OAdoIndex(bool _bCase
,OConnection
* _pConnection
,ADOIndex
* _pIndex
)
38 : sdbcx::OIndex(OUString(),OUString(),false,false,false,_bCase
)
39 ,m_pConnection(_pConnection
)
42 m_aIndex
.set(_pIndex
);
46 OAdoIndex::OAdoIndex(bool _bCase
,OConnection
* _pConnection
)
47 : sdbcx::OIndex(_bCase
)
48 ,m_pConnection(_pConnection
)
55 void OAdoIndex::refreshColumns()
57 ::std::vector
< OUString
> aVector
;
59 WpADOColumns aColumns
;
60 if ( m_aIndex
.IsValid() )
62 aColumns
= m_aIndex
.get_Columns();
63 aColumns
.fillElementNames(aVector
);
67 m_pColumns
->reFill(aVector
);
69 m_pColumns
.reset(new OColumns(*this, m_aMutex
, aVector
, aColumns
, isCaseSensitive(), m_pConnection
));
73 void SAL_CALL
OAdoIndex::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle
,const Any
& rValue
)
75 if(m_aIndex
.IsValid())
79 case PROPERTY_ID_NAME
:
83 m_aIndex
.put_Name(aVal
);
86 case PROPERTY_ID_CATALOG
:
90 m_aIndex
.put_Name(aVal
);
93 case PROPERTY_ID_ISUNIQUE
:
94 m_aIndex
.put_Unique(getBOOL(rValue
));
96 case PROPERTY_ID_ISPRIMARYKEYINDEX
:
97 m_aIndex
.put_PrimaryKey(getBOOL(rValue
));
99 case PROPERTY_ID_ISCLUSTERED
:
100 m_aIndex
.put_Clustered(getBOOL(rValue
));
104 sdbcx::OIndex::setFastPropertyValue_NoBroadcast(nHandle
,rValue
);
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */