LibreOffice Module dbaccess (master) 1
CIndexes.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 "CIndexes.hxx"
21
22
23using namespace connectivity;
24using namespace connectivity::sdbcx;
25using namespace ::com::sun::star::uno;
26using namespace ::com::sun::star::beans;
27using namespace ::com::sun::star::sdbcx;
28using namespace ::com::sun::star::sdbc;
29using namespace ::com::sun::star::container;
30using namespace ::com::sun::star::lang;
31using namespace dbaccess;
32using namespace cppu;
33
34
35ObjectType OIndexes::createObject(const OUString& _rName)
36{
37 ObjectType xRet;
38 if ( m_xIndexes.is() && m_xIndexes->hasByName(_rName) )
39 xRet.set(m_xIndexes->getByName(_rName),UNO_QUERY);
40 else
41 xRet = OIndexesHelper::createObject(_rName);
42
43 return xRet;
44}
45
46Reference< XPropertySet > OIndexes::createDescriptor()
47{
48 Reference<XDataDescriptorFactory> xData( m_xIndexes,UNO_QUERY);
49 if(xData.is())
50 return xData->createDataDescriptor();
51 else
53}
54
55// XAppend
56ObjectType OIndexes::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor )
57{
58 Reference<XAppend> xData( m_xIndexes,UNO_QUERY);
59 if ( !xData.is() )
60 return OIndexesHelper::appendObject( _rForName, descriptor );
61
62 xData->appendByDescriptor(descriptor);
63 return createObject( _rForName );
64}
65
66// XDrop
67void OIndexes::dropObject(sal_Int32 _nPos, const OUString& _sElementName)
68{
69 if ( m_xIndexes.is() )
70 {
71 Reference<XDrop> xData( m_xIndexes,UNO_QUERY);
72 if ( xData.is() )
73 xData->dropByName(_sElementName);
74 }
75 else
76 OIndexesHelper::dropObject(_nPos,_sElementName);
77}
78
80{
81 if ( m_xIndexes.is() )
83 else
85}
86
87/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void dropObject(sal_Int32 _nPos, const OUString &_sElementName) override
virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override
virtual sdbcx::ObjectType createObject(const OUString &_rName) override
virtual sdbcx::ObjectType appendObject(const OUString &_rForName, const css::uno::Reference< css::beans::XPropertySet > &descriptor) override
virtual connectivity::sdbcx::ObjectType appendObject(const OUString &_rForName, const css::uno::Reference< css::beans::XPropertySet > &descriptor) override
virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override
Definition: CIndexes.cxx:46
virtual void dropObject(sal_Int32 _nPos, const OUString &_sElementName) override
Definition: CIndexes.cxx:67
css::uno::Reference< css::container::XNameAccess > m_xIndexes
Definition: CIndexes.hxx:29
virtual void disposing() override
Definition: CIndexes.cxx:79
virtual connectivity::sdbcx::ObjectType createObject(const OUString &_rName) override
Definition: CIndexes.cxx:35
ObjectType
sal_Int32 _nPos