tdf#150789 - FILEOPEN PPTX: fix text in SmartArt vertically off
[LibreOffice.git] / connectivity / source / drivers / macab / MacabCatalog.cxx
blobd6485ab1c9717769d3aa88fd76bab7cdb1a8e906
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 .
21 #include "MacabCatalog.hxx"
22 #include "MacabConnection.hxx"
23 #include "MacabTables.hxx"
24 #include <com/sun/star/sdbc/XRow.hpp>
26 using namespace connectivity::macab;
27 using namespace ::com::sun::star::uno;
28 using namespace ::com::sun::star::beans;
29 using namespace ::com::sun::star::sdbcx;
30 using namespace ::com::sun::star::sdbc;
31 using namespace ::com::sun::star::container;
32 using namespace ::com::sun::star::lang;
33 using namespace ::cppu;
36 MacabCatalog::MacabCatalog(MacabConnection* _pCon)
37 : connectivity::sdbcx::OCatalog(_pCon),
38 m_pConnection(_pCon)
42 void MacabCatalog::refreshTables()
44 ::std::vector< OUString> aVector;
45 Sequence< OUString > aTypes { "%" };
46 Reference< XResultSet > xResult = m_xMetaData->getTables(
47 Any(), "%", "%", aTypes);
49 if (xResult.is())
51 Reference< XRow > xRow(xResult,UNO_QUERY);
52 OUString aName;
53 // const OUString& sDot = MacabCatalog::getDot();
55 while (xResult->next())
57 // aName = xRow->getString(2);
58 // aName += sDot;
59 aName = xRow->getString(3);
60 aVector.push_back(aName);
63 if (m_pTables)
64 m_pTables->reFill(aVector);
65 else
66 m_pTables.reset( new MacabTables(m_xMetaData,*this,m_aMutex,aVector) );
69 void MacabCatalog::refreshViews()
73 void MacabCatalog::refreshGroups()
77 void MacabCatalog::refreshUsers()
81 const OUString& MacabCatalog::getDot()
83 static constexpr OUString sDot = u"."_ustr;
84 return sDot;
88 // XTablesSupplier
89 Reference< XNameAccess > SAL_CALL MacabCatalog::getTables( )
91 ::osl::MutexGuard aGuard(m_aMutex);
92 checkDisposed(rBHelper.bDisposed);
94 try
96 if (!m_pTables)
97 refreshTables();
99 catch( const RuntimeException& )
101 // allowed to leave this method
102 throw;
104 catch( const Exception& )
106 // allowed
109 return m_pTables.get();
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */