diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2013-11-26 00:03:50 -0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-04 04:47:39 -0600 |
commit | 35c1d6f7617087c18b94e03ec9281c995e6d9e55 (patch) | |
tree | 354849bef7e354263f4a2515cb0783b111d8ad91 | |
parent | 42b733539179547a4030dfe54655b26985936717 (diff) |
fdo#60698: Merge hatchwindowfactory into svt
They are used at same conditions, and hatchwindowfactory just have
four files, so we don'y have any reason to keep them separated.
Change-Id: Iae3bb26ab1e95a309bf0d83c4ef17a0bf0261179
Reviewed-on: https://gerrit.libreoffice.org/6811
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | Repository.mk | 1 | ||||
-rwxr-xr-x | postprocess/Rdb_services.mk | 1 | ||||
-rw-r--r-- | svtools/Library_hatchwindowfactory.mk | 51 | ||||
-rw-r--r-- | svtools/Library_svt.mk | 4 | ||||
-rw-r--r-- | svtools/Module_svtools.mk | 1 | ||||
-rw-r--r-- | svtools/source/hatchwindow/hatchwindowfactory.component | 29 | ||||
-rw-r--r-- | svtools/source/hatchwindow/hatchwindowfactory.cxx | 44 | ||||
-rw-r--r-- | svtools/source/inc/documentcloser.hxx (renamed from svtools/source/hatchwindow/documentcloser.hxx) | 0 | ||||
-rw-r--r-- | svtools/source/inc/hatchwindow.hxx (renamed from svtools/source/hatchwindow/hatchwindow.hxx) | 0 | ||||
-rw-r--r-- | svtools/source/inc/hatchwindowfactory.hxx (renamed from svtools/source/hatchwindow/hatchwindowfactory.hxx) | 0 | ||||
-rw-r--r-- | svtools/source/uno/miscservices.cxx | 32 | ||||
-rw-r--r-- | svtools/util/svt.component | 7 |
12 files changed, 33 insertions, 137 deletions
diff --git a/Repository.mk b/Repository.mk index 60a0c7625dd0..02bfe0c84511 100644 --- a/Repository.mk +++ b/Repository.mk @@ -273,7 +273,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ $(if $(filter DESKTOP,$(BUILD_TYPE)),helplinker) \ i18npool \ i18nsearch \ - hatchwindowfactory \ hyphen \ icd \ icg \ diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk index e07017d3644b..fc7c671b9d43 100755 --- a/postprocess/Rdb_services.mk +++ b/postprocess/Rdb_services.mk @@ -80,7 +80,6 @@ $(eval $(call gb_Rdb_add_components,services,\ svl/source/fsstor/fsstorage \ svl/source/passwordcontainer/passwordcontainer \ svl/util/svl \ - svtools/source/hatchwindow/hatchwindowfactory \ svtools/util/svt \ svgio/svgio \ svx/util/svx \ diff --git a/svtools/Library_hatchwindowfactory.mk b/svtools/Library_hatchwindowfactory.mk deleted file mode 100644 index 7511eceddef9..000000000000 --- a/svtools/Library_hatchwindowfactory.mk +++ /dev/null @@ -1,51 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# 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 . -# - -$(eval $(call gb_Library_Library,hatchwindowfactory)) - -$(eval $(call gb_Library_set_componentfile,hatchwindowfactory,svtools/source/hatchwindow/hatchwindowfactory)) - -$(eval $(call gb_Library_set_include,hatchwindowfactory,\ - $$(INCLUDE) \ - -I$(SRCDIR)/svtools/inc \ -)) - -$(eval $(call gb_Library_use_external,hatchwindowfactory,boost_headers)) - -$(eval $(call gb_Library_use_sdk_api,hatchwindowfactory)) - -$(eval $(call gb_Library_use_libraries,hatchwindowfactory,\ - comphelper \ - cppu \ - cppuhelper \ - sal \ - tk \ - tl \ - vcl \ - $(gb_UWINAPI) \ -)) - -$(eval $(call gb_Library_add_exception_objects,hatchwindowfactory,\ - svtools/source/hatchwindow/documentcloser \ - svtools/source/hatchwindow/hatchwindow \ - svtools/source/hatchwindow/hatchwindowfactory \ - svtools/source/hatchwindow/ipwin \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk index eb1ba8cad406..915c5b87bd59 100644 --- a/svtools/Library_svt.mk +++ b/svtools/Library_svt.mk @@ -161,6 +161,10 @@ $(eval $(call gb_Library_add_exception_objects,svt,\ svtools/source/graphic/provider \ svtools/source/graphic/renderer \ svtools/source/graphic/transformer \ + svtools/source/hatchwindow/documentcloser \ + svtools/source/hatchwindow/hatchwindow \ + svtools/source/hatchwindow/hatchwindowfactory \ + svtools/source/hatchwindow/ipwin \ $(if $(ENABLE_JAVA), \ svtools/source/java/javacontext \ svtools/source/java/javainteractionhandler) \ diff --git a/svtools/Module_svtools.mk b/svtools/Module_svtools.mk index e2a3512c7caf..edef7d515343 100644 --- a/svtools/Module_svtools.mk +++ b/svtools/Module_svtools.mk @@ -20,7 +20,6 @@ $(eval $(call gb_Module_Module,svtools)) $(eval $(call gb_Module_add_targets,svtools,\ - Library_hatchwindowfactory \ Library_svt \ UIConfig_svt \ )) diff --git a/svtools/source/hatchwindow/hatchwindowfactory.component b/svtools/source/hatchwindow/hatchwindowfactory.component deleted file mode 100644 index 193ae427d702..000000000000 --- a/svtools/source/hatchwindow/hatchwindowfactory.component +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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 . - --> - -<component loader="com.sun.star.loader.SharedLibrary" prefix="hatchwindowfactory" - xmlns="http://openoffice.org/2010/uno-components"> - <implementation name="com.sun.star.comp.embed.DocumentCloser"> - <service name="com.sun.star.embed.DocumentCloser"/> - </implementation> - <implementation name="com.sun.star.comp.embed.HatchWindowFactory"> - <service name="com.sun.star.comp.embed.HatchWindowFactory"/> - <service name="com.sun.star.embed.HatchWindowFactory"/> - </implementation> -</component> diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx b/svtools/source/hatchwindow/hatchwindowfactory.cxx index b0f6fd0d02bf..f728add78d14 100644 --- a/svtools/source/hatchwindow/hatchwindowfactory.cxx +++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - #include "hatchwindowfactory.hxx" #include "hatchwindow.hxx" #include "cppuhelper/factory.hxx" @@ -28,7 +27,6 @@ using namespace ::com::sun::star; -//------------------------------------------------------------------------- uno::Sequence< OUString > SAL_CALL OHatchWindowFactory::impl_staticGetSupportedServiceNames() { uno::Sequence< OUString > aRet(2); @@ -37,21 +35,17 @@ uno::Sequence< OUString > SAL_CALL OHatchWindowFactory::impl_staticGetSupportedS return aRet; } -//------------------------------------------------------------------------- OUString SAL_CALL OHatchWindowFactory::impl_staticGetImplementationName() { return OUString( "com.sun.star.comp.embed.HatchWindowFactory" ); } -//------------------------------------------------------------------------- uno::Reference< uno::XInterface > SAL_CALL OHatchWindowFactory::impl_staticCreateSelfInstance( const uno::Reference< lang::XMultiServiceFactory >& xServiceManager ) { return uno::Reference< uno::XInterface >( *new OHatchWindowFactory( xServiceManager ) ); } - -//------------------------------------------------------------------------- uno::Reference< embed::XHatchWindow > SAL_CALL OHatchWindowFactory::createHatchWindowInstance( const uno::Reference< awt::XWindowPeer >& xParent, const awt::Rectangle& aBounds, @@ -85,42 +79,4 @@ uno::Sequence< OUString > SAL_CALL OHatchWindowFactory::getSupportedServiceNames return impl_staticGetSupportedServiceNames(); } -extern "C" -{ - -SAL_DLLPUBLIC_EXPORT void * SAL_CALL hatchwindowfactory_component_getFactory ( - const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) -{ - void * pResult = 0; - if (pServiceManager) - { - uno::Reference< lang::XSingleServiceFactory > xFactory; - if (OHatchWindowFactory::impl_staticGetImplementationName().equalsAscii(pImplementationName )) - { - xFactory = cppu::createOneInstanceFactory( - reinterpret_cast< lang::XMultiServiceFactory* >(pServiceManager), - OHatchWindowFactory::impl_staticGetImplementationName(), - OHatchWindowFactory::impl_staticCreateSelfInstance, - OHatchWindowFactory::impl_staticGetSupportedServiceNames()); - } - else if (ODocumentCloser::impl_staticGetImplementationName().equalsAscii(pImplementationName )) - { - xFactory = cppu::createSingleFactory( - reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), - ODocumentCloser::impl_staticGetImplementationName(), - ODocumentCloser::impl_staticCreateSelfInstance, - ODocumentCloser::impl_staticGetSupportedServiceNames() ); - } - - if (xFactory.is()) - { - xFactory->acquire(); - pResult = xFactory.get(); - } - } - return pResult; -} - -} // extern "C" - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/hatchwindow/documentcloser.hxx b/svtools/source/inc/documentcloser.hxx index 4fc37f08c581..4fc37f08c581 100644 --- a/svtools/source/hatchwindow/documentcloser.hxx +++ b/svtools/source/inc/documentcloser.hxx diff --git a/svtools/source/hatchwindow/hatchwindow.hxx b/svtools/source/inc/hatchwindow.hxx index feb136ca3968..feb136ca3968 100644 --- a/svtools/source/hatchwindow/hatchwindow.hxx +++ b/svtools/source/inc/hatchwindow.hxx diff --git a/svtools/source/hatchwindow/hatchwindowfactory.hxx b/svtools/source/inc/hatchwindowfactory.hxx index ed8d35c6c264..ed8d35c6c264 100644 --- a/svtools/source/hatchwindow/hatchwindowfactory.hxx +++ b/svtools/source/inc/hatchwindowfactory.hxx diff --git a/svtools/source/uno/miscservices.cxx b/svtools/source/uno/miscservices.cxx index afd04f4919bc..38f29003b56f 100644 --- a/svtools/source/uno/miscservices.cxx +++ b/svtools/source/uno/miscservices.cxx @@ -26,6 +26,9 @@ #include <com/sun/star/registry/XRegistryKey.hpp> #include <osl/diagnose.h> #include <uno/mapping.hxx> +#include "documentcloser.hxx" +#include "hatchwindowfactory.hxx" +#include "hatchwindow.hxx" #include "fpicker.hxx" #include "provider.hxx" #include "renderer.hxx" @@ -48,8 +51,6 @@ namespace unographic { extern sdecl::ServiceDecl const serviceDecl; } -// ------------------------------------------------------------------------------------- - // for CreateInstance functions implemented elsewhere #define DECLARE_CREATEINSTANCE( ImplName ) \ Reference< XInterface > SAL_CALL ImplName##_CreateInstance( const Reference< XMultiServiceFactory >& ); @@ -86,14 +87,11 @@ namespace }; } -// ------------------------------------------------------------------------------------- - DECLARE_CREATEINSTANCE_NAMESPACE( svt, OAddressBookSourceDialogUno ) DECLARE_CREATEINSTANCE( SvFilterOptionsDialog ) DECLARE_CREATEINSTANCE_NAMESPACE( unographic, GraphicProvider ) DECLARE_CREATEINSTANCE_NAMESPACE( unographic, GraphicRendererVCL ) -// ------------------------------------------------------------------------------------- extern "C" { @@ -144,18 +142,32 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svt_component_getFactory ( GraphicRendererVCL_CreateInstance, GraphicRendererVCL::getSupportedServiceNames_Static() ); } + else if (rtl_str_compare (pImplementationName, "com.sun.star.comp.embed.DocumentCloser") == 0) + { + xFactory = ::cppu::createOneInstanceFactory(xSMgr, + ODocumentCloser::impl_staticGetImplementationName(), + ODocumentCloser::impl_staticCreateSelfInstance, + ODocumentCloser::impl_staticGetSupportedServiceNames()); + } + else if (rtl_str_compare (pImplementationName, "com.sun.star.comp.embed.HatchWindowFactory") == 0) + { + xFactory = ::cppu::createOneInstanceFactory(xSMgr, + OHatchWindowFactory::impl_staticGetImplementationName(), + OHatchWindowFactory::impl_staticCreateSelfInstance, + OHatchWindowFactory::impl_staticGetSupportedServiceNames()); + } else { pResult = comphelper::service_decl::component_getFactoryHelper( pImplementationName, - static_cast<css::lang::XMultiServiceFactory *>( - _pServiceManager), + static_cast<css::lang::XMultiServiceFactory *>(_pServiceManager), static_cast<css::registry::XRegistryKey *>(pRegistryKey), serviceDecl ); if ( !pResult ) - pResult = cppu::component_getFactoryHelper( - pImplementationName, _pServiceManager, pRegistryKey, - s_aServiceEntries ); + pResult = cppu::component_getFactoryHelper(pImplementationName, + _pServiceManager, + pRegistryKey, + s_aServiceEntries); } if ( xFactory.is() ) diff --git a/svtools/util/svt.component b/svtools/util/svt.component index 249448b28305..efc97f93ff50 100644 --- a/svtools/util/svt.component +++ b/svtools/util/svt.component @@ -43,4 +43,11 @@ <implementation name="com.sun.star.comp.svt.FolderPicker"> <service name="com.sun.star.ui.dialogs.FolderPicker"/> </implementation> + <implementation name="com.sun.star.comp.embed.DocumentCloser"> + <service name="com.sun.star.embed.DocumentCloser"/> + </implementation> + <implementation name="com.sun.star.comp.embed.HatchWindowFactory"> + <service name="com.sun.star.comp.embed.HatchWindowFactory"/> + <service name="com.sun.star.embed.HatchWindowFactory"/> + </implementation> </component> |