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 "CIndexes.hxx"
23 using namespace connectivity
;
24 using namespace connectivity::sdbcx
;
25 using namespace ::com::sun::star::uno
;
26 using namespace ::com::sun::star::beans
;
27 using namespace ::com::sun::star::sdbcx
;
28 using namespace ::com::sun::star::sdbc
;
29 using namespace ::com::sun::star::container
;
30 using namespace ::com::sun::star::lang
;
31 using namespace dbaccess
;
35 ObjectType
OIndexes::createObject(const OUString
& _rName
)
38 if ( m_xIndexes
.is() && m_xIndexes
->hasByName(_rName
) )
39 xRet
.set(m_xIndexes
->getByName(_rName
),UNO_QUERY
);
41 xRet
= OIndexesHelper::createObject(_rName
);
46 Reference
< XPropertySet
> OIndexes::createDescriptor()
48 Reference
<XDataDescriptorFactory
> xData( m_xIndexes
,UNO_QUERY
);
50 return xData
->createDataDescriptor();
52 return OIndexesHelper::createDescriptor();
56 ObjectType
OIndexes::appendObject( const OUString
& _rForName
, const Reference
< XPropertySet
>& descriptor
)
58 Reference
<XAppend
> xData( m_xIndexes
,UNO_QUERY
);
60 return OIndexesHelper::appendObject( _rForName
, descriptor
);
62 xData
->appendByDescriptor(descriptor
);
63 return createObject( _rForName
);
67 void OIndexes::dropObject(sal_Int32 _nPos
, const OUString
& _sElementName
)
69 if ( m_xIndexes
.is() )
71 Reference
<XDrop
> xData( m_xIndexes
,UNO_QUERY
);
73 xData
->dropByName(_sElementName
);
76 OIndexesHelper::dropObject(_nPos
,_sElementName
);
79 void OIndexes::disposing()
81 if ( m_xIndexes
.is() )
84 OIndexesHelper::disposing();
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */