desktop/Library_sofficeapp.mk | 6 ++---- desktop/source/lib/init.cxx | 34 +--------------------------------- solenv/bin/native-code.py | 2 +- 3 files changed, 4 insertions(+), 38 deletions(-)
New commits: commit 523662727ccdd5c03842dd2c6607dace6b86cb41 Author: Skyler Grey <skyler.g...@collabora.com> AuthorDate: Fri Nov 8 17:53:47 2024 +0000 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Thu Jan 30 16:30:56 2025 +0100 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/+/180946 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk index cc39ccd12f92..8eb11fe42e37 100644 --- a/desktop/Library_sofficeapp.mk +++ b/desktop/Library_sofficeapp.mk @@ -138,13 +138,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 7bc0c16e5c53..9e21b2372ee4 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1352,8 +1352,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 @@ -1375,8 +1373,6 @@ rtl::Reference<LOKClipboard> forceSetClipboardForCurrentView(LibreOfficeKitDocum return xClip; } -#endif - const vcl::Font* FindFont(std::u16string_view rFontName) { SfxObjectShell* pDocSh = SfxObjectShell::Current(); @@ -1554,9 +1550,7 @@ LibLODocument_Impl::LibLODocument_Impl(uno::Reference <css::lang::XComponent> xC } pClass = m_pDocumentClass.get(); -#ifndef IOS forceSetClipboardForCurrentView(this); -#endif } LibLODocument_Impl::~LibLODocument_Impl() @@ -2334,12 +2328,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") { @@ -6115,18 +6107,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; @@ -6206,7 +6186,6 @@ static int doc_getClipboard(LibreOfficeKitDocument* pThis, } return 1; -#endif } static int doc_setClipboard(LibreOfficeKitDocument* pThis, @@ -6215,13 +6194,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; @@ -6246,7 +6218,7 @@ static int doc_setClipboard(LibreOfficeKitDocument* pThis, SetLastExceptionMsg(u"Document doesn't support this mime type"_ustr); return false; } -#endif + return true; } @@ -7042,11 +7014,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 b64606bac16e..3992949f2311 100755 --- a/solenv/bin/native-code.py +++ b/solenv/bin/native-code.py @@ -128,7 +128,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