Kaydet (Commit) 35c1d6f7 authored tarafından Marcos Paulo de Souza's avatar Marcos Paulo de Souza Kaydeden (comit) Caolán McNamara

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/6811Tested-by: 's avatarLibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 42b73353
......@@ -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 \
......
......@@ -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 \
......
# -*- 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:
......@@ -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) \
......
......@@ -20,7 +20,6 @@
$(eval $(call gb_Module_Module,svtools))
$(eval $(call gb_Module_add_targets,svtools,\
Library_hatchwindowfactory \
Library_svt \
UIConfig_svt \
))
......
<?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>
......@@ -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: */
......@@ -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() )
......
......@@ -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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment