summaryrefslogtreecommitdiff
path: root/vcl/osx/service_entry.cxx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2022-01-06 14:16:53 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2022-01-07 05:04:14 +0100
commit031576105c21b2e0c2585a1236092487d5d193e2 (patch)
treed251ce32730f1aec80820b0d8b03207c6ef25da7 /vcl/osx/service_entry.cxx
parent32bf2040bfa9d76731fc7c679845eb3835dde8a3 (diff)
VCL move platform code from mouse.cxx into plugins
... by moving it into ImplCreate(DragSource|DropTarget). The existing Create* variant now checks for headless mode and the IsRunningUnitTest flag, before creating the platform variants. There are two small helpers to initialize either X11 or Ole based UNO DnD interace implementations. Unfortunatly Windows requires to move two dtrans header files, but at least any other changes are minimal. Change-Id: Id79459ad71a26243b1c9cb1fe38ab236b0ab8fa6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128049 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/osx/service_entry.cxx')
-rw-r--r--vcl/osx/service_entry.cxx23
1 files changed, 8 insertions, 15 deletions
diff --git a/vcl/osx/service_entry.cxx b/vcl/osx/service_entry.cxx
index 73fd2aa9c958..849e73a77dcd 100644
--- a/vcl/osx/service_entry.cxx
+++ b/vcl/osx/service_entry.cxx
@@ -19,6 +19,8 @@
#include <vcl/svapp.hxx>
+#include <dndhelper.hxx>
+#include <vcl/sysdata.hxx>
#include <osx/saldata.hxx>
#include <osx/salinst.h>
@@ -34,11 +36,6 @@ using namespace ::cppu;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::datatransfer::clipboard;
-// We run unit tests in parallel, which is a problem when touching a shared resource
-// the system clipboard, so rather use the dummy GenericClipboard.
-// Note, cannot make this a global variable, because it might be initialised BEFORE the putenv() call in cppunittester.
-static bool IsRunningUnitTest() { return getenv("LO_TESTNAME") != nullptr; }
-
uno::Reference< XInterface > AquaSalInstance::CreateClipboard( const Sequence< Any >& i_rArguments )
{
if ( Application::IsHeadlessModeEnabled() || IsRunningUnitTest() )
@@ -50,20 +47,16 @@ uno::Reference< XInterface > AquaSalInstance::CreateClipboard( const Sequence< A
return pSalData->mxClipboard;
}
-uno::Reference<XInterface> AquaSalInstance::CreateDragSource()
+uno::Reference<XInterface> AquaSalInstance::ImplCreateDragSource(const SystemEnvData* pSysEnv)
{
- if ( Application::IsHeadlessModeEnabled() || IsRunningUnitTest() )
- return SalInstance::CreateDragSource();
-
- return uno::Reference<XInterface>(static_cast< XInitialization* >(new DragSource()), UNO_QUERY);
+ return vcl::OleDnDHelper(new DragSource(), reinterpret_cast<sal_IntPtr>(pSysEnv->mpNSView),
+ vcl::DragOrDrop::Drag);
}
-uno::Reference<XInterface> AquaSalInstance::CreateDropTarget()
+uno::Reference<XInterface> AquaSalInstance::ImplCreateDropTarget(const SystemEnvData* pSysEnv)
{
- if ( Application::IsHeadlessModeEnabled() || IsRunningUnitTest() )
- return SalInstance::CreateDropTarget();
-
- return uno::Reference<XInterface>(static_cast< XInitialization* >(new DropTarget()), UNO_QUERY);
+ return vcl::OleDnDHelper(new DropTarget(), reinterpret_cast<sal_IntPtr>(pSysEnv->mpNSView),
+ vcl::DragOrDrop::Drop);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */