calc: on editing invalidation of view with different zoom is wrong
[LibreOffice.git] / dbaccess / source / core / api / CIndexes.cxx
blob409d877288b8d2621003b73995b1b2ce4c84c9ad
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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;
32 using namespace cppu;
35 ObjectType OIndexes::createObject(const OUString& _rName)
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);
43 return xRet;
46 Reference< XPropertySet > OIndexes::createDescriptor()
48 Reference<XDataDescriptorFactory> xData( m_xIndexes,UNO_QUERY);
49 if(xData.is())
50 return xData->createDataDescriptor();
51 else
52 return OIndexesHelper::createDescriptor();
55 // XAppend
56 ObjectType OIndexes::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor )
58 Reference<XAppend> xData( m_xIndexes,UNO_QUERY);
59 if ( !xData.is() )
60 return OIndexesHelper::appendObject( _rForName, descriptor );
62 xData->appendByDescriptor(descriptor);
63 return createObject( _rForName );
66 // XDrop
67 void OIndexes::dropObject(sal_Int32 _nPos, const OUString& _sElementName)
69 if ( m_xIndexes.is() )
71 Reference<XDrop> xData( m_xIndexes,UNO_QUERY);
72 if ( xData.is() )
73 xData->dropByName(_sElementName);
75 else
76 OIndexesHelper::dropObject(_nPos,_sElementName);
79 void OIndexes::disposing()
81 if ( m_xIndexes.is() )
82 clear_NoDispose();
83 else
84 OIndexesHelper::disposing();
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */