diff options
Diffstat (limited to 'dbaccess/source/sdbtools')
-rw-r--r-- | dbaccess/source/sdbtools/connection/connectiontools.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/sdbtools/connection/objectnames.cxx | 13 | ||||
-rw-r--r-- | dbaccess/source/sdbtools/connection/objectnames.hxx | 4 | ||||
-rw-r--r-- | dbaccess/source/sdbtools/connection/tablename.cxx | 13 | ||||
-rw-r--r-- | dbaccess/source/sdbtools/inc/connectiondependent.hxx (renamed from dbaccess/source/sdbtools/connection/connectiondependent.hxx) | 0 | ||||
-rw-r--r-- | dbaccess/source/sdbtools/inc/connectiontools.hxx (renamed from dbaccess/source/sdbtools/connection/connectiontools.hxx) | 5 | ||||
-rw-r--r-- | dbaccess/source/sdbtools/inc/module_sdbt.hxx | 34 | ||||
-rw-r--r-- | dbaccess/source/sdbtools/inc/sdbt_resource.hrc | 38 | ||||
-rw-r--r-- | dbaccess/source/sdbtools/inc/sdbt_services.hxx | 31 | ||||
-rw-r--r-- | dbaccess/source/sdbtools/misc/module_sdbt.cxx | 29 | ||||
-rw-r--r-- | dbaccess/source/sdbtools/misc/sdbt_services.cxx | 28 | ||||
-rw-r--r-- | dbaccess/source/sdbtools/resource/sdbt_strings.src | 57 |
12 files changed, 21 insertions, 237 deletions
diff --git a/dbaccess/source/sdbtools/connection/connectiontools.cxx b/dbaccess/source/sdbtools/connection/connectiontools.cxx index cbc269aa6305..15cb2be4f883 100644 --- a/dbaccess/source/sdbtools/connection/connectiontools.cxx +++ b/dbaccess/source/sdbtools/connection/connectiontools.cxx @@ -18,7 +18,6 @@ */ #include "connectiontools.hxx" -#include "sdbt_services.hxx" #include "tablename.hxx" #include "objectnames.hxx" #include "datasourcemetadata.hxx" @@ -30,11 +29,6 @@ #include <algorithm> -extern "C" void SAL_CALL createRegistryInfo_ConnectionTools() -{ - ::sdbtools::OAutoRegistration< ::sdbtools::ConnectionTools > aRegistration; -} - namespace sdbtools { diff --git a/dbaccess/source/sdbtools/connection/objectnames.cxx b/dbaccess/source/sdbtools/connection/objectnames.cxx index d2026b579fff..9bc0e42b5c90 100644 --- a/dbaccess/source/sdbtools/connection/objectnames.cxx +++ b/dbaccess/source/sdbtools/connection/objectnames.cxx @@ -18,8 +18,9 @@ */ #include "objectnames.hxx" +#include "core_resource.hxx" -#include "sdbt_resource.hrc" +#include "strings.hrc" #include <com/sun/star/sdb/CommandType.hpp> #include <com/sun/star/sdbcx/XTablesSupplier.hpp> @@ -99,7 +100,7 @@ namespace sdbtools ::dbtools::DatabaseMetaData aMeta( m_xConnection ); if ( aMeta.supportsSubqueriesInFrom() ) { - OUString sNeedDistinctNames( SdbtRes( STR_QUERY_AND_TABLE_DISTINCT_NAMES ) ); + OUString sNeedDistinctNames( DBA_RES( STR_QUERY_AND_TABLE_DISTINCT_NAMES ) ); aError.NextException <<= SQLException( sNeedDistinctNames, m_xConnection, OUString(), 0, Any() ); } @@ -282,7 +283,7 @@ namespace sdbtools && ( _nCommandType != CommandType::QUERY ) ) throw IllegalArgumentException( - SdbtRes( STR_INVALID_COMMAND_TYPE ), + DBA_RES( STR_INVALID_COMMAND_TYPE ), nullptr, 0 ); @@ -305,7 +306,7 @@ namespace sdbtools catch( const Exception& ) { throw IllegalArgumentException( - SdbtRes( STR_CONN_WITHOUT_QUERIES_OR_TABLES ), + DBA_RES( STR_CONN_WITHOUT_QUERIES_OR_TABLES ), nullptr, 0 ); @@ -368,9 +369,9 @@ namespace sdbtools if ( sBaseName.isEmpty() ) { if ( CommandType == CommandType::TABLE ) - sBaseName = OUString( SdbtRes( STR_BASENAME_TABLE ) ); + sBaseName = DBA_RES(STR_BASENAME_TABLE); else - sBaseName = OUString( SdbtRes( STR_BASENAME_QUERY ) ); + sBaseName = DBA_RES(STR_BASENAME_QUERY); } else if( CommandType == CommandType::QUERY ) { diff --git a/dbaccess/source/sdbtools/connection/objectnames.hxx b/dbaccess/source/sdbtools/connection/objectnames.hxx index 6a74c457aadc..433f75b72742 100644 --- a/dbaccess/source/sdbtools/connection/objectnames.hxx +++ b/dbaccess/source/sdbtools/connection/objectnames.hxx @@ -21,7 +21,6 @@ #define INCLUDED_DBACCESS_SOURCE_SDBTOOLS_CONNECTION_OBJECTNAMES_HXX #include "connectiondependent.hxx" -#include "module_sdbt.hxx" #include <com/sun/star/sdb/tools/XObjectNames.hpp> @@ -40,9 +39,6 @@ namespace sdbtools class ObjectNames :public ObjectNames_Base ,public ConnectionDependentComponent { - private: - SdbtClient m_aModuleClient; // keep the module alive as long as this instance lives - public: /** constructs the instance diff --git a/dbaccess/source/sdbtools/connection/tablename.cxx b/dbaccess/source/sdbtools/connection/tablename.cxx index e51e997c13e0..0e78a9cb7d35 100644 --- a/dbaccess/source/sdbtools/connection/tablename.cxx +++ b/dbaccess/source/sdbtools/connection/tablename.cxx @@ -18,9 +18,10 @@ */ #include "tablename.hxx" -#include "sdbt_resource.hrc" -#include "module_sdbt.hxx" -#include "sdbtstrings.hrc" +#include "core_resource.hxx" +#include "strings.hrc" +#include "strings.hxx" +#include "stringconstants.hxx" #include <com/sun/star/sdb/tools/CompositionType.hpp> #include <com/sun/star/sdbcx/XTablesSupplier.hpp> @@ -53,8 +54,6 @@ namespace sdbtools // TableName struct TableName_Impl { - SdbtClient m_aModuleClient; // keep the module alive as long as this instance lives - OUString sCatalog; OUString sSchema; OUString sName; @@ -152,7 +151,7 @@ namespace sdbtools || !xPSI->hasPropertyByName( PROPERTY_NAME ) ) throw IllegalArgumentException( - SdbtRes( STR_NO_TABLE_OBJECT ), + DBA_RES( STR_NO_TABLE_OBJECT ), *this, 0 ); @@ -199,7 +198,7 @@ namespace sdbtools found = true; if ( !found ) throw IllegalArgumentException( - SdbtRes( STR_INVALID_COMPOSITION_TYPE ), + DBA_RES( STR_INVALID_COMPOSITION_TYPE ), nullptr, 0 ); diff --git a/dbaccess/source/sdbtools/connection/connectiondependent.hxx b/dbaccess/source/sdbtools/inc/connectiondependent.hxx index 37fb95b16588..37fb95b16588 100644 --- a/dbaccess/source/sdbtools/connection/connectiondependent.hxx +++ b/dbaccess/source/sdbtools/inc/connectiondependent.hxx diff --git a/dbaccess/source/sdbtools/connection/connectiontools.hxx b/dbaccess/source/sdbtools/inc/connectiontools.hxx index 4eb9ed23354b..b4b6b727a8cf 100644 --- a/dbaccess/source/sdbtools/connection/connectiontools.hxx +++ b/dbaccess/source/sdbtools/inc/connectiontools.hxx @@ -20,8 +20,6 @@ #ifndef INCLUDED_DBACCESS_SOURCE_SDBTOOLS_CONNECTION_CONNECTIONTOOLS_HXX #define INCLUDED_DBACCESS_SOURCE_SDBTOOLS_CONNECTION_CONNECTIONTOOLS_HXX -#include "module_sdbt.hxx" - #include "connectiondependent.hxx" #include <com/sun/star/sdb/tools/XConnectionTools.hpp> @@ -44,9 +42,6 @@ namespace sdbtools class ConnectionTools :public ConnectionTools_Base ,public ConnectionDependentComponent { - private: - SdbtClient m_aModuleClient; - public: /** constructs a ConnectionTools instance diff --git a/dbaccess/source/sdbtools/inc/module_sdbt.hxx b/dbaccess/source/sdbtools/inc/module_sdbt.hxx deleted file mode 100644 index 467b98963e3e..000000000000 --- a/dbaccess/source/sdbtools/inc/module_sdbt.hxx +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_DBACCESS_SOURCE_SDBTOOLS_INC_MODULE_SDBT_HXX -#define INCLUDED_DBACCESS_SOURCE_SDBTOOLS_INC_MODULE_SDBT_HXX - -#include <unotools/componentresmodule.hxx> - -namespace sdbtools -{ - - DEFINE_MODULE( SdbtModule, SdbtClient, SdbtRes ) - -} // namespace sdbtools - -#endif // INCLUDED_DBACCESS_SOURCE_SDBTOOLS_INC_MODULE_SDBT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/sdbtools/inc/sdbt_resource.hrc b/dbaccess/source/sdbtools/inc/sdbt_resource.hrc deleted file mode 100644 index ae0dbe3ef783..000000000000 --- a/dbaccess/source/sdbtools/inc/sdbt_resource.hrc +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef DBACCESS_SDBT_RESOURCE_HRC -#define DBACCESS_SDBT_RESOURCE_HRC - -#include <svl/solar.hrc> - -#define RID_SDBT_STRINGS_START RID_DBACCESS_START - -//- String-IDs -#define STR_QUERY_AND_TABLE_DISTINCT_NAMES RID_SDBT_STRINGS_START + 0 -#define STR_BASENAME_TABLE RID_SDBT_STRINGS_START + 1 -#define STR_BASENAME_QUERY RID_SDBT_STRINGS_START + 2 -#define STR_CONN_WITHOUT_QUERIES_OR_TABLES RID_SDBT_STRINGS_START + 3 -#define STR_NO_TABLE_OBJECT RID_SDBT_STRINGS_START + 4 -#define STR_INVALID_COMPOSITION_TYPE RID_SDBT_STRINGS_START + 5 -#define STR_INVALID_COMMAND_TYPE RID_SDBT_STRINGS_START + 6 - -#endif // DBACCESS_SDBT_RESOURCE_HRC - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/sdbtools/inc/sdbt_services.hxx b/dbaccess/source/sdbtools/inc/sdbt_services.hxx deleted file mode 100644 index a6491e2f5cfc..000000000000 --- a/dbaccess/source/sdbtools/inc/sdbt_services.hxx +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_DBACCESS_SOURCE_SDBTOOLS_INC_SDBT_SERVICES_HXX -#define INCLUDED_DBACCESS_SOURCE_SDBTOOLS_INC_SDBT_SERVICES_HXX - -#include <sal/config.h> - -#include <sal/types.h> - -extern "C" void SAL_CALL createRegistryInfo_ConnectionTools(); - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/sdbtools/misc/module_sdbt.cxx b/dbaccess/source/sdbtools/misc/module_sdbt.cxx deleted file mode 100644 index d40ef6b96aff..000000000000 --- a/dbaccess/source/sdbtools/misc/module_sdbt.cxx +++ /dev/null @@ -1,29 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "module_sdbt.hxx" - -namespace sdbtools -{ - - IMPLEMENT_MODULE( SdbtModule, "sdbt" ) - -} // namespace sdbtools - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/sdbtools/misc/sdbt_services.cxx b/dbaccess/source/sdbtools/misc/sdbt_services.cxx index 65d438cc6b22..0f2edc74ab9b 100644 --- a/dbaccess/source/sdbtools/misc/sdbt_services.cxx +++ b/dbaccess/source/sdbtools/misc/sdbt_services.cxx @@ -17,34 +17,22 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "module_sdbt.hxx" -#include "sdbt_services.hxx" +#include "connectiontools.hxx" +#include <comphelper/componentmodule.hxx> using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::XInterface; -extern "C" void SAL_CALL sdbt_initializeModule() -{ - static bool s_bInit = false; - if (!s_bInit) - { - createRegistryInfo_ConnectionTools(); - s_bInit = true; - } -} - extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL sdbt_component_getFactory( - const sal_Char* pImplementationName, - void* pServiceManager, - void* /*pRegistryKey*/) + const sal_Char* pImplementationName, SAL_UNUSED_PARAMETER void*, SAL_UNUSED_PARAMETER void*) { - sdbt_initializeModule(); - Reference< XInterface > xRet; - if (pServiceManager && pImplementationName) + + if (sdbtools::ConnectionTools::getImplementationName_static() == OUString::createFromAscii(pImplementationName)) { - xRet = ::sdbtools::SdbtModule::getInstance().getComponentFactory( - OUString::createFromAscii(pImplementationName)); + xRet = ::cppu::createSingleComponentFactory(sdbtools::ConnectionTools::Create, + sdbtools::ConnectionTools::getImplementationName_static(), + sdbtools::ConnectionTools::getSupportedServiceNames_static(), nullptr); } if (xRet.is()) diff --git a/dbaccess/source/sdbtools/resource/sdbt_strings.src b/dbaccess/source/sdbtools/resource/sdbt_strings.src deleted file mode 100644 index 858c0d70633e..000000000000 --- a/dbaccess/source/sdbtools/resource/sdbt_strings.src +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "sdbt_resource.hrc" - -String STR_QUERY_AND_TABLE_DISTINCT_NAMES -{ - Text [ en-US ] = "You cannot give a table and a query the same name. Please use a name which is not yet used by a query or table."; -}; - -String STR_BASENAME_TABLE -{ - Text [ en-US ] = "Table"; -}; - -String STR_BASENAME_QUERY -{ - Text [ en-US ] = "Query"; -}; - -String STR_CONN_WITHOUT_QUERIES_OR_TABLES -{ - Text [ en-US ] = "The given connection is no valid query and/or tables supplier."; -}; - -String STR_NO_TABLE_OBJECT -{ - Text [ en-US ] = "The given object is no table object."; -}; - -String STR_INVALID_COMPOSITION_TYPE -{ - Text [ en-US ] = "Invalid composition type - need a value from com.sun.star.sdb.tools.CompositionType."; -}; - -String STR_INVALID_COMMAND_TYPE -{ - Text [ en-US ] = "Invalid command type - only TABLE and QUERY from com.sun.star.sdb.CommandType are allowed."; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |