diff options
author | Armin Le Grand (Allotropia) <Armin.Le.Grand@me.com> | 2021-04-30 17:26:41 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2022-01-20 12:28:54 +0100 |
commit | 02140554ee1d70b219a42546191e2219d58be4b0 (patch) | |
tree | 3dd419dbdd0c23676c7f749bd8a83d09ad26c8bd /svx/source/dialog/charmap.cxx | |
parent | 02634fb7c7e8dc613ffc3717bb244f85cf81a7c6 (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 'svx/source/dialog/charmap.cxx')
-rw-r--r-- | svx/source/dialog/charmap.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx index fd72c77d52d6..3617e48a82c8 100644 --- a/svx/source/dialog/charmap.cxx +++ b/svx/source/dialog/charmap.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_wasm_strip.h> + #include <vcl/event.hxx> #include <vcl/fontcharmap.hxx> #include <vcl/svapp.hxx> @@ -732,6 +734,7 @@ void SvxShowCharSet::SelectIndex(int nNewIndex, bool bFocus) if( nSelectedIndex >= 0 ) { getSelectedChar() = mxFontCharMap->GetCharFromIndex( nSelectedIndex ); +#if !ENABLE_WASM_STRIP_ACCESSIBILITY if( m_xAccessible.is() ) { svx::SvxShowCharSetItem* pItem = ImplGetItem(nSelectedIndex); @@ -751,6 +754,7 @@ void SvxShowCharSet::SelectIndex(int nNewIndex, bool bFocus) aNewAny <<= AccessibleStateType::SELECTED; pItem->m_xItem->fireEvent( AccessibleEventId::STATE_CHANGED, aOldAny, aNewAny ); } +#endif } aHighHdl.Call( this ); } @@ -785,6 +789,7 @@ IMPL_LINK_NOARG(SvxShowCharSet, VscrollHdl, weld::ScrolledWindow&, void) } else if( nSelectedIndex > LastInView() ) { +#if !ENABLE_WASM_STRIP_ACCESSIBILITY if( m_xAccessible.is() ) { css::uno::Any aOldAny, aNewAny; @@ -795,6 +800,7 @@ IMPL_LINK_NOARG(SvxShowCharSet, VscrollHdl, weld::ScrolledWindow&, void) m_xAccessible ->fireEvent( AccessibleEventId::CHILD, aOldAny, aNewAny ); } } +#endif SelectIndex( (LastInView() - COLUMN_COUNT + 1) + (nSelectedIndex % COLUMN_COUNT) ); } @@ -803,18 +809,22 @@ IMPL_LINK_NOARG(SvxShowCharSet, VscrollHdl, weld::ScrolledWindow&, void) SvxShowCharSet::~SvxShowCharSet() { +#if !ENABLE_WASM_STRIP_ACCESSIBILITY if (m_xAccessible.is()) { m_aItems.clear(); m_xAccessible->clearCharSetControl(); m_xAccessible.clear(); } +#endif } css::uno::Reference< XAccessible > SvxShowCharSet::CreateAccessible() { +#if !ENABLE_WASM_STRIP_ACCESSIBILITY OSL_ENSURE(!m_xAccessible.is(),"Accessible already created!"); m_xAccessible = new svx::SvxShowCharSetAcc(this); +#endif return m_xAccessible; } @@ -823,7 +833,9 @@ svx::SvxShowCharSetItem* SvxShowCharSet::ImplGetItem( int _nPos ) ItemsMap::iterator aFind = m_aItems.find(_nPos); if ( aFind == m_aItems.end() ) { +#if !ENABLE_WASM_STRIP_ACCESSIBILITY OSL_ENSURE(m_xAccessible.is(), "Who wants to create a child of my table without a parent?"); +#endif auto xItem = std::make_shared<svx::SvxShowCharSetItem>(*this, m_xAccessible.get(), sal::static_int_cast< sal_uInt16 >(_nPos)); aFind = m_aItems.emplace(_nPos, xItem).first; |