[Libreoffice-commits] core.git: Branch 'private/jmux/current-reorga' - 125 commits - android/default-document basctl/Library_basctl.mk basegfx/source basic/qa basic/source bin/find-can-be-private-symbols.functions.results bin/gbuild-to-ide bin/oss-fuzz-setup.sh bin/run bin/update_pch_autotune.sh bridges/Library_cpp_uno.mk bridges/Module_bridges.mk bridges/source canvas/Module_canvas.mk canvas/source chart2/Library_chartcontroller.mk chart2/qa chart2/source comphelper/source compilerplugins/clang config_host/config_wasm_strip.h.in config_host.mk.in configmgr/source configure.ac connectivity/Library_postgresql-sdbc-impl.mk connectivity/source cppuhelper/source cppu/source cpputools/Module_cpputools.mk cui/Library_cui.mk cui/source cui/uiconfig cui/UIConfig_cui.mk desktop/CustomTarget_soffice.mk desktop/Executable_soffice_bin.mk desktop/inc desktop/Library_deployment.mk desktop/Module_desktop.mk desktop/Package_scripts.mk desktop/Pagein_common.mk desktop/scripts desktop/source distro-configs/LibreOf ficeWASM32.conf drawinglayer/Library_drawinglayer.mk editeng/Library_editeng.mk editeng/source emfio/source extensions/Module_extensions.mk extensions/source external/boost external/cairo external/fontconfig external/hunspell external/hyphen external/libnumbertext external/Module_external.mk extras/Module_extras.mk filter/source framework/Library_fwk.mk framework/source framework/util helpcompiler/Module_helpcompiler.mk helpcontent2 i18npool/source icon-themes/breeze icon-themes/breeze_dark icon-themes/colibre icon-themes/elementary icon-themes/karasa_jaga icon-themes/sifr icon-themes/sifr_dark icon-themes/sukapura include/comphelper include/editeng include/sal include/sfx2 include/svx include/toolkit include/tools include/vcl include/xmloff jvmfwk/inc lingucomponent/Library_guesslang.mk lingucomponent/Module_lingucomponent.mk m4/libo_externals.m4 Makefile.gbuild Makefile.in offapi/com offapi/UnoApi_offapi.mk officecfg/README.md officecfg/registry oox/Library_oox.mk oox/source osx/s office.xcodeproj package/source postprocess/Module_postprocess.mk postprocess/Rdb_services.mk registry/Module_registry.mk reportdesign/inc reportdesign/source RepositoryExternal.mk RepositoryFixes.mk Repository.mk RepositoryModule_host.mk sal/cppunittester sal/Library_cppunitmain.mk sal/Library_sal.mk sal/Module_sal.mk sal/osl sal/rtl sax/source schema/libreoffice sc/inc sc/qa sc/source sc/uiconfig sdext/source sd/inc sd/Library_sd.mk sd/qa sd/source sfx2/Library_sfx.mk sfx2/source sfx2/util shell/Library_syssh.mk shell/Module_shell.mk shell/source slideshow/source solenv/bin solenv/flatpak-manifest.in solenv/gbuild static/CustomTarget_components.mk static/CustomTarget_wasm_fs_image.mk static/environment.js static/Library_components.mk static/Makefile static/Module_static.mk static/README static/soffice_args.js svx/Library_svxcore.mk svx/Library_svx.mk svx/Module_svx.mk svx/source svx/util sw/inc sw/Library_sw.mk sw/qa sw/source toolkit/inc toolkit/source ucb/source unotools/Library _utl.mk ure/Package_install.mk vcl/headless vcl/inc vcl/Library_vcl.mk vcl/Module_vcl.mk vcl/osx vcl/qa vcl/qt5 vcl/quartz vcl/skia vcl/source vcl/unx vcl/win wasm-qt/Module_wasm-qt.mk wizards/source writerfilter/source writerperfect/Library_wpftwriter.mk writerperfect/Module_writerperfect.mk writerperfect/source xmloff/CppunitTest_xmloff_draw.mk xmloff/Library_xof.mk xmloff/Library_xo.mk xmloff/qa xmloff/source xmloff/util xmlsecurity/Library_xmlsecurity.mk xmlsecurity/Library_xsec_xmlsec.mk xmlsecurity/Module_xmlsecurity.mk xmlsecurity/util

Fri, 10 Dec 2021 05:29:01 -0800

Rebased ref, commits from common ancestor:
commit 77cb655a60a238100b4942b9a41a1a989031c39c
Author:     Jan-Marek Glogowski <[email protected]>
AuthorDate: Fri Dec 10 13:19:27 2021 +0100
Commit:     Jan-Marek Glogowski <[email protected]>
CommitDate: Fri Dec 10 14:09:13 2021 +0100

    catchall
    
    Change-Id: I61e9916a667a92e6bd5489e5ed1d1dead2a61765

diff --git a/basic/source/runtime/methods1.cxx 
b/basic/source/runtime/methods1.cxx
index 8e78776bc7f8..fca27708962a 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -2973,13 +2973,6 @@ void SbRtl_CompatibilityMode(StarBASIC *, SbxArray & 
rPar, bool)
     rPar.Get(0)->PutBool(bEnabled);
 }
 
-bool LibreOffice6FloatingPointMode()
-{
-    static bool bMode = std::getenv("LIBREOFFICE6FLOATINGPOINTMODE") != 
nullptr;
-
-    return bMode || 
officecfg::Office::Scripting::Basic::Compatibility::UseLibreOffice6FloatingPointConversion::get();
-}
-
 void SbRtl_Input(StarBASIC *, SbxArray & rPar, bool)
 {
     // 2 parameters needed
@@ -3030,7 +3023,14 @@ void SbRtl_Me(StarBASIC *, SbxArray & rPar, bool)
         refVar->PutObject( pClassModuleObject );
 }
 
-#endif
+#endif // HAVE_FEATURE_SCRIPTING
+
+bool LibreOffice6FloatingPointMode()
+{
+    static bool bMode = std::getenv("LIBREOFFICE6FLOATINGPOINTMODE") != 
nullptr;
+
+    return bMode || 
officecfg::Office::Scripting::Basic::Compatibility::UseLibreOffice6FloatingPointConversion::get();
+}
 
 sal_Int16 implGetWeekDay( double aDate, bool bFirstDayParam, sal_Int16 
nFirstDay )
 {
diff --git a/config_host/config_wasm_strip.h.in 
b/config_host/config_wasm_strip.h.in
index 0e74a2a568ad..fe3d8b908eca 100644
--- a/config_host/config_wasm_strip.h.in
+++ b/config_host/config_wasm_strip.h.in
@@ -17,7 +17,7 @@
 #define ENABLE_WASM_STRIP_PINGUSER
 #define ENABLE_WASM_STRIP_PREMULTIPLY
 #define ENABLE_WASM_STRIP_RECENT
-#define ENABLE_WASM_STRIP_RECOVERYUI
+// #define ENABLE_WASM_STRIP_RECOVERYUI
 #define ENABLE_WASM_STRIP_SPLASH
 #define ENABLE_WASM_STRIP_SWEXPORTS
 #endif
diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx
index af21518abd78..53020a9d21c1 100644
--- a/configmgr/source/xcuparser.cxx
+++ b/configmgr/source/xcuparser.cxx
@@ -286,7 +286,7 @@ void XcuParser::handleComponentData(xmlreader::XmlReader & 
reader) {
         data_.getComponents().findNode(valueParser_.getLayer(),
                                        componentName_));
     if (!node.is()) {
-        SAL_WARN(
+        SAL_INFO(
             "configmgr",
             "unknown component \"" << componentName_ << "\" in \""
                 << reader.getUrl() << '"');
@@ -898,7 +898,7 @@ void XcuParser::handleSetNode(xmlreader::XmlReader & 
reader, SetNode * set) {
     switch (op) {
     case OPERATION_MODIFY:
         if (i == members.end()) {
-            SAL_WARN(
+            SAL_INFO(
                 "configmgr",
                 "ignoring modify of unknown set member node \"" << name
                     << "\" in \"" << reader.getUrl() << '"');
diff --git a/configure.ac b/configure.ac
index 5c554c4ca35a..a5c55e8d6e04 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3038,7 +3038,7 @@ ENABLE_SERVICES_RDB_FROM_BUILD=
 if test "$enable_services_rdb_from_build" = yes; then
     ENABLE_SERVICES_RDB_FROM_BUILD=TRUE
     if test -n "$with_locales" -a "$with_locales" != en -a "$with_locales" != 
ALL; then
-        AC_MSG_ERROR([Currently just --with-locales=all or en is supported 
with --enable-services-rdb-from-build])
+        AC_MSG_ERROR([Currently just --with-locales=ALL or en is supported 
with --enable-services-rdb-from-build])
     fi
 fi
 AC_SUBST(ENABLE_SERVICES_RDB_FROM_BUILD)
diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx
index f2e8a27581ab..f19d8e725e4f 100644
--- a/cppu/source/uno/lbenv.cxx
+++ b/cppu/source/uno/lbenv.cxx
@@ -1002,7 +1002,6 @@ void EnvironmentsData::getRegisteredEnvironments(
 bool loadEnv(OUString const  & cLibStem,
                     uno_Environment * pEnv)
 {
-#ifndef __EMSCRIPTEN__
 #ifdef DISABLE_DYNLOADING
     uno_initEnvironmentFunc fpInit;
 
@@ -1042,11 +1041,6 @@ bool loadEnv(OUString const  & cLibStem,
 
     (*fpInit)( pEnv ); // init of environment
     return true;
-#else
-    (void)cLibStem;
-    (void)pEnv;
-    return false;
-#endif
 }
 
 }
diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx
index a670e3bcc820..43818eb85025 100644
--- a/cppu/source/uno/lbmap.cxx
+++ b/cppu/source/uno/lbmap.cxx
@@ -328,10 +328,8 @@ static void setNegativeBridge( const OUString & 
rBridgeName )
 
 static uno_ext_getMappingFunc selectMapFunc( const OUString & rBridgeName )
 {
-#ifndef EMSCRIPTEN
     if (rBridgeName.equalsAscii( CPPU_CURRENT_LANGUAGE_BINDING_NAME "_uno" ))
         return CPPU_ENV_uno_ext_getMapping;
-#endif
 #if HAVE_FEATURE_JAVA
     if (rBridgeName.equalsAscii( "java" "_uno" ))
         return java_uno_ext_getMapping;
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index d67cdd3f9aa7..01647789881b 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1514,8 +1514,8 @@ 
AbstractDialogFactory_Impl::CreateTipOfTheDayDialog(weld::Window* pParent)
 VclPtr<VclAbstractDialog>
 AbstractDialogFactory_Impl::CreateToolbarmodeDialog(weld::Window* pParent)
 {
-    return VclPtr<CuiAbstractController_Impl>::Create(
-        std::make_unique<ToolbarmodeDialog>(pParent));
+    return VclPtr<CuiAbstractControllerAsync_Impl>::Create(
+        std::make_shared<ToolbarmodeDialog>(pParent));
 }
 
 VclPtr<AbstractDiagramDialog>
diff --git a/desktop/CustomTarget_soffice.mk b/desktop/CustomTarget_soffice.mk
index c7ac35e46f9b..e493d061b4cd 100644
--- a/desktop/CustomTarget_soffice.mk
+++ b/desktop/CustomTarget_soffice.mk
@@ -13,7 +13,7 @@ $(call gb_CustomTarget_get_target,desktop/soffice) : \
        $(call gb_CustomTarget_get_workdir,desktop/soffice)/soffice.sh
 
 $(call gb_CustomTarget_get_workdir,desktop/soffice)/soffice.sh : \
-    $(SRCDIR)/desktop/scripts/soffice$(if $(DISABLE_DYNLOADING),_nodyn).sh \
+    $(SRCDIR)/desktop/scripts/soffice.sh \
     $(BUILDDIR)/config_host.mk \
                | $(call gb_CustomTarget_get_workdir,desktop/soffice)/.dir
        $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),SED,1)
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 3df0efe8ed34..51c19fa19323 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -2003,7 +2003,6 @@ void Desktop::OpenClients()
         handleCrashReport();
 #endif
 
-#if 0
     if ( ! bAllowRecoveryAndSessionManagement )
     {
         try
@@ -2080,7 +2079,6 @@ void Desktop::OpenClients()
             }
         }
     }
-#endif
 
     // write this information here to avoid depending on vcl in the crash 
reporter lib
     CrashReporter::addKeyValue("Language", 
Application::GetSettings().GetLanguageTag().getBcp47(), CrashReporter::Create);
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 30f813d0df3c..8dcb90caac4d 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -953,7 +953,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
             SfxAbstractDialogFactory* pFact = 
SfxAbstractDialogFactory::Create();
             ScopedVclPtr<VclAbstractDialog> pDlg(
                 pFact->CreateToolbarmodeDialog(rReq.GetFrameWeld()));
-            pDlg->Execute();
+            pDlg->StartExecuteAsync(nullptr);
             bDone = true;
             break;
         }
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 7dd13bdeb912..36d63319405e 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -29,6 +29,7 @@
 #include <boost/property_tree/json_parser.hpp>
 
 #include <com/sun/star/awt/PopupMenuDirection.hpp>
+#include <com/sun/star/awt/XPopupMenuAsync.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/frame/XDispatchRecorderSupplier.hpp>
 #include <com/sun/star/frame/XLayoutManager.hpp>
@@ -1697,19 +1698,27 @@ struct SfxDispatcherPopupFinish final
     css::uno::Reference<css::frame::XPopupMenuController> m_xPopupController;
     std::function<void(sal_Int16)> m_aCloseFunc;
     rtl::Reference<::svt::DialogClosedListener> m_xDialogListener;
-    VclPtr<PopupMenu> m_pPopupMenu;
+    css::uno::Reference<css::awt::XPopupMenu> m_xPopupMenu;
 
     DECL_LINK(PopupClosedHdl, css::ui::dialogs::DialogClosedEvent*, void);
 
     
SfxDispatcherPopupFinish(css::uno::Reference<css::frame::XPopupMenuController> 
xPopupController,
-                             const std::function<void(sal_Int16)>& rCloseFunc, 
PopupMenu& rVCLMenu)
+                             const std::function<void(sal_Int16)>& rCloseFunc,
+                             css::uno::Reference<css::awt::XPopupMenu> 
xPopupMenu)
         : m_xPopupController(xPopupController)
         , m_aCloseFunc(rCloseFunc)
         , m_xDialogListener(new ::svt::DialogClosedListener())
-        , m_pPopupMenu(&rVCLMenu)
+        , m_xPopupMenu(xPopupMenu)
     {
         m_xDialogListener->SetDialogClosedLink(LINK(this, 
SfxDispatcherPopupFinish, PopupClosedHdl));
     }
+
+    void Finish(sal_Int16 nResult)
+    {
+         css::uno::Reference<css::uno::XInterface> xInterface(m_xPopupMenu, 
css::uno::UNO_QUERY);
+         css::ui::dialogs::DialogClosedEvent aEvt(xInterface, nResult);
+         m_xDialogListener->dialogClosed(aEvt);
+    }
 };
 
 IMPL_LINK(SfxDispatcherPopupFinish, PopupClosedHdl, 
css::ui::dialogs::DialogClosedEvent*, pEvt, void)
@@ -1722,8 +1731,11 @@ IMPL_LINK(SfxDispatcherPopupFinish, PopupClosedHdl, 
css::ui::dialogs::DialogClos
     css::uno::Reference<css::lang::XComponent> xComponent(m_xPopupController, 
css::uno::UNO_QUERY);
     if (xComponent.is())
         xComponent->dispose();
-    m_pPopupMenu->Finish();
-    m_pPopupMenu.disposeAndClear();
+
+    VCLXMenu* pAwtMenu = comphelper::getFromUnoTunnel<VCLXMenu>(m_xPopupMenu);
+    PopupMenu* pPopupMenu = static_cast< PopupMenu*>(pAwtMenu->GetMenu());
+    pPopupMenu->Finish();
+
     SfxDispatcher_Impl::m_pActivePopupController = nullptr;
     delete this;
 }
@@ -1815,15 +1827,11 @@ void SfxDispatcher::ExecutePopup( const OUString& 
rResName, vcl::Window* pWin, c
             const sal_Int16 nFlags = 
css::awt::PopupMenuDirection::EXECUTE_DOWN;
             const css::awt::Rectangle aRect(aPos.X(), aPos.Y(), 1, 1);
             css::uno::Reference<css::awt::XWindowPeer> 
xParent(aEvent.SourceWindow, css::uno::UNO_QUERY);
-            css::uno::Reference<css::awt::XPopupMenuAsync 
xAsyncPopup(xPopupMenu, css::uno::UNO_QUERY);
-            pFin = new SfxDispatcherPopupFinish(xPopupController, rCloseFunc, 
*pVCLMenu);
+            css::uno::Reference<css::awt::XPopupMenuAsync> 
xAsyncPopup(xPopupMenu, css::uno::UNO_QUERY);
+            pFin = new SfxDispatcherPopupFinish(xPopupController, rCloseFunc, 
xPopupMenu);
             SfxDispatcher_Impl::m_pActivePopupController = 
&pFin->m_xPopupController;
-            if (!rCloseFunc || !xAsyncPopup.is() || 
!xAsyncPopup->popup(pWindow, aRect, nFlags, pFin->m_xDialogListener))
-            {
-                css::uno::Reference<css::uno::XInterface> 
xInterface(*pAwtMenu, css::uno::UNO_QUERY);
-                css::ui::dialogs::DialogClosedEvent aEvt(xInterface, 
xPopupMenu->execute(xParent, aRect, nFlags));
-                pFin->m_xDialogListener->dialogClosed(aEvt);
-            }
+            if (!rCloseFunc || !xAsyncPopup.is() || 
!xAsyncPopup->popup(xParent, aRect, nFlags, pFin->m_xDialogListener))
+                pFin->Finish(xPopupMenu->execute(xParent, aRect, nFlags));
         }
     }
 
diff --git a/solenv/bin/image-sort.py b/solenv/bin/image-sort.py
index 75b5da6ce0e7..5d248684b4a6 100644
--- a/solenv/bin/image-sort.py
+++ b/solenv/bin/image-sort.py
@@ -30,7 +30,7 @@ def read_icons(fname):
     full_path = os.path.join(args.base_path, fname)
     if not os.path.exists(full_path):
         if not args.quiet:
-            print("Skipping non-existent {}\n".format(full_path), 
file=sys.stderr)
+            print("Skipping non-existent {}".format(full_path), 
file=sys.stderr)
         return images
     with open(full_path) as fp:
         for line in fp:
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk 
b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 2f254057c957..fd96be05f17e 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -22,7 +22,7 @@ gb_EMSCRIPTEN_CPPFLAGS := -pthread -s USE_PTHREADS=1
 # To keep the link time (and memory) down, prevent all rewriting options from 
wasm-emscripten-finalize
 # See emscrypten.py, finalize_wasm, modify_wasm = True
 # So we need WASM_BIGINT=1 and ASSERTIONS=1 (2 implies STACK_OVERFLOW_CHECK)
-gb_EMSCRIPTEN_LDFLAGS := $(gb_EMSCRIPTEN_CPPFLAGS) --bind -s TOTAL_MEMORY=1GB 
-s PTHREAD_POOL_SIZE=4 -s FORCE_FILESYSTEM=1 -s WASM_BIGINT=1 -s 
ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s 
EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16"]
+gb_EMSCRIPTEN_LDFLAGS := $(gb_EMSCRIPTEN_CPPFLAGS) --bind -s 
TOTAL_MEMORY=512MB -s PTHREAD_POOL_SIZE=4 -s FORCE_FILESYSTEM=1 -s 
WASM_BIGINT=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s 
EXIT_RUNTIME=0 -s EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16"]
 gb_EMSCRIPTEN_QTDEFS := -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS 
-DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG 
-DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
 
 gb_Executable_EXT := .html
diff --git a/static/CustomTarget_wasm_fs_image.mk 
b/static/CustomTarget_wasm_fs_image.mk
index ff7182b6d203..c7f4ff76f930 100644
--- a/static/CustomTarget_wasm_fs_image.mk
+++ b/static/CustomTarget_wasm_fs_image.mk
@@ -1146,6 +1146,23 @@ gb_wasm_image_filelist := \
     $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fontconfig/conf.d/90-synthetic.conf \
     $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fontconfig/fonts.conf \
     $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/fc_local.conf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/gallery/fontwork.sdg \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/gallery/fontwork.sdv \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/gallery/fontwork.thm \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/liblangtag/common/bcp47/calendar.xml \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/liblangtag/common/bcp47/collation.xml \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/liblangtag/common/bcp47/currency.xml \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/liblangtag/common/bcp47/number.xml \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/liblangtag/common/bcp47/timezone.xml \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/liblangtag/common/bcp47/transform_ime.xml 
\
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/liblangtag/common/bcp47/transform_keyboard.xml 
\
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/liblangtag/common/bcp47/transform_mt.xml \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/liblangtag/common/bcp47/transform_private_use.xml
 \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/liblangtag/common/bcp47/transform.xml \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/liblangtag/common/bcp47/variant.xml \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/liblangtag/common/supplemental/likelySubtags.xml
 \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/liblangtag/common/supplemental/supplementalMetadata.xml
 \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/liblangtag/language-subtag-registry.xml \
     $(INSTROOT)/$(LIBO_SHARE_FOLDER)/registry/cjk.xcd \
     $(INSTROOT)/$(LIBO_SHARE_FOLDER)/registry/ctlseqcheck.xcd \
     $(INSTROOT)/$(LIBO_SHARE_FOLDER)/registry/ctl.xcd \
@@ -1169,6 +1186,7 @@ gb_wasm_image_filelist := \
     $(INSTROOT)/$(LIBO_SHARE_RESOURCE_FOLDER)/common/fonts/opens___.ttf \
     $(INSTROOT)/$(LIBO_URE_ETC_FOLDER)/$(call gb_Helper_get_rcfile,uno) \
     $(INSTROOT)/$(LIBO_URE_MISC_FOLDER)/services.rdb \
+    $(SRCDIR)/android/default-document/example3.odt \
     $(SRCDIR)/android/default-document/example.odt \
 
 ifneq ($(filter MORE_FONTS,$(BUILD_TYPE)),)
@@ -1413,7 +1431,7 @@ gb_wasm_image_filelist += \
     
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/schart/ui/tp_Trendline.ui
 \
     
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/schart/ui/wizelementspage.ui
 \
 
-endif
+endif # !ENABLE_WASM_STRIP_CHART
 
 wasm_fs_image_WORKDIR := $(call 
gb_CustomTarget_get_workdir,static/wasm_fs_image)
 
diff --git a/static/soffice_args.js b/static/soffice_args.js
index 4db43905aa07..df6d394f7b4b 100644
--- a/static/soffice_args.js
+++ b/static/soffice_args.js
@@ -1 +1,4 @@
-Module['arguments'] = ['/android/default-document/example.odt'];
+Module['arguments'] = [
+    '--norestore',
+    '/android/default-document/example.odt'
+];
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index 54f7bceea9cb..945e495d80ce 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -36,7 +36,7 @@ $(eval $(call gb_Module_add_targets,vcl,\
         Package_skia_denylist ) \
     $(if $(filter DESKTOP,$(BUILD_TYPE)), \
         StaticLibrary_vclmain \
-        $(if $(or $(DISABLE_GUI),$(DISABLE_DYNLOADING)),Executable_vcldemo, \
+        $(if $(or $(DISABLE_GUI),$(DISABLE_DYNLOADING)),, \
             $(if $(ENABLE_MACOSX_SANDBOX),, \
                 Executable_ui-previewer) \
             $(if $(filter LINUX MACOSX SOLARIS WNT %BSD,$(OS)), \
diff --git a/vcl/inc/qt5/QtInstance.hxx b/vcl/inc/qt5/QtInstance.hxx
index 674ba87428c1..c16dc1d03bc6 100644
--- a/vcl/inc/qt5/QtInstance.hxx
+++ b/vcl/inc/qt5/QtInstance.hxx
@@ -74,6 +74,7 @@ private Q_SLOTS:
     bool ImplYield(bool bWait, bool bHandleAllCurrentEvents);
     static void deleteObjectLater(QObject* pObject);
     static void localeChanged();
+    void virtualGeometryChanged(const QRect& rect);
 
 Q_SIGNALS:
     bool ImplYieldSignal(bool bWait, bool bHandleAllCurrentEvents);
diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx
index 7c066c92f7f7..022915837d3c 100644
--- a/vcl/qt5/QtFrame.cxx
+++ b/vcl/qt5/QtFrame.cxx
@@ -149,10 +149,10 @@ QtFrame::QtFrame(QtFrame* pParent, SalFrameStyleFlags 
nStyle, bool bUseCairo)
         else if (nStyle & SalFrameStyleFlags::TOOLTIP)
             aWinFlags = Qt::ToolTip;
         // Can't use Qt::Popup, because it grabs the input focus and generates
-        // a focus-out event, reaching the combo box. This used to map to
-        // Qt::ToolTip, which doesn't feel that correct...
+        // a focus-out event, reaching the combo box. So we could also use
+        // aWinFlags = Qt::Window | Qt::FramelessWindowHint | 
Qt::BypassWindowManagerHint;
         else if (isPopup())
-            aWinFlags = Qt::Window | Qt::FramelessWindowHint | 
Qt::BypassWindowManagerHint;
+            aWinFlags = Qt::ToolTip | Qt::FramelessWindowHint;
         else if (nStyle & SalFrameStyleFlags::TOOLWINDOW)
             aWinFlags = Qt::Tool;
         // top level windows can't be transient in Qt, so make them dialogs, 
if they have a parent. At least
@@ -176,8 +176,8 @@ QtFrame::QtFrame(QtFrame* pParent, SalFrameStyleFlags 
nStyle, bool bUseCairo)
 
     if (pParent && !(pParent->m_nStyle & SalFrameStyleFlags::PLUG))
     {
-        QWindow* pParentWindow = 
pParent->GetQWidget()->window()->windowHandle();
-        QWindow* pChildWindow = asChild()->window()->windowHandle();
+        QWindow* pParentWindow = pParent->windowHandle();
+        QWindow* pChildWindow = windowHandle();
         if (pParentWindow && pChildWindow && (pParentWindow != pChildWindow))
             pChildWindow->setTransientParent(pParentWindow);
     }
@@ -351,7 +351,11 @@ QWindow* QtFrame::windowHandle() const
 {
     // set attribute 'Qt::WA_NativeWindow' first to make sure a window handle 
actually exists
     QWidget* pChild = asChild();
+    assert(pChild->window() == pChild);
+#ifndef EMSCRIPTEN
+    // no idea, why this breaks the menubar for EMSCRIPTEN
     pChild->setAttribute(Qt::WA_NativeWindow);
+#endif
     return pChild->windowHandle();
 }
 
@@ -430,21 +434,27 @@ void QtFrame::modalReparent(bool bVisible)
 
     if (!bVisible)
     {
-        m_pQWidget->setParent(m_pParent ? m_pParent->asChild() : nullptr,
-                              m_pQWidget->windowFlags());
+        QWidget* pNewParent = m_pParent ? m_pParent->asChild() : nullptr;
+        if (pNewParent != m_pQWidget->parent())
+            m_pQWidget->setParent(pNewParent, m_pQWidget->windowFlags());
         return;
     }
 
     if (!QGuiApplication::modalWindow())
         return;
 
+    if (m_pParent->windowHandle() == QGuiApplication::modalWindow())
+        return;
+
     QtInstance* pInst = static_cast<QtInstance*>(GetSalData()->m_pInstance);
     for (auto* pFrame : pInst->getFrames())
     {
-        QWidget* pQWidget = static_cast<QtFrame*>(pFrame)->asChild();
-        if (pQWidget->windowHandle() == QGuiApplication::modalWindow())
+        QtFrame* pQtFrame = static_cast<QtFrame*>(pFrame);
+        if (pQtFrame->windowHandle() == QGuiApplication::modalWindow())
         {
-            m_pQWidget->setParent(pQWidget, m_pQWidget->windowFlags());
+            QWidget* pNewParent = pQtFrame->asChild();
+            if (pNewParent != m_pQWidget->parent())
+                m_pQWidget->setParent(pNewParent, m_pQWidget->windowFlags());
             break;
         }
     }
@@ -462,7 +472,7 @@ void QtFrame::Show(bool bVisible, bool bNoActivate)
     if (!bVisible) // hide
     {
         pSalInst->RunInMainThread([this]() {
-            asChild()->hide();
+            asChild()->setVisible(false);
             if (m_pQWidget->isModal())
                 modalReparent(false);
         });
@@ -477,9 +487,9 @@ void QtFrame::Show(bool bVisible, bool bNoActivate)
         QWidget* const pChild = asChild();
         if (m_pQWidget->isModal())
             modalReparent(true);
-        pChild->show();
+        pChild->setVisible(true);
         pChild->raise();
-        if (!bNoActivate && !isPopup())
+        if (!bNoActivate)
         {
             pChild->activateWindow();
             pChild->setFocus();
diff --git a/vcl/qt5/QtInstance.cxx b/vcl/qt5/QtInstance.cxx
index 00cff01f0d74..6074d8ada93e 100644
--- a/vcl/qt5/QtInstance.cxx
+++ b/vcl/qt5/QtInstance.cxx
@@ -40,6 +40,7 @@
 
 #include <QtCore/QAbstractEventDispatcher>
 #include <QtCore/QThread>
+#include <QtGui/QScreen>
 #include <QtWidgets/QApplication>
 #include <QtWidgets/QWidget>
 
@@ -248,6 +249,10 @@ QtInstance::QtInstance(std::unique_ptr<QApplication>& 
pQApp, bool bUseCairo)
     connect(QGuiApplication::inputMethod(), &QInputMethod::localeChanged, this,
             &QtInstance::localeChanged);
 
+    for (const QScreen* pCurScreen : QApplication::screens())
+        connect(pCurScreen, &QScreen::virtualGeometryChanged, this,
+                &QtInstance::virtualGeometryChanged);
+
 #ifndef EMSCRIPTEN
     m_bSupportsOpenGL = true;
 #endif
@@ -602,6 +607,13 @@ void* QtInstance::CreateGStreamerSink(const 
SystemChildWindow* pWindow)
 #endif
 }
 
+void QtInstance::virtualGeometryChanged(const QRect&)
+{
+    SalFrame* pAnyFrame = anyFrame();
+    if (pAnyFrame)
+        pAnyFrame->CallCallback(SalEvent::DisplayChanged, nullptr);
+}
+
 void QtInstance::AllocFakeCmdlineArgs(std::unique_ptr<char* []>& rFakeArgv,
                                       std::unique_ptr<int>& rFakeArgc,
                                       std::vector<FreeableCStr>& 
rFakeArgvFreeable)
diff --git a/vcl/qt5/QtWidget.cxx b/vcl/qt5/QtWidget.cxx
index 3078a7133764..edad48d660f8 100644
--- a/vcl/qt5/QtWidget.cxx
+++ b/vcl/qt5/QtWidget.cxx
@@ -630,7 +630,10 @@ QtWidget::QtWidget(QtFrame& rFrame, Qt::WindowFlags f)
 {
     create();
     setMouseTracking(true);
-    setFocusPolicy(Qt::StrongFocus);
+    if (!rFrame.isPopup())
+        setFocusPolicy(Qt::StrongFocus);
+    else
+        setFocusPolicy(Qt::ClickFocus);
 }
 
 static ExtTextInputAttr lcl_MapUndrelineStyle(QTextCharFormat::UnderlineStyle 
us)
diff --git a/xmloff/Library_xo.mk b/xmloff/Library_xo.mk
index 7486996d194b..ec98dc671fb6 100644
--- a/xmloff/Library_xo.mk
+++ b/xmloff/Library_xo.mk
@@ -21,9 +21,9 @@ $(eval $(call gb_Library_Library,xo))
 
 $(eval $(call gb_Library_set_componentfiles,xo, \
     xmloff/util/xo \
+    xmloff/util/xo.draw \
     $(if $(ENABLE_WASM_STRIP_CHART),,xmloff/util/xo.chart) \
     $(if $(ENABLE_WASM_STRIP_BASIC_CALC_DRAW_MATH_IMPRESS),, \
-        xmloff/util/xo.draw \
         xmloff/util/xo.impress \
         xmloff/util/xo.writer \
     ) \
commit bab898c7c9e1f7e39c5ac22fdcf823c7dbc493b6
Author:     Jan-Marek Glogowski <[email protected]>
AuthorDate: Wed Nov 17 01:57:33 2021 +0100
Commit:     Jan-Marek Glogowski <[email protected]>
CommitDate: Fri Dec 10 13:05:38 2021 +0100

    WIP: async popup menus
    
    A first patch to get some feedback. Asnyc LO popup menus are still
    buggy, as I'm not sure where to call the PopupMenu::Finish for
    them.
    
    Also the XDialogClosedListener is currently just for convenience
    and might want some separate notifier.
    
    Fun fact, that ImplExecute / ImplPopup is called for submenu, but
    then doesn't execute. And generally the naming of some variables
    is IMHO wrong; I might also prefix Menu members with "m_" for
    easier readability.
    
    Change-Id: Id8b413aa6b4699201e58db0113649c6b224d33b6

diff --git a/include/sfx2/dispatch.hxx b/include/sfx2/dispatch.hxx
index 6e87c89217f4..0f6cbeb55fdc 100644
--- a/include/sfx2/dispatch.hxx
+++ b/include/sfx2/dispatch.hxx
@@ -20,6 +20,7 @@
 #define INCLUDED_SFX2_DISPATCH_HXX
 
 #include <memory>
+#include <functional>
 #include <sal/config.h>
 #include <sfx2/dllapi.h>
 #include <sfx2/toolbarids.hxx>
@@ -42,6 +43,7 @@ class Point;
 struct SfxDispatcher_Impl;
 
 namespace vcl { class Window; }
+namespace com::sun::star::ui::dialogs { struct DialogClosedEvent; }
 
 enum class SfxDispatcherPopFlags
 {
@@ -136,8 +138,14 @@ public:
     SfxViewFrame*       GetFrame() const;
     SfxModule*          GetModule() const;
 
-    void                ExecutePopup( const OUString &rResName, vcl::Window 
*pWin = nullptr, const Point *pPos = nullptr );
-    static void         ExecutePopup( vcl::Window *pWin = nullptr, const Point 
*pPosPixel = nullptr );
+    /**
+     * @param rCloseFunc
+     *     If this is !nullptr, the popup will be just shown / run async and 
rCloseFunc will be called on close.
+     */
+    void ExecutePopup(const OUString &rResName, vcl::Window *pWin = nullptr, 
const Point *pPos = nullptr,
+                      const std::function<void(sal_Int16)>& rCloseFunc = 
nullptr);
+    static void ExecutePopup(vcl::Window *pWin = nullptr, const Point 
*pPosPixel = nullptr,
+                             const std::function<void(sal_Int16)>& rCloseFunc 
= nullptr);
 
     bool                IsAppDispatcher() const;
     bool                IsFlushed() const;
diff --git a/include/toolkit/awt/vclxmenu.hxx b/include/toolkit/awt/vclxmenu.hxx
index b77c4d65124e..fdf41be7fb09 100644
--- a/include/toolkit/awt/vclxmenu.hxx
+++ b/include/toolkit/awt/vclxmenu.hxx
@@ -25,10 +25,11 @@
 #include <toolkit/helper/listenermultiplexer.hxx>
 
 #include <com/sun/star/awt/XMenuBar.hpp>
-#include <com/sun/star/awt/XPopupMenu.hpp>
+#include <com/sun/star/awt/XPopupMenuAsync.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/lang/XTypeProvider.hpp>
 #include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/ui/dialogs/XDialogClosedListener.hpp>
 
 #include <comphelper/servicehelper.hxx>
 #include <cppuhelper/weak.hxx>
@@ -39,6 +40,7 @@
 
 #include <vector>
 
+struct DialogClosedEvent;
 class Menu;
 class MenuBar;
 class PopupMenu;
@@ -48,14 +50,12 @@ typedef ::std::vector<
     css::uno::Reference< css::awt::XPopupMenu >
 > PopupMenuRefList;
 
-
-
-
 class TOOLKIT_DLLPUBLIC VCLXMenu :  public css::awt::XMenuBar,
-                                    public css::awt::XPopupMenu,
+                                    public css::awt::XPopupMenuAsync,
                                     public css::lang::XServiceInfo,
                                     public css::lang::XTypeProvider,
                                     public css::lang::XUnoTunnel,
+                                    public 
css::ui::dialogs::XDialogClosedListener,
                                     public ::cppu::OWeakObject
 {
 private:
@@ -78,7 +78,6 @@ public:
     VCLXMenu( Menu* pMenu );
     virtual ~VCLXMenu() override;
 
-
     Menu*    GetMenu() const { return mpMenu; }
     bool IsPopupMenu() const;
 
@@ -137,10 +136,20 @@ public:
     virtual void SAL_CALL setItemImage( ::sal_Int16 nItemId, const 
css::uno::Reference< css::graphic::XGraphic >& xGraphic, sal_Bool bScale ) 
override;
     virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL 
getItemImage( ::sal_Int16 nItemId ) override;
 
+    // css::awt::XPopupMenuAsync
+    virtual sal_Bool SAL_CALL popup(const css::uno::Reference< 
css::awt::XWindowPeer >& Parent, const css::awt::Rectangle& Position,
+                                    ::sal_Int16 Direction, const 
css::uno::Reference<css::ui::dialogs::XDialogClosedListener>& xListener) 
override;
+
     // css::lang::XServiceInfo
     virtual OUString SAL_CALL getImplementationName(  ) override;
     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) 
override;
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames(  
) override;
+
+    // css::ui::dialogs::XDialogClosedListener
+    virtual void SAL_CALL dialogClosed(const 
css::ui::dialogs::DialogClosedEvent& aEvent) override;
+
+    // XEventListener (base of XDialogClosedListener)
+    virtual void SAL_CALL disposing(css::lang::EventObject const & Source) 
override;
 };
 
 class UNLESS_MERGELIBS(TOOLKIT_DLLPUBLIC) VCLXMenuBar final : public VCLXMenu
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index 1c54b9964feb..770b5d76b002 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -44,6 +44,7 @@ class Menu;
 class MenuItemList;
 class Image;
 class PopupMenu;
+struct PopupMenuFinishState;
 class KeyEvent;
 class MenuFloatingWindow;
 class SalMenu;
@@ -53,7 +54,8 @@ struct SystemMenuData;
 enum class FloatWinPopupFlags;
 enum class VclEventId;
 
-namespace com::sun::star::awt { class XPopupMenu; }
+namespace com::sun::star::awt { class XPopupMenuAsync; }
+namespace com::sun::star::ui::dialogs { class XDialogClosedListener; }
 namespace com::sun::star::accessibility { class XAccessible;  }
 namespace com::sun::star::frame { class XFrame; }
 
@@ -495,11 +497,16 @@ class VCL_DLLPUBLIC PopupMenu final : public Menu
     friend struct MenuItemData;
 
 private:
+    struct PopupMenuFinishState* m_pState;
+
     SAL_DLLPRIVATE MenuFloatingWindow * ImplGetFloatingWindow() const;
     SAL_DLLPRIVATE bool PrepareRun(const VclPtr<vcl::Window>& pParentWin, 
tools::Rectangle& rRect, FloatWinPopupFlags& nPopupModeFlags, Menu* pSFrom, 
bool& bRealExecute, VclPtr<MenuFloatingWindow>&);
-    SAL_DLLPRIVATE bool Run(const VclPtr<MenuFloatingWindow>&, bool 
bRealExecute, bool bPreSelectFirst, FloatWinPopupFlags nPopupModeFlags, Menu* 
pSFrom, const tools::Rectangle& rRect);
+    SAL_DLLPRIVATE bool Run(const VclPtr<MenuFloatingWindow>&, bool 
bRealExecute, bool bPreSelectFirst, FloatWinPopupFlags nPopupModeFlags, Menu* 
pSFrom, const tools::Rectangle& rRect,
+                            const 
css::uno::Reference<css::ui::dialogs::XDialogClosedListener>* xListener);
     SAL_DLLPRIVATE void FinishRun(const VclPtr<MenuFloatingWindow>&, const 
VclPtr<vcl::Window>& pParentWin, bool bRealExecute, bool bIsNativeMenu);
     SAL_DLLPRIVATE sal_uInt16 ImplExecute(const VclPtr<vcl::Window>& 
pParentWin, const tools::Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags, 
Menu* pSFrom, bool bPreSelectFirst);
+    SAL_DLLPRIVATE bool ImplPopup(const VclPtr<vcl::Window>& pParentWin, const 
tools::Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, bool 
bPreSelectFirst,
+                                  const 
css::uno::Reference<css::ui::dialogs::XDialogClosedListener>&);
     SAL_DLLPRIVATE void ImplFlushPendingSelect();
     SAL_DLLPRIVATE tools::Long ImplCalcHeight( sal_uInt16 nEntries ) const;
     SAL_DLLPRIVATE sal_uInt16 ImplCalcVisEntries( tools::Long nMaxHeight, 
sal_uInt16 nStartEntry, sal_uInt16* pLastVisible = nullptr ) const;
@@ -522,12 +529,18 @@ public:
     sal_uInt16 Execute( vcl::Window* pWindow, const Point& rPopupPos );
     sal_uInt16 Execute( vcl::Window* pWindow, const tools::Rectangle& rRect, 
PopupMenuFlags nFlags = PopupMenuFlags::NONE );
 
+    bool Popup(vcl::Window* pParentWin, const Point& rPopupPos,
+               const 
css::uno::Reference<css::ui::dialogs::XDialogClosedListener>&);
+    bool Popup(vcl::Window* pParentWin, const tools::Rectangle& rRect,
+               const 
css::uno::Reference<css::ui::dialogs::XDialogClosedListener>&, PopupMenuFlags = 
PopupMenuFlags::NONE);
+    void Finish();
+
     // for the TestTool
     void EndExecute();
     virtual void SelectItem(sal_uInt16 nId) override;
     void SetSelectedEntry( sal_uInt16 nId ); // for use by native submenu only
 
-    css::uno::Reference<css::awt::XPopupMenu> CreateMenuInterface();
+    css::uno::Reference<css::awt::XPopupMenuAsync> CreateMenuInterface();
 
     static PopupMenu* GetActivePopupMenu();
 
diff --git a/include/vcl/toolkit/unowrap.hxx b/include/vcl/toolkit/unowrap.hxx
index edaeb9dc9128..1773016a209a 100644
--- a/include/vcl/toolkit/unowrap.hxx
+++ b/include/vcl/toolkit/unowrap.hxx
@@ -34,7 +34,7 @@ class OutputDevice;
 class PopupMenu;
 namespace com::sun::star::awt {
     class XGraphics;
-    class XPopupMenu;
+    class XPopupMenuAsync;
     class XToolkit;
     class XWindow;
     class XWindowPeer;
@@ -61,7 +61,7 @@ public:
     virtual VclPtr<vcl::Window> GetWindow(const 
css::uno::Reference<css::awt::XWindow>& rxWindow) = 0;
 
     // PopupMenu
-    virtual css::uno::Reference<css::awt::XPopupMenu> CreateMenuInterface( 
PopupMenu* pPopupMenu ) = 0;
+    virtual css::uno::Reference<css::awt::XPopupMenuAsync> 
CreateMenuInterface( PopupMenu* pPopupMenu ) = 0;
 
     virtual void                WindowDestroyed( vcl::Window* pWindow ) = 0;
 
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 3eb002520e42..209541509e08 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -1859,6 +1859,7 @@ $(eval $(call 
gb_UnoApi_add_idlfiles,offapi,com/sun/star/awt,\
        XPatternField \
        XPointer \
        XPopupMenu \
+       XPopupMenuAsync \
        XPrinter \
        XPrinterPropertySet \
        XPrinterServer \
diff --git a/offapi/com/sun/star/awt/XPopupMenuAsync.idl 
b/offapi/com/sun/star/awt/XPopupMenuAsync.idl
new file mode 100644
index 000000000000..d3f7b317f086
--- /dev/null
+++ b/offapi/com/sun/star/awt/XPopupMenuAsync.idl
@@ -0,0 +1,51 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ *
+ */
+#ifndef __com_sun_star_awt_XPopupMenuAsync_idl__
+#define __com_sun_star_awt_XPopupMenuAsync_idl__
+
+#include <com/sun/star/awt/XPopupMenu.idl>
+#include <com/sun/star/ui/dialogs/XDialogClosedListener.idl>
+
+module com {  module sun {  module star {  module awt {
+
+/** shows a pop-up menu without blocking.
+ */
+interface XPopupMenuAsync: XPopupMenu
+{
+    /** just shows the popup menu without blocking and calls the
+        XDialogClosedListener when closed,
+
+        @param Parent
+            the parent window.
+
+        @param Position
+            a Rectangle representing the coordinates system
+            where the popup menu should be executed.
+
+        @param Direction
+            the direction in which a popup menu will grow, as specified
+            by one of the PopupMenuDirection constants.
+
+        @param xListener
+            notified, if the popup is closed.
+
+        @return
+            returns true, if the popup has started to run async.
+            May fail, if the native backend doesn't implement async popups.
+    */
+    boolean popup([in] XWindowPeer Parent, [in] Rectangle Position, [in] short 
Direction,
+                  [in] ::com::sun::star::ui::dialogs::XDialogClosedListener 
xListener);
+};
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index 71915d6a1914..fa793fd1f58b 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -799,7 +799,7 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, 
::sd::Window* pWin)
             bool bShouldDisableEditHyperlink = ShouldDisableEditHyperlink();
 
             if(rCEvt.IsMouseEvent())
-                GetViewFrame()->GetDispatcher()->ExecutePopup( aPopupId );
+                GetViewFrame()->GetDispatcher()->ExecutePopup(aPopupId, 
nullptr, nullptr, [](sal_Int16){});
             else
             {
                 //don't open contextmenu at mouse position if not opened via 
mouse
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index b0eee6eefb22..7dd13bdeb912 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -60,6 +60,7 @@
 #include <svl/eitem.hxx>
 #include <svl/itemiter.hxx>
 #include <svl/itempool.hxx>
+#include <svtools/dialogclosedlistener.hxx>
 #include <toolkit/awt/vclxmenu.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
 #include <tools/debug.hxx>
@@ -137,8 +138,12 @@ struct SfxDispatcher_Impl
     SfxDisableFlags      nDisableFlags;
     bool                 bFlushed;
     std::deque< std::deque<SfxToDo_Impl> > aToDoCopyStack;
+
+    static css::uno::Reference<css::frame::XPopupMenuController>* 
m_pActivePopupController;
 };
 
+css::uno::Reference<css::frame::XPopupMenuController>* 
SfxDispatcher_Impl::m_pActivePopupController = nullptr;
+
 /** This method checks if the stack of the SfxDispatchers is flushed, or if
     push- or pop- commands are pending.
 */
@@ -1685,7 +1690,48 @@ bool SfxDispatcher::FillState_(const SfxSlotServer& 
rSvr, SfxItemSet& rState,
     return false;
 }
 
-void SfxDispatcher::ExecutePopup( vcl::Window *pWin, const Point *pPos )
+namespace {
+
+struct SfxDispatcherPopupFinish final
+{
+    css::uno::Reference<css::frame::XPopupMenuController> m_xPopupController;
+    std::function<void(sal_Int16)> m_aCloseFunc;
+    rtl::Reference<::svt::DialogClosedListener> m_xDialogListener;
+    VclPtr<PopupMenu> m_pPopupMenu;
+
+    DECL_LINK(PopupClosedHdl, css::ui::dialogs::DialogClosedEvent*, void);
+
+    
SfxDispatcherPopupFinish(css::uno::Reference<css::frame::XPopupMenuController> 
xPopupController,
+                             const std::function<void(sal_Int16)>& rCloseFunc, 
PopupMenu& rVCLMenu)
+        : m_xPopupController(xPopupController)
+        , m_aCloseFunc(rCloseFunc)
+        , m_xDialogListener(new ::svt::DialogClosedListener())
+        , m_pPopupMenu(&rVCLMenu)
+    {
+        m_xDialogListener->SetDialogClosedLink(LINK(this, 
SfxDispatcherPopupFinish, PopupClosedHdl));
+    }
+};
+
+IMPL_LINK(SfxDispatcherPopupFinish, PopupClosedHdl, 
css::ui::dialogs::DialogClosedEvent*, pEvt, void)
+{
+    assert(m_xPopupController.is());
+    if (!comphelper::LibreOfficeKit::isActive())
+        assert(SfxDispatcher_Impl::m_pActivePopupController == 
&m_xPopupController);
+    if (m_aCloseFunc)
+        m_aCloseFunc(pEvt ? pEvt->DialogResult : 0);
+    css::uno::Reference<css::lang::XComponent> xComponent(m_xPopupController, 
css::uno::UNO_QUERY);
+    if (xComponent.is())
+        xComponent->dispose();
+    m_pPopupMenu->Finish();
+    m_pPopupMenu.disposeAndClear();
+    SfxDispatcher_Impl::m_pActivePopupController = nullptr;
+    delete this;
+}
+
+} // anon namespace
+
+void SfxDispatcher::ExecutePopup(vcl::Window *pWin, const Point *pPos,
+    const std::function<void(sal_Int16)>& rCloseFunc)
 {
     SfxDispatcher &rDisp = *SfxGetpApp()->GetDispatcher_Impl();
     sal_uInt16 nShLevel = 0;
@@ -1699,13 +1745,14 @@ void SfxDispatcher::ExecutePopup( vcl::Window *pWin, 
const Point *pPos )
         const OUString& rResName = pSh->GetInterface()->GetPopupMenuName();
         if ( !rResName.isEmpty() )
         {
-            rDisp.ExecutePopup( rResName, pWin, pPos );
+            rDisp.ExecutePopup(rResName, pWin, pPos, rCloseFunc);
             return;
         }
     }
 }
 
-void SfxDispatcher::ExecutePopup( const OUString& rResName, vcl::Window* pWin, 
const Point* pPos )
+void SfxDispatcher::ExecutePopup( const OUString& rResName, vcl::Window* pWin, 
const Point* pPos,
+    const std::function<void(sal_Int16)>& rCloseFunc)
 {
     css::uno::Sequence< css::uno::Any > aArgs{
         css::uno::Any(comphelper::makePropertyValue( "Value", rResName )),
@@ -1714,16 +1761,30 @@ void SfxDispatcher::ExecutePopup( const OUString& 
rResName, vcl::Window* pWin, c
     };
 
     css::uno::Reference< css::uno::XComponentContext > xContext = 
comphelper::getProcessComponentContext();
-    css::uno::Reference< css::frame::XPopupMenuController > xPopupController(
-        xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
-        "com.sun.star.comp.framework.ResourceMenuController", aArgs, xContext 
), css::uno::UNO_QUERY );
+
+    if (!comphelper::LibreOfficeKit::isActive())
+        assert(!xImp->m_pActivePopupController);
+    if (!comphelper::LibreOfficeKit::isActive() && 
xImp->m_pActivePopupController)
+        return;
+
+    css::uno::Reference<css::frame::XPopupMenuController> xPopupController =
+        css::uno::Reference<css::frame::XPopupMenuController>(
+            
xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
+            "com.sun.star.comp.framework.ResourceMenuController", aArgs, 
xContext), css::uno::UNO_QUERY);
+    if (!xPopupController.is())
+        return;
 
     css::uno::Reference< css::awt::XPopupMenu > xPopupMenu( 
xContext->getServiceManager()->createInstanceWithContext(
         "com.sun.star.awt.PopupMenu", xContext ), css::uno::UNO_QUERY );
-
-    if ( !xPopupController.is() || !xPopupMenu.is() )
+    if (!xPopupMenu.is())
+    {
+        css::uno::Reference<css::lang::XComponent> 
xComponent(xPopupController, css::uno::UNO_QUERY);
+        if (xComponent.is())
+            xComponent->dispose();
         return;
+    }
 
+    struct SfxDispatcherPopupFinish* pFin = nullptr;
     vcl::Window* pWindow = pWin ? pWin : 
xImp->pFrame->GetFrame().GetWorkWindow_Impl()->GetWindow();
     Point aPos = pPos ? *pPos : pWindow->GetPointerPosPixel();
 
@@ -1751,14 +1812,28 @@ void SfxDispatcher::ExecutePopup( const OUString& 
rResName, vcl::Window* pWin, c
         OUString aMenuURL = "private:resource/popupmenu/" + rResName;
         if (GetFrame()->GetViewShell()->TryContextMenuInterception(xPopupMenu, 
aMenuURL, aEvent))
         {
+            const sal_Int16 nFlags = 
css::awt::PopupMenuDirection::EXECUTE_DOWN;
+            const css::awt::Rectangle aRect(aPos.X(), aPos.Y(), 1, 1);
             css::uno::Reference<css::awt::XWindowPeer> 
xParent(aEvent.SourceWindow, css::uno::UNO_QUERY);
-            xPopupMenu->execute(xParent, css::awt::Rectangle(aPos.X(), 
aPos.Y(), 1, 1), css::awt::PopupMenuDirection::EXECUTE_DOWN);
+            css::uno::Reference<css::awt::XPopupMenuAsync 
xAsyncPopup(xPopupMenu, css::uno::UNO_QUERY);
+            pFin = new SfxDispatcherPopupFinish(xPopupController, rCloseFunc, 
*pVCLMenu);
+            SfxDispatcher_Impl::m_pActivePopupController = 
&pFin->m_xPopupController;
+            if (!rCloseFunc || !xAsyncPopup.is() || 
!xAsyncPopup->popup(pWindow, aRect, nFlags, pFin->m_xDialogListener))
+            {
+                css::uno::Reference<css::uno::XInterface> 
xInterface(*pAwtMenu, css::uno::UNO_QUERY);
+                css::ui::dialogs::DialogClosedEvent aEvt(xInterface, 
xPopupMenu->execute(xParent, aRect, nFlags));
+                pFin->m_xDialogListener->dialogClosed(aEvt);
+            }
         }
     }
 
-    css::uno::Reference< css::lang::XComponent > xComponent( xPopupController, 
css::uno::UNO_QUERY );
-    if ( xComponent.is() )
-        xComponent->dispose();
+    if (!pFin)
+    {
+        SfxDispatcher_Impl::m_pActivePopupController = nullptr;
+        css::uno::Reference<css::lang::XComponent> 
xComponent(xPopupController, css::uno::UNO_QUERY);
+        if (xComponent.is())
+            xComponent->dispose();
+    }
 }
 
 /** With this method the SfxDispatcher can be locked and released. A locked
diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index e5a5ad41f8fa..f019b3d0f2e0 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -5393,7 +5393,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
                         }
                     }
                     else if ( !m_rView.ExecSpellPopup( aDocPos ) )
-                        SfxDispatcher::ExecutePopup(this, &aPixPos);
+                        SfxDispatcher::ExecutePopup(this, &aPixPos, 
[](sal_Int16){});
                 }
                 else if (m_pApplyTempl->nUndo < 
rSh.GetDoc()->GetIDocumentUndoRedo().GetUndoActionCount())
                 {
diff --git a/toolkit/inc/helper/unowrapper.hxx 
b/toolkit/inc/helper/unowrapper.hxx
index 03a9b525cc18..5ecbd19086d1 100644
--- a/toolkit/inc/helper/unowrapper.hxx
+++ b/toolkit/inc/helper/unowrapper.hxx
@@ -56,7 +56,7 @@ public:
     virtual VclPtr<vcl::Window> GetWindow(const 
css::uno::Reference<css::awt::XWindow>& rxWindow) override;
 
     // Menu
-    virtual css::uno::Reference<css::awt::XPopupMenu> CreateMenuInterface( 
PopupMenu* pPopupMenu ) override;
+    virtual css::uno::Reference<css::awt::XPopupMenuAsync> 
CreateMenuInterface(PopupMenu* pPopupMenu) override;
 
     void                WindowDestroyed( vcl::Window* pWindow ) override;
 
diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx
index 56b0bb49a6ca..d243928a962a 100644
--- a/toolkit/source/awt/vclxmenu.cxx
+++ b/toolkit/source/awt/vclxmenu.cxx
@@ -37,6 +37,7 @@
 #include <vcl/window.hxx>
 
 #include <com/sun/star/awt/KeyModifier.hpp>
+#include <com/sun/star/ui/dialogs/DialogClosedEvent.hpp>
 
 VCLXMenu::VCLXMenu()
     : maMenuListeners( *this )
@@ -491,6 +492,33 @@ sal_Int16 VCLXMenu::execute(
     return nRet;
 }
 
+sal_Bool VCLXMenu::popup(
+    const css::uno::Reference< css::awt::XWindowPeer >& rxWindowPeer,
+    const css::awt::Rectangle& rPos, sal_Int16 nFlags,
+    const css::uno::Reference<css::ui::dialogs::XDialogClosedListener>& 
xListener)
+{
+    SolarMutexGuard aSolarGuard;
+    ::osl::Guard< ::osl::Mutex > aGuard(GetMutex());
+
+    if (!mpMenu || !IsPopupMenu())
+        return false;
+
+    return 
static_cast<PopupMenu*>(mpMenu.get())->Popup(VCLUnoHelper::GetWindow(rxWindowPeer),
+                                   VCLRectangle(rPos), xListener.is() ? 
xListener : this,
+                                   static_cast<PopupMenuFlags>(nFlags) | 
PopupMenuFlags::NoMouseUpClose);
+}
+
+void SAL_CALL VCLXMenu::dialogClosed(const 
css::ui::dialogs::DialogClosedEvent&)
+{
+    SolarMutexGuard aSolarGuard;
+    ::osl::Guard< ::osl::Mutex > aGuard(GetMutex());
+
+    assert(mpMenu && IsPopupMenu());
+    if (mpMenu && IsPopupMenu())
+        static_cast<PopupMenu*>(mpMenu.get())->Finish();
+}
+
+void SAL_CALL VCLXMenu::disposing(css::lang::EventObject const&) {}
 
 void SAL_CALL VCLXMenu::setCommand(
     sal_Int16 nItemId,
diff --git a/toolkit/source/helper/unowrapper.cxx 
b/toolkit/source/helper/unowrapper.cxx
index 5d5ce94a9b8f..c9685e7ca3fc 100644
--- a/toolkit/source/helper/unowrapper.cxx
+++ b/toolkit/source/helper/unowrapper.cxx
@@ -191,7 +191,7 @@ void UnoWrapper::SetWindowInterface( vcl::Window* pWindow, 
const css::uno::Refer
     }
 }
 
-css::uno::Reference<css::awt::XPopupMenu> UnoWrapper::CreateMenuInterface( 
PopupMenu* pPopupMenu )
+css::uno::Reference<css::awt::XPopupMenuAsync> 
UnoWrapper::CreateMenuInterface(PopupMenu* pPopupMenu)
 {
     return new VCLXPopupMenu(pPopupMenu);
 }
diff --git a/vcl/inc/osx/salmenu.h b/vcl/inc/osx/salmenu.h
index 597180cc1ac3..dae1a1035cae 100644
--- a/vcl/inc/osx/salmenu.h
+++ b/vcl/inc/osx/salmenu.h
@@ -67,7 +67,9 @@ public:
     virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const 
Image& rImage) override;
     virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, 
const vcl::KeyCode& rKeyCode, const OUString& rKeyName ) override;
     virtual void GetSystemMenuData( SystemMenuData* pData ) override;
-    virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const 
tools::Rectangle& rRect, FloatWinPopupFlags nFlags) override;
+    virtual bool ShowNativePopupMenu(
+        FloatingWindow*, const tools::Rectangle&, FloatWinPopupFlags,
+        const css::uno::Reference<css::ui::dialogs::XDialogClosedListener>* = 
nullptr) override;
     virtual bool AddMenuBarButton( const SalMenuButtonItem& ) override;
     virtual void RemoveMenuBarButton( sal_uInt16 nId ) override;
     virtual tools::Rectangle GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, 
SalFrame* i_pReferenceFrame ) override;
diff --git a/vcl/inc/qt5/QtMenu.hxx b/vcl/inc/qt5/QtMenu.hxx
index 55275ae6e099..738c98e336a3 100644
--- a/vcl/inc/qt5/QtMenu.hxx
+++ b/vcl/inc/qt5/QtMenu.hxx
@@ -38,7 +38,7 @@ class QtFrame;
 class QtMenu : public QObject, public SalMenu
 {
     Q_OBJECT
-private:
+
     std::vector<QtMenuItem*> maItems;
     VclPtr<Menu> mpVCLMenu;
     QtMenu* mpParentSalMenu;
@@ -52,6 +52,9 @@ private:
     QPushButton* mpCloseButton;
     QMetaObject::Connection maCloseButtonConnection;
 
+    css::uno::Reference<css::ui::dialogs::XDialogClosedListener> m_xListener;
+    FloatingWindow* m_pWin;
+
     void DoFullMenuUpdate(Menu* pMenuBar);
     static void NativeItemText(OUString& rItemText);
 
@@ -72,8 +75,9 @@ public:
     virtual void SetFrame(const SalFrame* pFrame) override;
     const QtFrame* GetFrame() const;
     virtual void ShowMenuBar(bool bVisible) override;
-    virtual bool ShowNativePopupMenu(FloatingWindow* pWin, const 
tools::Rectangle& rRect,
-                                     FloatWinPopupFlags nFlags) override;
+    virtual bool ShowNativePopupMenu(
+        FloatingWindow*, const tools::Rectangle&, FloatWinPopupFlags,
+        const css::uno::Reference<css::ui::dialogs::XDialogClosedListener>* = 
nullptr) override;
     QtMenu* GetTopLevel();
     virtual void SetItemBits(unsigned nPos, MenuItemBits nBits) override;
     virtual void CheckItem(unsigned nPos, bool bCheck) override;
diff --git a/vcl/inc/salmenu.hxx b/vcl/inc/salmenu.hxx
index c696503549e6..60840a020460 100644
--- a/vcl/inc/salmenu.hxx
+++ b/vcl/inc/salmenu.hxx
@@ -22,6 +22,7 @@
 
 #include <vcl/menu.hxx>
 #include <vcl/image.hxx>
+#include <com/sun/star/ui/dialogs/XDialogClosedListener.hpp>
 
 struct SystemMenuData;
 class FloatingWindow;
@@ -75,7 +76,17 @@ public:
     virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const 
Image& rImage ) = 0;
     virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, 
const vcl::KeyCode& rKeyCode, const OUString& rKeyName ) = 0;
     virtual void GetSystemMenuData( SystemMenuData* pData ) = 0;
-    virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const 
tools::Rectangle& rRect, FloatWinPopupFlags nFlags);
+    /**
+     * @param pListener
+     *     if !nullptr, the menu is supposed to be only shown and it'll run 
async.
+     *     Mainly means, when the menu is hidden, it must call the listener's
+     *     dialogClosed. The listener will destroy the SalMenu!
+     *
+     * @return
+     *     true, if the feature is implemented and was successful.
+     */
+    virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const 
tools::Rectangle& rRect, FloatWinPopupFlags nFlags,
+                                     const 
css::uno::Reference<css::ui::dialogs::XDialogClosedListener>* pListener = 
nullptr);
     virtual void ShowCloseButton(bool bShow);
     virtual bool AddMenuBarButton( const SalMenuButtonItem& ); // return false 
if not implemented or failure
     virtual void RemoveMenuBarButton( sal_uInt16 nId );
diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx
index 85c0f5d3d893..5d5a487df8f1 100644
--- a/vcl/inc/unx/gtk/gtksalmenu.hxx
+++ b/vcl/inc/unx/gtk/gtksalmenu.hxx
@@ -132,7 +132,8 @@ public:
 #endif
     void ReturnFocus();
 
-    virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const 
tools::Rectangle& rRect, FloatWinPopupFlags nFlags) override;
+    virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const 
tools::Rectangle& rRect, FloatWinPopupFlags nFlags,
+                                     const 
css::uno::Reference<css::ui::dialogs::XDialogClosedListener>* = nullptr) 
override;
     virtual void ShowCloseButton(bool bShow) override;
     virtual bool AddMenuBarButton( const SalMenuButtonItem& rNewItem ) 
override;
     virtual void RemoveMenuBarButton( sal_uInt16 nId ) override;
diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index 3164ba873bae..0a91ab88cc36 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -281,8 +281,13 @@ AquaSalMenu::~AquaSalMenu()
     }
 }
 
-bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const 
tools::Rectangle& rRect, FloatWinPopupFlags nFlags)
+bool AquaSalMenu::ShowNativePopupMenu(
+    FloatingWindow* pWin, const tools::Rectangle& rRect, FloatWinPopupFlags 
nFlags,
+    const css::uno::Reference<css::ui::dialogs::XDialogClosedListener>* 
pListener)
 {
+    if (pListener)
+        return false;
+
     // set offsets for positioning
     const float offset = 9.0;
 
diff --git a/vcl/qt5/QtMenu.cxx b/vcl/qt5/QtMenu.cxx
index c6224b137665..7cddbbe8b69d 100644
--- a/vcl/qt5/QtMenu.cxx
+++ b/vcl/qt5/QtMenu.cxx
@@ -93,6 +93,16 @@ void QtMenu::InsertMenuItem(QtMenuItem* pSalMenuItem, 
unsigned nPos)
             // no QMenu set, instantiate own one
             mpOwnedQMenu.reset(new QMenu);
             mpQMenu = mpOwnedQMenu.get();
+
+            connect(mpQMenu, &QMenu::aboutToHide, this, [this] {
+                if (m_pWin && m_xListener.is())
+                {
+                    QMenu* pMenu = mpOwnedQMenu.release();
+                    css::ui::dialogs::DialogClosedEvent 
aEvent(m_pWin->GetComponentInterface(), 0);
+                    m_xListener->dialogClosed(aEvent);
+                    pMenu->deleteLater();
+                }
+            });
         }
 
         if (pSalMenuItem->mpSubMenu)
@@ -672,15 +682,27 @@ void QtMenu::ShowCloseButton(bool bShow)
         pButton->hide();
 }
 
-bool QtMenu::ShowNativePopupMenu(FloatingWindow*, const tools::Rectangle&,
-                                 FloatWinPopupFlags nFlags)
+bool QtMenu::ShowNativePopupMenu(
+    FloatingWindow* pWin, const tools::Rectangle&, FloatWinPopupFlags nFlags,
+    const css::uno::Reference<css::ui::dialogs::XDialogClosedListener>* 
pListener)
 {
     assert(mpQMenu);
     DoFullMenuUpdate(mpVCLMenu);
     mpQMenu->setTearOffEnabled(bool(nFlags & 
FloatWinPopupFlags::AllowTearOff));
 
     const QPoint aPos = QCursor::pos();
-    mpQMenu->exec(aPos);
+    if (pListener)
+    {
+        m_xListener = *pListener;
+        m_pWin = pWin;
+        mpQMenu->popup(aPos);
+    }
+    else
+    {
+        m_xListener = nullptr;
+        m_pWin = nullptr;
+        mpQMenu->exec(aPos);
+    }
 
     return true;
 }
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index f0a2f9f7a6f4..579573dbf481 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -176,7 +176,9 @@ SalObject::~SalObject() {}
 
 SalMenu::~SalMenu() {}
 
-bool SalMenu::ShowNativePopupMenu(FloatingWindow*, const tools::Rectangle&, 
FloatWinPopupFlags)
+bool SalMenu::ShowNativePopupMenu(
+    FloatingWindow*, const tools::Rectangle&, FloatWinPopupFlags,
+    const css::uno::Reference<css::ui::dialogs::XDialogClosedListener>*)
 {
     return false;
 }
diff --git a/vcl/source/control/managedmenubutton.cxx 
b/vcl/source/control/managedmenubutton.cxx
index 880730721ce2..f671cdd9c695 100644
--- a/vcl/source/control/managedmenubutton.cxx
+++ b/vcl/source/control/managedmenubutton.cxx
@@ -13,6 +13,7 @@
 #include <managedmenubutton.hxx>
 #include <vcl/menu.hxx>
 
+#include <com/sun/star/awt/XPopupMenuAsync.hpp>
 #include <com/sun/star/frame/ModuleManager.hpp>
 #include <com/sun/star/frame/theDesktop.hpp>
 #include <com/sun/star/frame/thePopupMenuControllerFactory.hpp>
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index a286bea3d9f0..184b4000f610 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2686,6 +2686,7 @@ MenuFloatingWindow * PopupMenu::ImplGetFloatingWindow() 
const {
 }
 
 PopupMenu::PopupMenu()
+    : m_pState(nullptr)
 {
     mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu(false, this);
 }
@@ -2698,6 +2699,7 @@ PopupMenu::PopupMenu( const PopupMenu& rMenu )
 
 PopupMenu::~PopupMenu()
 {
+    assert(!m_pState);
     disposeOnce();
 }
 
@@ -2795,6 +2797,36 @@ sal_uInt16 PopupMenu::Execute( vcl::Window* pExecWindow, 
const tools::Rectangle&
     return ImplExecute( pExecWindow, rRect, lcl_TranslateFlags(nFlags), 
nullptr, false );
 }
 
+struct PopupMenuFinishState final
+{
+    VclPtr<PopupMenu> pSelf;
+    VclPtr<vcl::Window> pParentWin;
+    VclPtr<MenuFloatingWindow> pWin;
+    bool bRealExecute;
+    bool bIsNativeMenu;
+
+    void clean()
+    {
+        pWin = nullptr;
+        pParentWin = nullptr;
+        pSelf = nullptr;
+    }
+};
+
+bool PopupMenu::Popup(vcl::Window* pExecWindow, const Point& rPopupPos,
+                            const 
css::uno::Reference<css::ui::dialogs::XDialogClosedListener>& listener)
+{
+    return Popup(pExecWindow, tools::Rectangle(rPopupPos, rPopupPos), 
listener, PopupMenuFlags::ExecuteDown);
+}
+
+bool PopupMenu::Popup(vcl::Window* pExecWindow, const tools::Rectangle& rRect,
+                      const 
css::uno::Reference<css::ui::dialogs::XDialogClosedListener>& listener, 
PopupMenuFlags nFlags)
+{
+    assert(!m_pState);
+    ENSURE_OR_RETURN(pExecWindow, "PopupMenu::Popup: need a non-NULL window!", 
false);
+    return ImplPopup(pExecWindow, rRect, lcl_TranslateFlags(nFlags), nullptr, 
false, listener);
+}
+
 void PopupMenu::ImplFlushPendingSelect()
 {
     // is there still Select?
@@ -2946,7 +2978,7 @@ bool PopupMenu::PrepareRun(const VclPtr<vcl::Window>& 
pParentWin, tools::Rectang
     if (pStartedFrom && pStartedFrom->IsMenuBar())
         nMaxHeight -= pParentWin->GetSizePixel().Height();
     sal_Int32 nLeft, nTop, nRight, nBottom;
-    pWindow->GetBorder( nLeft, nTop, nRight, nBottom );
+    pWindow->GetBorder(nLeft, nTop, nRight, nBottom);
     nMaxHeight -= nTop+nBottom;
     if ( aSz.Height() > nMaxHeight )
     {
@@ -2962,10 +2994,11 @@ bool PopupMenu::PrepareRun(const VclPtr<vcl::Window>& 
pParentWin, tools::Rectang
 }
 
 bool PopupMenu::Run(const VclPtr<MenuFloatingWindow>& pWin, const bool 
bRealExecute, const bool bPreSelectFirst,
-                    const FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, 
const tools::Rectangle& rRect)
+                    const FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, 
const tools::Rectangle& rRect,
+                    const 
css::uno::Reference<css::ui::dialogs::XDialogClosedListener>* xListener)
 {
     SalMenu* pMenu = ImplGetSalMenu();
-    if (pMenu && bRealExecute && pMenu->ShowNativePopupMenu(pWin, rRect, 
nPopupModeFlags))
+    if (pMenu && bRealExecute && pMenu->ShowNativePopupMenu(pWin, rRect, 
nPopupModeFlags, xListener))
         return true;
 
     pWin->StartPopupMode(rRect, nPopupModeFlags);
@@ -3001,7 +3034,12 @@ bool PopupMenu::Run(const VclPtr<MenuFloatingWindow>& 
pWin, const bool bRealExec
     }
 
     if (bRealExecute)
-        pWin->Execute();
+    {
+        if (!xListener)
+            pWin->Execute();
+        else
+            pWin->Popup(*xListener);
+    }
 
     return false;
 }
@@ -3046,11 +3084,42 @@ sal_uInt16 PopupMenu::ImplExecute(const 
VclPtr<vcl::Window>& pParentWin, const t
     VclPtr<MenuFloatingWindow> pWin;
     if (!PrepareRun(pParentWin, aRect, nPopupModeFlags, pSFrom, bRealExecute, 
pWin))
         return 0;
-    const bool bNative = Run(pWin, bRealExecute, bPreSelectFirst, 
nPopupModeFlags, pSFrom, aRect);
+    const bool bNative = Run(pWin, bRealExecute, bPreSelectFirst, 
nPopupModeFlags, pSFrom, aRect, nullptr);
     FinishRun(pWin, pParentWin, bRealExecute, bNative);
     return nSelectedId;
 }
 
+bool PopupMenu::ImplPopup(const VclPtr<vcl::Window>& pParentWin, const 
tools::Rectangle& rRect,
+                          FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, 
bool bPreSelectFirst,
+                          const 
css::uno::Reference<css::ui::dialogs::XDialogClosedListener>& xListener)
+{
+    // tdf#126054 hold this until after function completes
+    VclPtr<PopupMenu> xThis(this);
+    bool bRealExecute = false;
+    tools::Rectangle aRect(rRect);
+    VclPtr<MenuFloatingWindow> pWin;
+    if (!PrepareRun(pParentWin, aRect, nPopupModeFlags, pSFrom, bRealExecute, 
pWin))
+        return false;
+    assert(!m_pState);
+    m_pState = new PopupMenuFinishState;
+    m_pState->bIsNativeMenu = Run(pWin, bRealExecute, bPreSelectFirst, 
nPopupModeFlags, pSFrom, aRect, &xListener);
+    m_pState->pWin = pWin;
+    m_pState->pParentWin = pParentWin;
+    m_pState->bRealExecute = bRealExecute;
+    m_pState->pSelf = xThis;
+    return true;
+}
+
+void PopupMenu::Finish()
+{
+    if (!m_pState)
+        return;
+    FinishRun(m_pState->pWin, m_pState->pParentWin, m_pState->bRealExecute, 
m_pState->bIsNativeMenu);
+    m_pState->clean();
+    delete m_pState;
+    m_pState = nullptr;
+}
+
 sal_uInt16 PopupMenu::ImplCalcVisEntries( tools::Long nMaxHeight, sal_uInt16 
nStartEntry, sal_uInt16* pLastVisible ) const
 {
     nMaxHeight -= 2 * ImplGetFloatingWindow()->GetScrollerHeight();
@@ -3099,7 +3168,7 @@ tools::Long PopupMenu::ImplCalcHeight( sal_uInt16 
nEntries ) const
     return nHeight;
 }
 
-css::uno::Reference<css::awt::XPopupMenu> PopupMenu::CreateMenuInterface()
+css::uno::Reference<css::awt::XPopupMenuAsync> PopupMenu::CreateMenuInterface()
 {
     UnoWrapperBase* pWrapper = UnoWrapperBase::GetUnoWrapper();
     if ( pWrapper )
diff --git a/vcl/source/window/menufloatingwindow.cxx 
b/vcl/source/window/menufloatingwindow.cxx
index cfd6a6ae190e..075fb97f5632 100644
--- a/vcl/source/window/menufloatingwindow.cxx
+++ b/vcl/source/window/menufloatingwindow.cxx
@@ -308,8 +308,15 @@ IMPL_LINK_NOARG(MenuFloatingWindow, PopupEnd, 
FloatingWindow*, void)
             pMenu->pStartedFrom->ClosePopup(pMenu);
     }
 
-    if ( pM )
+    if (pM)
+    {
         pM->pStartedFrom = nullptr;
+        if (m_xListener.is())
+        {
+            css::ui::dialogs::DialogClosedEvent 
aEvent(GetComponentInterface(), pM->GetCurItemId());
+            m_xListener->dialogClosed(aEvent);
+        }
+    }
 }
 
 IMPL_LINK_NOARG(MenuFloatingWindow, AutoScroll, Timer *, void)
@@ -443,21 +450,31 @@ void MenuFloatingWindow::End()
         Window::EndSaveFocus(xFocusId);
     }
 
+    Finish();
+
     bInExecute = false;
 }
 
-void MenuFloatingWindow::Execute()
+void MenuFloatingWindow::Popup(const 
css::uno::Reference<css::ui::dialogs::XDialogClosedListener>& xListener)
 {
     ImplSVData* pSVData = ImplGetSVData();
-
     pSVData->maAppData.mpActivePopupMenu = 
static_cast<PopupMenu*>(pMenu.get());
-
+    m_xListener = xListener;
     Start();
+}
 
+void MenuFloatingWindow::Finish()
+{
+    ImplSVData* pSVData = ImplGetSVData();
+    pSVData->maAppData.mpActivePopupMenu = nullptr;
+}
+
+void MenuFloatingWindow::Execute()
+{
+    Popup();
     while (bInExecute && !Application::IsQuit())
         Application::Yield();
-
-    pSVData->maAppData.mpActivePopupMenu = nullptr;
+    Finish();
 }
 
 void MenuFloatingWindow::StopExecute()
@@ -474,6 +491,7 @@ void MenuFloatingWindow::StopExecute()
     // notify parent, needed for accessibility
     if( pMenu && pMenu->pStartedFrom )
         pMenu->pStartedFrom->ImplCallEventListeners( 
VclEventId::MenuSubmenuDeactivate, nPosInParent );
+    Finish();
 }
 
 void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly )
@@ -502,6 +520,7 @@ void MenuFloatingWindow::KillActivePopup( PopupMenu* 
pThisOnly )
 
         PaintImmediately();
     }
+    pPopup->Finish();
 }
 
 void MenuFloatingWindow::EndExecute()
diff --git a/vcl/source/window/menufloatingwindow.hxx 
b/vcl/source/window/menufloatingwindow.hxx
index f26fb50373ca..b6c8b54738ce 100644
--- a/vcl/source/window/menufloatingwindow.hxx
+++ b/vcl/source/window/menufloatingwindow.hxx
@@ -46,6 +46,7 @@ private:
     sal_uInt16 nScrollerHeight;
     sal_uInt16 nFirstEntry;
     sal_uInt16 nPosInParent;
+    css::uno::Reference<css::ui::dialogs::XDialogClosedListener> m_xListener;
 
     bool bInExecute : 1;
     bool bScrollMenu : 1;
@@ -67,6 +68,7 @@ private:
 
     void Start();
     void End();
+    static void Finish();
 
 protected:
     vcl::Region ImplCalcClipRegion() const;
@@ -107,6 +109,8 @@ public:
     bool IsScrollMenu() const        { return bScrollMenu; }
     sal_uInt16 GetScrollerHeight() const   { return nScrollerHeight; }
 
+    void Popup(const 
css::uno::Reference<css::ui::dialogs::XDialogClosedListener>& xListener = 
nullptr);
+
     void Execute();
     void StopExecute();
     void EndExecute();
diff --git a/vcl/unx/gtk3/gtksalmenu.cxx b/vcl/unx/gtk3/gtksalmenu.cxx
index e0a35c1d5404..6d86316c8273 100644
--- a/vcl/unx/gtk3/gtksalmenu.cxx
+++ b/vcl/unx/gtk3/gtksalmenu.cxx
@@ -422,9 +422,13 @@ static void MenuClosed(GtkPopover* pWidget, GMainLoop* 
pLoop)
     g_main_loop_quit(pLoop);
 }
 
