LibreOffice Module connectivity (master) 1
AView.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 <ado/AView.hxx>
21#include <com/sun/star/lang/DisposedException.hpp>
22#include <ado/adoimp.hxx>
23#include <ado/Awrapado.hxx>
25#include <comphelper/types.hxx>
26#include <systools/win32/oleauto.hxx>
27
28#include <TConnection.hxx>
29
30
31using namespace comphelper;
32using namespace connectivity::ado;
33using namespace com::sun::star::uno;
34using namespace com::sun::star::lang;
35using namespace com::sun::star::beans;
36using namespace com::sun::star::sdbc;
37
38// IMPLEMENT_SERVICE_INFO(OAdoView,"com.sun.star.sdbcx.AView","com.sun.star.sdbcx.View");
39
40OAdoView::OAdoView(bool _bCase,ADOView* _pView) : OView_ADO(_bCase,nullptr)
41,m_aView(_pView)
42{
43}
44
45void OAdoView::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) const
46{
47 if(m_aView.IsValid())
48 {
49 switch(nHandle)
50 {
52 rValue <<= m_aView.get_Name();
53 break;
55 break;
57 // rValue <<= m_aView.get_Type();
58 break;
60 {
61 OLEVariant aVar;
62 m_aView.get_Command(aVar);
63 if(!aVar.isNull() && !aVar.isEmpty())
64 {
65 ADOCommand* pCom = static_cast<ADOCommand*>(aVar.getIDispatch());
66 sal::systools::BStr aBSTR;
67 pCom->get_CommandText(&aBSTR);
68 rValue <<= OUString(aBSTR);
69 }
70 }
71 break;
72 }
73 }
74 else
76}
77
78/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
Definition: AView.cxx:45
IDispatch * getIDispatch() const
void get_Command(OLEVariant &_rVar) const
Definition: Awrapado.cxx:1354
OUString get_Name() const
Definition: Awrapado.cxx:1346
#define PROPERTY_ID_NAME
Definition: propertyids.hxx:50
#define PROPERTY_ID_CATALOGNAME
Definition: propertyids.hxx:70
#define PROPERTY_ID_COMMAND
Definition: propertyids.hxx:72
#define PROPERTY_ID_SCHEMANAME
Definition: propertyids.hxx:69
sal_Int32 nHandle