android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java | 1 android/default-document/example.odt |binary android/source/res/layout/activity_document_browser.xml | 4 android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java | 88 ++++------ cppuhelper/source/exc_thrower.cxx | 19 +- sw/source/core/doc/docbm.cxx | 5 sw/source/core/inc/layfrm.hxx | 1 sw/source/core/layout/findfrm.cxx | 21 ++ sw/source/core/layout/pagechg.cxx | 2 ucb/source/ucp/webdav-curl/CurlSession.cxx | 7 vcl/inc/qt5/QtInstance.hxx | 6 vcl/inc/qt5/QtWidget.hxx | 8 vcl/qt5/QtInstance.cxx | 7 vcl/qt5/QtWidget.cxx | 55 +++++- 14 files changed, 159 insertions(+), 65 deletions(-)
New commits: commit 8d1304d602d67c695f3de6f2aea74a1ca2419fcf Author: Jan-Marek Glogowski <glo...@fbihome.de> AuthorDate: Wed Nov 17 01:24:22 2021 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Apr 22 07:14:24 2022 +0200 Convert example document from cz to en-us Change-Id: Ia757491ce8802ec9deec9e75c65c6ae1c8ff2c79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126460 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> (cherry picked from commit 7a4a13517dc464ed409be0b9c36b2a32a4027c98) diff --git a/android/default-document/example.odt b/android/default-document/example.odt index 2da7ce6e84d1..3aa6bb5119e9 100644 Binary files a/android/default-document/example.odt and b/android/default-document/example.odt differ commit 5c2b5e77da29edfcbdb0b3f534bbed077842b327 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Apr 21 17:01:55 2022 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Apr 22 07:13:48 2022 +0200 android: Show file chooser despite package visibility filtering in API 30 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.wegh...@posteo.de> (cherry picked from commit b68821acc77c774c09ebca8be157a768ea417e04) diff --git a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java index 16e0fe8af2cd..965639e6e2ba 100644 --- a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java +++ b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java @@ -10,6 +10,7 @@ package org.libreoffice.ui; import android.Manifest; +import android.content.ActivityNotFoundException; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -268,8 +269,10 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings intent.setType("*/*"); intent.putExtra(Intent.EXTRA_MIME_TYPES, SUPPORTED_MIME_TYPES); - if (intent.resolveActivity(getPackageManager()) != null) { + try { startActivityForResult(intent, REQUEST_CODE_OPEN_FILECHOOSER); + } catch (ActivityNotFoundException e) { + Log.w(LOGTAG, "No activity available that can handle the intent to open a document."); } } commit 24c771a19ceaa52af84e38ce50b5976be71e9e79 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Apr 21 16:34:03 2022 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Apr 22 07:13:47 2022 +0200 android: Slightly improve style in use of arrays 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.wegh...@posteo.de> (cherry picked from commit b68362b178f732f90fdc99073aaa5940bee409bb) diff --git a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java index 1f7292b2a538..16e0fe8af2cd 100644 --- a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java +++ b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java @@ -197,9 +197,9 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings SharedPreferences prefs = getSharedPreferences(EXPLORER_PREFS_KEY, MODE_PRIVATE); String recentPref = prefs.getString(RECENT_DOCUMENTS_KEY, ""); - List<String> recentFileStrings = Arrays.asList(recentPref.split(RECENT_DOCUMENTS_DELIMITER)); + String[] recentFileStrings = recentPref.split(RECENT_DOCUMENTS_DELIMITER); - final List<RecentFile> recentFiles = new ArrayList(); + final List<RecentFile> recentFiles = new ArrayList<>(); for (String recentFileString : recentFileStrings) { Uri uri = Uri.parse(recentFileString); String filename = FileUtilities.retrieveDisplayNameForDocumentUri(getContentResolver(), uri); @@ -364,7 +364,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings getContentResolver().takePersistableUriPermission(fileUri, Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION); String newRecent = fileUri.toString(); - List<String> recentsList = new ArrayList(Arrays.asList(prefs.getString(RECENT_DOCUMENTS_KEY, "").split(RECENT_DOCUMENTS_DELIMITER))); + List<String> recentsList = new ArrayList<>(Arrays.asList(prefs.getString(RECENT_DOCUMENTS_KEY, "").split(RECENT_DOCUMENTS_DELIMITER))); // remove string if present, so that it doesn't appear multiple times recentsList.remove(newRecent); @@ -393,7 +393,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings //Remove all shortcuts, and apply new ones. shortcutManager.removeAllDynamicShortcuts(); - ArrayList<ShortcutInfo> shortcuts = new ArrayList<ShortcutInfo>(); + ArrayList<ShortcutInfo> shortcuts = new ArrayList<>(); for (String recentDoc : recentsList) { Uri docUri = Uri.parse(recentDoc); String filename = FileUtilities.retrieveDisplayNameForDocumentUri(getContentResolver(), docUri); commit c93cbf24b9db2c070472cee2fa80f64db2a16c6a Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Apr 21 15:54:55 2022 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Apr 22 07:13:47 2022 +0200 android: Drop unused import and extra semicolon Change-Id: I19557b0b1d63698a31dac61ce9fde3ce07f86451 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133267 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> (cherry picked from commit 6515633aad867dd9e2d59378f3254e292dbdacb0) diff --git a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java index 3b7b401804b8..1f7292b2a538 100644 --- a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java +++ b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java @@ -10,7 +10,6 @@ package org.libreoffice.ui; import android.Manifest; -import android.content.ActivityNotFoundException; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -267,7 +266,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings } intent.setType("*/*"); - intent.putExtra(Intent.EXTRA_MIME_TYPES, SUPPORTED_MIME_TYPES);; + intent.putExtra(Intent.EXTRA_MIME_TYPES, SUPPORTED_MIME_TYPES); if (intent.resolveActivity(getPackageManager()) != null) { startActivityForResult(intent, REQUEST_CODE_OPEN_FILECHOOSER); commit b6e8557fbbb55a59a9ac96fac5c9f72679f2bf6e Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Apr 21 15:52:54 2022 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Apr 22 07:13:47 2022 +0200 android: Avoid using resource ID in switch-case 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.wegh...@posteo.de> (cherry picked from commit 62524dcf152b274b855005402d082debaa3fc84a) diff --git a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java index f2e366c90ed3..3b7b401804b8 100644 --- a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java +++ b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java @@ -318,19 +318,18 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings @Override public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case R.id.action_about: { - AboutDialogFragment aboutDialogFragment = new AboutDialogFragment(); - aboutDialogFragment.show(getSupportFragmentManager(), "AboutDialogFragment"); - } - return true; - case R.id.action_settings: - startActivity(new Intent(getApplicationContext(), SettingsActivity.class)); - return true; - - default: - return super.onOptionsItemSelected(item); + final int itemId = item.getItemId(); + if (itemId == R.id.action_about) { + AboutDialogFragment aboutDialogFragment = new AboutDialogFragment(); + aboutDialogFragment.show(getSupportFragmentManager(), "AboutDialogFragment"); + return true; } + if (itemId == R.id.action_settings) { + startActivity(new Intent(getApplicationContext(), SettingsActivity.class)); + return true; + } + + return super.onOptionsItemSelected(item); } public void readPreferences(){ @@ -441,35 +440,28 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings @Override public void onClick(View v) { int id = v.getId(); - switch (id){ - case R.id.editFAB: - // Intent.ACTION_CREATE_DOCUMENT, used in 'createNewFileDialog' requires SDK version 19 - if (Build.VERSION.SDK_INT < 19) { - Toast.makeText(this, - getString(R.string.creating_new_files_not_supported), Toast.LENGTH_SHORT).show(); - return; - } - if (isFabMenuOpen) { - collapseFabMenu(); - } else { - expandFabMenu(); - } - break; - case R.id.open_file_view: - showSystemFilePickerAndOpenFile(); - break; - case R.id.newWriterFAB: - loadNewDocument(DocumentType.WRITER); - break; - case R.id.newImpressFAB: - loadNewDocument(DocumentType.IMPRESS); - break; - case R.id.newCalcFAB: - loadNewDocument(DocumentType.CALC); - break; - case R.id.newDrawFAB: - loadNewDocument(DocumentType.DRAW); - break; + if (id == R.id.editFAB) { + // Intent.ACTION_CREATE_DOCUMENT, used in 'createNewFileDialog' requires SDK version 19 + if (Build.VERSION.SDK_INT < 19) { + Toast.makeText(this, + getString(R.string.creating_new_files_not_supported), Toast.LENGTH_SHORT).show(); + return; + } + if (isFabMenuOpen) { + collapseFabMenu(); + } else { + expandFabMenu(); + } + } else if (id == R.id.open_file_view) { + showSystemFilePickerAndOpenFile(); + } else if (id == R.id.newWriterFAB) { + loadNewDocument(DocumentType.WRITER); + } else if (id == R.id.newImpressFAB) { + loadNewDocument(DocumentType.IMPRESS); + } else if (id == R.id.newCalcFAB) { + loadNewDocument(DocumentType.CALC); + } else if (id == R.id.newDrawFAB) { + loadNewDocument(DocumentType.DRAW); } } } commit 22b84e1ed22f78d31a8d02bee8d66f6bf20c3273 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Apr 21 14:26:18 2022 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Apr 22 07:13:25 2022 +0200 android: Use fake exceptions on all architectures 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.wegh...@posteo.de> (cherry picked from commit a03d7b1871673473b6201a8a15be175d7b65d71d) diff --git a/cppuhelper/source/exc_thrower.cxx b/cppuhelper/source/exc_thrower.cxx index c0d441fcd48b..57e2ad1d0235 100644 --- a/cppuhelper/source/exc_thrower.cxx +++ b/cppuhelper/source/exc_thrower.cxx @@ -168,7 +168,7 @@ ExceptionThrower::ExceptionThrower() uno_Interface::pDispatcher = ExceptionThrower_dispatch; } -#if defined(IOS) || (defined(__aarch64__) && defined(ANDROID)) || defined(EMSCRIPTEN) +#if defined(IOS) || defined(ANDROID) || defined(EMSCRIPTEN) #define RETHROW_FAKE_EXCEPTIONS 1 #else #define RETHROW_FAKE_EXCEPTIONS 0 @@ -256,9 +256,7 @@ void SAL_CALL throwException( Any const & exc ) Any SAL_CALL getCaughtException() { // why does this differ from RETHROW_FAKE_EXCEPTIONS? -#if (defined(__aarch64__) && defined(ANDROID)) || defined(EMSCRIPTEN) - // FIXME This stuff works on 32bit ARM, let's use the shortcut only for - // the 64bit ARM. +#if defined(ANDROID) || defined(EMSCRIPTEN) return Any(); #else Mapping cpp2uno(Environment::getCurrent(), Environment(UNO_LB_UNO)); commit c3f328ccf69f8a32594d47abc2781041935d5258 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Apr 22 07:10:33 2022 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Apr 22 07:11:59 2022 +0200 Cherry-pick exc_thrower.cxx changes from 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.behr...@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 <glo...@fbihome.de> Change-Id: Icfb74267c59437eb6467f2f91a5aa1dada3716d4 diff --git a/cppuhelper/source/exc_thrower.cxx b/cppuhelper/source/exc_thrower.cxx index 1bb8bfab13b3..c0d441fcd48b 100644 --- a/cppuhelper/source/exc_thrower.cxx +++ b/cppuhelper/source/exc_thrower.cxx @@ -168,9 +168,15 @@ ExceptionThrower::ExceptionThrower() uno_Interface::pDispatcher = ExceptionThrower_dispatch; } +#if defined(IOS) || (defined(__aarch64__) && defined(ANDROID)) || defined(EMSCRIPTEN) +#define RETHROW_FAKE_EXCEPTIONS 1 +#else +#define RETHROW_FAKE_EXCEPTIONS 0 +#endif + class theExceptionThrower : public rtl::Static<ExceptionThrower, theExceptionThrower> {}; -#if defined(IOS) || (defined(__aarch64__) && defined(ANDROID)) +#if RETHROW_FAKE_EXCEPTIONS // In the native iOS / Android app, where we don't have any Java, Python, // BASIC, or other scripting, the only thing that would use the C++/UNO bridge // functionality that invokes codeSnippet() was cppu::throwException(). @@ -208,7 +214,7 @@ void lo_mobile_throwException(css::uno::Any const& aException) assert(false); } -#endif // defined(IOS) || (defined(__aarch64__) && defined(ANDROID)) +#endif // RETHROW_FAKE_EXCEPTIONS } // anonymous namespace @@ -226,7 +232,7 @@ void SAL_CALL throwException( Any const & exc ) "(must be derived from com::sun::star::uno::Exception)!" ); } -#if defined(IOS) || (defined(__aarch64__) && defined(ANDROID)) +#if RETHROW_FAKE_EXCEPTIONS lo_mobile_throwException(exc); #else Mapping uno2cpp(Environment(UNO_LB_UNO), Environment::getCurrent()); @@ -243,13 +249,14 @@ void SAL_CALL throwException( Any const & exc ) ExceptionThrower::getCppuType() ); OSL_ASSERT( xThrower.is() ); xThrower->throwException( exc ); -#endif +#endif // !RETHROW_FAKE_EXCEPTIONS } Any SAL_CALL getCaughtException() { -#if defined(__aarch64__) && defined(ANDROID) + // why does this differ from RETHROW_FAKE_EXCEPTIONS? +#if (defined(__aarch64__) && defined(ANDROID)) || defined(EMSCRIPTEN) // FIXME This stuff works on 32bit ARM, let's use the shortcut only for // the 64bit ARM. return Any(); commit 48b28c596ddbdd64cda6327a55b38a9dfbbd6492 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Apr 21 14:16:30 2022 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Apr 22 07:05:47 2022 +0200 android: Explicitly load libc++_shared 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.wegh...@posteo.de> (cherry picked from commit 7084da45dd322c253626c3576aef53ae021fdcdf) diff --git a/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java b/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java index f6658d64806a..f7597c29a86c 100644 --- a/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java +++ b/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java @@ -102,6 +102,7 @@ class NativeLibLoader { System.loadLibrary("smime3"); System.loadLibrary("ssl3"); + System.loadLibrary("c++_shared"); System.loadLibrary("lo-native-code"); done = true; } commit 463f81d9c8090ff553401dda6f00024dfe8b205d Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Apr 21 13:48:53 2022 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Apr 22 07:04:26 2022 +0200 android: Use drawable tag already supported with API level 16 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.wegh...@posteo.de> (cherry picked from commit 730add0ca619985b99e133dd586e063f0f12538b) diff --git a/android/source/res/layout/activity_document_browser.xml b/android/source/res/layout/activity_document_browser.xml index 1632770d97a8..23ef44f4e5dc 100644 --- a/android/source/res/layout/activity_document_browser.xml +++ b/android/source/res/layout/activity_document_browser.xml @@ -82,10 +82,10 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" - android:drawableLeft="@drawable/ic_folder_grey_48dp" android:gravity="center_vertical" android:text="@string/select_file_to_open" - android:textSize="14dp" /> + android:textSize="14dp" + app:drawableLeftCompat="@drawable/ic_folder_grey_48dp" /> </LinearLayout> <TextView commit 04b80e1d50430be6ffd8b472623f55ce9bdf4bdd Merge: 6a2f179809ef af0955d600cd Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Apr 22 07:03:35 2022 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Apr 22 07:03:35 2022 +0200 Merge branch 'libreoffice-7-3' into distro/lhm/libreoffice-7-3+backports Change-Id: If18d653bb2e451057f3cf2ea535cc3f47286f202 commit af0955d600cd3d54d26a87b9ff30e3c402a226dd Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Wed Apr 20 18:48:30 2022 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Apr 21 20:48:52 2022 +0200 sw: layout: fix crash when deleting page with section being formatted 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.st...@allotropia.de> (cherry picked from commit 85aa57359befd7a21b3fdf36f2b362f50495f77c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133150 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx index 3f73602e6bfa..b0f981477499 100644 --- a/sw/source/core/inc/layfrm.hxx +++ b/sw/source/core/inc/layfrm.hxx @@ -100,6 +100,7 @@ public: SwPrintData const*const pPrintData = nullptr ) const override; const SwFrame *Lower() const { return m_pLower; } SwFrame *Lower() { return m_pLower; } + bool ContainsDeleteForbiddenLayFrame() const; const SwContentFrame *ContainsContent() const; inline SwContentFrame *ContainsContent(); const SwCellFrame *FirstCell() const; diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index d100e24526a4..3d92f2a9ce0e 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -165,6 +165,27 @@ const SwFrame *SwLayoutFrame::ContainsAny( const bool _bInvestigateFootnoteForSe return nullptr; } +bool SwLayoutFrame::ContainsDeleteForbiddenLayFrame() const +{ + if (IsDeleteForbidden()) + { + return true; + } + for (SwFrame const* pFrame = Lower(); pFrame; pFrame = pFrame->GetNext()) + { + if (!pFrame->IsLayoutFrame()) + { + continue; + } + SwLayoutFrame const*const pLay(static_cast<SwLayoutFrame const*>(pFrame)); + if (pLay->ContainsDeleteForbiddenLayFrame()) + { + return true; + } + } + return false; +} + const SwFrame* SwFrame::GetLower() const { return IsLayoutFrame() ? static_cast<const SwLayoutFrame*>(this)->Lower() : nullptr; diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index fe84f956a35c..e7a458737d30 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -1024,6 +1024,8 @@ bool IsPageFrameEmpty(SwPageFrame const& rPage) rPage.FindFootnoteCont() || (nullptr != (pBody = rPage.FindBodyCont()) && ( pBody->ContainsContent() || + // check for section frames that are being formatted on the stack + rPage.ContainsDeleteForbiddenLayFrame() || // #i47580# // Do not delete page if there's an empty tabframe // left. I think it might be correct to use ContainsAny() commit 06c51d61e4a16057f945effe85b1ff9457f8cffb Author: Jan-Marek Glogowski <glo...@fbihome.de> AuthorDate: Thu Apr 21 10:56:42 2022 +0200 Commit: Jan-Marek Glogowski <glo...@fbihome.de> CommitDate: Thu Apr 21 18:57:05 2022 +0200 tdf#148699 Qt track the active / shown popup 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.wegh...@posteo.de> (cherry picked from commit 347622a98f512dae709f938a85498dcdcf9f225a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133260 Reviewed-by: Jan-Marek Glogowski <glo...@fbihome.de> diff --git a/vcl/inc/qt5/QtInstance.hxx b/vcl/inc/qt5/QtInstance.hxx index 9a9853a7a2ce..fd111bb22abe 100644 --- a/vcl/inc/qt5/QtInstance.hxx +++ b/vcl/inc/qt5/QtInstance.hxx @@ -35,6 +35,7 @@ #include "QtFilePicker.hxx" +class QtFrame; class QtTimer; class QApplication; @@ -67,6 +68,8 @@ class VCLPLUG_QT_PUBLIC QtInstance : public QObject, Timer m_aUpdateStyleTimer; bool m_bUpdateFonts; + QtFrame* m_pActivePopup; + DECL_DLLPRIVATE_LINK(updateStyleHdl, Timer*, void); void AfterAppInit() override; @@ -172,6 +175,9 @@ public: void UpdateStyle(bool bFontsChanged); void* CreateGStreamerSink(const SystemChildWindow*) override; + + QtFrame* activePopup() const { return m_pActivePopup; } + void setActivePopup(QtFrame*); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/qt5/QtWidget.hxx b/vcl/inc/qt5/QtWidget.hxx index 4a40589b16ba..8f7f6cc319e1 100644 --- a/vcl/inc/qt5/QtWidget.hxx +++ b/vcl/inc/qt5/QtWidget.hxx @@ -73,6 +73,7 @@ class QtWidget : public QWidget virtual void paintEvent(QPaintEvent*) override; virtual void resizeEvent(QResizeEvent*) override; virtual void showEvent(QShowEvent*) override; + virtual void hideEvent(QHideEvent*) override; virtual void wheelEvent(QWheelEvent*) override; virtual void closeEvent(QCloseEvent*) override; virtual void changeEvent(QEvent*) override; diff --git a/vcl/qt5/QtInstance.cxx b/vcl/qt5/QtInstance.cxx index d252109e122a..247001443020 100644 --- a/vcl/qt5/QtInstance.cxx +++ b/vcl/qt5/QtInstance.cxx @@ -223,6 +223,7 @@ QtInstance::QtInstance(std::unique_ptr<QApplication>& pQApp, bool bUseCairo) , m_pQApplication(std::move(pQApp)) , m_aUpdateStyleTimer("vcl::qt5 m_aUpdateStyleTimer") , m_bUpdateFonts(false) + , m_pActivePopup(nullptr) { ImplSVData* pSVData = ImplGetSVData(); const OUString sToolkit = "qt" + OUString::number(QT_VERSION_MAJOR); @@ -722,6 +723,12 @@ std::unique_ptr<QApplication> QtInstance::CreateQApplication(int& nArgc, char** return pQApp; } +void QtInstance::setActivePopup(QtFrame* pFrame) +{ + assert(!pFrame || pFrame->isPopup()); + m_pActivePopup = pFrame; +} + extern "C" { VCLPLUG_QT_PUBLIC SalInstance* create_SalInstance() { diff --git a/vcl/qt5/QtWidget.cxx b/vcl/qt5/QtWidget.cxx index 5f07974600e8..8c545fd13377 100644 --- a/vcl/qt5/QtWidget.cxx +++ b/vcl/qt5/QtWidget.cxx @@ -317,9 +317,21 @@ void QtWidget::showEvent(QShowEvent*) // sequence from QtFrame::SetModal, if the frame was already set visible, // resulting in a hidden / unmapped window SalPaintEvent aPaintEvt(0, 0, aSize.width(), aSize.height()); + if (m_rFrame.isPopup()) + { + auto* pQtInst(static_cast<QtInstance*>(GetSalData()->m_pInstance)); + pQtInst->setActivePopup(&m_rFrame); + } m_rFrame.CallCallback(SalEvent::Paint, &aPaintEvt); } +void QtWidget::hideEvent(QHideEvent*) +{ + auto* pQtInst(static_cast<QtInstance*>(GetSalData()->m_pInstance)); + if (m_rFrame.isPopup() && pQtInst->activePopup() == &m_rFrame) + pQtInst->setActivePopup(nullptr); +} + void QtWidget::closeEvent(QCloseEvent* /*pEvent*/) { m_rFrame.CallCallback(SalEvent::Close, nullptr); @@ -627,11 +639,11 @@ bool QtWidget::handleEvent(QtFrame& rFrame, QWidget& rWidget, QEvent* pEvent) } else if (pEvent->type() == QEvent::ToolTip) { - // Qt's POV on focus is wrong for our fake popup windows, so check LO's state. + // Qt's POV on the active popup is wrong due to our fake popup, so check LO's state. // Otherwise Qt will continue handling ToolTip events from the "parent" window. - const vcl::Window* pFocusWin = Application::GetFocusWindow(); - if (!rFrame.m_aTooltipText.isEmpty() && pFocusWin - && pFocusWin->GetFrameWindow() == rFrame.GetWindow()) + const QtFrame* pPopupFrame + = static_cast<QtInstance*>(GetSalData()->m_pInstance)->activePopup(); + if (!rFrame.m_aTooltipText.isEmpty() && (!pPopupFrame || pPopupFrame == &rFrame)) QToolTip::showText(QCursor::pos(), toQString(rFrame.m_aTooltipText), &rWidget, rFrame.m_aTooltipArea); else commit 3fe6a03426a86ec6b18a9b712588619f19a72897 Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Wed Apr 20 13:16:31 2022 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Apr 21 14:15:23 2022 +0200 tdf#146460 tdf#148429 ucb: webdav-curl: censor "curl" in UserAgent 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.st...@allotropia.de> (cherry picked from commit 8d9c56e8f42428fd6695942c673bffb985d22ad5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133146 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx b/ucb/source/ucp/webdav-curl/CurlSession.cxx index 813988c78489..66232a73a15f 100644 --- a/ucb/source/ucp/webdav-curl/CurlSession.cxx +++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx @@ -620,9 +620,10 @@ CurlSession::CurlSession(uno::Reference<uno::XComponentContext> const& xContext, // en.wikipedia.org:80 forces back 403 "Scripts should use an informative // User-Agent string with contact information, or they may be IP-blocked // without notice" otherwise: - OString const useragent(OString::Concat("LibreOffice " LIBO_VERSION_DOTTED " curl/") - + ::std::string_view(pVersion->version, strlen(pVersion->version)) + " " - + pVersion->ssl_version); + OString const useragent( + OString::Concat("LibreOffice " LIBO_VERSION_DOTTED " denylistedbackend/") + + ::std::string_view(pVersion->version, strlen(pVersion->version)) + " " + + pVersion->ssl_version); // looks like an explicit "User-Agent" header in CURLOPT_HTTPHEADER // will override CURLOPT_USERAGENT, see Curl_http_useragent(), so no need // to check anything here commit 93234133477d5f3268ffd441b1e2b7758c809dd4 Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Wed Apr 20 15:04:47 2022 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Apr 21 13:56:48 2022 +0200 tdf#147723 sw_fieldmarkhide: fix crash when copying multiple fieldmarks 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.st...@allotropia.de> (cherry picked from commit 2f726fa41cbd249f2fb30222b29d5f30bce52e6e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133148 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 35d016c93ac0..e3c87f5ea065 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -687,8 +687,9 @@ namespace sw::mark // no special array for these break; } - if (eType == IDocumentMarkAccess::MarkType::TEXT_FIELDMARK - || eType == IDocumentMarkAccess::MarkType::DATE_FIELDMARK) + if (eMode == InsertMode::New + && (eType == IDocumentMarkAccess::MarkType::TEXT_FIELDMARK + || eType == IDocumentMarkAccess::MarkType::DATE_FIELDMARK)) { // due to SwInsText notifications everything is visible now - tell // layout to hide as appropriate commit 00f9671624e676f34c9039d7b0b0ebba6034f05c Author: Jan-Marek Glogowski <glo...@fbihome.de> AuthorDate: Tue Apr 19 16:03:56 2022 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Thu Apr 21 11:31:13 2022 +0200 tdf#140463 Qt handle mouse enter+leave events 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 <glo...@fbihome.de> (cherry picked from commit dc886bc6de2c0061a840bea2426663c3be2ecd26) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133149 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/vcl/inc/qt5/QtWidget.hxx b/vcl/inc/qt5/QtWidget.hxx index 878c8b1229ce..4a40589b16ba 100644 --- a/vcl/inc/qt5/QtWidget.hxx +++ b/vcl/inc/qt5/QtWidget.hxx @@ -51,6 +51,7 @@ class QtWidget : public QWidget static void commitText(QtFrame&, const QString& aText); static bool handleKeyEvent(QtFrame&, const QWidget&, QKeyEvent*, const ButtonKeyState); static void handleMouseButtonEvent(const QtFrame&, const QMouseEvent*, const ButtonKeyState); + static void handleMouseEnterLeaveEvents(const QtFrame&, QEvent*); static void fillSalAbstractMouseEvent(const QtFrame& rFrame, const QInputEvent* pQEvent, const QPoint& rPos, Qt::MouseButtons eButtons, int nWidth, SalAbstractMouseEvent& aSalEvent); @@ -75,6 +76,12 @@ class QtWidget : public QWidget virtual void wheelEvent(QWheelEvent*) override; virtual void closeEvent(QCloseEvent*) override; virtual void changeEvent(QEvent*) override; + virtual void leaveEvent(QEvent*) override; +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + virtual void enterEvent(QEnterEvent*) override; +#else + virtual void enterEvent(QEvent*) override; +#endif void inputMethodEvent(QInputMethodEvent*) override; QVariant inputMethodQuery(Qt::InputMethodQuery) const override; diff --git a/vcl/qt5/QtWidget.cxx b/vcl/qt5/QtWidget.cxx index 017249b05434..5f07974600e8 100644 --- a/vcl/qt5/QtWidget.cxx +++ b/vcl/qt5/QtWidget.cxx @@ -208,6 +208,41 @@ void QtWidget::mouseMoveEvent(QMouseEvent* pEvent) pEvent->accept(); } +void QtWidget::handleMouseEnterLeaveEvents(const QtFrame& rFrame, QEvent* pQEvent) +{ + const qreal fRatio = rFrame.devicePixelRatioF(); + const QWidget* pWidget = rFrame.GetQWidget(); + const Point aPos = toPoint(pWidget->mapFromGlobal(QCursor::pos()) * fRatio); + + SalMouseEvent aEvent; + aEvent.mnX + = QGuiApplication::isLeftToRight() ? aPos.X() : round(pWidget->width() * fRatio) - aPos.X(); + aEvent.mnY = aPos.Y(); + aEvent.mnTime = 0; + aEvent.mnButton = 0; + aEvent.mnCode = GetKeyModCode(QGuiApplication::keyboardModifiers()) + | GetMouseModCode(QGuiApplication::mouseButtons()); + + SalEvent nEventType; + if (pQEvent->type() == QEvent::Enter) + nEventType = SalEvent::MouseMove; + else + nEventType = SalEvent::MouseLeave; + rFrame.CallCallback(nEventType, &aEvent); + pQEvent->accept(); +} + +void QtWidget::leaveEvent(QEvent* pEvent) { handleMouseEnterLeaveEvents(m_rFrame, pEvent); } + +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +void QtWidget::enterEvent(QEnterEvent* pEvent) +#else +void QtWidget::enterEvent(QEvent* pEvent) +#endif +{ + handleMouseEnterLeaveEvents(m_rFrame, pEvent); +} + void QtWidget::wheelEvent(QWheelEvent* pEvent) { SalWheelMouseEvent aEvent;