bump product version to 7.2.5.1
[LibreOffice.git] / connectivity / source / drivers / firebird / Keys.cxx
blob8de112ec6fc4a951aa08366b5a59556623854f0e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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/.
8 */
10 #include "Keys.hxx"
11 #include "Table.hxx"
13 #include <connectivity/dbtools.hxx>
15 using namespace ::connectivity;
16 using namespace ::connectivity::firebird;
18 using namespace ::dbtools;
19 using namespace ::osl;
21 using namespace ::com::sun::star;
22 using namespace ::com::sun::star::beans;
23 using namespace ::com::sun::star::sdbc;
24 using namespace ::com::sun::star::uno;
26 Keys::Keys(Table* pTable, Mutex& rMutex, const ::std::vector< OUString>& rNames):
27 OKeysHelper(pTable,
28 rMutex,
29 rNames),
30 m_pTable(pTable)
34 //----- XDrop ----------------------------------------------------------------
35 void Keys::dropObject(sal_Int32 nPosition, const OUString& sName)
37 if (m_pTable->isNew())
38 return;
40 uno::Reference<XPropertySet> xKey(getObject(nPosition), UNO_QUERY);
42 if (xKey.is())
44 const OUString sQuote = m_pTable->getConnection()->getMetaData()
45 ->getIdentifierQuoteString();
47 OUString sSql("ALTER TABLE " + quoteName(sQuote, m_pTable->getName())
48 + " DROP CONSTRAINT " + quoteName(sQuote, sName));
50 m_pTable->getConnection()->createStatement()->execute(sSql);
54 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */