LibreOffice Module connectivity (master) 1
DColumns.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 <dbase/DColumns.hxx>
21#include <dbase/DTable.hxx>
23
24using namespace connectivity::dbase;
25using namespace connectivity;
26using namespace ::com::sun::star::uno;
27using namespace ::com::sun::star::beans;
28using namespace ::com::sun::star::lang;
29using namespace ::com::sun::star::sdbcx;
30using namespace ::com::sun::star::sdbc;
31using namespace ::com::sun::star::container;
32
33sdbcx::ObjectType ODbaseColumns::createObject(const OUString& _rName)
34{
35 ODbaseTable* pTable = static_cast<ODbaseTable*>(m_pTable);
36
37 const ::rtl::Reference<OSQLColumns>& aCols = pTable->getTableColumns();
38 OSQLColumns::const_iterator aIter = find(aCols->begin(),aCols->end(),_rName,::comphelper::UStringMixEqual(isCaseSensitive()));
39
41 if(aIter != aCols->end())
42 xRet = sdbcx::ObjectType(*aIter,UNO_QUERY);
43 return xRet;
44}
45
46
48{
50}
51
52Reference< XPropertySet > ODbaseColumns::createDescriptor()
53{
54 return new sdbcx::OColumn(isCaseSensitive());
55}
56
57
58// XAppend
59sdbcx::ObjectType ODbaseColumns::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor )
60{
61 if ( m_pTable->isNew() )
62 return cloneDescriptor( descriptor );
63
64 m_pTable->addColumn( descriptor );
65 return createObject( _rForName );
66}
67
68
69// XDrop
70void ODbaseColumns::dropObject(sal_Int32 _nPos, const OUString& /*_sElementName*/)
71{
72 if(!m_pTable->isNew())
74}
75
76
77/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void impl_refresh() override
Definition: DColumns.cxx:47
virtual sdbcx::ObjectType appendObject(const OUString &_rForName, const css::uno::Reference< css::beans::XPropertySet > &descriptor) override
appends an object described by a descriptor, under a given name
Definition: DColumns.cxx:59
virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override
Definition: DColumns.cxx:52
virtual sdbcx::ObjectType createObject(const OUString &_rName) override
Definition: DColumns.cxx:33
virtual void dropObject(sal_Int32 _nPos, const OUString &_sElementName) override
Definition: DColumns.cxx:70
virtual void dropColumn(sal_Int32 _nPos)
Definition: FTable.cxx:149
const ::rtl::Reference< OSQLColumns > & getTableColumns() const
Definition: FTable.hxx:72
virtual void refreshColumns() override
Definition: FTable.cxx:73
virtual void addColumn(const css::uno::Reference< css::beans::XPropertySet > &descriptor)
Definition: FTable.cxx:144
ObjectType cloneDescriptor(const ObjectType &_descriptor)
clones the given descriptor
css::uno::Reference< css::beans::XPropertySet > ObjectType
Definition: VCollection.hxx:59
OSQLColumns::const_iterator find(const OSQLColumns::const_iterator &first, const OSQLColumns::const_iterator &last, std::u16string_view _rVal, const ::comphelper::UStringMixEqual &_rCase)
Definition: dbtools.cxx:1958
sal_Int32 _nPos