From a4954e5575ed4cc17e88bdfe24ae30442cd883ab Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Fri, 11 Jul 2025 14:14:06 +0200 Subject: [PATCH] vcl: Drop logic to create drag source by service name This is basically the drag source equivalent of previous commit Change-Id: I93c099b82e209efe11f30bbc4f5fa0a6e1fff992 Author: Michael Weghorn Date: Fri Jul 11 13:47:54 2025 +0200 vcl: Drop logic to create drop target by service name , see the commit message of that one for more details/background. Change-Id: If870b340f39bd7fcf6674af3184e2a4c3017310d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187727 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- postprocess/qa/services.cxx | 7 ----- vcl/inc/factory.hxx | 46 ---------------------------- vcl/source/components/dtranscomp.cxx | 30 ------------------ vcl/source/components/factory.cxx | 30 ++---------------- vcl/vcl.common.component | 8 ----- vcl/vcl.common.component.macosx | 1 - vcl/vcl.common.component.unx | 1 - 7 files changed, 2 insertions(+), 121 deletions(-) delete mode 100644 vcl/inc/factory.hxx diff --git a/postprocess/qa/services.cxx b/postprocess/qa/services.cxx index 26f9963dc46f..be123dc67fe1 100644 --- a/postprocess/qa/services.cxx +++ b/postprocess/qa/services.cxx @@ -351,13 +351,6 @@ void Test::createInstance( // SystemClipboard is a wrapper returning either a platform-specific or // the generic VCLGenericClipboard: expImpl = "com.sun.star.datatransfer.VCLGenericClipboard"; -#if !defined(_WIN32) - } else if (name == "com.sun.star.comp.datatransfer.dnd.OleDragSource_V1" - || name == "com.sun.star.datatransfer.dnd.XdndSupport") - { - expImpl = "com.sun.star.datatransfer.dnd.VclGenericDragSource"; - expServs = {u"com.sun.star.datatransfer.dnd.GenericDragSource"_ustr}; -#endif } else if (name == "com.sun.star.ui.dialogs.FolderPicker") { // FolderPicker is a wrapper returning either a platform-specific or the // generic OfficeFolderPicker. In headless mode it is always the diff --git a/vcl/inc/factory.hxx b/vcl/inc/factory.hxx deleted file mode 100644 index f961f06d49ac..000000000000 --- a/vcl/inc/factory.hxx +++ /dev/null @@ -1,46 +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 . - */ - -#pragma once - -#include - -#include -#include -#include - -namespace com::sun::star { - namespace lang { - class XMultiServiceFactory; - } - namespace uno { class XInterface; } -} - -namespace vcl { - -css::uno::Sequence DragSource_getSupportedServiceNames(); - -OUString DragSource_getImplementationName(); - -css::uno::Reference DragSource_createInstance( - css::uno::Reference const &); - -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/components/dtranscomp.cxx b/vcl/source/components/dtranscomp.cxx index 053d2319b5aa..3f910456bb13 100644 --- a/vcl/source/components/dtranscomp.cxx +++ b/vcl/source/components/dtranscomp.cxx @@ -26,7 +26,6 @@ #include #include -#include #include #include @@ -274,35 +273,6 @@ void GenericDragSource::initialize( const Sequence< Any >& ) { } -Sequence< OUString > DragSource_getSupportedServiceNames() -{ -#if defined MACOSX - return { "com.sun.star.datatransfer.dnd.OleDragSource" }; -#elif defined UNX - return { u"com.sun.star.datatransfer.dnd.X11DragSource"_ustr }; -#else - return { "com.sun.star.datatransfer.dnd.VclGenericDragSource" }; -#endif -} - -OUString DragSource_getImplementationName() -{ -#if defined MACOSX - return "com.sun.star.comp.datatransfer.dnd.OleDragSource_V1"; -#elif defined UNX - return u"com.sun.star.datatransfer.dnd.XdndSupport"_ustr; -#else - return "com.sun.star.datatransfer.dnd.VclGenericDragSource"; -#endif -} - -Reference< XInterface > DragSource_createInstance( const Reference< XMultiServiceFactory >& ) -{ - SolarMutexGuard aGuard; - Reference< XInterface > xResult = ImplGetSVData()->mpDefInst->CreateDragSource(); - return xResult; -} - /* * generic DragSource dummy */ diff --git a/vcl/source/components/factory.cxx b/vcl/source/components/factory.cxx index 806dc6277d8e..63e9043c4878 100644 --- a/vcl/source/components/factory.cxx +++ b/vcl/source/components/factory.cxx @@ -17,41 +17,15 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include #include -#include - extern "C" { VCL_DLLPUBLIC void* vcl_component_getFactory( - const char* pImplementationName, - void* pXUnoSMgr, + const char* /*pImplementationName*/, + void* /*pXUnoSMgr*/, void* /*pXUnoKey*/) { - if (!pXUnoSMgr) - return nullptr; - - css::uno::Reference xMgr( - static_cast(pXUnoSMgr)); - - css::uno::Reference xFactory; - - if( vcl::DragSource_getImplementationName().equalsAscii( pImplementationName ) ) - { - xFactory = ::cppu::createSingleFactory( - xMgr, vcl::DragSource_getImplementationName(), vcl::DragSource_createInstance, - vcl::DragSource_getSupportedServiceNames() ); - } - - if( xFactory.is() ) - { - xFactory->acquire(); - return xFactory.get(); - } - return nullptr; } diff --git a/vcl/vcl.common.component b/vcl/vcl.common.component index d79fa0061db0..6f9bdccf7125 100644 --- a/vcl/vcl.common.component +++ b/vcl/vcl.common.component @@ -19,10 +19,6 @@ - - - - @@ -41,10 +37,6 @@ - - - - diff --git a/vcl/vcl.common.component.macosx b/vcl/vcl.common.component.macosx index cc831c8090e9..2ba983feded4 100644 --- a/vcl/vcl.common.component.macosx +++ b/vcl/vcl.common.component.macosx @@ -4,7 +4,6 @@ # 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/. -com.sun.star.comp.datatransfer.dnd.OleDragSource_V1 com.sun.star.datatransfer.clipboard.AquaClipboard com.sun.star.frame.VCLSessionManagerClient org.libreoffice.uitest.UITest diff --git a/vcl/vcl.common.component.unx b/vcl/vcl.common.component.unx index 88ddc02397fe..ecdafce5f73e 100644 --- a/vcl/vcl.common.component.unx +++ b/vcl/vcl.common.component.unx @@ -4,7 +4,6 @@ # 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/. -com.sun.star.datatransfer.dnd.XdndSupport com.sun.star.datatransfer.X11ClipboardSupport com.sun.star.frame.VCLSessionManagerClient org.libreoffice.uitest.UITest