summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-05-03android: Show Impress icon for .pps filesdistro/lhm/libreoffice-7-3+backportsMichael Weghorn1-1/+1
For some reason, that was commented out. Opening such a PowerPoint file worked just fine, and with this commit in place, the Impress icon is shown in the "Recent Files" view as well. Change-Id: I69bce54074c084928d9aa7b95f37145a9692b847 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133649 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit c50afd45d2f6a7c70bb3a7591747b162a2675311)
2022-05-03tdf#111427 android: Enable support for .ppsxMichael Weghorn3-2/+3
Opening the sample file of MIME type "application/vnd.openxmlformats-officedocument.presentationml.slideshow" attached to tdf#111427 worked fine now when testing in an x86_64 AVD with API level 31, so declare support for it. Change-Id: I67ace0fb6ee82c0a43624dc32671ba2d453e473c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133648 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 965205931162b7fcdc175672354103b40985c6ed)
2022-05-03tdf#148851 Unmap + close file again in xdictionary dtorMichael Weghorn2-12/+28
The file opened and mapped to memory in the `xdictionary` ctor was never unmapped and closed again, resulting in a memory leak. For Android Viewer, this resulted in the app running out of memory after a while when scrolling up and down in the Chinese sample doc from tdf#148851. On Android, closing the file is actually the relevant part, because the content of files from `/assets` is automatically loaded into memory when the files are opened (s. the call to `openMemoryAsFile` in `openFilePath` in `sal/osl/unx/file.cxx`) and that memory is only freed when the file is closed again (s. `osl_closeFile`). When using the sample doc, the file in question was "file:///assets/share/dict_zh.data", which has a size of 2.2 MB and is therefore actually loaded into memory anew every time, since only files below 50 KiB are handled by the file cache introduced in commit 26a46c1143e34e361d76d6459535c2056c59de77 Date: Fri Dec 20 14:46:36 2019 +0000 android: file-cache to improve performance. Fix the memory leak by unmapping and closing the file again in the dtor. Change-Id: I3388964877080d1f2b3cf2682a41549e0bfb850c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133581 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit d4370761421508522a29c5206aea6e538d71b342)
2022-05-03android: Slightly clean up style of LOKitTileProvider#resetPartsMichael Weghorn1-2/+4
* Reduce scope of the `parts` variable to the if block * add an emptly line before the next method Change-Id: I22389cb4c9307f6888c4ed836056caf23ce84da6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133450 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 5453f75a1e682992f3a725781bb563b8cc76cf1b)
2022-05-03android: Reuse existing LOKitTileProvider#resetPartsMichael Weghorn1-18/+2
... instead of duplicating what it does in `LOKitTileProvider#postLoad`. Change-Id: I0ed3d77d9f9651efec764eafeaa3f71576abcf6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133449 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit e996ad71582ecd4425a1ab0d0347cccf7c7724c2)
2022-05-03android: Leave part names starting with "Sheet" etc. intactMichael Weghorn1-2/+0
It's unexpected that opening a Calc sheet with two tables called "Sheet foobar" and "Sheet 10" would result in the sheets showing up as "Sheet 1" and "Sheet 2" in the parts view instead of their real names. Therefore, leave the original names intact and show them instead of generating new generic names. The change to rename such sheets (and similar parts) has been added in commit 1239dce2595877ad64fd8c8fd927ea4285d69abe Date: Thu Nov 1 22:03:31 2018 +0300 [Pardus] language improvements on Android More hardcoded strings extrated to the resource file Few Turkish language improvements This patch is sponsored by ULAKBIM/Pardus project. where the intention seems to have been to have a localized name for the parts show up. That still happens when the part name is empty (s. lines above), but I think that explicit names should remain as they are, as e.g. also happens for Calc sheets in the desktop version of LibreOffice. Change-Id: I3073babf99a6b2309be2107141bba92236eba76d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133448 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 1b45a30ccd4726612420bd09318eeae2a72425be)
2022-05-03android: Use 'if' instead of switch-cases with just 1 caseMichael Weghorn1-6/+3
... which IMHO makes this a bit more readable. Change-Id: Ica1d9416f711e75e6d6c23963ca64d13e08c138e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133428 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 6df639114da3fa98bd2fd749eca40d3c2190c018)
2022-05-03android: Drop redundant check for SDK version <= 11Michael Weghorn1-4/+0
minSdkVersion is 16. Change-Id: I1082cc5abd7ecc02211509e57fd41c97cf706e8a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133427 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 052c8a4b1b3aaa472ca89f834572c293f7d9ead2)
2022-04-22oss-fuzz: fix some compiler warningsJan-Marek Glogowski4-10/+14
Some unused functions and variables and many missing HAVE_FEATURE_NSS warnings, because the native-code.py stubs were missing the config_crypto.h header. Change-Id: I88ff7d8f96e7382027a21f205db982fd797bd6af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127392 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> (cherry picked from commit fa5db38ae5bbe9abfd41b6765074ca1200b8def2)
2022-04-22Convert example document from cz to en-usJan-Marek Glogowski1-0/+0
Change-Id: Ia757491ce8802ec9deec9e75c65c6ae1c8ff2c79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126460 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> (cherry picked from commit 7a4a13517dc464ed409be0b9c36b2a32a4027c98)
2022-04-22android: Show file chooser despite package visibility filtering in API 30Michael Weghorn1-1/+4
While it was working just fine in my x86_64 AVD with API level 31, opening the the file chooser on a real HW aarch64 device running Android 12 no longer worked by tapping on the TextView in `LibreOfficeUIActivity` after updating target API from 28 to 31 in commit 2ab389b251744fa7f3f6b060c09746e59d87f3b1 Date: Tue Apr 19 10:33:27 2022 +0200 android: Update compileSdkVersion/targetSdkVersion to 31 The intent.resolveActivity(getPackageManager()) != null check was failing there, so the Activity with `Intent.ACTION_OPEN_DOCUMENT` wasn't started there. This looks like an issue due to package visibility filtering introduced in target API level 30. Quoting from [1]: > When an app targets Android 11 (API level 30) or higher and queries for > information about the other apps that are installed on a device, the > system filters this information by default. The limited package > visibility reduces the number of apps that appear to be installed on a > device, from your app's perspective. > > [...] > > The limited app visibility affects the return results of methods that > give information about other apps, such as queryIntentActivities(), > getPackageInfo(), and getInstalledApplications(). The limited > visibility also affects explicit interactions with other apps, such > as starting another app's service. From how I understand it, the check is used to make sure that there is an app that can handle the Intent, as e.g. the "Android fundamentals 02.3: Implicit intents" tutorial [2] mentions it for the example using an `Intent.ACTION_VIEW`: > Use the resolveActivity() method and the Android package manager to find > an Activity that can handle your implicit Intent. Make sure that the > request resolved successfully. > > if (intent.resolveActivity(getPackageManager()) != null) { > } > > This request matches your Intent action and data with the Intent filters > for installed apps on the device. You use it to make sure there is at > least one Activity that can handle your requests. While that sounds reasonable to make sure there is an app that can view specific data passed *from* the app (and [3] describes how to add a corresponding `<queries>` element to make this use case work), it seems to be unnecessary for `Intent.ACTION_OPEN_DOCUMENT`, since that causes the system to "display the various DocumentsProvider instances installed on the device, letting the user navigate through them" and Android presumably at least provides a provider for handling local files by itself in any case. The `Intent.ACTION_GET_CONTENT` case used instead of `Intent.ACTION_OPEN_DOCUMENT` for API level < 19 should presumably be similar. Anyway, in case there should still be any case where the Intent cannot be handled: `startActivityForResult` "throws ActivityNotFoundException if there was no Activity found to run the given Intent." [4], so add a try-catch block handling that exception instead of the previous check. [1] https://developer.android.com/training/package-visibility [2] https://developer.android.com/codelabs/android-training-activity-with-implicit-intent?index=..%2F..android-training#3 [3] https://developer.android.com/training/package-visibility/use-cases#open-a-file [4] https://developer.android.com/reference/android/app/Activity#startActivityForResult(android.content.Intent,%20int) Change-Id: I7702b100d71333be2d78df1bc81ef2e5a7e016bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133272 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit b68821acc77c774c09ebca8be157a768ea417e04)
2022-04-22android: Slightly improve style in use of arraysMichael Weghorn1-4/+4
Addresses these warnings shown in Android Studio for class `LibreOfficeUIActivity`: * "Unnecessary 'Arrays.asList()' call" * "Raw use of parameterized class 'ArrayList'" * "Explicit type argument ShortcutInfo can be replaced with <>" Change-Id: I083e5fcf804209fae704b19643ce80bc92126ca8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133271 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit b68362b178f732f90fdc99073aaa5940bee409bb)
2022-04-22android: Drop unused import and extra semicolonMichael Weghorn1-2/+1
Change-Id: I19557b0b1d63698a31dac61ce9fde3ce07f86451 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133267 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 6515633aad867dd9e2d59378f3254e292dbdacb0)
2022-04-22android: Avoid using resource ID in switch-caseMichael Weghorn1-41/+33
Adresses this warning shown in Android Studio: > Resource IDs will be non-final by default in Android Gradle Plugin > version 8.0, avoid using them in switch case statements Change-Id: I8cead0ceb3b71e263b29d4283a8cfac522ed4204 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133266 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 62524dcf152b274b855005402d082debaa3fc84a)
2022-04-22android: Use fake exceptions on all architecturesMichael Weghorn1-4/+2
This was previously only used for aarch64, and the workaround does not seem to be necessary in current Android versions on other architectures. However, while it's e.g. not needed on an x86 AVD with API level 21 (Android 5), at least my x86 AVD with API level 16 (Android 4.1), which is currently our `minSdkVersion`, fails otherwise when trying to open any document with the below in the ADB log. With this (and all the previous fixes for low API/SDK levels) in place, opening a document in Android Viewer finally succeeds there. > F/libc ( 3288): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 3310 (Thread-122) > I/stderr ( 3288): terminating with uncaught exception of type com::sun::star::ucb::InteractiveAugmentedIOException > I/stderr ( 3288): assertion "terminating with uncaught exception of type com::sun::star::ucb::InteractiveAugmentedIOException" failed: file "/usr/local/google/buildbot/src/android/ndk-release-r20/external/libcxx/../../external/libcxxabi/src/abort_message.cpp", line 73, function "abort_message" > I/DEBUG ( 1173): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** > I/DEBUG ( 1173): Build fingerprint: 'generic_x86/sdk_x86/generic_x86:4.1.2/MASTER/eng.wdu.20191218.182616:eng/test-keys' > I/DEBUG ( 1173): pid: 3288, tid: 3310, name: Thread-122 >>> org.libreoffice <<< > I/DEBUG ( 1173): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad > I/DEBUG ( 1173): eax 00000000 ebx b76c9f4c ecx 00000000 edx b76cbfd4 > I/DEBUG ( 1173): esi b65ed000 edi 788c7d6c > I/DEBUG ( 1173): xcs 00000073 xds 0000007b xes 0000007b xfs 00000000 xss 0000007b > I/DEBUG ( 1173): eip b7661c03 ebp 788c7d88 esp 788c7d40 flags 00210246 > I/DEBUG ( 1173): > I/DEBUG ( 1173): backtrace: > I/DEBUG ( 1173): #00 pc 00021c03 /system/lib/libc.so (abort+131) > I/DEBUG ( 1173): #01 pc 00030ff1 /system/lib/libc.so > I/DEBUG ( 1173): #02 pc 0e137175 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #03 pc 0e1372f5 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #04 pc 0e133d0a /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #05 pc 0e13323f /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #06 pc 0e133194 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #07 pc 0d369737 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #08 pc 0d3673b0 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #09 pc 0d366a7b /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #10 pc 0d377a25 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #11 pc 09a2b944 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #12 pc 098826da /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #13 pc 098cc47c /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #14 pc 098ded29 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #15 pc 098bb839 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #16 pc 098b7e23 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #17 pc 098bb8cf /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #18 pc 0987a677 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #19 pc 0987b7c7 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #20 pc 0987ab4b /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #21 pc 0987a9a7 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #22 pc 0987f90b /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #23 pc 0986d4ff /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #24 pc 09872298 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #25 pc 035625cf /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #26 pc 0355dff2 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #27 pc 035713f9 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #28 pc 03570d3b /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #29 pc 035714b8 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #30 pc 09a5fb66 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #31 pc 09a5f984 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): > I/DEBUG ( 1173): stack: > I/DEBUG ( 1173): 788c7d00 b76cca48 > I/DEBUG ( 1173): 788c7d04 b76ca208 /system/lib/libc.so > I/DEBUG ( 1173): 788c7d08 b76699eb /system/lib/libc.so (_fwalk+11) > I/DEBUG ( 1173): 788c7d0c b76c9f4c /system/lib/libc.so > I/DEBUG ( 1173): 788c7d10 00000000 > I/DEBUG ( 1173): 788c7d14 00000000 > I/DEBUG ( 1173): 788c7d18 00000000 > I/DEBUG ( 1173): 788c7d1c 00000000 > I/DEBUG ( 1173): 788c7d20 00000000 > I/DEBUG ( 1173): 788c7d24 00000000 > I/DEBUG ( 1173): 788c7d28 00000000 > I/DEBUG ( 1173): 788c7d2c 00000000 > I/DEBUG ( 1173): 788c7d30 00000000 > I/DEBUG ( 1173): 788c7d34 00000000 > I/DEBUG ( 1173): 788c7d38 00000000 > I/DEBUG ( 1173): 788c7d3c 00000000 > I/DEBUG ( 1173): #00 788c7d40 00000002 > I/DEBUG ( 1173): 788c7d44 788c7d6c [stack:3310] > I/DEBUG ( 1173): 788c7d48 00000000 > I/DEBUG ( 1173): 788c7d4c 00000115 > I/DEBUG ( 1173): 788c7d50 0000007f > I/DEBUG ( 1173): 788c7d54 b76c9f4c /system/lib/libc.so > I/DEBUG ( 1173): 788c7d58 788c7d98 [stack:3310] > I/DEBUG ( 1173): 788c7d5c b76c9f4c /system/lib/libc.so > I/DEBUG ( 1173): 788c7d60 b76ca208 /system/lib/libc.so > I/DEBUG ( 1173): 788c7d64 788c7e04 [stack:3310] > I/DEBUG ( 1173): 788c7d68 788c7d88 [stack:3310] > I/DEBUG ( 1173): 788c7d6c fffffbdf > I/DEBUG ( 1173): 788c7d70 b76ca208 /system/lib/libc.so > I/DEBUG ( 1173): 788c7d74 b76b3b24 /system/lib/libc.so > I/DEBUG ( 1173): 788c7d78 b7661b8e /system/lib/libc.so (abort+14) > I/DEBUG ( 1173): 788c7d7c b76c9f4c /system/lib/libc.so > I/DEBUG ( 1173): ........ ........ > I/DEBUG ( 1173): #01 788c7d90 b76ca208 /system/lib/libc.so > I/DEBUG ( 1173): 788c7d94 b76b3b24 /system/lib/libc.so > I/DEBUG ( 1173): 788c7d98 b9b98fc0 [heap] > I/DEBUG ( 1173): 788c7d9c 8723cac3 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): 788c7da0 00000049 > I/DEBUG ( 1173): 788c7da4 8723cb39 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): 788c7da8 b766b6fe /system/lib/libc.so (vasprintf+14) > I/DEBUG ( 1173): 788c7dac 8d73b830 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): 788c7db0 b7670fa9 /system/lib/libc.so (__assert2+9) > I/DEBUG ( 1173): 788c7db4 8d73b830 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): 788c7db8 788c7df8 [stack:3310] > I/DEBUG ( 1173): 788c7dbc 86a0d175 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): #02 788c7dc0 8723cac3 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): 788c7dc4 00000049 > I/DEBUG ( 1173): 788c7dc8 8723cb39 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): 788c7dcc b9b98fc0 [heap] > I/DEBUG ( 1173): 788c7dd0 b9b98fc0 [heap] > I/DEBUG ( 1173): 788c7dd4 788c7e04 [stack:3310] > I/DEBUG ( 1173): 788c7dd8 788c7e04 [stack:3310] > I/DEBUG ( 1173): 788c7ddc 86a09960 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): 788c7de0 00000014 > I/DEBUG ( 1173): 788c7de4 86a09980 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): 788c7de8 788c7e38 [stack:3310] > I/DEBUG ( 1173): 788c7dec 788c7e1c [stack:3310] > I/DEBUG ( 1173): 788c7df0 b9b1c480 [heap] > I/DEBUG ( 1173): 788c7df4 8d73b830 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): 788c7df8 788c8238 [stack:3310] > I/DEBUG ( 1173): 788c7dfc 86a0d2f5 /data/data/org.libreoffice/lib/liblo-native-code.so > I/DEBUG ( 1173): > I/DEBUG ( 1173): memory map around fault addr deadbaad: > I/DEBUG ( 1173): bfa03000-bfa24000 [stack] > I/DEBUG ( 1173): (no map for address) > I/DEBUG ( 1173): (no map above) > D/Zygote ( 1176): Process 3288 terminated by signal (11) Change-Id: I0bc6d13b1217959c5e447e7c6126006b561639a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133264 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit a03d7b1871673473b6201a8a15be175d7b65d71d)
2022-04-22Cherry-pick exc_thrower.cxx changes from ↵Michael Weghorn1-5/+12
c367a2781f99ed22d0f7d64184fb567aacc43f35 This cherry-picks just the changes to `cppuhelper/source/exc_thrower.cxx` to our distro/lhm/libreoffice-7-3+backports branch to simplify backporting of Android-related changes. (The other WASM-related changes are irrelevant since we don't use WASM.) This is a partial cherry-pick of: commit c367a2781f99ed22d0f7d64184fb567aacc43f35 Author: Thorsten Behrens <thorsten.behrens@allotropia.de> Date: Sat Sep 25 18:03:31 2021 +0200 WASM UNO: add a minimal dummy bridge ... and use the same fake exception rethrowing code then the mobile platforms. Change-Id: Ic90de1cfd1e0092d6064d041a613d60d9f5f76b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128596 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> Change-Id: Icfb74267c59437eb6467f2f91a5aa1dada3716d4
2022-04-22android: Explicitly load libc++_sharedMichael Weghorn1-0/+1
While it works just fine without that in newer Android versions, trying to open any doc in an x86 AVD with API level 16 failed like this: > E/AndroidRuntime( 2999): java.lang.ExceptionInInitializerError > E/AndroidRuntime( 2999): at org.libreoffice.TileProviderFactory.initialize(TileProviderFactory.java:23) > E/AndroidRuntime( 2999): at org.libreoffice.LOKitThread.<init>(LOKitThread.java:39) > E/AndroidRuntime( 2999): at org.libreoffice.LibreOfficeMainActivity.onCreate(LibreOfficeMainActivity.java:149) > E/AndroidRuntime( 2999): at android.app.Activity.performCreate(Activity.java:5008) > E/AndroidRuntime( 2999): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) > E/AndroidRuntime( 2999): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023) > E/AndroidRuntime( 2999): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) > E/AndroidRuntime( 2999): at android.app.ActivityThread.access$600(ActivityThread.java:130) > E/AndroidRuntime( 2999): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) > E/AndroidRuntime( 2999): at android.os.Handler.dispatchMessage(Handler.java:99) > E/AndroidRuntime( 2999): at android.os.Looper.loop(Looper.java:137) > E/AndroidRuntime( 2999): at android.app.ActivityThread.main(ActivityThread.java:4745) > E/AndroidRuntime( 2999): at java.lang.reflect.Method.invokeNative(Native Method) > E/AndroidRuntime( 2999): at java.lang.reflect.Method.invoke(Method.java:511) > E/AndroidRuntime( 2999): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) > E/AndroidRuntime( 2999): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) > E/AndroidRuntime( 2999): at dalvik.system.NativeStart.main(Native Method) > E/AndroidRuntime( 2999): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1891]: 1176 could not load needed library 'libc++_shared.so' for 'liblo-native-code.so' (load_library[1093]: Library 'libc++_shared.so' not found) > E/AndroidRuntime( 2999): at java.lang.Runtime.loadLibrary(Runtime.java:370) > E/AndroidRuntime( 2999): at java.lang.System.loadLibrary(System.java:535) > E/AndroidRuntime( 2999): at org.libreoffice.kit.NativeLibLoader.load(LibreOfficeKit.java:105) > E/AndroidRuntime( 2999): at org.libreoffice.kit.LibreOfficeKit.<clinit>(LibreOfficeKit.java:82) > E/AndroidRuntime( 2999): ... 17 more > W/ActivityManager( 1421): Force finishing activity org.libreoffice/.LibreOfficeMainActivity > W/ActivityManager( 1421): Force finishing activity org.libreoffice/.ui.LibreOfficeUIActivity Change-Id: I6e383e624b9e66c0daa9ecfda4a3b176c8fa0d94 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133263 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 7084da45dd322c253626c3576aef53ae021fdcdf)
2022-04-22android: Use drawable tag already supported with API level 16Michael Weghorn1-2/+2
Use the `app:drawableLeftCompat` tag instead of `android:drawableLeft` to set the icon to show in the TextView. With the latter, trying to start Android Viewer in an x86 AVD with API level 16 resulted in this crash: > E/AndroidRuntime( 2510): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.libreoffice/org.libreoffice.ui.LibreOfficeUIActivity}: android.view.InflateException: Binary XML file line #80: Error inflating class TextView > E/AndroidRuntime( 2510): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059) > E/AndroidRuntime( 2510): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) > E/AndroidRuntime( 2510): at android.app.ActivityThread.access$600(ActivityThread.java:130) > E/AndroidRuntime( 2510): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) > E/AndroidRuntime( 2510): at android.os.Handler.dispatchMessage(Handler.java:99) > E/AndroidRuntime( 2510): at android.os.Looper.loop(Looper.java:137) > E/AndroidRuntime( 2510): at android.app.ActivityThread.main(ActivityThread.java:4745) > E/AndroidRuntime( 2510): at java.lang.reflect.Method.invokeNative(Native Method) > E/AndroidRuntime( 2510): at java.lang.reflect.Method.invoke(Method.java:511) > E/AndroidRuntime( 2510): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) > E/AndroidRuntime( 2510): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) > E/AndroidRuntime( 2510): at dalvik.system.NativeStart.main(Native Method) > E/AndroidRuntime( 2510): Caused by: android.view.InflateException: Binary XML file line #80: Error inflating class TextView > E/AndroidRuntime( 2510): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) > E/AndroidRuntime( 2510): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) > E/AndroidRuntime( 2510): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749) > E/AndroidRuntime( 2510): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749) > E/AndroidRuntime( 2510): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749) > E/AndroidRuntime( 2510): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749) > E/AndroidRuntime( 2510): at android.view.LayoutInflater.inflate(LayoutInflater.java:489) > E/AndroidRuntime( 2510): at android.view.LayoutInflater.inflate(LayoutInflater.java:396) > E/AndroidRuntime( 2510): at android.view.LayoutInflater.inflate(LayoutInflater.java:352) > E/AndroidRuntime( 2510): at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696) > E/AndroidRuntime( 2510): at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:170) > E/AndroidRuntime( 2510): at org.libreoffice.ui.LibreOfficeUIActivity.createUI(LibreOfficeUIActivity.java:169) > E/AndroidRuntime( 2510): at org.libreoffice.ui.LibreOfficeUIActivity.onCreate(LibreOfficeUIActivity.java:147) > E/AndroidRuntime( 2510): at android.app.Activity.performCreate(Activity.java:5008) > E/AndroidRuntime( 2510): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) > E/AndroidRuntime( 2510): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023) > E/AndroidRuntime( 2510): ... 11 more > E/AndroidRuntime( 2510): Caused by: android.content.res.Resources$NotFoundException: File res/drawable-hdpi-v4/ic_folder_grey_48dp.xml from drawable resource ID #0x7f080083 > E/AndroidRuntime( 2510): at android.content.res.Resources.loadDrawable(Resources.java:1923) > E/AndroidRuntime( 2510): at android.content.res.TypedArray.getDrawable(TypedArray.java:601) > E/AndroidRuntime( 2510): at android.widget.TextView.<init>(TextView.java:614) > E/AndroidRuntime( 2510): at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:100) > E/AndroidRuntime( 2510): at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:95) > E/AndroidRuntime( 2510): at androidx.appcompat.app.AppCompatViewInflater.createTextView(AppCompatViewInflater.java:194) > E/AndroidRuntime( 2510): at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:115) > E/AndroidRuntime( 2510): at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1551) > E/AndroidRuntime( 2510): at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1602) > E/AndroidRuntime( 2510): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:675) > E/AndroidRuntime( 2510): ... 26 more > E/AndroidRuntime( 2510): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #1: invalid drawable tag vector > E/AndroidRuntime( 2510): at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:877) > E/AndroidRuntime( 2510): at android.graphics.drawable.Drawable.createFromXml(Drawable.java:818) > E/AndroidRuntime( 2510): at android.content.res.Resources.loadDrawable(Resources.java:1920) > E/AndroidRuntime( 2510): ... 35 more > W/ActivityManager( 1421): Force finishing activity org.libreoffice/.ui.LibreOfficeUIActivity Change-Id: I4253a68f90d6c507805c7bf72aaf81011fb19339 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133256 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 730add0ca619985b99e133dd586e063f0f12538b)
2022-04-22Merge branch 'libreoffice-7-3'Michael Weghorn9-9/+103
into distro/lhm/libreoffice-7-3+backports Change-Id: If18d653bb2e451057f3cf2ea535cc3f47286f202
2022-04-21sw: layout: fix crash when deleting page with section being formattedMichael Stahl3-0/+24
This crashes only when calling storeToURL() with writer_pdf_Export? There is a text frame 112, followed by section frame 126, which contains table frame 127. The section frame 126 is being formatted, which in SwFrame::PrepareMake() formats its prev, text frame 112. This does MoveBwd() and in SwContentFrame::MakeAll() formats its next, tab frame 127. This also does MoveBwd() and then there is this really odd condition in SwTabFrame::Paste() where it calls SwFrame::CheckPageDescs() if it *doesn't* have a RES_PAGEDESC item and the page has a non-default page style - this condition remains inexplicable since initial CVS import. Then CheckPageDesc() sees the (next) page is empty and deletes it. So check in sw::IsPageFrameEmpty() that there aren't any sections with IsDeleteForbidden() set. (regression from commit b9ef71476fd70bc13f50ebe80390e0730d1b7afb) Change-Id: I3c64fe40fabffc255c4146a35c678ce6a1cc09c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133222 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 85aa57359befd7a21b3fdf36f2b362f50495f77c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133150 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-04-21tdf#148699 Qt track the active / shown popupJan-Marek Glogowski4-4/+30
I have no idea, if there can be multiple active popups in LO in some way. There can be multiple FloatingWindow and gtk does count them in m_nFloats... There is a whole lot going on in gtk3 related to isFloatGrabWindow(), with "funny" comments like: // FIXME: find out who the hell steals the focus from our frame So this goes with some "optimistic" approach: there is just one active popup, so we can track it in QtInstance. It WFM... Change-Id: I9778587696e1ad9e641dba4f102e2e921266eee6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133249 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 347622a98f512dae709f938a85498dcdcf9f225a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133260 Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-04-21tdf#146460 tdf#148429 ucb: webdav-curl: censor "curl" in UserAgentMichael Stahl1-3/+4
This is now the second bug filed because a server replies with 403 if the UserAgent contains the string "curl". Change-Id: I25ca2d255af76a7ff4e64dad900b1bf0b78de59f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133212 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 8d9c56e8f42428fd6695942c673bffb985d22ad5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133146 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-04-21tdf#147723 sw_fieldmarkhide: fix crash when copying multiple fieldmarksMichael Stahl1-2/+3
The problem is the UpdateFramesForAddDeleteRedline() call in makeMark(), this is called in a loop for multiple fieldmarks and when it's called for the first one, of course the other ones aren't in the document yet, so HideIterator::Next() can't find them. But this is only needed when inserting a new fieldmark anyway, so just disable for copying. (regression from commit 92384a813176b964a67bcbeb2fa617c554dbc4a2) Change-Id: Ic1b34d469a553cf7bbf2d1a99edaea900bdd7417 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133215 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 2f726fa41cbd249f2fb30222b29d5f30bce52e6e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133148 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-04-21android: Pass variable for "selected" paramMichael Weghorn1-12/+4
... of the CalcHeaderCell ctor, to simplify this a bit. Change-Id: I02ff00acccaec26de54534c6c021b9cd05f1d472 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132813 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 9c5facd726e3d5148d17ad547213afe0874ea910)
2022-04-21android: use mavenCentral instead of jcenter repositoryMichael Weghorn1-2/+2
From the `./gradlew --warning-mode all assembleStrippedUIEditingRelease` output: > > Configure project : > The RepositoryHandler.jcenter() method has been deprecated. This is > scheduled to be removed in Gradle 8.0. JFrog announced JCenter's sunset > in February 2021. Use mavenCentral() instead. Consult the upgrading > guide for further information: > https://docs.gradle.org/7.2/userguide/upgrading_version_6.html#jcenter_deprecation > at build_a6ed945jjgv6miyybz50fclhq$_run_closure1$_closure2.doCall(/home/michi/development/git/libreoffice-WORKTREE-for-android-x86/android/source/build.gradle:14) > (Run with --stacktrace to get the full stack trace of this deprecation warning.) Change-Id: I5db84a9778b598d1e3459dd313aa05c229060368 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133239 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit b6a237ad1f5957b9d32bca7e41aa4a2b3bed01fc)
2022-04-21android: Drop obsolete build tools version check from configure.acMichael Weghorn1-10/+0
`build.gradle` no longer contains a specific `buildToolsVersion` since commit a93770e6d0d2fcc5a2eefbed546acee055833fd4 Date: Fri Mar 6 12:16:24 2020 +0100 android: Update gradle The previous version e.g. did not support building Android App Bundles yet. Drop explicit 'buildToolsVersion', as suggested in the warning during build: > WARNING: The specified Android SDK Build Tools version (27.0.3) is ignored, > as it is below the minimum supported version (28.0.3) for Android Gradle > Plugin 3.6.1. > Android SDK Build Tools 28.0.3 will be used. > To suppress this warning, remove "buildToolsVersion '27.0.3'" from your build.gradle > file, as each version of the Android Gradle Plugin now has a default > version of the build tools. so the sed expression in configure.ac was evaluating to an empty string and only the existence of `"$ANDROID_SDK_DIR/build-tools/` was checked. As mentioned in a93770e6d0d2fcc5a2eefbed546acee055833fd4, each version of the Android Gradle Plugin now has a default version of the build tools. It takes care of downloading and installing that one as necessary. Change-Id: Ic8528c5dc238dccb35ccf215945ef935e8c3a89c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133238 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit b548507896f9b1fef606e5d5329c6283436a592c)
2022-04-21tdf#140463 Qt handle mouse enter+leave eventsJan-Marek Glogowski2-0/+42
Currently just implemented for the QtWidget, but still as a static function, so it may be used for QtObject at some point too. But there is no (mouse) enter or leave event function in QWindow, so no way to handle these there. And since we can't modify the returned QWidget from QWidget::createWindowContainer, the only way would be to expand the static QtWidget::handleEvent used by QtObjectWindow::event ... if it's actually needed at some point. Includes squashed commit 5d56255c22c79b72c1cedb48cfe0a200f89bdc66 ("qt6: Fix build (QtWidget::enterEvent)"). Change-Id: If9009e5dfca508acd1e702df1a17eb8ad7c29690 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133190 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> (cherry picked from commit dc886bc6de2c0061a840bea2426663c3be2ecd26) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133149 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-04-20android: Use android.ndkPath property to set path to NDKMichael Weghorn1-2/+4
Quoting from commit 128de1949ff120ac925dbb06e398fa992fb295ba Date: Tue Apr 19 15:18:49 2022 +0200 android: Use property instead of ANDROID_NDK_HOME env var which ported from an obsolete (no longer supported by current Gradle versions) way of setting the NDK path to a deprecated but still supported one as an intermediate step to allow upgrading Gradle: > Note however, that with this approach of using the `ndk.dir` > property instead of the suggested `android.ndkVersion` > (with the latter having the stricter requirement that > the `ndk` dir would have to be a subdir of the SDK dir), > doing the actual upgrade to a newer Gradle (plugin) version > in follow-up commit > Change-Id Ia982d72d877e229c3006c6d528b830d16c88481f > "android: Update Android Gradle Plugin to 7.1.3" > revealed that the use of the `ndk.dir` property > is deprecated in newer Gradle (plugin) versions as well, > resulting in this warning. > > > > Task :stripStrippedUIDebugDebugSymbols > > [CXX5106] NDK was located by using ndk.dir property. This method is > > deprecated and will be removed in a future release. Please delete > > ndk.dir from local.properties and set android.ndkVersion to > > [20.0.5594570] in all native modules in the project. > > https://developer.android.com/r/studio-ui/ndk-dir > > It might make sense to address that in a follow-up step, > but for now, it's an improvement and keeps it working > after the upgrade without potentially causing any incompatibility > problems with existing autogen configurations, > while support for the `ANDROID_NDK_HOME` env var that was > used so far seems to have been dropped, [...]. The release notes for Android Gradle Plugin version 4.1.0 mention yet another way of setting an explicit NDK path instead of just a version and that one is still supported and not deprecated [1]: > # Set the NDK path > You can set the path to your local NDK installation using the > android.ndkPath property in your module's build.gradle file. > > android { > ndkPath "your-custom-ndk-path" > } > > If you use this property together with the android.ndkVersion property, > then this path must contain an NDK version that matches > android.ndkVersion. Therefore, switch to setting the NDK path using the `android.ndkPath` property in liboSettings.gradle instead of the deprecated `ndk.dir` in local.properties. [1] https://developer.android.com/studio/releases/gradle-plugin?buildsystem=ndk-build#ndk-path Change-Id: I34690ca8e15ff4742bab9a716a58b9ad85fa86e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133197 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit c6fada2bfe38dc8b10908ad95b999b2092c841c5)
2022-04-20android: Set archivesBaseName differently after gradle updateMichael Weghorn2-1/+1
Setting the archive base name in build.gradle using project.ext.set("archivesBaseName", "LibreOfficeViewer") no longer worked after commit 39326bc7d439170dd24c9d4b837c2cdb720b5d6f Date: Tue Apr 19 15:49:53 2022 +0200 android: Update Android Gradle Plugin to 7.1.3 ... and gradle to 7.2, which is what Android Studio suggested and did automatically when confirming. As a consequence, the generated .apk or .aar files would no longer have the app name in them, but be called e.g. "source-strippedUIEditing-release-unsigned.apk" instead of "LibreOfficeViewer-strippedUIEditing-release-unsigned.apk". Setting `archivesBaseName` in `android.defaultConfig` in libOSettings.gradle works, so move it there. [NOTE: This is v1 of https://gerrit.libreoffice.org/c/core/+/133191 which I plan to merge to upstream master once Jenkins CI run has finished successfully.] Change-Id: Id03cbe10681aca85c35aeef64527bc7707c95736
2022-04-20android: Update dependencies to current versionsMichael Weghorn1-2/+2
This requires the Gradle update from Change-Id Ia982d72d877e229c3006c6d528b830d16c88481f "android: Update Android Gradle Plugin to 7.1.3" as a prerequisite, since the build would otherwise fail with > > Task :desugarStrippedUIDebugFileDependencies FAILED > D8: Method name '$private$<clinit>' in class > 'com.sun.star.frame.XMenuBarMergingAcceptor$-CC' cannot be represented > in dex format. > > FAILURE: Build failed with an exception. after updating only the dependencies. Change-Id: Ifa007fa0e520e9494ace173d1643abb7d7a5f9c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133183 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit f22f83fbac3a0a419c2e95d7b725525fd02649e6)
2022-04-20android: Drop obsolete "sourceCompatibility 6"Michael Weghorn1-4/+0
This addresses this warning when building Android Viewer: > > Task :compileStrippedUIDebugJavaWithJavac > warning: [options] source value 6 is obsolete and will be removed in a future release > warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. Change-Id: Ic1a80117e7e8c31774947729452bfafacd7a24c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133182 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 8917c8b11a4c05e9dd8b0259146179a99ae08a19)
2022-04-20android: Update Android Gradle Plugin to 7.1.3Michael Weghorn2-3/+3
... and gradle to 7.2, which is what Android Studio suggested and did automatically when confirming. Also apply the following optional, but recommended change while doing so: > Migrate from lintOptions to lint > Configuration related to lint is now performed using the lint block. Change-Id: Ia982d72d877e229c3006c6d528b830d16c88481f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133179 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 39326bc7d439170dd24c9d4b837c2cdb720b5d6f)
2022-04-20android: Stop using ANDROID_SDK_HOME env variableMichael Weghorn5-15/+15
Otherwise, upgrading to Android Gradle Plugin 7.1.3 and gradle 7.2 (which will be done in a follow-up commit) would make the build fail like this: > FAILURE: Build failed with an exception. > > * Where: > Build file '/home/michi/development/git/libreoffice-WORKTREE-for-android-x86/android/source/build.gradle' line: 1 > > * What went wrong: > A problem occurred evaluating root project 'source'. > > Failed to apply plugin 'com.android.internal.application'. > > ANDROID_SDK_HOME is set to the root of your SDK: /home/michi/Android/Sdk > ANDROID_SDK_HOME was meant to be the parent path of the preference folder expected by the Android tools. > It is now deprecated. > > To set a custom preference folder location, use ANDROID_USER_HOME. > > It should NOT be set to the same directory as the root of your SDK. > To set a custom SDK location, use ANDROID_HOME. We don't actually rely on `ANDROID_SDK_HOME` being evaluated by the Android toolchain, but it used to be set in configure.ac, and the value was then assigned to the `sdk.dir` property written to `android/source/local.properties`. Just use a new variable name `ANDROID_SDK_DIR` and keep the mechanism otherwise unchanged for now. Change-Id: I44826621a1342119d40036fb704d8ff1eeed7c77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133178 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 76d50f83274549002cedc7dc6ded0e3eac7c277c)
2022-04-20android: Use property instead of ANDROID_NDK_HOME env varMichael Weghorn4-16/+17
Write an `ndk.dir` property with the directory path to `android/source/local.properties` instead, similar to how it's done for `sdk.dir`. Also, rename the `ANDROID_NDK_HOME` variable that's assigned in configure.ac that holds the corresponding value to `ANDROID_NDK_DIR`, because the gradle warning still shows up if that environment variable is set in addition to having an `ndk.dir` property in `local.properties`. This makes the following gradle warning disappear: > > Task :stripStrippedUIDebugDebugSymbols > WARNING: Support for ANDROID_NDK_HOME is deprecated and will be removed in the future. Use android.ndkVersion in build.gradle instead. > Support for ANDROID_NDK_HOME is deprecated and will be removed in the future. Use android.ndkVersion in build.gradle instead. Note however, that with this approach of using the `ndk.dir` property instead of the suggested `android.ndkVersion` (with the latter having the stricter requirement that the `ndk` dir would have to be a subdir of the SDK dir), doing the actual upgrade to a newer Gradle (plugin) version in follow-up commit Change-Id Ia982d72d877e229c3006c6d528b830d16c88481f "android: Update Android Gradle Plugin to 7.1.3" revealed that the use of the `ndk.dir` property is deprecated in newer Gradle (plugin) versions as well, resulting in this warning. > > Task :stripStrippedUIDebugDebugSymbols > [CXX5106] NDK was located by using ndk.dir property. This method is > deprecated and will be removed in a future release. Please delete > ndk.dir from local.properties and set android.ndkVersion to > [20.0.5594570] in all native modules in the project. > https://developer.android.com/r/studio-ui/ndk-dir It might make sense to address that in a follow-up step, but for now, it's an improvement and keeps it working after the upgrade without potentially causing any incompatibility problems with existing autogen configurations, while support for the `ANDROID_NDK_HOME` env var that was used so far seems to have been dropped, resulting in > > Task :stripStrippedUIDebugDebugSymbols > Unable to strip the following libraries, packaging them as they are: > libc++_shared.so, libfreebl3.so, liblo-native-code.so, libnspr4.so, > libnss3.so, libnssckbi.so, libnssdbm3.so, libnssutil3.so, > libplc4.so, libplds4.so, libsmime3.so, libsoftokn3.so, > libsqlite3.so, libssl3.so. instead if upgrading gradle without switching to the use of the property. Change-Id: I4a090e8736dac80777f69b0e12819b9c056f582b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133177 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 128de1949ff120ac925dbb06e398fa992fb295ba)
2022-04-20android: Remove redundant label attribute from activitiesMichael Weghorn1-2/+0
Android Studio was showing an info/warning in the "Problems" pane that this label is redundant, so remove it. (The app name is used by default if nothing else is specified anyway.) Change-Id: I799c681488b95e2fffe89b59e7de18febe654dcb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133174 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 258fd217a35444ed245528ccbabdef62869c0419)
2022-04-20android: Update compileSdkVersion/targetSdkVersion to 31Michael Weghorn2-4/+6
Google Play now requires that apps target API level 30 or higher, and compileSdkVersion/targetSdkVersion 31 is also needed to update the com.google.android.material dependency to >= 1.5.0 [1]. Explicitly set the `android:exported="true"` attribute for activities which is required when targeting Android 12 or newer; quoting from the list of behavior changes for apps targeting Android 12 [1]: > Safer component exporting > > If your app targets Android 12 or higher and contains activities, > services, or broadcast receivers that use intent filters, you must > explicitly declare the android:exported attribute for these app > components. Warning: If an activity, service, or broadcast receiver > uses intent filters and doesn't have an explicitly-declared value for > android:exported, your app can't be installed on a device that runs > Android 12 or higher. > > If the app component includes the LAUNCHER category, set > android:exported to true. In most other cases, set android:exported > to false. > > The following code snippet shows an example of a service that > contains an intent filter whose android:exported attribute is set to > false: > > <service android:name="com.example.app.backgroundService" > android:exported="false"> > <intent-filter> > <action android:name="com.example.app.START_BACKGROUND" /> > </intent-filter> > </service> The app worked fine in a quick test on an x86_64 AVD with API level 31. [1] https://github.com/material-components/material-components-android/releases/tag/1.5.0-alpha03 Change-Id: Ibb919e4edb995740e48ebc3338ffab6ca35c1373 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133167 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 2ab389b251744fa7f3f6b060c09746e59d87f3b1)
2022-04-20Merge branch 'libreoffice-7-3'Michael Weghorn20-408/+509
into distro/lhm/libreoffice-7-3+backports Change-Id: Ibe31bcd9ef56163740c2ea3d625a96816d78a527
2022-04-20tdf#148313 Basic IDE crashing while resizing dialogNoel Grandin1-3/+4
Change-Id: Ic68b78f26626f346f3ef8b54a584de64165d9eb2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133170 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit d40c6601330b70c3cb9c1be0fa9e9775ad51113c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133140 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2022-04-19tdf#148101 don't autocomplete remote files dialog entry on delete/backspaceCaolán McNamara3-1/+27
Change-Id: Ieddb41eb37e7090416a418afeffb76ce0eddf90a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132873 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-04-19tdf#148197 gtk_tree_row_reference_new_proxy warning on docking navigatorCaolán McNamara1-1/+1
Gtk-CRITICAL **: 09:05:11.124: gtk_tree_row_reference_new_proxy: assertion 'path->depth > 0' failed from TreeView::set_cursor(-1) gtk_tree_view_set_cursor is ok (and documented as such) with an "invalid" path to unset the cursor, but there isn't the same for gtk_tree_view_scroll_to_cell, though there null is docs as acceptable. Change-Id: I11b94ba997fbbd2f31031d9e73765ea1882ad9ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132872 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2022-04-19tdf#148620 Crash in Draw using Format > Lists > Move DownNoel Grandin11-386/+429
This reverts commit 35f03f26799747894d1534796b6cb227bd4f233b speed up loading large ODS a little since ImpEditEngine::ImpMoveParagraphs wants to manipulate ParaPortion's and also identify them by pointer Also convert the OSL_ASSERT in this method to an assert to catch such problems earlier Change-Id: Id924d00c9524223db9a96e487b331ce60e3a4fff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133128 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133165 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-04-19tdf#147472: sw: bug in numbering with previous level NONEVasily Melenchuk2-3/+2
Previous fix for tdf#146257 was not complete and was not able to take care of disabled numebering started just at beginning of the numbering string. UI test test_tdf144439_outline with modifications is covering this situation. No need in extra testcases. Change-Id: Id17838cec7fb4fb039f9b457b7ee9ad3ab345678 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133124 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de> (cherry picked from commit a31a7b53c42eef3a8007766c60ec5a2539054a7c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133135 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-04-19Related: tdf#147237 change the SalObject background when the settings changeCaolán McNamara2-14/+46
which solves the problem of parts of the gtk ui remaining in the old theme when switching dark<->light Change-Id: I59060dfdf3937ca13cd706eefc9e67c133478992 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133043 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2022-04-19android: Use proper Intent to open doc for API level < 19Michael Weghorn1-2/+3
`Intent.ACTION_OPEN_DOCUMENT` was introduced in API level 19, therefore `Intent.ACTION_GET_CONTENT` is supposed to be used for older Android versions. The previous attempt at doing so didn't work, since no `ActivityNotFoundException` is thrown when trying to set the action to `Intent.ACTION_OPEN_DOCUMENT` on older Android versions. Fix that by using a proper version check instead. Change-Id: Ie06fa3f39e3042b4b7161a3c937bf655eb658abd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133025 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 003e2873e4463974e59e1f909f9250cde743851f)
2022-04-19android: Use "ContentResolver#query" available from API level 1Michael Weghorn1-1/+1
Use the `ContentResolver#query` overload that is available from Android API level 1 on, not the one that's only available from API level 26 on [2], which would otherwise trigger an exception if run on devices running Android version < 8.0, as seen on an AVD with API level 21: > E/AndroidRuntime( 2914): FATAL EXCEPTION: main > E/AndroidRuntime( 2914): Process: org.libreoffice, PID: 2914 > E/AndroidRuntime( 2914): java.lang.NoSuchMethodError: No virtual method query(Landroid/net/Uri;[Ljava/lang/String;Landroid/os/Bundle;Landroid/os/CancellationSignal;)Landroid/database/Cursor; in class Landroid/content/ContentResolver; or its super classes (declaration of 'android.content.ContentResolver' appears in /system/framework/framework.jar) > E/AndroidRuntime( 2914): at org.libreoffice.ui.FileUtilities.retrieveDisplayNameForDocumentUri(FileUtilities.java:137) > E/AndroidRuntime( 2914): at org.libreoffice.ui.LibreOfficeUIActivity.createUI(LibreOfficeUIActivity.java:206) > E/AndroidRuntime( 2914): at org.libreoffice.ui.LibreOfficeUIActivity.onCreate(LibreOfficeUIActivity.java:147) > E/AndroidRuntime( 2914): at android.app.Activity.performCreate(Activity.java:5937) > E/AndroidRuntime( 2914): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105) > E/AndroidRuntime( 2914): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251) > E/AndroidRuntime( 2914): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360) > E/AndroidRuntime( 2914): at android.app.ActivityThread.access$800(ActivityThread.java:144) > E/AndroidRuntime( 2914): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278) > E/AndroidRuntime( 2914): at android.os.Handler.dispatchMessage(Handler.java:102) > E/AndroidRuntime( 2914): at android.os.Looper.loop(Looper.java:135) > E/AndroidRuntime( 2914): at android.app.ActivityThread.main(ActivityThread.java:5221) > E/AndroidRuntime( 2914): at java.lang.reflect.Method.invoke(Native Method) > E/AndroidRuntime( 2914): at java.lang.reflect.Method.invoke(Method.java:372) > E/AndroidRuntime( 2914): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) > E/AndroidRuntime( 2914): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) > [1] https://developer.android.com/reference/android/content/ContentResolver#query(android.net.Uri,%20java.lang.String[],%20java.lang.String,%20java.lang.String[],%20java.lang.String) [2] https://developer.android.com/reference/android/content/ContentResolver#query(android.net.Uri,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal) Change-Id: I13ecc57d3d6b25a7eb2e5ff85a3420ef8064cb20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133024 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit f869807175f1fc49328465473aa8e90b6f1876ff)
2022-04-19android: Port from Android Support Lib to AndroidXMichael Weghorn24-81/+73
Replace the no longer maintained Android Support Library with the Android Jetpack libraries. Quoting [1]: > Version 28.0.0 is the last release of the Support Library. There will be > no more android.support library releases. All new feature development > will be in the androidx namespace. Most porting was done automatically by using Android Studio's "Refactor" -> "Migrate to AndroidX..." function. In `android/source/res/layout/toolbar_bottom.xml` and `android/source/res/layout/toolbar_color_picker.xml`, the uses of `app:layout_behavior="android.support.design.widget.BottomSheetBehavior"` had to be replaced manually as described at [2], because the app would crash when using the old "android.support" values. Also drop the Android Support Library related bits from configure.ac In a quick test, this worked fine and no obvious difference was visible when running this in various AVDs. When trying to test this in an x86 AVD still using SDK 16 (Android 4.1), which is currently specified as Android Viewer's `minSdkVersion`, only various unrelated issues showed up, some of which will be handled in follow-up commits. After the migration, many weird errors showed up in Android Studio, which disappeared after invalidating the caches (via "File" -> "Invalidate Caches..."). [1] https://developer.android.com/jetpack/androidx [2] https://stackoverflow.com/questions/45100963/runtimeexception-could-not-inflate-behavior-subclass Change-Id: I2a57f0ebd56e7ecc09b7d65aae17fd15088a633b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133002 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 70cb4955f1c099b030567e6bf4702f7dc6ee521a)
2022-04-19Merge branch 'libreoffice-7-3'Michael Weghorn19-28/+131
into distro/lhm/libreoffice-7-3+backports Change-Id: I5dddfbc45dfbff00b703221269b36182e5f9cc8a
2022-04-18tdf#109169 use custGeom for Octagon Bevel shapeRegina Henschel4-3/+49
The shapes 'Octagon Bevel', type col_60da8460, and 'Diamond Bevel', type col-502ad400, are LO specific preset shapes. They have neither a counterpart in MS binary nor in OOXML. So they need to be exported with custGeom. To force custGeom these shape types are moved from vDenylist to vAllowlist. These shapes were exported as prst='rect' before. Change-Id: I9619345812b6dba8f14ec2cc6a92ae808a56b595 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133069 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133113
2022-04-18tdf#142151: Red cast rendered in 16 bit TIFF imageJulien Nabet1-2/+2
I found this fix by testing "pure" red/green/blue files (see attachments in the bugtracker) where red 16 bits file was ok but not green and blue 16 bits ones. Change-Id: Ic700a0fa17c3056d1d4f1d1a7f16a799ff4c7378 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133108 (cherry picked from commit 49ee1c889665c3539fa9a1c99a865a42fc08ee97) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133051 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2022-04-17tdf#148551: sw ui: set default format value for Insert Field dlgVasily Melenchuk1-0/+13
My previous implementation was changing current format selection only for field edit dialog. However it should be initialized also for insert field dlg. It is not always first element. Instead of older confusing approach right now there is a switch to set defaults: it is less confusing IMO. Change-Id: I189339ba66effc49267004a42345a28892cb693c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132980 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> (cherry picked from commit b2b821715a3745718a941fa99dda92137c0f0c86) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133045