summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'desktop')
-rw-r--r--desktop/Library_sofficeapp.mk3
-rw-r--r--desktop/lokclipboard.component26
-rw-r--r--desktop/source/lib/lokclipboard.cxx16
3 files changed, 44 insertions, 1 deletions
diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk
index c315a113ca89..0ae136c70e50 100644
--- a/desktop/Library_sofficeapp.mk
+++ b/desktop/Library_sofficeapp.mk
@@ -136,6 +136,8 @@ $(eval $(call gb_Library_add_exception_objects,sofficeapp,\
$(if $(filter $(OS),ANDROID), \
desktop/source/lib/lokandroid) \
))
+$(if $(filter-out $(OS),IOS), \
+ $(eval $(call gb_Library_set_componentfile,sofficeapp,desktop/lokclipboard,services)))
else
ifneq ($(filter TRUE,$(USING_X11) $(DISABLE_GUI))($filter EMSCRIPTEN,$(OS)),)
$(eval $(call gb_Library_add_exception_objects,sofficeapp,\
@@ -143,6 +145,7 @@ $(eval $(call gb_Library_add_exception_objects,sofficeapp,\
desktop/source/lib/lokinteractionhandler \
desktop/source/lib/lokclipboard \
))
+$(eval $(call gb_Library_set_componentfile,sofficeapp,desktop/lokclipboard,services))
endif
endif
diff --git a/desktop/lokclipboard.component b/desktop/lokclipboard.component
new file mode 100644
index 000000000000..a2c7c63284aa
--- /dev/null
+++ b/desktop/lokclipboard.component
@@ -0,0 +1,26 @@
+<?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" environment="@CPPU_ENV@"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.datatransfer.LOKClipboard"
+ constructor="desktop_LOKClipboard_get_implementation">
+ <service name="com.sun.star.datatransfer.clipboard.LokClipboard"/>
+ </implementation>
+</component>
diff --git a/desktop/source/lib/lokclipboard.cxx b/desktop/source/lib/lokclipboard.cxx
index b4de36c56578..6a04f386ce17 100644
--- a/desktop/source/lib/lokclipboard.cxx
+++ b/desktop/source/lib/lokclipboard.cxx
@@ -10,9 +10,11 @@
#include "lokclipboard.hxx"
#include <unordered_map>
#include <vcl/lazydelete.hxx>
+#include <vcl/svapp.hxx>
#include <sfx2/lokhelper.hxx>
#include <sal/log.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
using namespace css;
using namespace css::uno;
@@ -75,7 +77,7 @@ LOKClipboard::LOKClipboard()
Sequence<OUString> LOKClipboard::getSupportedServiceNames_static()
{
- Sequence<OUString> aRet{ "com.sun.star.datatransfer.clipboard.SystemClipboard" };
+ Sequence<OUString> aRet{ "com.sun.star.datatransfer.clipboard.LokClipboard" };
return aRet;
}
@@ -227,4 +229,16 @@ sal_Bool SAL_CALL LOKTransferable::isDataFlavorSupported(const datatransfer::Dat
!= std::cend(m_aFlavors);
}
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+desktop_LOKClipboard_get_implementation(css::uno::XComponentContext*,
+ css::uno::Sequence<css::uno::Any> const& /*args*/)
+{
+ SolarMutexGuard aGuard;
+
+ cppu::OWeakObject* pClipboard = LOKClipboardFactory::getClipboardForCurView().get();
+
+ pClipboard->acquire();
+ return pClipboard;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */