summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorArmin Le Grand (Allotropia) <Armin.Le.Grand@me.com>2021-04-30 17:26:41 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2022-01-20 12:28:54 +0100
commit02140554ee1d70b219a42546191e2219d58be4b0 (patch)
tree3dd419dbdd0c23676c7f749bd8a83d09ad26c8bd /sfx2
parent02634fb7c7e8dc613ffc3717bb244f85cf81a7c6 (diff)
WASM --enable-wasm-strip now skips lots of LO code
... resulting in a stripped-down, Writer-only build to decrease the resulting WASM bytecode size. It removes the following code from the build: * All other major modules: Base, Calc, Chart, Draw, Impress and Math and related writerperfect filters * The premultiply tables * The (auto-)recovery functionality * All accessibility (but not the accessibility document checker) * The LanguageGuess component * EPUB support * The start center / BackingWindow * The TipOfTheDay functionality * The splash screen communication Currently crashs with anything different then soffice --writer. Closing the document also still crashes. FYI: many of these features are now behind ENABLE_WASM_STRIP_* defines, but they normally don't work on their own, globally! That's because we started with stripping the main components. Change-Id: Ib9c0f9452815910c0a2aceaf142ba1ad4a9cb0d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126182 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/Library_sfx.mk17
-rw-r--r--sfx2/source/appl/appserv.cxx6
-rw-r--r--sfx2/source/view/viewfrm.cxx8
-rw-r--r--sfx2/util/sfx.component1
-rw-r--r--sfx2/util/sfx.component.extended7
5 files changed, 35 insertions, 4 deletions
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index 51a34d510771..d790d9fef901 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -23,6 +23,10 @@ $(eval $(call gb_Library_add_sdi_headers,sfx,sfx2/sdi/sfxslots))
$(eval $(call gb_Library_set_componentfile,sfx,sfx2/util/sfx,services))
+$(eval $(call gb_Library_add_componentimpls,sfx, \
+ $(if $(ENABLE_WASM_STRIP_RECENT),,extended) \
+))
+
$(eval $(call gb_Library_set_precompiled_header,sfx,sfx2/inc/pch/precompiled_sfx))
$(eval $(call gb_Library_use_custom_headers,sfx,\
@@ -81,6 +85,15 @@ $(eval $(call gb_Library_use_externals,sfx,\
orcus-parser\
))
+ifneq ($(ENABLE_WASM_STRIP_RECENT),TRUE)
+$(eval $(call gb_Library_add_exception_objects,sfx,\
+ sfx2/source/dialog/backingcomp \
+ sfx2/source/dialog/backingwindow \
+ sfx2/source/control/recentdocsview \
+ sfx2/source/control/recentdocsviewitem \
+))
+endif
+
$(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/accessibility/AccessibilityCheck \
sfx2/source/accessibility/AccessibilityIssue \
@@ -142,8 +155,6 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/control/msg \
sfx2/source/control/msgpool \
sfx2/source/control/objface \
- sfx2/source/control/recentdocsview \
- sfx2/source/control/recentdocsviewitem \
sfx2/source/control/request \
sfx2/source/control/sfxstatuslistener \
sfx2/source/control/shell \
@@ -170,8 +181,6 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/devtools/DocumentModelTreeHandler \
sfx2/source/devtools/ObjectInspectorTreeHandler \
sfx2/source/dialog/alienwarn \
- sfx2/source/dialog/backingcomp \
- sfx2/source/dialog/backingwindow \
sfx2/source/dialog/basedlgs \
sfx2/source/dialog/checkin \
sfx2/source/dialog/dialoghelper \
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index b8c80823daf3..980d4cb057e9 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -18,6 +18,8 @@
*/
#include <config_features.h>
+#include <config_wasm_strip.h>
+
#include <com/sun/star/drawing/ModuleDispatcher.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/DispatchResultEvent.hpp>
@@ -504,6 +506,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
sfx2::openUriExternally(sURL, false, rReq.GetFrameWeld());
break;
}
+#if !ENABLE_WASM_STRIP_PINGUSER
case SID_GETINVOLVED:
{
// Open get involved/join us page based on locales
@@ -539,6 +542,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
sfx2::openUriExternally(sURL, false, rReq.GetFrameWeld());
break;
}
+#endif
case SID_SHOW_LICENSE:
{
LicenseDialog aDialog(rReq.GetFrameWeld());
@@ -618,6 +622,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
break;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+#if !ENABLE_WASM_STRIP_PINGUSER
case SID_TIPOFTHEDAY:
{
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
@@ -626,6 +631,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
bDone = true;
break;
}
+#endif
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
case SID_ABOUT:
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 7050dee85964..0c9a742158d2 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -18,6 +18,8 @@
*/
#include <config_feature_desktop.h>
+#include <config_wasm_strip.h>
+
#include <osl/file.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/infobar.hxx>
@@ -47,7 +49,9 @@
#include <vcl/stdtext.hxx>
#include <vcl/weld.hxx>
#include <vcl/weldutils.hxx>
+#if !ENABLE_WASM_STRIP_PINGUSER
#include <unotools/VersionConfig.hxx>
+#endif
#include <svtools/miscopt.hxx>
#include <tools/diagnose_ex.h>
#include <com/sun/star/container/XIndexAccess.hpp>
@@ -1396,6 +1400,7 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
rBind.Invalidate( SID_RELOAD );
rBind.Invalidate( SID_EDITDOC );
+#if !ENABLE_WASM_STRIP_PINGUSER
bool bIsHeadlessOrUITest = SfxApplication::IsHeadlessOrUITest(); //uitest.uicheck fails when the dialog is open
//what's new infobar
@@ -1476,6 +1481,7 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
officecfg::Setup::Product::LastTimeDonateShown::set(nNow, batch);
batch->commit();
}
+#endif
// read-only infobar if necessary
const SfxViewShell *pVSh;
@@ -1628,6 +1634,7 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
}
}
+#if !ENABLE_WASM_STRIP_PINGUSER
IMPL_LINK_NOARG(SfxViewFrame, WhatsNewHandler, weld::Button&, void)
{
GetDispatcher()->Execute(SID_WHATSNEW);
@@ -1642,6 +1649,7 @@ IMPL_LINK_NOARG(SfxViewFrame, DonationHandler, weld::Button&, void)
{
GetDispatcher()->Execute(SID_DONATION);
}
+#endif
IMPL_LINK(SfxViewFrame, SwitchReadOnlyHandler, weld::Button&, rButton, void)
{
diff --git a/sfx2/util/sfx.component b/sfx2/util/sfx.component
index a7c9930e0ec8..7970342db206 100644
--- a/sfx2/util/sfx.component
+++ b/sfx2/util/sfx.component
@@ -23,6 +23,7 @@
constructor="com_sun_star_comp_sfx2_BackingComp_get_implementation">
<service name="com.sun.star.frame.StartModule"/>
<service name="com.sun.star.frame.ProtocolHandler"/>
+ <optional/>
</implementation>
<implementation name="SfxDocumentMetaData"
constructor="SfxDocumentMetaData_get_implementation">
diff --git a/sfx2/util/sfx.component.extended b/sfx2/util/sfx.component.extended
new file mode 100644
index 000000000000..2695e06a0d1a
--- /dev/null
+++ b/sfx2/util/sfx.component.extended
@@ -0,0 +1,7 @@
+# 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/.
+
+com.sun.star.comp.sfx2.BackingComp