android/source/build.gradle | 23 +++++++++++------------ unoxml/source/dom/documentbuilder.hxx | 2 +- 2 files changed, 12 insertions(+), 13 deletions(-)
New commits: commit bcce2205313b6c3a427d0ab12b65526a577fe996 Author: Michael Weghorn <[email protected]> AuthorDate: Mon Jan 16 16:07:11 2023 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Tue Jan 17 06:17:42 2023 +0000 tdf#153009 android: Include more doc layout related XML files instdir/share/config/soffice.cfg/simpress/objectlist.xml contains default positions for elements that are used in new Impress presentations, but that file wasn't included in the Android app/APK previously, so couldn't be read from in `SdDrawDocument::InitObjectVector`. As a result, the title and text were misplaced when creating a new presentation in Android Viewer. Include all of the related Impress XML files into the app to make this work as expected. (At least a failed attempt to read from `layoutlist.xml` was also observed while debugging the issue mentioned above.) Change-Id: Iba1ac68c0b983d3e465515f07b3fc67162a0ee3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145621 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/android/source/build.gradle b/android/source/build.gradle index 245d1c41d71e..b31b82eb1120 100644 --- a/android/source/build.gradle +++ b/android/source/build.gradle @@ -149,7 +149,7 @@ task copyAssets(type: Copy) { into ('config') { from ("${liboInstdir}/share/config") includes = ['images_**.zip', - '**/simpress/styles.xml', + '**/simpress/**.xml', '**/annotation.ui', '**/hfmenubutton.ui', '**/inforeadonlydialog.ui', commit 48916eb11bea29ac2f7963d779b18491d6015737 Author: Michael Weghorn <[email protected]> AuthorDate: Mon Jan 16 11:23:21 2023 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Tue Jan 17 06:17:36 2023 +0000 tdf#153009 Use recursive mutex in CDocumentBuilder This was changed from `osl::Mutex` to `std::mutex` in commit e66fdb597b30fc701bb068824d0ae4d89fecd55f Date: Sat Jul 31 20:12:30 2021 +0200 osl::Mutex->std::mutex in CDocumentBuilder , but `DOM::CDocumentBuilder::parseURI` locks the mutex and then calls `DOM::CDocumentBuilder::parse` for the // if we failed to parse the URI as a simple file, lets try via a ucb stream. // For Android file:///assets/ URLs which must go via the osl/ file API. case, which would result in a deadlock because `DOM::CDocumentBuilder::parse` wants to lock the mutex again. This happens once that code path is executed on Android Viewer when creating a new Impress presentation with Change-Id Iba1ac68c0b983d3e465515f07b3fc67162a0ee3f ("tdf#153009 android: Include more doc layout related XML files") in place. Fix the deadlock by using a "std::recursive_mutex` instead. Part of the backtrace: DOM::CDocumentBuilder::parse(const com::sun::star::uno::Reference<…> &) documentbuilder.cxx:331 DOM::CDocumentBuilder::parseURI(const rtl::OUString &) documentbuilder.cxx:387 non-virtual thunk to DOM::CDocumentBuilder::parseURI(rtl::OUString const&) documentbuilder.cxx:0 SdDrawDocument::InitLayoutVector() drawdoc.cxx:1130 SdDrawDocument::SdDrawDocument(DocumentType, SfxObjectShell *) drawdoc.cxx:147 sd::DrawDocShell::Construct(bool) docshell.cxx:94 sd::DrawDocShell::DrawDocShell(SfxModelFlags, bool, DocumentType) docshell.cxx:140 sd_PresentationDocument_get_implementation::$_1::operator()(SfxModelFlags) const unodoc.cxx:65 std::__ndk1::__invoke<…>(sd_PresentationDocument_get_implementation::$_1 &, SfxModelFlags &&) type_traits:4353 std::__ndk1::__invoke_void_return_wrapper::__call<…>(sd_PresentationDocument_get_implementation::$_1 &, SfxModelFlags &&) __functional_base:318 std::__ndk1::__function::__alloc_func::operator()(SfxModelFlags &&) functional:1527 std::__ndk1::__function::__func::operator()(SfxModelFlags &&) functional:1651 std::__ndk1::__function::__value_func::operator()(SfxModelFlags &&) const functional:1799 std::__ndk1::function::operator()(SfxModelFlags) const functional:2347 sfx2::createSfxModelInstance(const com::sun::star::uno::Sequence<…> &, std::__ndk1::function<…>) sfxmodelfactory.cxx:82 sd_PresentationDocument_get_implementation(com::sun::star::uno::XComponentContext *, const com::sun::star::uno::Sequence<…> &) unodoc.cxx:61 std::__ndk1::__invoke<…>(com::sun::star::uno::XInterface *(*&)(com::sun::star::uno::XComponentContext *, const com::sun::star::uno::Sequence<…> &), com::sun::star::uno::XComponentContext *&&, const com::sun::star::uno::Sequence<…> &) type_traits:4353 std::__ndk1::__invoke_void_return_wrapper::__call<…>(com::sun::star::uno::XInterface *(*&)(com::sun::star::uno::XComponentContext *, const com::sun::star::uno::Sequence<…> &), com::sun::star::uno::XComponentContext *&&, const com::sun::star::uno::Sequence<…> &) __functional_base:318 std::__ndk1::__function::__alloc_func::operator()(com::sun::star::uno::XComponentContext *&&, const com::sun::star::uno::Sequence<…> &) functional:1527 std::__ndk1::__function::__func::operator()(com::sun::star::uno::XComponentContext *&&, const com::sun::star::uno::Sequence<…> &) functional:1651 std::__ndk1::__function::__value_func::operator()(com::sun::star::uno::XComponentContext *&&, const com::sun::star::uno::Sequence<…> &) const functional:1799 std::__ndk1::function::operator()(com::sun::star::uno::XComponentContext *, const com::sun::star::uno::Sequence<…> &) const functional:2347 cppuhelper::ServiceManager::Data::Implementation::doCreateInstance(const com::sun::star::uno::Reference<…> &) servicemanager.cxx:706 cppuhelper::ServiceManager::Data::Implementation::createInstance(const com::sun::star::uno::Reference<…> &, bool) servicemanager.cxx:675 cppuhelper::ServiceManager::createInstanceWithContext(const rtl::OUString &, const com::sun::star::uno::Reference<…> &) servicemanager.cxx:1006 non-virtual thunk to cppuhelper::ServiceManager::createInstanceWithContext(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) servicemanager.cxx:0 SfxFrameLoader_Impl::load(const com::sun::star::uno::Sequence<…> &, const com::sun::star::uno::Reference<…> &) frmload.cxx:707 non-virtual thunk to (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) frmload.cxx:0 framework::LoadEnv::impl_loadContent() loadenv.cxx:1167 framework::LoadEnv::start() loadenv.cxx:403 framework::LoadEnv::startLoading(const rtl::OUString &, const com::sun::star::uno::Sequence<…> &, const com::sun::star::uno::Reference<…> &, const rtl::OUString &, long, LoadEnvFeatures) loadenv.cxx:308 framework::LoadEnv::loadComponentFromURL(const com::sun::star::uno::Reference<…> &, const com::sun::star::uno::Reference<…> &, const rtl::OUString &, const rtl::OUString &, long, const com::sun::star::uno::Sequence<…> &) loadenv.cxx:168 framework::Desktop::loadComponentFromURL(const rtl::OUString &, const rtl::OUString &, long, const com::sun::star::uno::Sequence<…> &) desktop.cxx:594 non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, long, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) desktop.cxx:0 lo_documentLoadWithOptions(_LibreOfficeKit *, const char *, const char *) init.cxx:2666 lo_documentLoad(_LibreOfficeKit *, const char *) init.cxx:2532 Java_org_libreoffice_kit_Office_documentLoadNative(JNIEnv *, jobject, jstring) lokandroid.cxx:134 [...] Change-Id: I63bc7b6f682dab2e94f4e932429c513c5129428e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145620 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/unoxml/source/dom/documentbuilder.hxx b/unoxml/source/dom/documentbuilder.hxx index b29e0410e76e..7b93b170d4c1 100644 --- a/unoxml/source/dom/documentbuilder.hxx +++ b/unoxml/source/dom/documentbuilder.hxx @@ -46,7 +46,7 @@ namespace DOM : public CDocumentBuilder_Base { private: - std::mutex m_Mutex; + std::recursive_mutex m_Mutex; css::uno::Reference< css::xml::sax::XEntityResolver > m_xEntityResolver; css::uno::Reference< css::xml::sax::XErrorHandler > m_xErrorHandler; commit 3cecdaeab10d4fcb0f478035fa3831c2e255b10c Author: Michael Weghorn <[email protected]> AuthorDate: Mon Jan 16 09:39:35 2023 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Tue Jan 17 06:17:29 2023 +0000 tdf#153009 android: Set BRAND_SHARE_SUBDIR for more default structure Set `BRAND_SHARE_SUBDIR=share` in the `fundamentalrc` shipped with Android Viewer, as is the case for the desktop variant as well. This implies that the .ui files will be expected underneath the "config/share" directory in the app's assets from now on instead of just "config", since `BRAND_SHARE_SUBDIR` will be expanded accordingly in the paths. Therefore, put the .ui files there. Merge the block responsible for copying UI files into into the existing block already copying to that dir in the `copyTask` gradle task. There seems to be no particular reason for omitting the "share" subdirectory just for the .ui files in the Android assets. This is also in preparation of fixing tdf#153009: Not having `BRAND_SHARE_SUBDIR` set on Android resulted in "vnd.sun.star.expand:$BRAND_BASE_DIR/$BRAND_SHARE_SUBDIR/config/soffice.cfg/simpress/objectlist.xml" previously getting expanded to file:///assets//config/soffice.cfg/simpress/objectlist.xml in `SdDrawDocument::InitObjectVector`, and that would cause failure to read object property settings (e.g. for the placeholder text in a new Impress presentation) from that file, even when `objectlist.xml` was put into the app's assets (s. Change-Id Iba1ac68c0b983d3e465515f07b3fc67162a0ee3f, "tdf#153009 android: Include more doc layout related XML files") at "config/soffice.cfg/simpress/objectlist.xml" due to the double-slash after "assets" not being treated the same way as a single slash at that place. Change-Id: Ia9d86e1f59daf8a41951cefb3a1e9f82f0e9f184 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145619 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/android/source/build.gradle b/android/source/build.gradle index 2b6d566148ba..245d1c41d71e 100644 --- a/android/source/build.gradle +++ b/android/source/build.gradle @@ -144,12 +144,20 @@ task copyAssets(type: Copy) { description "copies assets that can be accessed within the installed apk" into 'assets' - // include icons and Impress styles + // include icons, Impress styles and required .ui files into ('share') { into ('config') { from ("${liboInstdir}/share/config") includes = ['images_**.zip', - '**/simpress/styles.xml'] + '**/simpress/styles.xml', + '**/annotation.ui', + '**/hfmenubutton.ui', + '**/inforeadonlydialog.ui', + '**/pbmenubutton.ui', + '**/scrollbars.ui', + '**/tabbuttons.ui', + '**/tabviewbar.ui' + ] } } @@ -174,16 +182,6 @@ task copyAssets(type: Copy) { include '*.data' } } - // include required .ui files - into('config') { - from "${liboInstdir}/share/config" - include '**/annotation.ui', - '**/hfmenubutton.ui', - '**/inforeadonlydialog.ui', - '**/pbmenubutton.ui', - '**/scrollbars.ui', - '**/tabbuttons.ui', '**/tabviewbar.ui' - } } task copyAppResources(type: Copy) { @@ -265,6 +263,7 @@ task createRCfiles { [Bootstrap] LO_LIB_DIR=file://$APP_DATA_DIR/lib/ BRAND_BASE_DIR=file:///assets + BRAND_SHARE_SUBDIR=share CONFIGURATION_LAYERS=xcsxcu:${BRAND_BASE_DIR}/share/registry res:${BRAND_BASE_DIR}/share/registry URE_BIN_DIR=file:///assets/ure/bin/dir/nothing-here/we-can/exec-anyway '''.stripIndent()