-bool GtkSalMenu::ShowNativePopupMenu(FloatingWindow* pWin, const 
tools::Rectangle& rRect,
-                                     FloatWinPopupFlags nFlags)
+bool GtkSalMenu::ShowNativePopupMenu
+    (FloatingWindow* pWin, const tools::Rectangle& rRect, FloatWinPopupFlags 
nFlags,
+     const css::uno::Reference<css::ui::dialogs::XDialogClosedListener>* 
pListener)
 {
+    if (pListener)
+        return false;
+
     VclPtr<vcl::Window> xParent = pWin->ImplGetWindowImpl()->mpRealParent;
     mpFrame = static_cast<GtkSalFrame*>(xParent->ImplGetFrame());
 
commit 385157b5629841cda91b30d5b9de794bbb6b5df4
Author:     Jan-Marek Glogowski <[email protected]>
AuthorDate: Sat Nov 20 15:06:35 2021 +0100
Commit:     Jan-Marek Glogowski <[email protected]>
CommitDate: Fri Dec 10 13:05:38 2021 +0100

    Refactor PopupMenu::ImplExecute for async support
    
    Splits ImplExecute into PrepareRun, Run and FinishRun.
    
    Change-Id: Ifddb1e968b468c9757eeece0bb19513cc26a9c8d

diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index 7fd2e34492bd..1c54b9964feb 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -496,7 +496,10 @@ class VCL_DLLPUBLIC PopupMenu final : public Menu
 
 private:
     SAL_DLLPRIVATE MenuFloatingWindow * ImplGetFloatingWindow() const;
-    SAL_DLLPRIVATE sal_uInt16 ImplExecute( const VclPtr<vcl::Window>& pW, 
const tools::Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags, Menu* 
pSFrom, bool bPreSelectFirst );
+    SAL_DLLPRIVATE bool PrepareRun(const VclPtr<vcl::Window>& pParentWin, 
tools::Rectangle& rRect, FloatWinPopupFlags& nPopupModeFlags, Menu* pSFrom, 
bool& bRealExecute, VclPtr<MenuFloatingWindow>&);
+    SAL_DLLPRIVATE bool Run(const VclPtr<MenuFloatingWindow>&, bool 
bRealExecute, bool bPreSelectFirst, FloatWinPopupFlags nPopupModeFlags, Menu* 
pSFrom, const tools::Rectangle& rRect);
+    SAL_DLLPRIVATE void FinishRun(const VclPtr<MenuFloatingWindow>&, const 
VclPtr<vcl::Window>& pParentWin, bool bRealExecute, bool bIsNativeMenu);
+    SAL_DLLPRIVATE sal_uInt16 ImplExecute(const VclPtr<vcl::Window>& 
pParentWin, const tools::Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags, 
Menu* pSFrom, bool bPreSelectFirst);
     SAL_DLLPRIVATE void ImplFlushPendingSelect();
     SAL_DLLPRIVATE tools::Long ImplCalcHeight( sal_uInt16 nEntries ) const;
     SAL_DLLPRIVATE sal_uInt16 ImplCalcVisEntries( tools::Long nMaxHeight, 
sal_uInt16 nStartEntry, sal_uInt16* pLastVisible = nullptr ) const;
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 68e01be87c65..a286bea3d9f0 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2771,10 +2771,8 @@ sal_uInt16 PopupMenu::Execute( vcl::Window* pExecWindow, 
const Point& rPopupPos
     return Execute( pExecWindow, tools::Rectangle( rPopupPos, rPopupPos ), 
PopupMenuFlags::ExecuteDown );
 }
 
-sal_uInt16 PopupMenu::Execute( vcl::Window* pExecWindow, const 
tools::Rectangle& rRect, PopupMenuFlags nFlags )
+static FloatWinPopupFlags lcl_TranslateFlags(PopupMenuFlags nFlags)
 {
-    ENSURE_OR_RETURN( pExecWindow, "PopupMenu::Execute: need a non-NULL 
window!", 0 );
-
     FloatWinPopupFlags nPopupModeFlags = FloatWinPopupFlags::NONE;
     if ( nFlags & PopupMenuFlags::ExecuteDown )
         nPopupModeFlags = FloatWinPopupFlags::Down;
@@ -2788,7 +2786,13 @@ sal_uInt16 PopupMenu::Execute( vcl::Window* pExecWindow, 
const tools::Rectangle&
     if (nFlags & PopupMenuFlags::NoMouseUpClose )                      // 
allow popup menus to stay open on mouse button up
         nPopupModeFlags |= FloatWinPopupFlags::NoMouseUpClose;    // useful if 
the menu was opened on mousebutton down (eg toolbox configuration)
 
-    return ImplExecute( pExecWindow, rRect, nPopupModeFlags, nullptr, false );
+    return nPopupModeFlags;
+}
+
+sal_uInt16 PopupMenu::Execute( vcl::Window* pExecWindow, const 
tools::Rectangle& rRect, PopupMenuFlags nFlags )
+{
+    ENSURE_OR_RETURN( pExecWindow, "PopupMenu::Execute: need a non-NULL 
window!", 0 );
+    return ImplExecute( pExecWindow, rRect, lcl_TranslateFlags(nFlags), 
nullptr, false );
 }
 
 void PopupMenu::ImplFlushPendingSelect()
@@ -2804,10 +2808,14 @@ void PopupMenu::ImplFlushPendingSelect()
     }
 }
 
-sal_uInt16 PopupMenu::ImplExecute( const VclPtr<vcl::Window>& pW, const 
tools::Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, bool 
bPreSelectFirst )
+bool PopupMenu::PrepareRun(const VclPtr<vcl::Window>& pParentWin, 
tools::Rectangle& rRect,
+                           FloatWinPopupFlags& nPopupModeFlags, Menu* pSFrom,
+                           bool& bRealExecute, VclPtr<MenuFloatingWindow>& 
pWin)
 {
-    if ( !pSFrom && ( vcl::IsInPopupMenuExecute() || !GetItemCount() ) )
-        return 0;
+    bRealExecute = false;
+    const sal_uInt16 nItemCount = GetItemCount();
+    if (!pSFrom && (vcl::IsInPopupMenuExecute() || !nItemCount))
+        return false;
 
     mpLayoutData.reset();
 
@@ -2819,7 +2827,6 @@ sal_uInt16 PopupMenu::ImplExecute( const 
VclPtr<vcl::Window>& pW, const tools::R
     bCanceled = false;
 
     VclPtr<vcl::Window> xFocusId;
-    bool bRealExecute = false;
     if ( !pStartedFrom )
     {
         pSVData->mpWinData->mbNoDeactivate = true;
@@ -2835,25 +2842,24 @@ sal_uInt16 PopupMenu::ImplExecute( const 
VclPtr<vcl::Window>& pW, const tools::R
     }
 
     SAL_WARN_IF( ImplGetWindow(), "vcl", "Win?!" );
-    tools::Rectangle aRect( rRect );
-    aRect.SetPos( pW->OutputToScreenPixel( aRect.TopLeft() ) );
+    rRect.SetPos(pParentWin->OutputToScreenPixel(rRect.TopLeft()));
 
+    nPopupModeFlags |= FloatWinPopupFlags::NoKeyClose | 
FloatWinPopupFlags::AllMouseButtonClose | FloatWinPopupFlags::GrabFocus;
     if (bRealExecute)
         nPopupModeFlags |= FloatWinPopupFlags::NewLevel;
-    nPopupModeFlags |= FloatWinPopupFlags::NoKeyClose | 
FloatWinPopupFlags::AllMouseButtonClose;
 
     bInCallback = true; // set it here, if Activate overridden
     Activate();
     bInCallback = false;
 
-    if ( pW->isDisposed() )
-        return 0;   // Error
+    if (pParentWin->isDisposed())
+        return false;
 
     if ( bCanceled || bKilled )
-        return 0;
+        return false;
 
-    if ( !GetItemCount() )
-        return 0;
+    if (!nItemCount)
+        return false;
 
     // The flag MenuFlags::HideDisabledEntries is inherited.
     if ( pSFrom )
@@ -2883,10 +2889,10 @@ sal_uInt16 PopupMenu::ImplExecute( const 
VclPtr<vcl::Window>& pW, const tools::R
         ImplCallEventListeners(VclEventId::MenuSubmenuChanged, nPos);
     }
 
-    VclPtrInstance<MenuFloatingWindow> pWin( this, pW, WB_BORDER | 
WB_SYSTEMWINDOW );
+    pWin = VclPtrInstance<MenuFloatingWindow>(this, pParentWin, WB_BORDER | 
WB_SYSTEMWINDOW);
     if (comphelper::LibreOfficeKit::isActive() && get_id() == 
"editviewspellmenu")
     {
-        VclPtr<vcl::Window> xNotifierParent = pW->GetParentWithLOKNotifier();
+        VclPtr<vcl::Window> xNotifierParent = 
pParentWin->GetParentWithLOKNotifier();
         assert(xNotifierParent && xNotifierParent->GetLOKNotifier() && 
"editview menu without LOKNotifier");
         pWin->SetLOKNotifier(xNotifierParent->GetLOKNotifier());
     }
@@ -2905,9 +2911,9 @@ sal_uInt16 PopupMenu::ImplExecute( const 
VclPtr<vcl::Window>& pW, const tools::R
         vcl::Window* pDeskW = pWindow->GetWindow( GetWindowType::RealParent );
         if( ! pDeskW )
             pDeskW = pWindow;
-        Point aDesktopTL( pDeskW->OutputToAbsoluteScreenPixel( aRect.TopLeft() 
) );
+        Point aDesktopTL(pDeskW->OutputToAbsoluteScreenPixel(rRect.TopLeft()));
         aDesktopRect = Application::GetScreenPosSizePixel(
-            Application::GetBestScreen( tools::Rectangle( aDesktopTL, 
aRect.GetSize() ) ));
+            Application::GetBestScreen(tools::Rectangle(aDesktopTL, 
rRect.GetSize())));
     }
 
     tools::Long nMaxHeight = aDesktopRect.GetHeight();
@@ -2922,8 +2928,8 @@ sal_uInt16 PopupMenu::ImplExecute( const 
VclPtr<vcl::Window>& pW, const tools::R
         if ( pRef->GetParent() )
             pRef = pRef->GetParent();
 
-        tools::Rectangle devRect(  pRef->OutputToAbsoluteScreenPixel( 
aRect.TopLeft() ),
-                            pRef->OutputToAbsoluteScreenPixel( 
aRect.BottomRight() ) );
+        tools::Rectangle 
devRect(pRef->OutputToAbsoluteScreenPixel(rRect.TopLeft()),
+                                 
pRef->OutputToAbsoluteScreenPixel(rRect.BottomRight()));
 
         tools::Long nHeightAbove = devRect.Top() - aDesktopRect.Top();
         tools::Long nHeightBelow = aDesktopRect.Bottom() - devRect.Bottom();
@@ -2938,7 +2944,7 @@ sal_uInt16 PopupMenu::ImplExecute( const 
VclPtr<vcl::Window>& pW, const tools::R
     nMaxHeight = std::max(nMaxHeight, tools::Long(768));
 
     if (pStartedFrom && pStartedFrom->IsMenuBar())
-        nMaxHeight -= pW->GetSizePixel().Height();
+        nMaxHeight -= pParentWin->GetSizePixel().Height();
     sal_Int32 nLeft, nTop, nRight, nBottom;
     pWindow->GetBorder( nLeft, nTop, nRight, nBottom );
     nMaxHeight -= nTop+nBottom;
@@ -2950,43 +2956,34 @@ sal_uInt16 PopupMenu::ImplExecute( const 
VclPtr<vcl::Window>& pW, const tools::R
         aSz.setHeight( ImplCalcHeight( nEntries ) );
     }
 
-    // tdf#126054 hold this until after function completes
-    VclPtr<PopupMenu> xThis(this);
-
     pWin->SetFocusId( xFocusId );
     pWin->SetOutputSizePixel( aSz );
-    if ( GetItemCount() )
+    return true;
+}
+
+bool PopupMenu::Run(const VclPtr<MenuFloatingWindow>& pWin, const bool 
bRealExecute, const bool bPreSelectFirst,
+                    const FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, 
const tools::Rectangle& rRect)
+{
+    SalMenu* pMenu = ImplGetSalMenu();
+    if (pMenu && bRealExecute && pMenu->ShowNativePopupMenu(pWin, rRect, 
nPopupModeFlags))
+        return true;
+
+    pWin->StartPopupMode(rRect, nPopupModeFlags);
+    if (pSFrom)
     {
-        SalMenu* pMenu = ImplGetSalMenu();
-        if( pMenu && bRealExecute && pMenu->ShowNativePopupMenu( pWin, aRect, 
nPopupModeFlags | FloatWinPopupFlags::GrabFocus ) )
-        {
-            pWin->StopExecute();
-            pWin->doShutdown();
-            pWindow.disposeAndClear();
-            ImplClosePopupToolBox(pW);
-            ImplFlushPendingSelect();
-            return nSelectedId;
-        }
+        sal_uInt16 aPos;
+        if (pSFrom->IsMenuBar())
+            aPos = static_cast<MenuBarWindow 
*>(pSFrom->pWindow.get())->GetHighlightedItem();
         else
-        {
-            pWin->StartPopupMode( aRect, nPopupModeFlags | 
FloatWinPopupFlags::GrabFocus );
-        }
-        if( pSFrom )
-        {
-            sal_uInt16 aPos;
-            if (pSFrom->IsMenuBar())
-                aPos = static_cast<MenuBarWindow 
*>(pSFrom->pWindow.get())->GetHighlightedItem();
-            else
-                aPos = static_cast<MenuFloatingWindow 
*>(pSFrom->pWindow.get())->GetHighlightedItem();
+            aPos = static_cast<MenuFloatingWindow 
*>(pSFrom->pWindow.get())->GetHighlightedItem();
 
-            pWin->SetPosInParent( aPos );  // store position to be sent in 
SUBMENUDEACTIVATE
-            pSFrom->ImplCallEventListeners( VclEventId::MenuSubmenuActivate, 
aPos );
-        }
+        pWin->SetPosInParent(aPos);  // store position to be sent in 
SUBMENUDEACTIVATE
+        pSFrom->ImplCallEventListeners(VclEventId::MenuSubmenuActivate, aPos);
     }
+
     if ( bPreSelectFirst )
     {
-        size_t nCount = pItemList->size();
-        for ( size_t n = 0; n < nCount; n++ )
+        for (size_t n = 0; n < static_cast<size_t>(GetItemCount()); n++)
         {
             MenuItemData* pData = pItemList->GetDataFromPos( n );
             if (  (  pData->bEnabled
@@ -2997,22 +2994,30 @@ sal_uInt16 PopupMenu::ImplExecute( const 
VclPtr<vcl::Window>& pW, const tools::R
                && ImplIsSelectable( n )
                )
             {
-                pWin->ChangeHighlightItem( n, false );
+                pWin->ChangeHighlightItem(n, false);
                 break;
             }
         }
     }
-    if ( bRealExecute )
-    {
+
+    if (bRealExecute)
         pWin->Execute();
-        if (pWin->isDisposed())
-            return 0;
 
-        xFocusId = pWin->GetFocusId();
+    return false;
+}
+
+void PopupMenu::FinishRun(const VclPtr<MenuFloatingWindow>& pWin, const 
VclPtr<vcl::Window>& pParentWin, const bool bRealExecute, const bool 
bIsNativeMenu)
+{
+    if (!bRealExecute || pWin->isDisposed())
+        return;
+
+    if (!bIsNativeMenu)
+    {
+        VclPtr<vcl::Window> xFocusId = pWin->GetFocusId();
         assert(xFocusId == nullptr && "Focus should already be restored by 
MenuFloatingWindow::End");
         pWin->ImplEndPopupMode(FloatWinPopupEndFlags::NONE, xFocusId);
 
-        if ( nSelectedId )  // then clean up .. ( otherwise done by TH )
+        if (nSelectedId)  // then clean up .. ( otherwise done by TH )
         {
             PopupMenu* pSub = pWin->GetActivePopup();
             while ( pSub )
@@ -3021,13 +3026,29 @@ sal_uInt16 PopupMenu::ImplExecute( const 
VclPtr<vcl::Window>& pW, const tools::R
                 pSub = pSub->ImplGetFloatingWindow()->GetActivePopup();
             }
         }
-        pWin->doShutdown();
-        pWindow.disposeAndClear();
-        ImplClosePopupToolBox(pW);
-        ImplFlushPendingSelect();
     }
+    else
+        pWin->StopExecute();
 
-    return bRealExecute ? nSelectedId : 0;
+    pWin->doShutdown();
+    pWindow.disposeAndClear();
+    ImplClosePopupToolBox(pParentWin);
+    ImplFlushPendingSelect();
+}
+
+sal_uInt16 PopupMenu::ImplExecute(const VclPtr<vcl::Window>& pParentWin, const 
tools::Rectangle& rRect,
+                                  FloatWinPopupFlags nPopupModeFlags, Menu* 
pSFrom, bool bPreSelectFirst)
+{
+    // tdf#126054 hold this until after function completes
+    VclPtr<PopupMenu> xThis(this);
+    bool bRealExecute = false;
+    tools::Rectangle aRect(rRect);
+    VclPtr<MenuFloatingWindow> pWin;
+    if (!PrepareRun(pParentWin, aRect, nPopupModeFlags, pSFrom, bRealExecute, 
pWin))
+        return 0;
+    const bool bNative = Run(pWin, bRealExecute, bPreSelectFirst, 
nPopupModeFlags, pSFrom, aRect);
+    FinishRun(pWin, pParentWin, bRealExecute, bNative);
+    return nSelectedId;
 }
 
 sal_uInt16 PopupMenu::ImplCalcVisEntries( tools::Long nMaxHeight, sal_uInt16 
nStartEntry, sal_uInt16* pLastVisible ) const
commit 465c22eff42c9aea6714271ed6a7f27d22aace1c
Author:     Jan-Marek Glogowski <[email protected]>
AuthorDate: Fri Dec 3 01:13:51 2021 +0100
Commit:     Jan-Marek Glogowski <[email protected]>
CommitDate: Fri Dec 10 13:05:38 2021 +0100

    Normalize --disable-scripting handling
    
    Just add the default value to the platform section and handle the
    AC_ARG_ENABLE action-if-not-present accordingly.
    
    Change-Id: I050ace4b20808cedcc4b8ab92f8766c5b5d49d33

diff --git a/configure.ac b/configure.ac
index 4bfeb3c78abc..5c554c4ca35a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1112,6 +1112,7 @@ emscripten)
     test_system_freetype=no
     enable_compiler_plugins=no
     enable_qt5=yes
+    enable_scripting=no
     enable_services_rdb_from_build=yes
     enable_split_debug=yes
     enable_wasm_strip=yes
commit 6e0a3576d2882fc6b7ac950bf04677aaefa0162a
Author:     Jan-Marek Glogowski <[email protected]>
AuthorDate: Fri Dec 3 06:34:58 2021 +0100
Commit:     Jan-Marek Glogowski <[email protected]>
CommitDate: Fri Dec 10 13:05:38 2021 +0100

    WASM minimize xmlsecurity build
    
    Just use additional component files for WASM ATM and figure out
    the real dependencies later, if needed.
    
    Change-Id: Idc0623e8883881dc2bf09e6e87b47cccec04aaba

diff --git a/xmlsecurity/Library_xmlsecurity.mk 
b/xmlsecurity/Library_xmlsecurity.mk
index 9d6862e8d6ec..732266eb92db 100644
--- a/xmlsecurity/Library_xmlsecurity.mk
+++ b/xmlsecurity/Library_xmlsecurity.mk
@@ -9,7 +9,11 @@
 
 $(eval $(call gb_Library_Library,xmlsecurity))
 
+ifeq ($(ENABLE_WASM_STRIP),TRUE)
+$(eval $(call 
gb_Library_set_componentfile,xmlsecurity,xmlsecurity/util/xmlsecurity_wasm))
+else
 $(eval $(call 
gb_Library_set_componentfile,xmlsecurity,xmlsecurity/util/xmlsecurity))
+endif
 
 $(eval $(call gb_Library_set_include,xmlsecurity,\
        $$(INCLUDE) \
diff --git a/xmlsecurity/Library_xsec_xmlsec.mk 
b/xmlsecurity/Library_xsec_xmlsec.mk
index 95742fc4bd2b..de42a52c3aa7 100644
--- a/xmlsecurity/Library_xsec_xmlsec.mk
+++ b/xmlsecurity/Library_xsec_xmlsec.mk
@@ -9,7 +9,11 @@
 
 $(eval $(call gb_Library_Library,xsec_xmlsec))
 
+ifeq ($(ENABLE_WASM_STRIP),TRUE)
+$(eval $(call 
gb_Library_set_componentfile,xsec_xmlsec,xmlsecurity/util/xsec_xmlsec_wasm))
+else
 $(eval $(call 
gb_Library_set_componentfile,xsec_xmlsec,xmlsecurity/util/xsec_xmlsec))
+endif
 
 $(eval $(call gb_Library_set_include,xsec_xmlsec,\
        $$(INCLUDE) \
diff --git a/xmlsecurity/util/xmlsecurity_wasm.component 
b/xmlsecurity/util/xmlsecurity_wasm.component
new file mode 100644
index 000000000000..085e8f2f2d9e
--- /dev/null
+++ b/xmlsecurity/util/xmlsecurity_wasm.component
@@ -0,0 +1,25 @@
+<?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.security.CertificateContainer"
+      
constructor="com_sun_star_security_CertificateContainer_get_implementation">
+    <service name="com.sun.star.security.CertificateContainer"/>
+  </implementation>
+</component>
diff --git a/xmlsecurity/util/xsec_xmlsec_wasm.component 
b/xmlsecurity/util/xsec_xmlsec_wasm.component
new file mode 100644
index 000000000000..33d1f8d77a5d
--- /dev/null
+++ b/xmlsecurity/util/xsec_xmlsec_wasm.component
@@ -0,0 +1,29 @@
+<?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.xml.wrapper.XMLDocumentWrapper"
+      
constructor="com_sun_star_xml_wrapper_XMLDocumentWrapper_get_implementation">
+    <service name="com.sun.star.xml.wrapper.XMLDocumentWrapper"/>
+  </implementation>
+  <implementation name="com.sun.star.xml.wrapper.XMLElementWrapper"
+      
constructor="com_sun_star_xml_wrapper_XMLElementWrapper_get_implementation">
+    <service name="com.sun.star.xml.wrapper.XMLElementWrapper"/>
+  </implementation>
+</component>
commit 435fb122605eef3f19c57045e68a5905983a1bc6
Author:     Jan-Marek Glogowski <[email protected]>
AuthorDate: Wed Dec 1 07:31:01 2021 +0100
Commit:     Jan-Marek Glogowski <[email protected]>
CommitDate: Fri Dec 10 13:05:38 2021 +0100

    WASM optionally add MORE_FONTS to image
    
    AFAIK there is no way to get the file list from packages, because
    FILES is a target-specific variable, not accessible outside of the
    target.
    
    Change-Id: I9da70b0bcd0fc2d86a7e34044182fbd696818440

diff --git a/static/CustomTarget_wasm_fs_image.mk 
b/static/CustomTarget_wasm_fs_image.mk
index 9a1dcfe4a4a5..ff7182b6d203 100644
--- a/static/CustomTarget_wasm_fs_image.mk
+++ b/static/CustomTarget_wasm_fs_image.mk
@@ -1171,6 +1171,191 @@ gb_wasm_image_filelist := \
     $(INSTROOT)/$(LIBO_URE_MISC_FOLDER)/services.rdb \
     $(SRCDIR)/android/default-document/example.odt \
 
+ifneq ($(filter MORE_FONTS,$(BUILD_TYPE)),)
+gb_wasm_image_filelist += \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/Alef-Bold.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/Alef-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/Amiri-BoldSlanted.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/Amiri-Bold.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/AmiriQuran.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/Amiri-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/Amiri-Slanted.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/Caladea-BoldItalic.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/Caladea-Bold.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/Caladea-Italic.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/Caladea-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/Carlito-BoldItalic.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/Carlito-Bold.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/Carlito-Italic.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/Carlito-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DavidLibre-Bold.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DavidLibre-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuMathTeXGyre.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuSans-BoldOblique.ttf 
\
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuSans-Bold.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuSansCondensed-BoldOblique.ttf
 \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuSansCondensed-Bold.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuSansCondensed-Oblique.ttf 
\
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuSansCondensed.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuSans-ExtraLight.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuSansMono-BoldOblique.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuSansMono-Bold.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuSansMono-Oblique.ttf 
\
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuSansMono.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuSans-Oblique.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuSans.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuSerif-BoldItalic.ttf 
\
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuSerif-Bold.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuSerifCondensed-BoldItalic.ttf
 \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuSerifCondensed-Bold.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuSerifCondensed-Italic.ttf 
\
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuSerifCondensed.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuSerif-Italic.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/DejaVuSerif.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/EmojiOneColor-SVGinOT.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/FrankRuehlCLM-BoldOblique.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/FrankRuehlCLM-Bold.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/FrankRuehlCLM-MediumOblique.ttf 
\
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/FrankRuehlCLM-Medium.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/GenBasBI.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/GenBasB.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/GenBasI.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/GenBasR.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/GenBkBasBI.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/GenBkBasB.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/GenBkBasI.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/GenBkBasR.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/KacstBook.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/KacstOffice.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LiberationMono-BoldItalic.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LiberationMono-Bold.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LiberationMono-Italic.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LiberationMono-Regular.ttf 
\
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LiberationSans-BoldItalic.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LiberationSans-Bold.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LiberationSans-Italic.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LiberationSansNarrow-BoldItalic.ttf
 \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LiberationSansNarrow-Bold.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LiberationSansNarrow-Italic.ttf 
\
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LiberationSansNarrow-Regular.ttf
 \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LiberationSans-Regular.ttf 
\
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LiberationSerif-BoldItalic.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LiberationSerif-Bold.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LiberationSerif-Italic.ttf 
\
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LiberationSerif-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LinBiolinum_RB_G.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LinBiolinum_R_G.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LinBiolinum_RI_G.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LinLibertine_DR_G.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LinLibertine_RB_G.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LinLibertine_RBI_G.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LinLibertine_R_G.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LinLibertine_RI_G.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LinLibertine_RZ_G.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/LinLibertine_RZI_G.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/MiriamCLM-Bold.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/MiriamCLM-Book.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/MiriamMonoCLM-BoldOblique.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/MiriamMonoCLM-Bold.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/MiriamMonoCLM-BookOblique.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/MiriamMonoCLM-Book.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoKufiArabic-Bold.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoKufiArabic-Regular.ttf 
\
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoMono-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoNaskhArabic-Bold.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoNaskhArabic-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoNaskhArabicUI-Bold.ttf 
\
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoNaskhArabicUI-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSansArabic-Bold.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSansArabic-Regular.ttf 
\
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSansArabicUI-Bold.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSansArabicUI-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSansArmenian-Bold.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSansArmenian-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSans-BoldItalic.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSans-Bold.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSans-CondensedBoldItalic.ttf
 \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSans-CondensedBold.ttf 
\
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSans-CondensedItalic.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSans-Condensed.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSansGeorgian-Bold.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSansGeorgian-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSansHebrew-Bold.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSansHebrew-Regular.ttf 
\
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSans-Italic.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSansLao-Bold.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSansLao-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSans-LightItalic.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSans-Light.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSansLisu-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSans-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSerifArmenian-Bold.ttf 
\
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSerifArmenian-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSerif-BoldItalic.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSerif-Bold.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSerif-CondensedBoldItalic.ttf
 \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSerif-CondensedBold.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSerif-CondensedItalic.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSerif-Condensed.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSerifGeorgian-Bold.ttf 
\
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSerifGeorgian-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSerifHebrew-Bold.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSerifHebrew-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSerif-Italic.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSerifLao-Bold.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSerifLao-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSerif-LightItalic.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSerif-Light.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/NotoSerif-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/opens___.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/ReemKufi-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/Rubik-BoldItalic.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/Rubik-Bold.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/Rubik-Italic.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/Rubik-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/Scheherazade-Bold.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/Scheherazade-Regular.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceCodePro-BlackIt.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceCodePro-Black.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceCodePro-BoldIt.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceCodePro-Bold.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceCodePro-ExtraLightIt.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceCodePro-ExtraLight.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceCodePro-It.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceCodePro-LightIt.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceCodePro-Light.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceCodePro-MediumIt.ttf 
\
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceCodePro-Medium.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceCodePro-Regular.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceCodePro-SemiboldIt.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceCodePro-Semibold.ttf 
\
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceSansPro-BlackIt.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceSansPro-Black.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceSansPro-BoldIt.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceSansPro-Bold.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceSansPro-ExtraLightIt.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceSansPro-ExtraLight.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceSansPro-It.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceSansPro-LightIt.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceSansPro-Light.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceSansPro-Regular.ttf \
+    
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceSansPro-SemiboldIt.ttf \
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceSansPro-Semibold.ttf 
\
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceSerifPro-BlackIt.ttf 
\
+    $(INSTROOT)/$(LIBO_SHARE_FOLDER)/fonts/truetype/SourceSerifPro-Black.ttf \

... etc. - the rest is truncated

Reply via email to