summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSkyler Grey <skyler.grey@collabora.com>2024-11-08 17:53:47 +0000
committerSkyler Grey <skyler.grey@collabora.com>2024-11-19 17:10:57 +0100
commit5f095a3e7d7e364e5112eccf150e9636214b8e40 (patch)
tree214a87a9b335081167c50240398e1921a31ee2ea
parentb7c5fbadab3f912b792abc61dac2c879d6b4a969 (diff)
feat(iOS): Allow use of desktop clipboard code
Historically, iOS has used pasteboard code instead of the normal clipboard code, forming a different clipboard flow for the Collabora Online app for iOS. This is "not ideal" for consistency in clipboard behavior between iOS and other platforms, so we're switching iOS to use the same clipboard APIs as everywhere else. This means that we need this desktop clipboard code to be compiled into iOS. Change-Id: I42567ad64641913817a26d1494858393501b6503 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176542 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r--desktop/Library_sofficeapp.mk6
-rw-r--r--desktop/source/lib/init.cxx34
-rwxr-xr-xsolenv/bin/native-code.py2
3 files changed, 4 insertions, 38 deletions
diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk
index 641efda7eda2..ab79f98d539a 100644
--- a/desktop/Library_sofficeapp.mk
+++ b/desktop/Library_sofficeapp.mk
@@ -132,13 +132,11 @@ ifneq ($(filter $(OS),ANDROID iOS MACOSX WNT),)
$(eval $(call gb_Library_add_exception_objects,sofficeapp,\
desktop/source/lib/init \
desktop/source/lib/lokinteractionhandler \
- $(if $(filter-out $(OS),iOS), \
- desktop/source/lib/lokclipboard) \
+ desktop/source/lib/lokclipboard \
$(if $(filter $(OS),ANDROID), \
desktop/source/lib/lokandroid) \
))
-$(if $(filter-out $(OS),IOS), \
- $(eval $(call gb_Library_set_componentfile,sofficeapp,desktop/lokclipboard,services)))
+$(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,\
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 42be55ca1065..b5493bc22cfc 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1361,8 +1361,6 @@ ITiledRenderable* getTiledRenderable(LibreOfficeKitDocument* pThis)
return dynamic_cast<ITiledRenderable*>(pDocument->mxComponent.get());
}
-#ifndef IOS
-
/*
* Unfortunately clipboard creation using UNO is insanely baroque.
* we also need to ensure that this works for the first view which
@@ -1384,8 +1382,6 @@ rtl::Reference<LOKClipboard> forceSetClipboardForCurrentView(LibreOfficeKitDocum
return xClip;
}
-#endif
-
const vcl::Font* FindFont(std::u16string_view rFontName)
{
SfxObjectShell* pDocSh = SfxObjectShell::Current();
@@ -1563,9 +1559,7 @@ LibLODocument_Impl::LibLODocument_Impl(uno::Reference <css::lang::XComponent> xC
}
pClass = m_pDocumentClass.get();
-#ifndef IOS
forceSetClipboardForCurrentView(this);
-#endif
}
LibLODocument_Impl::~LibLODocument_Impl()
@@ -2343,12 +2337,10 @@ bool CallbackFlushHandler::processWindowEvent(int type, CallbackData& aCallbackD
return false;
}
-#ifndef IOS
auto xClip = forceSetClipboardForCurrentView(m_pDocument);
uno::Reference<datatransfer::clipboard::XClipboard> xClipboard(xClip);
pWindow->SetClipboard(xClipboard);
-#endif
}
else if (aAction == "size_changed")
{
@@ -6100,18 +6092,6 @@ static int doc_getClipboard(LibreOfficeKitDocument* pThis,
size_t **pOutSizes,
char ***pOutStreams)
{
-#ifdef IOS
- (void) pThis;
- (void) pMimeTypes;
- (void) pOutCount;
- (void) pOutMimeTypes;
- (void) pOutSizes;
- (void) pOutStreams;
-
- assert(!"doc_getClipboard should not be called on iOS");
-
- return 0;
-#else
comphelper::ProfileZone aZone("doc_getClipboard");
SolarMutexGuard aGuard;
@@ -6188,7 +6168,6 @@ static int doc_getClipboard(LibreOfficeKitDocument* pThis,
}
return 1;
-#endif
}
static int doc_setClipboard(LibreOfficeKitDocument* pThis,
@@ -6197,13 +6176,6 @@ static int doc_setClipboard(LibreOfficeKitDocument* pThis,
const size_t *pInSizes,
const char **pInStreams)
{
-#ifdef IOS
- (void) pThis;
- (void) nInCount;
- (void) pInMimeTypes;
- (void) pInSizes;
- (void) pInStreams;
-#else
comphelper::ProfileZone aZone("doc_setClipboard");
SolarMutexGuard aGuard;
@@ -6228,7 +6200,7 @@ static int doc_setClipboard(LibreOfficeKitDocument* pThis,
SetLastExceptionMsg(u"Document doesn't support this mime type"_ustr);
return false;
}
-#endif
+
return true;
}
@@ -7023,11 +6995,7 @@ static int doc_createViewWithOptions(LibreOfficeKitDocument* pThis,
vcl::lok::numberOfViewsChanged(SfxLokHelper::getViewsCount(pDocument->mnDocumentId));
-#ifdef IOS
- (void) pThis;
-#else
forceSetClipboardForCurrentView(pThis);
-#endif
return nId;
}
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 955317ebc0ca..32573fa400fd 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -127,7 +127,7 @@ core_constructor_list = [
"com_sun_star_comp_dba_ODatabaseSource",
"com_sun_star_comp_dba_ORowSet_get_implementation",
# desktop/lokclipboard.component
- ("desktop_LOKClipboard_get_implementation", "#ifndef IOS"),
+ "desktop_LOKClipboard_get_implementation",
# drawinglayer/drawinglayer.component
"drawinglayer_XPrimitive2DRenderer",
# embeddedobj/util/embobj.component