basic/Library_sb.mk | 2 basic/source/inc/dlgcont.hxx | 6 -- basic/source/inc/scriptcont.hxx | 8 --- basic/source/uno/dlgcont.cxx | 36 ++++------------ basic/source/uno/sbmodule.cxx | 52 ------------------------ basic/source/uno/sbmodule.hxx | 86 ---------------------------------------- basic/source/uno/sbservices.cxx | 50 ----------------------- basic/source/uno/sbservices.hxx | 35 ---------------- basic/source/uno/scriptcont.cxx | 35 +++------------- basic/util/sb.component | 8 ++- 10 files changed, 22 insertions(+), 296 deletions(-)
New commits: commit 164276a0d26dc78924a8c0e7c264ce7c78032bd4 Author: Stephan Bergmann <sberg...@redhat.com> Date: Thu Feb 26 15:34:57 2015 +0100 Clean up previous commit Change-Id: Iddade9d297be8f4a4e69b3bec5ab7588bf68c112 diff --git a/basic/Library_sb.mk b/basic/Library_sb.mk index 36c1be9..b364190 100644 --- a/basic/Library_sb.mk +++ b/basic/Library_sb.mk @@ -92,7 +92,6 @@ $(eval $(call gb_Library_add_exception_objects,sb,\ basic/source/uno/dlgcont \ basic/source/uno/modsizeexceeded \ basic/source/uno/namecont \ - basic/source/uno/sbmodule \ basic/source/uno/scriptcont \ basic/source/runtime/comenumwrapper \ basic/source/runtime/ddectrl \ diff --git a/basic/source/inc/dlgcont.hxx b/basic/source/inc/dlgcont.hxx index 33155af..baf3da8 100644 --- a/basic/source/inc/dlgcont.hxx +++ b/basic/source/inc/dlgcont.hxx @@ -91,9 +91,6 @@ public: // XLibraryQueryExecutable virtual sal_Bool SAL_CALL HasExecutableCode(const OUString&) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - // Service - static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_static(); - static OUString getImplementationName_static(); }; diff --git a/basic/source/inc/scriptcont.hxx b/basic/source/inc/scriptcont.hxx index 2f21441..75f65e3 100644 --- a/basic/source/inc/scriptcont.hxx +++ b/basic/source/inc/scriptcont.hxx @@ -121,10 +121,6 @@ public: throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - // Service - static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_static(); - static OUString getImplementationName_static(); }; diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx index 6f22b95..39dde70 100644 --- a/basic/source/uno/dlgcont.cxx +++ b/basic/source/uno/dlgcont.cxx @@ -32,7 +32,6 @@ #include <com/sun/star/resource/StringResourceWithLocation.hpp> #include <com/sun/star/document/GraphicObjectResolver.hpp> #include "dlgcont.hxx" -#include "sbmodule.hxx" #include <comphelper/processfactory.hxx> #include <unotools/streamwrap.hxx> #include <osl/mutex.hxx> @@ -451,16 +450,11 @@ SfxDialogLibraryContainer:: HasExecutableCode( const OUString& /*Library*/ ) thr OUString SAL_CALL SfxDialogLibraryContainer::getImplementationName( ) throw (RuntimeException, std::exception) { - return getImplementationName_static(); + return OUString("com.sun.star.comp.sfx2.DialogLibraryContainer"); } Sequence< OUString > SAL_CALL SfxDialogLibraryContainer::getSupportedServiceNames( ) throw (RuntimeException, std::exception) { - return getSupportedServiceNames_static(); -} - -Sequence< OUString > SfxDialogLibraryContainer::getSupportedServiceNames_static() -{ Sequence< OUString > aServiceNames( 2 ); aServiceNames[0] = "com.sun.star.script.DocumentDialogLibraryContainer"; // plus, for compatibility: @@ -468,12 +462,6 @@ Sequence< OUString > SfxDialogLibraryContainer::getSupportedServiceNames_static( return aServiceNames; } -OUString SfxDialogLibraryContainer::getImplementationName_static() -{ - return OUString("com.sun.star.comp.sfx2.DialogLibraryContainer"); -} - - // Implementation class SfxDialogLibrary // Ctor diff --git a/basic/source/uno/sbmodule.cxx b/basic/source/uno/sbmodule.cxx deleted file mode 100644 index cbe3742..0000000 --- a/basic/source/uno/sbmodule.cxx +++ /dev/null @@ -1,52 +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 "sbmodule.hxx" -#include <rtl/instance.hxx> - - -namespace basic -{ - - - struct BasicModuleCreator - { - BasicModule m_aBasicModule; - }; - namespace - { - class theBasicModuleInstance : public rtl::Static<BasicModuleCreator, theBasicModuleInstance> {}; - } - - BasicModule::BasicModule() - :BaseClass() - { - } - - BasicModule& BasicModule::getInstance() - { - return theBasicModuleInstance::get().m_aBasicModule; - } - - -} // namespace basic - - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basic/source/uno/sbmodule.hxx b/basic/source/uno/sbmodule.hxx deleted file mode 100644 index f7eb2e5..0000000 --- a/basic/source/uno/sbmodule.hxx +++ /dev/null @@ -1,86 +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_BASIC_SOURCE_UNO_SBMODULE_HXX -#define INCLUDED_BASIC_SOURCE_UNO_SBMODULE_HXX - -#include <comphelper/componentmodule.hxx> - - -namespace basic -{ - - - class BasicModule : public ::comphelper::OModule - { - friend struct BasicModuleCreator; - typedef ::comphelper::OModule BaseClass; - - public: - static BasicModule& getInstance(); - - private: - BasicModule(); - }; - - /* -------------------------------------------------------------------- */ - class BasicModuleClient : public ::comphelper::OModuleClient - { - private: - typedef ::comphelper::OModuleClient BaseClass; - - public: - BasicModuleClient() : BaseClass( BasicModule::getInstance() ) - { - } - }; - - /* -------------------------------------------------------------------- */ - template < class TYPE > - class OAutoRegistration : public ::comphelper::OAutoRegistration< TYPE > - { - private: - typedef ::comphelper::OAutoRegistration< TYPE > BaseClass; - - public: - OAutoRegistration() : BaseClass( BasicModule::getInstance() ) - { - } - }; - - /* -------------------------------------------------------------------- */ - template < class TYPE > - class OSingletonRegistration : public ::comphelper::OSingletonRegistration< TYPE > - { - private: - typedef ::comphelper::OSingletonRegistration< TYPE > BaseClass; - - public: - OSingletonRegistration() : BaseClass( BasicModule::getInstance() ) - { - } - }; - - -} // namespace basic - - -#endif // INCLUDED_BASIC_SOURCE_UNO_SBMODULE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx index 73bcbec..eeb68f0 100644 --- a/basic/source/uno/scriptcont.cxx +++ b/basic/source/uno/scriptcont.cxx @@ -18,7 +18,6 @@ */ #include "scriptcont.hxx" -#include "sbmodule.hxx" #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/xml/sax/Parser.hpp> #include <com/sun/star/xml/sax/InputSource.hpp> @@ -1193,17 +1192,12 @@ sal_Bool SAL_CALL SfxScriptLibraryContainer:: HasExecutableCode( const OUString& OUString SAL_CALL SfxScriptLibraryContainer::getImplementationName( ) throw (RuntimeException, std::exception) { - return getImplementationName_static(); + return OUString("com.sun.star.comp.sfx2.ScriptLibraryContainer" ); } Sequence< OUString > SAL_CALL SfxScriptLibraryContainer::getSupportedServiceNames( ) throw (RuntimeException, std::exception) { - return getSupportedServiceNames_static(); -} - -Sequence< OUString > SfxScriptLibraryContainer::getSupportedServiceNames_static() -{ Sequence< OUString > aServiceNames( 2 ); aServiceNames[0] = "com.sun.star.script.DocumentScriptLibraryContainer"; // plus, for compatibility: @@ -1211,11 +1205,6 @@ Sequence< OUString > SfxScriptLibraryContainer::getSupportedServiceNames_static( return aServiceNames; } -OUString SfxScriptLibraryContainer::getImplementationName_static() -{ - return OUString("com.sun.star.comp.sfx2.ScriptLibraryContainer" ); -} - // Implementation class SfxScriptLibrary // Ctor diff --git a/basic/util/sb.component b/basic/util/sb.component index 710c37f..9271a84 100644 --- a/basic/util/sb.component +++ b/basic/util/sb.component @@ -18,9 +18,9 @@ --> <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" - prefix="sb" xmlns="http://openoffice.org/2010/uno-components"> + xmlns="http://openoffice.org/2010/uno-components"> <implementation name="com.sun.star.comp.sfx2.DialogLibraryContainer" - constructor="com_sun_star_comp_sfx2_DialogLibraryContainer_get_implementation"> + constructor="com_sun_star_comp_sfx2_DialogLibraryContainer_get_implementation"> <service name="com.sun.star.script.DialogLibraryContainer"/> <service name="com.sun.star.script.DocumentDialogLibraryContainer"/> </implementation> commit a45a5501cce95f57a9166b8bad0073ec79d72daa Author: Chris Sherlock <chris.sherl...@collabora.com> Date: Tue Feb 24 14:31:11 2015 +1100 basic: convert sb.component to constructor usage Change-Id: I45ddf460fa7d673c5210f9415b2a8015988a643e Signed-off-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/basic/Library_sb.mk b/basic/Library_sb.mk index eefe8e0..36c1be9 100644 --- a/basic/Library_sb.mk +++ b/basic/Library_sb.mk @@ -93,7 +93,6 @@ $(eval $(call gb_Library_add_exception_objects,sb,\ basic/source/uno/modsizeexceeded \ basic/source/uno/namecont \ basic/source/uno/sbmodule \ - basic/source/uno/sbservices \ basic/source/uno/scriptcont \ basic/source/runtime/comenumwrapper \ basic/source/runtime/ddectrl \ diff --git a/basic/source/inc/dlgcont.hxx b/basic/source/inc/dlgcont.hxx index 4259674..33155af 100644 --- a/basic/source/inc/dlgcont.hxx +++ b/basic/source/inc/dlgcont.hxx @@ -94,9 +94,6 @@ public: // Service static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_static(); static OUString getImplementationName_static(); - static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Create - ( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xServiceManager ) - throw( ::com::sun::star::uno::Exception ); }; diff --git a/basic/source/inc/scriptcont.hxx b/basic/source/inc/scriptcont.hxx index 116e05c..2f21441 100644 --- a/basic/source/inc/scriptcont.hxx +++ b/basic/source/inc/scriptcont.hxx @@ -125,10 +125,6 @@ public: // Service static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_static(); static OUString getImplementationName_static(); - static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Create - ( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xServiceManager ) - throw( ::com::sun::star::uno::Exception ); - }; diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx index b9d128b..6f22b95 100644 --- a/basic/source/uno/dlgcont.cxx +++ b/basic/source/uno/dlgcont.cxx @@ -33,7 +33,6 @@ #include <com/sun/star/document/GraphicObjectResolver.hpp> #include "dlgcont.hxx" #include "sbmodule.hxx" -#include "sbservices.hxx" #include <comphelper/processfactory.hxx> #include <unotools/streamwrap.hxx> #include <osl/mutex.hxx> @@ -450,11 +449,6 @@ SfxDialogLibraryContainer:: HasExecutableCode( const OUString& /*Library*/ ) thr // Service -void createRegistryInfo_SfxDialogLibraryContainer() -{ - static OAutoRegistration< SfxDialogLibraryContainer > aAutoRegistration; -} - OUString SAL_CALL SfxDialogLibraryContainer::getImplementationName( ) throw (RuntimeException, std::exception) { return getImplementationName_static(); @@ -479,14 +473,6 @@ OUString SfxDialogLibraryContainer::getImplementationName_static() return OUString("com.sun.star.comp.sfx2.DialogLibraryContainer"); } -Reference< XInterface > SAL_CALL SfxDialogLibraryContainer::Create( const Reference< XComponentContext >& ) throw( Exception ) -{ - Reference< XInterface > xRet = - static_cast< XInterface* >( static_cast< OWeakObject* >(new SfxDialogLibraryContainer()) ); - return xRet; -} - - // Implementation class SfxDialogLibrary @@ -608,4 +594,12 @@ bool SAL_CALL SfxDialogLibrary::isLibraryElementValid( ::com::sun::star::uno::An } +extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL +com_sun_star_comp_sfx2_DialogLibraryContainer_get_implementation(::com::sun::star::uno::XComponentContext*, + ::com::sun::star::uno::Sequence<css::uno::Any> const &) +{ + return cppu::acquire(new basic::SfxDialogLibraryContainer()); +} + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basic/source/uno/sbservices.cxx b/basic/source/uno/sbservices.cxx deleted file mode 100644 index e3eafb9..0000000 --- a/basic/source/uno/sbservices.cxx +++ /dev/null @@ -1,50 +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 "sbmodule.hxx" -#include "sbservices.hxx" - -namespace basic -{ - static void initializeModule() - { - static bool bInitialized( false ); - if ( !bInitialized ) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if ( !bInitialized ) - { - createRegistryInfo_SfxDialogLibraryContainer(); - createRegistryInfo_SfxScriptLibraryContainer(); - } - } - } - - -} // namespace basic - - -extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL sb_component_getFactory( - const sal_Char* pImplementationName, void*, void* ) -{ - ::basic::initializeModule(); - return ::basic::BasicModule::getInstance().getComponentFactory( pImplementationName ); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basic/source/uno/sbservices.hxx b/basic/source/uno/sbservices.hxx deleted file mode 100644 index a344b27..0000000 --- a/basic/source/uno/sbservices.hxx +++ /dev/null @@ -1,35 +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_BASIC_SOURCE_UNO_SBSERVICES_HXX -#define INCLUDED_BASIC_SOURCE_UNO_SBSERVICES_HXX - -#include <sal/config.h> - -namespace basic { - -void createRegistryInfo_SfxDialogLibraryContainer(); - -void createRegistryInfo_SfxScriptLibraryContainer(); - -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx index 43da15a..73bcbec 100644 --- a/basic/source/uno/scriptcont.cxx +++ b/basic/source/uno/scriptcont.cxx @@ -19,7 +19,6 @@ #include "scriptcont.hxx" #include "sbmodule.hxx" -#include "sbservices.hxx" #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/xml/sax/Parser.hpp> #include <com/sun/star/xml/sax/InputSource.hpp> @@ -1191,11 +1190,6 @@ sal_Bool SAL_CALL SfxScriptLibraryContainer:: HasExecutableCode( const OUString& // Service -void createRegistryInfo_SfxScriptLibraryContainer() -{ - static OAutoRegistration< SfxScriptLibraryContainer > aAutoRegistration; -} - OUString SAL_CALL SfxScriptLibraryContainer::getImplementationName( ) throw (RuntimeException, std::exception) { @@ -1222,14 +1216,6 @@ OUString SfxScriptLibraryContainer::getImplementationName_static() return OUString("com.sun.star.comp.sfx2.ScriptLibraryContainer" ); } -Reference< XInterface > SAL_CALL SfxScriptLibraryContainer::Create( const Reference< XComponentContext >& ) - throw( Exception ) -{ - Reference< XInterface > xRet = static_cast< XInterface* >( static_cast< OWeakObject* >(new SfxScriptLibraryContainer()) ); - return xRet; -} - - // Implementation class SfxScriptLibrary // Ctor @@ -1352,9 +1338,15 @@ void SAL_CALL SfxScriptLibrary::removeModuleInfo( const OUString& ModuleName ) mModuleInfos.erase( mModuleInfos.find( ModuleName ) ); } +} // namespace basic +extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL +com_sun_star_comp_sfx2_ScriptLibraryContainer_get_implementation(::com::sun::star::uno::XComponentContext*, + ::com::sun::star::uno::Sequence<css::uno::Any> const &) +{ + return cppu::acquire(new basic::SfxScriptLibraryContainer()); +} -} // namespace basic /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basic/util/sb.component b/basic/util/sb.component index 15e9998..710c37f 100644 --- a/basic/util/sb.component +++ b/basic/util/sb.component @@ -19,11 +19,13 @@ <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" prefix="sb" xmlns="http://openoffice.org/2010/uno-components"> - <implementation name="com.sun.star.comp.sfx2.DialogLibraryContainer"> + <implementation name="com.sun.star.comp.sfx2.DialogLibraryContainer" + constructor="com_sun_star_comp_sfx2_DialogLibraryContainer_get_implementation"> <service name="com.sun.star.script.DialogLibraryContainer"/> <service name="com.sun.star.script.DocumentDialogLibraryContainer"/> </implementation> - <implementation name="com.sun.star.comp.sfx2.ScriptLibraryContainer"> + <implementation name="com.sun.star.comp.sfx2.ScriptLibraryContainer" + constructor="com_sun_star_comp_sfx2_ScriptLibraryContainer_get_implementation"> <service name="com.sun.star.script.DocumentScriptLibraryContainer"/> <service name="com.sun.star.script.ScriptLibraryContainer"/> </implementation> _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits